target
stringlengths 5
300
| feat_repo_name
stringlengths 6
76
| text
stringlengths 26
1.05M
|
---|---|---|
client/src/components/IssueStatus/VoteStatus/VoteCounter/index.js | dotkom/super-duper-fiesta | import React from 'react';
import PropTypes from 'prop-types';
import css from './VoteCounter.css';
const VoteCounter = ({ count, total, label }) => (
<div className={css.counter}>
<div className={css.label}>
{ label } <span className={css.count}>({ count } / { total })</span>
</div>
<div className={css.bar}>
<div className={css.progress} style={{ width: total ? `${(count / total) * 100}%` : '0%' }} />
</div>
</div>
);
VoteCounter.defaultProps = {
total: 0,
count: 0,
};
VoteCounter.propTypes = {
total: PropTypes.number,
count: PropTypes.number,
label: PropTypes.string.isRequired,
};
export default VoteCounter;
|
wrappers/json.js | dearwish/gatsby-starter-clean | import React from 'react'
import Helmet from 'react-helmet'
import { config } from 'config'
module.exports = React.createClass({
propTypes () {
return {
route: React.PropTypes.object,
}
},
render () {
const data = this.props.route.page.data
return (
<div>
<Helmet
title={`${config.siteTitle} | ${data.title}`}
/>
<h1>{data.title}</h1>
<p>Raw view of json file</p>
<pre dangerouslySetInnerHTML={{ __html: JSON.stringify(data, null, 4) }} />
</div>
)
},
})
|
ajax/libs/yui/3.4.1/loader-base/loader-base.js | sujonvidia/cdnjs | YUI.add('loader-base', function(Y) {
/**
* The YUI loader core
* @module loader
* @submodule loader-base
*/
if (!YUI.Env[Y.version]) {
(function() {
var VERSION = Y.version,
BUILD = '/build/',
ROOT = VERSION + BUILD,
CDN_BASE = Y.Env.base,
GALLERY_VERSION = 'gallery-2011.09.14-20-40',
TNT = '2in3',
TNT_VERSION = '4',
YUI2_VERSION = '2.9.0',
COMBO_BASE = CDN_BASE + 'combo?',
META = { version: VERSION,
root: ROOT,
base: Y.Env.base,
comboBase: COMBO_BASE,
skin: { defaultSkin: 'sam',
base: 'assets/skins/',
path: 'skin.css',
after: ['cssreset',
'cssfonts',
'cssgrids',
'cssbase',
'cssreset-context',
'cssfonts-context']},
groups: {},
patterns: {} },
groups = META.groups,
yui2Update = function(tnt, yui2) {
var root = TNT + '.' +
(tnt || TNT_VERSION) + '/' +
(yui2 || YUI2_VERSION) + BUILD;
groups.yui2.base = CDN_BASE + root;
groups.yui2.root = root;
},
galleryUpdate = function(tag) {
var root = (tag || GALLERY_VERSION) + BUILD;
groups.gallery.base = CDN_BASE + root;
groups.gallery.root = root;
};
groups[VERSION] = {};
groups.gallery = {
ext: false,
combine: true,
comboBase: COMBO_BASE,
update: galleryUpdate,
patterns: { 'gallery-': { },
'lang/gallery-': {},
'gallerycss-': { type: 'css' } }
};
groups.yui2 = {
combine: true,
ext: false,
comboBase: COMBO_BASE,
update: yui2Update,
patterns: {
'yui2-': {
configFn: function(me) {
if (/-skin|reset|fonts|grids|base/.test(me.name)) {
me.type = 'css';
me.path = me.path.replace(/\.js/, '.css');
// this makes skins in builds earlier than
// 2.6.0 work as long as combine is false
me.path = me.path.replace(/\/yui2-skin/,
'/assets/skins/sam/yui2-skin');
}
}
}
}
};
galleryUpdate();
yui2Update();
YUI.Env[VERSION] = META;
}());
}
/**
* Loader dynamically loads script and css files. It includes the dependency
* info for the version of the library in use, and will automatically pull in
* dependencies for the modules requested. It supports rollup files and will
* automatically use these when appropriate in order to minimize the number of
* http connections required to load all of the dependencies. It can load the
* files from the Yahoo! CDN, and it can utilize the combo service provided on
* this network to reduce the number of http connections required to download
* YUI files.
*
* @module loader
* @main loader
* @submodule loader-base
*/
var NOT_FOUND = {},
NO_REQUIREMENTS = [],
MAX_URL_LENGTH = 2048,
GLOBAL_ENV = YUI.Env,
GLOBAL_LOADED = GLOBAL_ENV._loaded,
CSS = 'css',
JS = 'js',
INTL = 'intl',
VERSION = Y.version,
ROOT_LANG = '',
YObject = Y.Object,
oeach = YObject.each,
YArray = Y.Array,
_queue = GLOBAL_ENV._loaderQueue,
META = GLOBAL_ENV[VERSION],
SKIN_PREFIX = 'skin-',
L = Y.Lang,
ON_PAGE = GLOBAL_ENV.mods,
modulekey,
cache,
_path = function(dir, file, type, nomin) {
var path = dir + '/' + file;
if (!nomin) {
path += '-min';
}
path += '.' + (type || CSS);
return path;
};
if (YUI.Env.aliases) {
YUI.Env.aliases = {}; //Don't need aliases if Loader is present
}
/**
* The component metadata is stored in Y.Env.meta.
* Part of the loader module.
* @property meta
* @for YUI
*/
Y.Env.meta = META;
/**
* Loader dynamically loads script and css files. It includes the dependency
* info for the version of the library in use, and will automatically pull in
* dependencies for the modules requested. It supports rollup files and will
* automatically use these when appropriate in order to minimize the number of
* http connections required to load all of the dependencies. It can load the
* files from the Yahoo! CDN, and it can utilize the combo service provided on
* this network to reduce the number of http connections required to download
* YUI files.
*
* While the loader can be instantiated by the end user, it normally is not.
* @see YUI.use for the normal use case. The use function automatically will
* pull in missing dependencies.
*
* @constructor
* @class Loader
* @param {object} o an optional set of configuration options. Valid options:
* <ul>
* <li>base:
* The base dir</li>
* <li>comboBase:
* The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?</li>
* <li>root:
* The root path to prepend to module names for the combo service.
* Ex: 2.5.2/build/</li>
* <li>filter:.
*
* A filter to apply to result urls. This filter will modify the default
* path for all modules. The default path for the YUI library is the
* minified version of the files (e.g., event-min.js). The filter property
* can be a predefined filter or a custom filter. The valid predefined
* filters are:
* <dl>
* <dt>DEBUG</dt>
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* This option will automatically include the Logger widget</dd>
* <dt>RAW</dt>
* <dd>Selects the non-minified version of the library (e.g., event.js).
* </dd>
* </dl>
* You can also define a custom filter, which must be an object literal
* containing a search expression and a replace string:
* <pre>
* myFilter: {
* 'searchExp': "-min\\.js",
* 'replaceStr': "-debug.js"
* }
* </pre>
*
* </li>
* <li>filters: per-component filter specification. If specified
* for a given component, this overrides the filter config. _Note:_ This does not work on combo urls, use the filter property instead.</li>
* <li>combine:
* Use the YUI combo service to reduce the number of http connections
* required to load your dependencies</li>
* <li>ignore:
* A list of modules that should never be dynamically loaded</li>
* <li>force:
* A list of modules that should always be loaded when required, even if
* already present on the page</li>
* <li>insertBefore:
* Node or id for a node that should be used as the insertion point for
* new nodes</li>
* <li>charset:
* charset for dynamic nodes (deprecated, use jsAttributes or cssAttributes)
* </li>
* <li>jsAttributes: object literal containing attributes to add to script
* nodes</li>
* <li>cssAttributes: object literal containing attributes to add to link
* nodes</li>
* <li>timeout:
* The number of milliseconds before a timeout occurs when dynamically
* loading nodes. If not set, there is no timeout</li>
* <li>context:
* execution context for all callbacks</li>
* <li>onSuccess:
* callback for the 'success' event</li>
* <li>onFailure: callback for the 'failure' event</li>
* <li>onCSS: callback for the 'CSSComplete' event. When loading YUI
* components with CSS the CSS is loaded first, then the script. This
* provides a moment you can tie into to improve
* the presentation of the page while the script is loading.</li>
* <li>onTimeout:
* callback for the 'timeout' event</li>
* <li>onProgress:
* callback executed each time a script or css file is loaded</li>
* <li>modules:
* A list of module definitions. See Loader.addModule for the supported
* module metadata</li>
* <li>groups:
* A list of group definitions. Each group can contain specific definitions
* for base, comboBase, combine, and accepts a list of modules. See above
* for the description of these properties.</li>
* <li>2in3: the version of the YUI 2 in 3 wrapper to use. The intrinsic
* support for YUI 2 modules in YUI 3 relies on versions of the YUI 2
* components inside YUI 3 module wrappers. These wrappers
* change over time to accomodate the issues that arise from running YUI 2
* in a YUI 3 sandbox.</li>
* <li>yui2: when using the 2in3 project, you can select the version of
* YUI 2 to use. Valid values * are 2.2.2, 2.3.1, 2.4.1, 2.5.2, 2.6.0,
* 2.7.0, 2.8.0, and 2.8.1 [default] -- plus all versions of YUI 2
* going forward.</li>
* </ul>
*/
Y.Loader = function(o) {
var defaults = META.modules,
self = this;
modulekey = META.md5;
/**
* Internal callback to handle multiple internal insert() calls
* so that css is inserted prior to js
* @property _internalCallback
* @private
*/
// self._internalCallback = null;
/**
* Callback that will be executed when the loader is finished
* with an insert
* @method onSuccess
* @type function
*/
// self.onSuccess = null;
/**
* Callback that will be executed if there is a failure
* @method onFailure
* @type function
*/
// self.onFailure = null;
/**
* Callback for the 'CSSComplete' event. When loading YUI components
* with CSS the CSS is loaded first, then the script. This provides
* a moment you can tie into to improve the presentation of the page
* while the script is loading.
* @method onCSS
* @type function
*/
// self.onCSS = null;
/**
* Callback executed each time a script or css file is loaded
* @method onProgress
* @type function
*/
// self.onProgress = null;
/**
* Callback that will be executed if a timeout occurs
* @method onTimeout
* @type function
*/
// self.onTimeout = null;
/**
* The execution context for all callbacks
* @property context
* @default {YUI} the YUI instance
*/
self.context = Y;
/**
* Data that is passed to all callbacks
* @property data
*/
// self.data = null;
/**
* Node reference or id where new nodes should be inserted before
* @property insertBefore
* @type string|HTMLElement
*/
// self.insertBefore = null;
/**
* The charset attribute for inserted nodes
* @property charset
* @type string
* @deprecated , use cssAttributes or jsAttributes.
*/
// self.charset = null;
/**
* An object literal containing attributes to add to link nodes
* @property cssAttributes
* @type object
*/
// self.cssAttributes = null;
/**
* An object literal containing attributes to add to script nodes
* @property jsAttributes
* @type object
*/
// self.jsAttributes = null;
/**
* The base directory.
* @property base
* @type string
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
*/
self.base = Y.Env.meta.base + Y.Env.meta.root;
/**
* Base path for the combo service
* @property comboBase
* @type string
* @default http://yui.yahooapis.com/combo?
*/
self.comboBase = Y.Env.meta.comboBase;
/*
* Base path for language packs.
*/
// self.langBase = Y.Env.meta.langBase;
// self.lang = "";
/**
* If configured, the loader will attempt to use the combo
* service for YUI resources and configured external resources.
* @property combine
* @type boolean
* @default true if a base dir isn't in the config
*/
self.combine = o.base &&
(o.base.indexOf(self.comboBase.substr(0, 20)) > -1);
/**
* The default seperator to use between files in a combo URL
* @property comboSep
* @type {String}
* @default Ampersand
*/
self.comboSep = '&';
/**
* Max url length for combo urls. The default is 2048. This is the URL
* limit for the Yahoo! hosted combo servers. If consuming
* a different combo service that has a different URL limit
* it is possible to override this default by supplying
* the maxURLLength config option. The config option will
* only take effect if lower than the default.
*
* @property maxURLLength
* @type int
*/
self.maxURLLength = MAX_URL_LENGTH;
/**
* Ignore modules registered on the YUI global
* @property ignoreRegistered
* @default false
*/
// self.ignoreRegistered = false;
/**
* Root path to prepend to module path for the combo
* service
* @property root
* @type string
* @default [YUI VERSION]/build/
*/
self.root = Y.Env.meta.root;
/**
* Timeout value in milliseconds. If set, self value will be used by
* the get utility. the timeout event will fire if
* a timeout occurs.
* @property timeout
* @type int
*/
self.timeout = 0;
/**
* A list of modules that should not be loaded, even if
* they turn up in the dependency tree
* @property ignore
* @type string[]
*/
// self.ignore = null;
/**
* A list of modules that should always be loaded, even
* if they have already been inserted into the page.
* @property force
* @type string[]
*/
// self.force = null;
self.forceMap = {};
/**
* Should we allow rollups
* @property allowRollup
* @type boolean
* @default false
*/
self.allowRollup = false;
/**
* A filter to apply to result urls. This filter will modify the default
* path for all modules. The default path for the YUI library is the
* minified version of the files (e.g., event-min.js). The filter property
* can be a predefined filter or a custom filter. The valid predefined
* filters are:
* <dl>
* <dt>DEBUG</dt>
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* This option will automatically include the Logger widget</dd>
* <dt>RAW</dt>
* <dd>Selects the non-minified version of the library (e.g., event.js).
* </dd>
* </dl>
* You can also define a custom filter, which must be an object literal
* containing a search expression and a replace string:
* <pre>
* myFilter: {
* 'searchExp': "-min\\.js",
* 'replaceStr': "-debug.js"
* }
* </pre>
* @property filter
* @type string| {searchExp: string, replaceStr: string}
*/
// self.filter = null;
/**
* per-component filter specification. If specified for a given
* component, this overrides the filter config.
* @property filters
* @type object
*/
self.filters = {};
/**
* The list of requested modules
* @property required
* @type {string: boolean}
*/
self.required = {};
/**
* If a module name is predefined when requested, it is checked againsts
* the patterns provided in this property. If there is a match, the
* module is added with the default configuration.
*
* At the moment only supporting module prefixes, but anticipate
* supporting at least regular expressions.
* @property patterns
* @type Object
*/
// self.patterns = Y.merge(Y.Env.meta.patterns);
self.patterns = {};
/**
* The library metadata
* @property moduleInfo
*/
// self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);
self.moduleInfo = {};
self.groups = Y.merge(Y.Env.meta.groups);
/**
* Provides the information used to skin the skinnable components.
* The following skin definition would result in 'skin1' and 'skin2'
* being loaded for calendar (if calendar was requested), and
* 'sam' for all other skinnable components:
*
* <code>
* skin: {
*
* // The default skin, which is automatically applied if not
* // overriden by a component-specific skin definition.
* // Change this in to apply a different skin globally
* defaultSkin: 'sam',
*
* // This is combined with the loader base property to get
* // the default root directory for a skin. ex:
* // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
* base: 'assets/skins/',
*
* // Any component-specific overrides can be specified here,
* // making it possible to load different skins for different
* // components. It is possible to load more than one skin
* // for a given component as well.
* overrides: {
* calendar: ['skin1', 'skin2']
* }
* }
* </code>
* @property skin
*/
self.skin = Y.merge(Y.Env.meta.skin);
/*
* Map of conditional modules
* @since 3.2.0
*/
self.conditions = {};
// map of modules with a hash of modules that meet the requirement
// self.provides = {};
self.config = o;
self._internal = true;
cache = GLOBAL_ENV._renderedMods;
if (cache) {
oeach(cache, function modCache(v, k) {
//self.moduleInfo[k] = Y.merge(v);
self.moduleInfo[k] = v;
});
cache = GLOBAL_ENV._conditions;
oeach(cache, function condCache(v, k) {
//self.conditions[k] = Y.merge(v);
self.conditions[k] = v;
});
} else {
oeach(defaults, self.addModule, self);
}
if (!GLOBAL_ENV._renderedMods) {
//GLOBAL_ENV._renderedMods = Y.merge(self.moduleInfo);
//GLOBAL_ENV._conditions = Y.merge(self.conditions);
GLOBAL_ENV._renderedMods = self.moduleInfo;
GLOBAL_ENV._conditions = self.conditions;
}
self._inspectPage();
self._internal = false;
self._config(o);
self.testresults = null;
if (Y.config.tests) {
self.testresults = Y.config.tests;
}
/**
* List of rollup files found in the library metadata
* @property rollups
*/
// self.rollups = null;
/**
* Whether or not to load optional dependencies for
* the requested modules
* @property loadOptional
* @type boolean
* @default false
*/
// self.loadOptional = false;
/**
* All of the derived dependencies in sorted order, which
* will be populated when either calculate() or insert()
* is called
* @property sorted
* @type string[]
*/
self.sorted = [];
/**
* Set when beginning to compute the dependency tree.
* Composed of what YUI reports to be loaded combined
* with what has been loaded by any instance on the page
* with the version number specified in the metadata.
* @property loaded
* @type {string: boolean}
*/
self.loaded = GLOBAL_LOADED[VERSION];
/*
* A list of modules to attach to the YUI instance when complete.
* If not supplied, the sorted list of dependencies are applied.
* @property attaching
*/
// self.attaching = null;
/**
* Flag to indicate the dependency tree needs to be recomputed
* if insert is called again.
* @property dirty
* @type boolean
* @default true
*/
self.dirty = true;
/**
* List of modules inserted by the utility
* @property inserted
* @type {string: boolean}
*/
self.inserted = {};
/**
* List of skipped modules during insert() because the module
* was not defined
* @property skipped
*/
self.skipped = {};
// Y.on('yui:load', self.loadNext, self);
self.tested = {};
/*
* Cached sorted calculate results
* @property results
* @since 3.2.0
*/
//self.results = {};
};
Y.Loader.prototype = {
FILTER_DEFS: {
RAW: {
'searchExp': '-min\\.js',
'replaceStr': '.js'
},
DEBUG: {
'searchExp': '-min\\.js',
'replaceStr': '-debug.js'
}
},
/*
* Check the pages meta-data and cache the result.
* @method _inspectPage
* @private
*/
_inspectPage: function() {
oeach(ON_PAGE, function(v, k) {
if (v.details) {
var m = this.moduleInfo[k],
req = v.details.requires,
mr = m && m.requires;
if (m) {
if (!m._inspected && req && mr.length != req.length) {
// console.log('deleting ' + m.name);
// m.requres = YObject.keys(Y.merge(YArray.hash(req), YArray.hash(mr)));
delete m.expanded;
// delete m.expanded_map;
}
} else {
m = this.addModule(v.details, k);
}
m._inspected = true;
}
}, this);
},
/*
* returns true if b is not loaded, and is required directly or by means of modules it supersedes.
* @private
* @method _requires
* @param {String} mod1 The first module to compare
* @param {String} mod2 The second module to compare
*/
_requires: function(mod1, mod2) {
var i, rm, after_map, s,
info = this.moduleInfo,
m = info[mod1],
other = info[mod2];
if (!m || !other) {
return false;
}
rm = m.expanded_map;
after_map = m.after_map;
// check if this module should be sorted after the other
// do this first to short circut circular deps
if (after_map && (mod2 in after_map)) {
return true;
}
after_map = other.after_map;
// and vis-versa
if (after_map && (mod1 in after_map)) {
return false;
}
// check if this module requires one the other supersedes
s = info[mod2] && info[mod2].supersedes;
if (s) {
for (i = 0; i < s.length; i++) {
if (this._requires(mod1, s[i])) {
return true;
}
}
}
s = info[mod1] && info[mod1].supersedes;
if (s) {
for (i = 0; i < s.length; i++) {
if (this._requires(mod2, s[i])) {
return false;
}
}
}
// check if this module requires the other directly
// if (r && YArray.indexOf(r, mod2) > -1) {
if (rm && (mod2 in rm)) {
return true;
}
// external css files should be sorted below yui css
if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {
return true;
}
return false;
},
/**
* Apply a new config to the Loader instance
* @method _config
* @param {Object} o The new configuration
*/
_config: function(o) {
var i, j, val, f, group, groupName, self = this;
// apply config values
if (o) {
for (i in o) {
if (o.hasOwnProperty(i)) {
val = o[i];
if (i == 'require') {
self.require(val);
} else if (i == 'skin') {
Y.mix(self.skin, o[i], true);
} else if (i == 'groups') {
for (j in val) {
if (val.hasOwnProperty(j)) {
groupName = j;
group = val[j];
self.addGroup(group, groupName);
}
}
} else if (i == 'modules') {
// add a hash of module definitions
oeach(val, self.addModule, self);
} else if (i == 'gallery') {
this.groups.gallery.update(val);
} else if (i == 'yui2' || i == '2in3') {
this.groups.yui2.update(o['2in3'], o.yui2);
} else if (i == 'maxURLLength') {
self[i] = Math.min(MAX_URL_LENGTH, val);
} else {
self[i] = val;
}
}
}
}
// fix filter
f = self.filter;
if (L.isString(f)) {
f = f.toUpperCase();
self.filterName = f;
self.filter = self.FILTER_DEFS[f];
if (f == 'DEBUG') {
self.require('yui-log', 'dump');
}
}
if (self.lang) {
self.require('intl-base', 'intl');
}
},
/**
* Returns the skin module name for the specified skin name. If a
* module name is supplied, the returned skin module name is
* specific to the module passed in.
* @method formatSkin
* @param {string} skin the name of the skin.
* @param {string} mod optional: the name of a module to skin.
* @return {string} the full skin module name.
*/
formatSkin: function(skin, mod) {
var s = SKIN_PREFIX + skin;
if (mod) {
s = s + '-' + mod;
}
return s;
},
/**
* Adds the skin def to the module info
* @method _addSkin
* @param {string} skin the name of the skin.
* @param {string} mod the name of the module.
* @param {string} parent parent module if this is a skin of a
* submodule or plugin.
* @return {string} the module name for the skin.
* @private
*/
_addSkin: function(skin, mod, parent) {
var mdef, pkg, name, nmod,
info = this.moduleInfo,
sinf = this.skin,
ext = info[mod] && info[mod].ext;
// Add a module definition for the module-specific skin css
if (mod) {
name = this.formatSkin(skin, mod);
if (!info[name]) {
mdef = info[mod];
pkg = mdef.pkg || mod;
nmod = {
name: name,
group: mdef.group,
type: 'css',
after: sinf.after,
path: (parent || pkg) + '/' + sinf.base + skin +
'/' + mod + '.css',
ext: ext
};
if (mdef.base) {
nmod.base = mdef.base;
}
if (mdef.configFn) {
nmod.configFn = mdef.configFn;
}
this.addModule(nmod, name);
}
}
return name;
},
/**
* Add a new module group
* <dl>
* <dt>name:</dt> <dd>required, the group name</dd>
* <dt>base:</dt> <dd>The base dir for this module group</dd>
* <dt>root:</dt> <dd>The root path to add to each combo
* resource path</dd>
* <dt>combine:</dt> <dd>combo handle</dd>
* <dt>comboBase:</dt> <dd>combo service base path</dd>
* <dt>modules:</dt> <dd>the group of modules</dd>
* </dl>
* @method addGroup
* @param {object} o An object containing the module data.
* @param {string} name the group name.
*/
addGroup: function(o, name) {
var mods = o.modules,
self = this;
name = name || o.name;
o.name = name;
self.groups[name] = o;
if (o.patterns) {
oeach(o.patterns, function(v, k) {
v.group = name;
self.patterns[k] = v;
});
}
if (mods) {
oeach(mods, function(v, k) {
v.group = name;
self.addModule(v, k);
}, self);
}
},
/**
* Add a new module to the component metadata.
* <dl>
* <dt>name:</dt> <dd>required, the component name</dd>
* <dt>type:</dt> <dd>required, the component type (js or css)
* </dd>
* <dt>path:</dt> <dd>required, the path to the script from
* "base"</dd>
* <dt>requires:</dt> <dd>array of modules required by this
* component</dd>
* <dt>optional:</dt> <dd>array of optional modules for this
* component</dd>
* <dt>supersedes:</dt> <dd>array of the modules this component
* replaces</dd>
* <dt>after:</dt> <dd>array of modules the components which, if
* present, should be sorted above this one</dd>
* <dt>after_map:</dt> <dd>faster alternative to 'after' -- supply
* a hash instead of an array</dd>
* <dt>rollup:</dt> <dd>the number of superseded modules required
* for automatic rollup</dd>
* <dt>fullpath:</dt> <dd>If fullpath is specified, this is used
* instead of the configured base + path</dd>
* <dt>skinnable:</dt> <dd>flag to determine if skin assets should
* automatically be pulled in</dd>
* <dt>submodules:</dt> <dd>a hash of submodules</dd>
* <dt>group:</dt> <dd>The group the module belongs to -- this
* is set automatically when it is added as part of a group
* configuration.</dd>
* <dt>lang:</dt>
* <dd>array of BCP 47 language tags of languages for which this
* module has localized resource bundles,
* e.g., ["en-GB","zh-Hans-CN"]</dd>
* <dt>condition:</dt>
* <dd>Specifies that the module should be loaded automatically if
* a condition is met. This is an object with up to three fields:
* [trigger] - the name of a module that can trigger the auto-load
* [test] - a function that returns true when the module is to be
* loaded.
* [when] - specifies the load order of the conditional module
* with regard to the position of the trigger module.
* This should be one of three values: 'before', 'after', or
* 'instead'. The default is 'after'.
* </dd>
* <dt>testresults:</dt><dd>a hash of test results from Y.Features.all()</dd>
* </dl>
* @method addModule
* @param {object} o An object containing the module data.
* @param {string} name the module name (optional), required if not
* in the module data.
* @return {object} the module definition or null if
* the object passed in did not provide all required attributes.
*/
addModule: function(o, name) {
name = name || o.name;
//Only merge this data if the temp flag is set
//from an earlier pass from a pattern or else
//an override module (YUI_config) can not be used to
//replace a default module.
if (this.moduleInfo[name] && this.moduleInfo[name].temp) {
//This catches temp modules loaded via a pattern
// The module will be added twice, once from the pattern and
// Once from the actual add call, this ensures that properties
// that were added to the module the first time around (group: gallery)
// are also added the second time around too.
o = Y.merge(this.moduleInfo[name], o);
}
o.name = name;
if (!o || !o.name) {
return null;
}
if (!o.type) {
o.type = JS;
}
if (!o.path && !o.fullpath) {
o.path = _path(name, name, o.type);
}
o.supersedes = o.supersedes || o.use;
o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;
o.requires = this.filterRequires(o.requires) || [];
// Handle submodule logic
var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,
j, langs, packName, supName, flatSup, flatLang, lang, ret,
overrides, skinname, when,
conditions = this.conditions, trigger;
// , existing = this.moduleInfo[name], newr;
this.moduleInfo[name] = o;
if (!o.langPack && o.lang) {
langs = YArray(o.lang);
for (j = 0; j < langs.length; j++) {
lang = langs[j];
packName = this.getLangPackName(lang, name);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
}
}
if (subs) {
sup = o.supersedes || [];
l = 0;
for (i in subs) {
if (subs.hasOwnProperty(i)) {
s = subs[i];
s.path = s.path || _path(name, i, o.type);
s.pkg = name;
s.group = o.group;
if (s.supersedes) {
sup = sup.concat(s.supersedes);
}
smod = this.addModule(s, i);
sup.push(i);
if (smod.skinnable) {
o.skinnable = true;
overrides = this.skin.overrides;
if (overrides && overrides[i]) {
for (j = 0; j < overrides[i].length; j++) {
skinname = this._addSkin(overrides[i][j],
i, name);
sup.push(skinname);
}
}
skinname = this._addSkin(this.skin.defaultSkin,
i, name);
sup.push(skinname);
}
// looks like we are expected to work out the metadata
// for the parent module language packs from what is
// specified in the child modules.
if (s.lang && s.lang.length) {
langs = YArray(s.lang);
for (j = 0; j < langs.length; j++) {
lang = langs[j];
packName = this.getLangPackName(lang, name);
supName = this.getLangPackName(lang, i);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
flatSup = flatSup || YArray.hash(smod.supersedes);
if (!(supName in flatSup)) {
smod.supersedes.push(supName);
}
o.lang = o.lang || [];
flatLang = flatLang || YArray.hash(o.lang);
if (!(lang in flatLang)) {
o.lang.push(lang);
}
// Add rollup file, need to add to supersedes list too
// default packages
packName = this.getLangPackName(ROOT_LANG, name);
supName = this.getLangPackName(ROOT_LANG, i);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
if (!(supName in flatSup)) {
smod.supersedes.push(supName);
}
// Add rollup file, need to add to supersedes list too
}
}
l++;
}
}
//o.supersedes = YObject.keys(YArray.hash(sup));
o.supersedes = YArray.dedupe(sup);
if (this.allowRollup) {
o.rollup = (l < 4) ? l : Math.min(l - 1, 4);
}
}
plugins = o.plugins;
if (plugins) {
for (i in plugins) {
if (plugins.hasOwnProperty(i)) {
plug = plugins[i];
plug.pkg = name;
plug.path = plug.path || _path(name, i, o.type);
plug.requires = plug.requires || [];
plug.group = o.group;
this.addModule(plug, i);
if (o.skinnable) {
this._addSkin(this.skin.defaultSkin, i, name);
}
}
}
}
if (o.condition) {
t = o.condition.trigger;
if (YUI.Env.aliases[t]) {
t = YUI.Env.aliases[t];
}
if (!Y.Lang.isArray(t)) {
t = [t];
}
for (i = 0; i < t.length; i++) {
trigger = t[i];
when = o.condition.when;
conditions[trigger] = conditions[trigger] || {};
conditions[trigger][name] = o.condition;
// the 'when' attribute can be 'before', 'after', or 'instead'
// the default is after.
if (when && when != 'after') {
if (when == 'instead') { // replace the trigger
o.supersedes = o.supersedes || [];
o.supersedes.push(trigger);
} else { // before the trigger
// the trigger requires the conditional mod,
// so it should appear before the conditional
// mod if we do not intersede.
}
} else { // after the trigger
o.after = o.after || [];
o.after.push(trigger);
}
}
}
if (o.after) {
o.after_map = YArray.hash(o.after);
}
// this.dirty = true;
if (o.configFn) {
ret = o.configFn(o);
if (ret === false) {
delete this.moduleInfo[name];
o = null;
}
}
return o;
},
/**
* Add a requirement for one or more module
* @method require
* @param {string[] | string*} what the modules to load.
*/
require: function(what) {
var a = (typeof what === 'string') ? YArray(arguments) : what;
this.dirty = true;
this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));
this._explodeRollups();
},
/**
* Grab all the items that were asked for, check to see if the Loader
* meta-data contains a "use" array. If it doesm remove the asked item and replace it with
* the content of the "use".
* This will make asking for: "dd"
* Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
* @private
* @method _explodeRollups
*/
_explodeRollups: function() {
var self = this, m,
r = self.required;
if (!self.allowRollup) {
oeach(r, function(v, name) {
m = self.getModule(name);
if (m && m.use) {
//delete r[name];
YArray.each(m.use, function(v) {
m = self.getModule(v);
if (m && m.use) {
//delete r[v];
YArray.each(m.use, function(v) {
r[v] = true;
});
} else {
r[v] = true;
}
});
}
});
self.required = r;
}
},
/**
* Explodes the required array to remove aliases and replace them with real modules
* @method filterRequires
* @param {Array} r The original requires array
* @return {Array} The new array of exploded requirements
*/
filterRequires: function(r) {
if (r) {
if (!Y.Lang.isArray(r)) {
r = [r];
}
r = Y.Array(r);
var c = [], i, mod, o, m;
for (i = 0; i < r.length; i++) {
mod = this.getModule(r[i]);
if (mod && mod.use) {
for (o = 0; o < mod.use.length; o++) {
//Must walk the other modules in case a module is a rollup of rollups (datatype)
m = this.getModule(mod.use[o]);
if (m && m.use) {
c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));
} else {
c.push(mod.use[o]);
}
}
} else {
c.push(r[i]);
}
}
r = c;
}
return r;
},
/**
* Returns an object containing properties for all modules required
* in order to load the requested module
* @method getRequires
* @param {object} mod The module definition from moduleInfo.
* @return {array} the expanded requirement list.
*/
getRequires: function(mod) {
if (!mod || mod._parsed) {
return NO_REQUIREMENTS;
}
var i, m, j, add, packName, lang, testresults = this.testresults,
name = mod.name, cond, go,
adddef = ON_PAGE[name] && ON_PAGE[name].details,
d, k, m1,
r, old_mod,
o, skinmod, skindef, skinpar, skinname,
intl = mod.lang || mod.intl,
info = this.moduleInfo,
ftests = Y.Features && Y.Features.tests.load,
hash;
// console.log(name);
// pattern match leaves module stub that needs to be filled out
if (mod.temp && adddef) {
old_mod = mod;
mod = this.addModule(adddef, name);
mod.group = old_mod.group;
mod.pkg = old_mod.pkg;
delete mod.expanded;
}
// console.log('cache: ' + mod.langCache + ' == ' + this.lang);
// if (mod.expanded && (!mod.langCache || mod.langCache == this.lang)) {
if (mod.expanded && (!this.lang || mod.langCache === this.lang)) {
return mod.expanded;
}
d = [];
hash = {};
r = this.filterRequires(mod.requires);
if (mod.lang) {
//If a module has a lang attribute, auto add the intl requirement.
d.unshift('intl');
r.unshift('intl');
intl = true;
}
o = this.filterRequires(mod.optional);
mod._parsed = true;
mod.langCache = this.lang;
for (i = 0; i < r.length; i++) {
if (!hash[r[i]]) {
d.push(r[i]);
hash[r[i]] = true;
m = this.getModule(r[i]);
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
// get the requirements from superseded modules, if any
r = this.filterRequires(mod.supersedes);
if (r) {
for (i = 0; i < r.length; i++) {
if (!hash[r[i]]) {
// if this module has submodules, the requirements list is
// expanded to include the submodules. This is so we can
// prevent dups when a submodule is already loaded and the
// parent is requested.
if (mod.submodules) {
d.push(r[i]);
}
hash[r[i]] = true;
m = this.getModule(r[i]);
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}
if (o && this.loadOptional) {
for (i = 0; i < o.length; i++) {
if (!hash[o[i]]) {
d.push(o[i]);
hash[o[i]] = true;
m = info[o[i]];
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}
cond = this.conditions[name];
if (cond) {
if (testresults && ftests) {
oeach(testresults, function(result, id) {
var condmod = ftests[id].name;
if (!hash[condmod] && ftests[id].trigger == name) {
if (result && ftests[id]) {
hash[condmod] = true;
d.push(condmod);
}
}
});
} else {
oeach(cond, function(def, condmod) {
if (!hash[condmod]) {
go = def && ((def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
hash[condmod] = true;
d.push(condmod);
m = this.getModule(condmod);
if (m) {
add = this.getRequires(m);
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}, this);
}
}
// Create skin modules
if (mod.skinnable) {
skindef = this.skin.overrides;
oeach(YUI.Env.aliases, function(o, n) {
if (Y.Array.indexOf(o, name) > -1) {
skinpar = n;
}
});
if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {
skinname = name;
if (skindef[skinpar]) {
skinname = skinpar;
}
for (i = 0; i < skindef[skinname].length; i++) {
skinmod = this._addSkin(skindef[skinname][i], name);
d.push(skinmod);
}
} else {
skinmod = this._addSkin(this.skin.defaultSkin, name);
d.push(skinmod);
}
}
mod._parsed = false;
if (intl) {
if (mod.lang && !mod.langPack && Y.Intl) {
lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);
packName = this.getLangPackName(lang, name);
if (packName) {
d.unshift(packName);
}
}
d.unshift(INTL);
}
mod.expanded_map = YArray.hash(d);
mod.expanded = YObject.keys(mod.expanded_map);
return mod.expanded;
},
/**
* Returns a hash of module names the supplied module satisfies.
* @method getProvides
* @param {string} name The name of the module.
* @return {object} what this module provides.
*/
getProvides: function(name) {
var m = this.getModule(name), o, s;
// supmap = this.provides;
if (!m) {
return NOT_FOUND;
}
if (m && !m.provides) {
o = {};
s = m.supersedes;
if (s) {
YArray.each(s, function(v) {
Y.mix(o, this.getProvides(v));
}, this);
}
o[name] = true;
m.provides = o;
}
return m.provides;
},
/**
* Calculates the dependency tree, the result is stored in the sorted
* property.
* @method calculate
* @param {object} o optional options object.
* @param {string} type optional argument to prune modules.
*/
calculate: function(o, type) {
if (o || type || this.dirty) {
if (o) {
this._config(o);
}
if (!this._init) {
this._setup();
}
this._explode();
if (this.allowRollup) {
this._rollup();
} else {
this._explodeRollups();
}
this._reduce();
this._sort();
}
},
/**
* Creates a "psuedo" package for languages provided in the lang array
* @method _addLangPack
* @param {String} lang The language to create
* @param {Object} m The module definition to create the language pack around
* @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)
* @return {Object} The module definition
*/
_addLangPack: function(lang, m, packName) {
var name = m.name,
packPath,
existing = this.moduleInfo[packName];
if (!existing) {
packPath = _path((m.pkg || name), packName, JS, true);
this.addModule({ path: packPath,
intl: true,
langPack: true,
ext: m.ext,
group: m.group,
supersedes: [] }, packName);
if (lang) {
Y.Env.lang = Y.Env.lang || {};
Y.Env.lang[lang] = Y.Env.lang[lang] || {};
Y.Env.lang[lang][name] = true;
}
}
return this.moduleInfo[packName];
},
/**
* Investigates the current YUI configuration on the page. By default,
* modules already detected will not be loaded again unless a force
* option is encountered. Called by calculate()
* @method _setup
* @private
*/
_setup: function() {
var info = this.moduleInfo, name, i, j, m, l,
packName;
for (name in info) {
if (info.hasOwnProperty(name)) {
m = info[name];
if (m) {
// remove dups
//m.requires = YObject.keys(YArray.hash(m.requires));
m.requires = YArray.dedupe(m.requires);
// Create lang pack modules
if (m.lang && m.lang.length) {
// Setup root package if the module has lang defined,
// it needs to provide a root language pack
packName = this.getLangPackName(ROOT_LANG, name);
this._addLangPack(null, m, packName);
}
}
}
}
//l = Y.merge(this.inserted);
l = {};
// available modules
if (!this.ignoreRegistered) {
Y.mix(l, GLOBAL_ENV.mods);
}
// add the ignore list to the list of loaded packages
if (this.ignore) {
Y.mix(l, YArray.hash(this.ignore));
}
// expand the list to include superseded modules
for (j in l) {
if (l.hasOwnProperty(j)) {
Y.mix(l, this.getProvides(j));
}
}
// remove modules on the force list from the loaded list
if (this.force) {
for (i = 0; i < this.force.length; i++) {
if (this.force[i] in l) {
delete l[this.force[i]];
}
}
}
Y.mix(this.loaded, l);
this._init = true;
},
/**
* Builds a module name for a language pack
* @method getLangPackName
* @param {string} lang the language code.
* @param {string} mname the module to build it for.
* @return {string} the language pack module name.
*/
getLangPackName: function(lang, mname) {
return ('lang/' + mname + ((lang) ? '_' + lang : ''));
},
/**
* Inspects the required modules list looking for additional
* dependencies. Expands the required list to include all
* required modules. Called by calculate()
* @method _explode
* @private
*/
_explode: function() {
var r = this.required, m, reqs, done = {},
self = this;
// the setup phase is over, all modules have been created
self.dirty = false;
self._explodeRollups();
r = self.required;
oeach(r, function(v, name) {
if (!done[name]) {
done[name] = true;
m = self.getModule(name);
if (m) {
var expound = m.expound;
if (expound) {
r[expound] = self.getModule(expound);
reqs = self.getRequires(r[expound]);
Y.mix(r, YArray.hash(reqs));
}
reqs = self.getRequires(m);
Y.mix(r, YArray.hash(reqs));
}
}
});
},
/**
* Get's the loader meta data for the requested module
* @method getModule
* @param {String} mname The module name to get
* @return {Object} The module metadata
*/
getModule: function(mname) {
//TODO: Remove name check - it's a quick hack to fix pattern WIP
if (!mname) {
return null;
}
var p, found, pname,
m = this.moduleInfo[mname],
patterns = this.patterns;
// check the patterns library to see if we should automatically add
// the module with defaults
if (!m) {
for (pname in patterns) {
if (patterns.hasOwnProperty(pname)) {
p = patterns[pname];
// use the metadata supplied for the pattern
// as the module definition.
if (mname.indexOf(pname) > -1) {
found = p;
break;
}
}
}
if (found) {
if (p.action) {
p.action.call(this, mname, pname);
} else {
// ext true or false?
m = this.addModule(Y.merge(found), mname);
m.temp = true;
}
}
}
return m;
},
// impl in rollup submodule
_rollup: function() { },
/**
* Remove superceded modules and loaded modules. Called by
* calculate() after we have the mega list of all dependencies
* @method _reduce
* @return {object} the reduced dependency hash.
* @private
*/
_reduce: function(r) {
r = r || this.required;
var i, j, s, m, type = this.loadType,
ignore = this.ignore ? YArray.hash(this.ignore) : false;
for (i in r) {
if (r.hasOwnProperty(i)) {
m = this.getModule(i);
// remove if already loaded
if (((this.loaded[i] || ON_PAGE[i]) &&
!this.forceMap[i] && !this.ignoreRegistered) ||
(type && m && m.type != type)) {
delete r[i];
}
if (ignore && ignore[i]) {
delete r[i];
}
// remove anything this module supersedes
s = m && m.supersedes;
if (s) {
for (j = 0; j < s.length; j++) {
if (s[j] in r) {
delete r[s[j]];
}
}
}
}
}
return r;
},
/**
* Handles the queue when a module has been loaded for all cases
* @method _finish
* @private
* @param {String} msg The message from Loader
* @param {Boolean} success A boolean denoting success or failure
*/
_finish: function(msg, success) {
_queue.running = false;
var onEnd = this.onEnd;
if (onEnd) {
onEnd.call(this.context, {
msg: msg,
data: this.data,
success: success
});
}
this._continue();
},
/**
* The default Loader onSuccess handler, calls this.onSuccess with a payload
* @method _onSuccess
* @private
*/
_onSuccess: function() {
var self = this, skipped = Y.merge(self.skipped), fn,
failed = [], rreg = self.requireRegistration,
success, msg;
oeach(skipped, function(k) {
delete self.inserted[k];
});
self.skipped = {};
oeach(self.inserted, function(v, k) {
var mod = self.getModule(k);
if (mod && rreg && mod.type == JS && !(k in YUI.Env.mods)) {
failed.push(k);
} else {
Y.mix(self.loaded, self.getProvides(k));
}
});
fn = self.onSuccess;
msg = (failed.length) ? 'notregistered' : 'success';
success = !(failed.length);
if (fn) {
fn.call(self.context, {
msg: msg,
data: self.data,
success: success,
failed: failed,
skipped: skipped
});
}
self._finish(msg, success);
},
/**
* The default Loader onFailure handler, calls this.onFailure with a payload
* @method _onFailure
* @private
*/
_onFailure: function(o) {
var f = this.onFailure, msg = 'failure: ' + o.msg;
if (f) {
f.call(this.context, {
msg: msg,
data: this.data,
success: false
});
}
this._finish(msg, false);
},
/**
* The default Loader onTimeout handler, calls this.onTimeout with a payload
* @method _onTimeout
* @private
*/
_onTimeout: function() {
var f = this.onTimeout;
if (f) {
f.call(this.context, {
msg: 'timeout',
data: this.data,
success: false
});
}
this._finish('timeout', false);
},
/**
* Sorts the dependency tree. The last step of calculate()
* @method _sort
* @private
*/
_sort: function() {
// create an indexed list
var s = YObject.keys(this.required),
// loaded = this.loaded,
done = {},
p = 0, l, a, b, j, k, moved, doneKey;
// keep going until we make a pass without moving anything
for (;;) {
l = s.length;
moved = false;
// start the loop after items that are already sorted
for (j = p; j < l; j++) {
// check the next module on the list to see if its
// dependencies have been met
a = s[j];
// check everything below current item and move if we
// find a requirement for the current item
for (k = j + 1; k < l; k++) {
doneKey = a + s[k];
if (!done[doneKey] && this._requires(a, s[k])) {
// extract the dependency so we can move it up
b = s.splice(k, 1);
// insert the dependency above the item that
// requires it
s.splice(j, 0, b[0]);
// only swap two dependencies once to short circut
// circular dependencies
done[doneKey] = true;
// keep working
moved = true;
break;
}
}
// jump out of loop if we moved something
if (moved) {
break;
// this item is sorted, move our pointer and keep going
} else {
p++;
}
}
// when we make it here and moved is false, we are
// finished sorting
if (!moved) {
break;
}
}
this.sorted = s;
},
/**
* (Unimplemented)
* @method partial
* @unimplemented
*/
partial: function(partial, o, type) {
this.sorted = partial;
this.insert(o, type, true);
},
/**
* Handles the actual insertion of script/link tags
* @method _insert
* @param {Object} source The YUI instance the request came from
* @param {Object} o The metadata to include
* @param {String} type JS or CSS
* @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta
*/
_insert: function(source, o, type, skipcalc) {
// restore the state at the time of the request
if (source) {
this._config(source);
}
// build the dependency list
// don't include type so we can process CSS and script in
// one pass when the type is not specified.
if (!skipcalc) {
this.calculate(o);
}
this.loadType = type;
if (!type) {
var self = this;
this._internalCallback = function() {
var f = self.onCSS, n, p, sib;
// IE hack for style overrides that are not being applied
if (this.insertBefore && Y.UA.ie) {
n = Y.config.doc.getElementById(this.insertBefore);
p = n.parentNode;
sib = n.nextSibling;
p.removeChild(n);
if (sib) {
p.insertBefore(n, sib);
} else {
p.appendChild(n);
}
}
if (f) {
f.call(self.context, Y);
}
self._internalCallback = null;
self._insert(null, null, JS);
};
this._insert(null, null, CSS);
return;
}
// set a flag to indicate the load has started
this._loading = true;
// flag to indicate we are done with the combo service
// and any additional files will need to be loaded
// individually
this._combineComplete = {};
// start the load
this.loadNext();
},
/**
* Once a loader operation is completely finished, process any additional queued items.
* @method _continue
* @private
*/
_continue: function() {
if (!(_queue.running) && _queue.size() > 0) {
_queue.running = true;
_queue.next()();
}
},
/**
* inserts the requested modules and their dependencies.
* <code>type</code> can be "js" or "css". Both script and
* css are inserted if type is not provided.
* @method insert
* @param {object} o optional options object.
* @param {string} type the type of dependency to insert.
*/
insert: function(o, type, skipsort) {
var self = this, copy = Y.merge(this);
delete copy.require;
delete copy.dirty;
_queue.add(function() {
self._insert(copy, o, type, skipsort);
});
this._continue();
},
/**
* Executed every time a module is loaded, and if we are in a load
* cycle, we attempt to load the next script. Public so that it
* is possible to call this if using a method other than
* Y.register to determine when scripts are fully loaded
* @method loadNext
* @param {string} mname optional the name of the module that has
* been loaded (which is usually why it is time to load the next
* one).
*/
loadNext: function(mname) {
// It is possible that this function is executed due to something
// else on the page loading a YUI module. Only react when we
// are actively loading something
if (!this._loading) {
return;
}
var s, len, i, m, url, fn, msg, attr, group, groupName, j, frag,
comboSource, comboSources, mods, combining, urls, comboBase,
self = this,
type = self.loadType,
handleSuccess = function(o) {
self.loadNext(o.data);
},
handleCombo = function(o) {
self._combineComplete[type] = true;
var i, len = combining.length;
for (i = 0; i < len; i++) {
self.inserted[combining[i]] = true;
}
handleSuccess(o);
};
if (self.combine && (!self._combineComplete[type])) {
combining = [];
self._combining = combining;
s = self.sorted;
len = s.length;
// the default combo base
comboBase = self.comboBase;
url = comboBase;
urls = [];
comboSources = {};
for (i = 0; i < len; i++) {
comboSource = comboBase;
m = self.getModule(s[i]);
groupName = m && m.group;
if (groupName) {
group = self.groups[groupName];
if (!group.combine) {
m.combine = false;
continue;
}
m.combine = true;
if (group.comboBase) {
comboSource = group.comboBase;
}
if ("root" in group && L.isValue(group.root)) {
m.root = group.root;
}
}
comboSources[comboSource] = comboSources[comboSource] || [];
comboSources[comboSource].push(m);
}
for (j in comboSources) {
if (comboSources.hasOwnProperty(j)) {
url = j;
mods = comboSources[j];
len = mods.length;
for (i = 0; i < len; i++) {
// m = self.getModule(s[i]);
m = mods[i];
// Do not try to combine non-yui JS unless combo def
// is found
if (m && (m.type === type) && (m.combine || !m.ext)) {
frag = ((L.isValue(m.root)) ? m.root : self.root) + m.path;
frag = self._filter(frag, m.name);
if ((url !== j) && (i <= (len - 1)) &&
((frag.length + url.length) > self.maxURLLength)) {
//Hack until this is rewritten to use an array and not string concat:
if (url.substr(url.length - 1, 1) === self.comboSep) {
url = url.substr(0, (url.length - 1));
}
urls.push(self._filter(url));
url = j;
}
url += frag;
if (i < (len - 1)) {
url += self.comboSep;
}
combining.push(m.name);
}
}
if (combining.length && (url != j)) {
//Hack until this is rewritten to use an array and not string concat:
if (url.substr(url.length - 1, 1) === self.comboSep) {
url = url.substr(0, (url.length - 1));
}
urls.push(self._filter(url));
}
}
}
if (combining.length) {
// if (m.type === CSS) {
if (type === CSS) {
fn = Y.Get.css;
attr = self.cssAttributes;
} else {
fn = Y.Get.script;
attr = self.jsAttributes;
}
fn(urls, {
data: self._loading,
onSuccess: handleCombo,
onFailure: self._onFailure,
onTimeout: self._onTimeout,
insertBefore: self.insertBefore,
charset: self.charset,
attributes: attr,
timeout: self.timeout,
autopurge: false,
context: self
});
return;
} else {
self._combineComplete[type] = true;
}
}
if (mname) {
// if the module that was just loaded isn't what we were expecting,
// continue to wait
if (mname !== self._loading) {
return;
}
// The global handler that is called when each module is loaded
// will pass that module name to this function. Storing this
// data to avoid loading the same module multiple times
// centralize this in the callback
self.inserted[mname] = true;
// self.loaded[mname] = true;
// provided = self.getProvides(mname);
// Y.mix(self.loaded, provided);
// Y.mix(self.inserted, provided);
if (self.onProgress) {
self.onProgress.call(self.context, {
name: mname,
data: self.data
});
}
}
s = self.sorted;
len = s.length;
for (i = 0; i < len; i = i + 1) {
// this.inserted keeps track of what the loader has loaded.
// move on if this item is done.
if (s[i] in self.inserted) {
continue;
}
// Because rollups will cause multiple load notifications
// from Y, loadNext may be called multiple times for
// the same module when loading a rollup. We can safely
// skip the subsequent requests
if (s[i] === self._loading) {
return;
}
// log("inserting " + s[i]);
m = self.getModule(s[i]);
if (!m) {
if (!self.skipped[s[i]]) {
msg = 'Undefined module ' + s[i] + ' skipped';
// self.inserted[s[i]] = true;
self.skipped[s[i]] = true;
}
continue;
}
group = (m.group && self.groups[m.group]) || NOT_FOUND;
// The load type is stored to offer the possibility to load
// the css separately from the script.
if (!type || type === m.type) {
self._loading = s[i];
if (m.type === CSS) {
fn = Y.Get.css;
attr = self.cssAttributes;
} else {
fn = Y.Get.script;
attr = self.jsAttributes;
}
url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :
self._url(m.path, s[i], group.base || m.base);
fn(url, {
data: s[i],
onSuccess: handleSuccess,
insertBefore: self.insertBefore,
charset: self.charset,
attributes: attr,
onFailure: self._onFailure,
onTimeout: self._onTimeout,
timeout: self.timeout,
autopurge: false,
context: self
});
return;
}
}
// we are finished
self._loading = null;
fn = self._internalCallback;
// internal callback for loading css first
if (fn) {
self._internalCallback = null;
fn.call(self);
} else {
self._onSuccess();
}
},
/**
* Apply filter defined for this instance to a url/path
* @method _filter
* @param {string} u the string to filter.
* @param {string} name the name of the module, if we are processing
* a single module as opposed to a combined url.
* @return {string} the filtered string.
* @private
*/
_filter: function(u, name) {
var f = this.filter,
hasFilter = name && (name in this.filters),
modFilter = hasFilter && this.filters[name],
groupName = this.moduleInfo[name] ? this.moduleInfo[name].group:null;
if (groupName && this.groups[groupName].filter) {
modFilter = this.groups[groupName].filter;
hasFilter = true;
};
if (u) {
if (hasFilter) {
f = (L.isString(modFilter)) ?
this.FILTER_DEFS[modFilter.toUpperCase()] || null :
modFilter;
}
if (f) {
u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);
}
}
return u;
},
/**
* Generates the full url for a module
* @method _url
* @param {string} path the path fragment.
* @param {String} name The name of the module
* @pamra {String} [base=self.base] The base url to use
* @return {string} the full url.
* @private
*/
_url: function(path, name, base) {
return this._filter((base || this.base || '') + path, name);
},
/**
* Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
* @method resolve
* @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
* @param {Array} [s=loader.sorted] An override for the loader.sorted array
* @return {Object} Object hash (js and css) of two arrays of file lists
* @example This method can be used as an off-line dep calculator
*
* var Y = YUI();
* var loader = new Y.Loader({
* filter: 'debug',
* base: '../../',
* root: 'build/',
* combine: true,
* require: ['node', 'dd', 'console']
* });
* var out = loader.resolve(true);
*
*/
resolve: function(calc, s) {
var self = this, i, m, url, out = { js: [], css: [] };
if (calc) {
self.calculate();
}
s = s || self.sorted;
for (i = 0; i < s.length; i++) {
m = self.getModule(s[i]);
if (m) {
if (self.combine) {
url = self._filter((self.root + m.path), m.name, self.root);
} else {
url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
}
out[m.type].push(url);
}
}
if (self.combine) {
out.js = [self.comboBase + out.js.join(self.comboSep)];
out.css = [self.comboBase + out.css.join(self.comboSep)];
}
return out;
},
/**
* Returns an Object hash of hashes built from `loader.sorted` or from an arbitrary list of sorted modules.
* @method hash
* @private
* @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
* @param {Array} [s=loader.sorted] An override for the loader.sorted array
* @return {Object} Object hash (js and css) of two object hashes of file lists, with the module name as the key
* @example This method can be used as an off-line dep calculator
*
* var Y = YUI();
* var loader = new Y.Loader({
* filter: 'debug',
* base: '../../',
* root: 'build/',
* combine: true,
* require: ['node', 'dd', 'console']
* });
* var out = loader.hash(true);
*
*/
hash: function(calc, s) {
var self = this, i, m, url, out = { js: {}, css: {} };
if (calc) {
self.calculate();
}
s = s || self.sorted;
for (i = 0; i < s.length; i++) {
m = self.getModule(s[i]);
if (m) {
url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
out[m.type][m.name] = url;
}
}
return out;
}
};
}, '@VERSION@' ,{requires:['get']});
|
src/components/Feedback/Feedback.js | sbassan/Kingsthorpe | /**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 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 React from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './Feedback.scss';
function Feedback() {
return (
<div className={s.root}>
<div className={s.container}>
<a
className={s.link}
href="https://gitter.im/kriasoft/react-starter-kit"
>Ask a question</a>
<span className={s.spacer}>|</span>
<a
className={s.link}
href="https://github.com/kriasoft/react-starter-kit/issues/new"
>Report an issue</a>
</div>
</div>
);
}
export default withStyles(Feedback, s);
|
node_modules/debug/src/browser.js | jadlao/jadlao.github.io | /**
* This is the web browser implementation of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = require('./debug');
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = 'undefined' != typeof chrome
&& 'undefined' != typeof chrome.storage
? chrome.storage.local
: localstorage();
/**
* Colors.
*/
exports.colors = [
'#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
'#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
'#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
'#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
'#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
'#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
'#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
'#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
'#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
'#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
'#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
];
/**
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
* and the Firebug extension (any Firefox version) are known
* to support "%c" CSS customizations.
*
* TODO: add a `localStorage` variable to explicitly enable/disable colors
*/
function useColors() {
// NB: In an Electron preload script, document will be defined but not fully
// initialized. Since we know we're in Chrome, we'll just detect this case
// explicitly
if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
return true;
}
// Internet Explorer and Edge do not support colors.
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
return false;
}
// is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
// is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
// is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
// double check webkit in userAgent just in case we are in a worker
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}
/**
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
*/
exports.formatters.j = function(v) {
try {
return JSON.stringify(v);
} catch (err) {
return '[UnexpectedJSONParseError]: ' + err.message;
}
};
/**
* Colorize log arguments if enabled.
*
* @api public
*/
function formatArgs(args) {
var useColors = this.useColors;
args[0] = (useColors ? '%c' : '')
+ this.namespace
+ (useColors ? ' %c' : ' ')
+ args[0]
+ (useColors ? '%c ' : ' ')
+ '+' + exports.humanize(this.diff);
if (!useColors) return;
var c = 'color: ' + this.color;
args.splice(1, 0, c, 'color: inherit')
// the final "%c" is somewhat tricky, because there could be other
// arguments passed either before or after the %c, so we need to
// figure out the correct index to insert the CSS into
var index = 0;
var lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, function(match) {
if ('%%' === match) return;
index++;
if ('%c' === match) {
// we only are interested in the *last* %c
// (the user may have provided their own)
lastC = index;
}
});
args.splice(lastC, 0, c);
}
/**
* Invokes `console.log()` when available.
* No-op when `console.log` is not a "function".
*
* @api public
*/
function log() {
// this hackery is required for IE8/9, where
// the `console.log` function doesn't have 'apply'
return 'object' === typeof console
&& console.log
&& Function.prototype.apply.call(console.log, console, arguments);
}
/**
* Save `namespaces`.
*
* @param {String} namespaces
* @api private
*/
function save(namespaces) {
try {
if (null == namespaces) {
exports.storage.removeItem('debug');
} else {
exports.storage.debug = namespaces;
}
} catch(e) {}
}
/**
* Load `namespaces`.
*
* @return {String} returns the previously persisted debug modes
* @api private
*/
function load() {
var r;
try {
r = exports.storage.debug;
} catch(e) {}
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
if (!r && typeof process !== 'undefined' && 'env' in process) {
r = process.env.DEBUG;
}
return r;
}
/**
* Enable namespaces listed in `localStorage.debug` initially.
*/
exports.enable(load());
/**
* Localstorage attempts to return the localstorage.
*
* This is necessary because safari throws
* when a user disables cookies/localstorage
* and you attempt to access it.
*
* @return {LocalStorage}
* @api private
*/
function localstorage() {
try {
return window.localStorage;
} catch (e) {}
}
|
src/components/Library.js | jansuchomel/tosine | import React, { Component } from 'react';
import { render } from 'react-dom';
import { VirtualScroll, AutoSizer } from 'react-virtualized';
export default class Library extends Component {
expandLibrary(library, uri) {
this.props.mopidyAction("expandLibrary", {library: library, uri: uri});
}
expandArtist(library, artist, uri) {
this.props.mopidyAction("expandArtist", {library: library, artist:artist, uri: uri});
}
expandAlbum(library, artist, album, uri) {
this.props.mopidyAction("expandAlbum", {library:library, artist:artist, album:album, uri: uri});
}
addToTl(uri) {
this.props.mopidyAction("addToTl", {uri: uri});
}
render() {
const { libraries, mopidyAction } = this.props;
let comps = [];
libraries.forEach((library, libraryName) => {
comps.push(
<span className="list-group-item level0" key={libraryName} onClick={this.expandLibrary.bind(this, libraryName, library.get("uri"))}>
{libraryName}
<a onClick={this.addToTl.bind(this, library.get("uri"))}>+</a>
</span>);
library.get("artists").forEach((artist, artistName) => {
comps.push(
<span className="list-group-item level1" key={artistName} onClick={this.expandArtist.bind(this, libraryName, artistName, artist.get("uri"))}>
{artistName}
<a onClick={this.addToTl.bind(this, artist.get("uri"))}>+</a>
</span>);
if (artist.has("albums")) {
let i = 0;
artist.get("albums").forEach((album, albumName) => {
comps.push(
<span className="list-group-item level2"
key={"album_" + artistName + "_" + ++i}
onClick={this.expandAlbum.bind(this, libraryName, artistName, albumName, album.get("uri"))}>
{albumName}
<a onClick={this.addToTl.bind(this, album.get("uri"))}>+</a>
</span>);
let j = 0;
let tracks = album.get("tracks");
tracks.forEach((track, trackName) => {
comps.push(
<span className="list-group-item level3"
key={"track_" + trackName + "_" + ++j}>
{track.get("name")}
<a onClick={this.addToTl.bind(this, track.get("uri"))}>+</a>
</span>
);
});
});
}
});
})
return (
<div className="library-list list-group list-group-root">
<AutoSizer>
{({ height, width }) => (
<VirtualScroll
width={width}
height={height}
rowsCount={comps.length}
rowHeight={40}
rowRenderer={
index => comps[index] // Could also be a DOM element
}
/>
)}
</AutoSizer>
</div>
);
}
}
|
ajax/libs/rxjs/2.2.3/rx.compat.js | jtangelder/cdnjs | // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
(function (window, undefined) {
var freeExports = typeof exports == 'object' && exports,
freeModule = typeof module == 'object' && module && module.exports == freeExports && module,
freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal) {
window = freeGlobal;
}
/**
* @name Rx
* @type Object
*/
var Rx = { Internals: {} };
// Defaults
function noop() { }
function identity(x) { return x; }
var defaultNow = (function () { return !!Date.now ? Date.now : function () { return +new Date; }; }());
function defaultComparer(x, y) { return isEqual(x, y); }
function defaultSubComparer(x, y) { return x - y; }
function defaultKeySerializer(x) { return x.toString(); }
function defaultError(err) { throw err; }
// Errors
var sequenceContainsNoElements = 'Sequence contains no elements.';
var argumentOutOfRange = 'Argument out of range';
var objectDisposed = 'Object has been disposed';
function checkDisposed() {
if (this.isDisposed) {
throw new Error(objectDisposed);
}
}
/** Used to determine if values are of the language type Object */
var objectTypes = {
'boolean': false,
'function': true,
'object': true,
'number': false,
'string': false,
'undefined': false
};
/** `Object#toString` result shortcuts */
var argsClass = '[object Arguments]',
arrayClass = '[object Array]',
boolClass = '[object Boolean]',
dateClass = '[object Date]',
errorClass = '[object Error]',
funcClass = '[object Function]',
numberClass = '[object Number]',
objectClass = '[object Object]',
regexpClass = '[object RegExp]',
stringClass = '[object String]';
var toString = Object.prototype.toString,
hasOwnProperty = Object.prototype.hasOwnProperty,
supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
suportNodeClass;
try {
suportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
} catch(e) {
suportNodeClass = true;
}
function isNode(value) {
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
// methods that are `typeof` "string" and still can coerce nodes to strings
return typeof value.toString != 'function' && typeof (value + '') == 'string';
}
function isArguments(value) {
return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
}
// fallback for browsers that can't detect `arguments` objects by [[Class]]
if (!supportsArgsClass) {
isArguments = function(value) {
return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
};
}
function isFunction(value) {
return typeof value == 'function';
}
// fallback for older versions of Chrome and Safari
if (isFunction(/x/)) {
isFunction = function(value) {
return typeof value == 'function' && toString.call(value) == funcClass;
};
}
var isEqual = Rx.Internals.isEqual = function (x, y) {
return deepEquals(x, y, [], []);
};
/** @private
* Used for deep comparison
**/
function deepEquals(a, b, stackA, stackB) {
var result;
// exit early for identical values
if (a === b) {
// treat `+0` vs. `-0` as not equal
return a !== 0 || (1 / a == 1 / b);
}
var type = typeof a,
otherType = typeof b;
// exit early for unlike primitive values
if (a === a &&
!(a && objectTypes[type]) &&
!(b && objectTypes[otherType])) {
return false;
}
// exit early for `null` and `undefined`, avoiding ES3's Function#call behavior
// http://es5.github.io/#x15.3.4.4
if (a == null || b == null) {
return a === b;
}
// compare [[Class]] names
var className = toString.call(a),
otherClass = toString.call(b);
if (className == argsClass) {
className = objectClass;
}
if (otherClass == argsClass) {
otherClass = objectClass;
}
if (className != otherClass) {
return false;
}
switch (className) {
case boolClass:
case dateClass:
// coerce dates and booleans to numbers, dates to milliseconds and booleans
// to `1` or `0`, treating invalid dates coerced to `NaN` as not equal
return +a == +b;
case numberClass:
// treat `NaN` vs. `NaN` as equal
return (a != +a)
? b != +b
// but treat `+0` vs. `-0` as not equal
: (a == 0 ? (1 / a == 1 / b) : a == +b);
case regexpClass:
case stringClass:
// coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
// treat string primitives and their corresponding object instances as equal
return a == String(b);
}
var isArr = className == arrayClass;
if (!isArr) {
// exit for functions and DOM nodes
if (className != objectClass || (!suportNodeClass && (isNode(a) || isNode(b)))) {
return false;
}
// in older versions of Opera, `arguments` objects have `Array` constructors
var ctorA = !supportsArgsClass && isArguments(a) ? Object : a.constructor,
ctorB = !supportsArgsClass && isArguments(b) ? Object : b.constructor;
// non `Object` object instances with different constructors are not equal
if (ctorA != ctorB && !(
isFunction(ctorA) && ctorA instanceof ctorA &&
isFunction(ctorB) && ctorB instanceof ctorB
)) {
return false;
}
}
// assume cyclic structures are equal
// the algorithm for detecting cyclic structures is adapted from ES 5.1
// section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
var length = stackA.length;
while (length--) {
if (stackA[length] == a) {
return stackB[length] == b;
}
}
var size = 0;
result = true;
// add `a` and `b` to the stack of traversed objects
stackA.push(a);
stackB.push(b);
// recursively compare objects and arrays (susceptible to call stack limits)
if (isArr) {
length = a.length;
size = b.length;
// compare lengths to determine if a deep comparison is necessary
result = size == a.length;
// deep compare the contents, ignoring non-numeric properties
while (size--) {
var index = length,
value = b[size];
if (!(result = deepEquals(a[size], value, stackA, stackB))) {
break;
}
}
return result;
}
// deep compare each object
for(var key in b) {
if (hasOwnProperty.call(b, key)) {
// count properties and deep compare each property value
size++;
return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], b[key], stackA, stackB));
}
}
if (result) {
// ensure both objects have the same number of properties
for (var key in a) {
if (hasOwnProperty.call(a, key)) {
// `size` will be `-1` if `a` has more properties than `b`
return (result = --size > -1);
}
}
}
stackA.pop();
stackB.pop();
return result;
}
var slice = Array.prototype.slice;
function argsOrArray(args, idx) {
return args.length === 1 && Array.isArray(args[idx]) ?
args[idx] :
slice.call(args);
}
var hasProp = {}.hasOwnProperty;
/** @private */
var inherits = this.inherits = Rx.Internals.inherits = function (child, parent) {
function __() { this.constructor = child; }
__.prototype = parent.prototype;
child.prototype = new __();
};
/** @private */
var addProperties = Rx.Internals.addProperties = function (obj) {
var sources = slice.call(arguments, 1);
for (var i = 0, len = sources.length; i < len; i++) {
var source = sources[i];
for (var prop in source) {
obj[prop] = source[prop];
}
}
};
// Rx Utils
var addRef = Rx.Internals.addRef = function (xs, r) {
return new AnonymousObservable(function (observer) {
return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
});
};
// Collection polyfills
function arrayInitialize(count, factory) {
var a = new Array(count);
for (var i = 0; i < count; i++) {
a[i] = factory();
}
return a;
}
// Utilities
if (!Function.prototype.bind) {
Function.prototype.bind = function (that) {
var target = this,
args = slice.call(arguments, 1);
var bound = function () {
if (this instanceof bound) {
function F() { }
F.prototype = target.prototype;
var self = new F();
var result = target.apply(self, args.concat(slice.call(arguments)));
if (Object(result) === result) {
return result;
}
return self;
} else {
return target.apply(that, args.concat(slice.call(arguments)));
}
};
return bound;
};
}
var boxedString = Object("a"),
splitString = boxedString[0] != "a" || !(0 in boxedString);
if (!Array.prototype.every) {
Array.prototype.every = function every(fun /*, thisp */) {
var object = Object(this),
self = splitString && {}.toString.call(this) == "[object String]" ?
this.split("") :
object,
length = self.length >>> 0,
thisp = arguments[1];
if ({}.toString.call(fun) != "[object Function]") {
throw new TypeError(fun + " is not a function");
}
for (var i = 0; i < length; i++) {
if (i in self && !fun.call(thisp, self[i], i, object)) {
return false;
}
}
return true;
};
}
if (!Array.prototype.map) {
Array.prototype.map = function map(fun /*, thisp*/) {
var object = Object(this),
self = splitString && {}.toString.call(this) == "[object String]" ?
this.split("") :
object,
length = self.length >>> 0,
result = Array(length),
thisp = arguments[1];
if ({}.toString.call(fun) != "[object Function]") {
throw new TypeError(fun + " is not a function");
}
for (var i = 0; i < length; i++) {
if (i in self)
result[i] = fun.call(thisp, self[i], i, object);
}
return result;
};
}
if (!Array.prototype.filter) {
Array.prototype.filter = function (predicate) {
var results = [], item, t = new Object(this);
for (var i = 0, len = t.length >>> 0; i < len; i++) {
item = t[i];
if (i in t && predicate.call(arguments[1], item, i, t)) {
results.push(item);
}
}
return results;
};
}
if (!Array.isArray) {
Array.isArray = function (arg) {
return Object.prototype.toString.call(arg) == '[object Array]';
};
}
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function indexOf(searchElement) {
var t = Object(this);
var len = t.length >>> 0;
if (len === 0) {
return -1;
}
var n = 0;
if (arguments.length > 1) {
n = Number(arguments[1]);
if (n !== n) {
n = 0;
} else if (n !== 0 && n != Infinity && n !== -Infinity) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
}
}
if (n >= len) {
return -1;
}
var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
for (; k < len; k++) {
if (k in t && t[k] === searchElement) {
return k;
}
}
return -1;
};
}
// Collections
var IndexedItem = function (id, value) {
this.id = id;
this.value = value;
};
IndexedItem.prototype.compareTo = function (other) {
var c = this.value.compareTo(other.value);
if (c === 0) {
c = this.id - other.id;
}
return c;
};
// Priority Queue for Scheduling
var PriorityQueue = Rx.Internals.PriorityQueue = function (capacity) {
this.items = new Array(capacity);
this.length = 0;
};
var priorityProto = PriorityQueue.prototype;
priorityProto.isHigherPriority = function (left, right) {
return this.items[left].compareTo(this.items[right]) < 0;
};
priorityProto.percolate = function (index) {
if (index >= this.length || index < 0) {
return;
}
var parent = index - 1 >> 1;
if (parent < 0 || parent === index) {
return;
}
if (this.isHigherPriority(index, parent)) {
var temp = this.items[index];
this.items[index] = this.items[parent];
this.items[parent] = temp;
this.percolate(parent);
}
};
priorityProto.heapify = function (index) {
if (index === undefined) {
index = 0;
}
if (index >= this.length || index < 0) {
return;
}
var left = 2 * index + 1,
right = 2 * index + 2,
first = index;
if (left < this.length && this.isHigherPriority(left, first)) {
first = left;
}
if (right < this.length && this.isHigherPriority(right, first)) {
first = right;
}
if (first !== index) {
var temp = this.items[index];
this.items[index] = this.items[first];
this.items[first] = temp;
this.heapify(first);
}
};
priorityProto.peek = function () { return this.items[0].value; };
priorityProto.removeAt = function (index) {
this.items[index] = this.items[--this.length];
delete this.items[this.length];
this.heapify();
};
priorityProto.dequeue = function () {
var result = this.peek();
this.removeAt(0);
return result;
};
priorityProto.enqueue = function (item) {
var index = this.length++;
this.items[index] = new IndexedItem(PriorityQueue.count++, item);
this.percolate(index);
};
priorityProto.remove = function (item) {
for (var i = 0; i < this.length; i++) {
if (this.items[i].value === item) {
this.removeAt(i);
return true;
}
}
return false;
};
PriorityQueue.count = 0;
/**
* Represents a group of disposable resources that are disposed together.
* @constructor
*/
var CompositeDisposable = Rx.CompositeDisposable = function () {
this.disposables = argsOrArray(arguments, 0);
this.isDisposed = false;
this.length = this.disposables.length;
};
var CompositeDisposablePrototype = CompositeDisposable.prototype;
/**
* Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
* @param {Mixed} item Disposable to add.
*/
CompositeDisposablePrototype.add = function (item) {
if (this.isDisposed) {
item.dispose();
} else {
this.disposables.push(item);
this.length++;
}
};
/**
* Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
* @param {Mixed} item Disposable to remove.
* @returns {Boolean} true if found; false otherwise.
*/
CompositeDisposablePrototype.remove = function (item) {
var shouldDispose = false;
if (!this.isDisposed) {
var idx = this.disposables.indexOf(item);
if (idx !== -1) {
shouldDispose = true;
this.disposables.splice(idx, 1);
this.length--;
item.dispose();
}
}
return shouldDispose;
};
/**
* Disposes all disposables in the group and removes them from the group.
*/
CompositeDisposablePrototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var currentDisposables = this.disposables.slice(0);
this.disposables = [];
this.length = 0;
for (var i = 0, len = currentDisposables.length; i < len; i++) {
currentDisposables[i].dispose();
}
}
};
/**
* Removes and disposes all disposables from the CompositeDisposable, but does not dispose the CompositeDisposable.
*/
CompositeDisposablePrototype.clear = function () {
var currentDisposables = this.disposables.slice(0);
this.disposables = [];
this.length = 0;
for (var i = 0, len = currentDisposables.length; i < len; i++) {
currentDisposables[i].dispose();
}
};
/**
* Determines whether the CompositeDisposable contains a specific disposable.
* @param {Mixed} item Disposable to search for.
* @returns {Boolean} true if the disposable was found; otherwise, false.
*/
CompositeDisposablePrototype.contains = function (item) {
return this.disposables.indexOf(item) !== -1;
};
/**
* Converts the existing CompositeDisposable to an array of disposables
* @returns {Array} An array of disposable objects.
*/
CompositeDisposablePrototype.toArray = function () {
return this.disposables.slice(0);
};
/**
* Provides a set of static methods for creating Disposables.
*
* @constructor
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
*/
var Disposable = Rx.Disposable = function (action) {
this.isDisposed = false;
this.action = action || noop;
};
/** Performs the task of cleaning up resources. */
Disposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.action();
this.isDisposed = true;
}
};
/**
* Creates a disposable object that invokes the specified action when disposed.
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
* @return {Disposable} The disposable object that runs the given action upon disposal.
*/
var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
/**
* Gets the disposable that does nothing when disposed.
*/
var disposableEmpty = Disposable.empty = { dispose: noop };
/**
* Represents a disposable resource which only allows a single assignment of its underlying disposable resource.
* If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an Error.
*
* @constructor
*/
var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () {
this.isDisposed = false;
this.current = null;
};
var SingleAssignmentDisposablePrototype = SingleAssignmentDisposable.prototype;
/**
* Gets the underlying disposable. After disposal, the result of getting this method is undefined.
* @returns {Disposable} The underlying disposable.
*/
SingleAssignmentDisposablePrototype.getDisposable = function () {
return this.current;
};
/* @private */
SingleAssignmentDisposable.disposable = function (value) {
return arguments.length ? this.getDisposable() : this.setDisposable(value);
};
/**
* Sets the underlying disposable.
* @param {Disposable} value The new underlying disposable.
*/
SingleAssignmentDisposablePrototype.setDisposable = function (value) {
if (this.current) {
throw new Error('Disposable has already been assigned');
}
var shouldDispose = this.isDisposed;
if (!shouldDispose) {
this.current = value;
}
if (shouldDispose && value) {
value.dispose();
}
};
/**
* Disposes the underlying disposable.
*/
SingleAssignmentDisposablePrototype.dispose = function () {
var old;
if (!this.isDisposed) {
this.isDisposed = true;
old = this.current;
this.current = null;
}
if (old) {
old.dispose();
}
};
/**
* Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource.
* @constructor
*/
var SerialDisposable = Rx.SerialDisposable = function () {
this.isDisposed = false;
this.current = null;
};
var serialDisposablePrototype = SerialDisposable.prototype;
/**
* Gets the underlying disposable.
* @return The underlying disposable.
*/
serialDisposablePrototype.getDisposable = function () {
return this.current;
};
/**
* Sets the underlying disposable.
* @param {Disposable} value The new underlying disposable.
*/
serialDisposablePrototype.setDisposable = function (value) {
var shouldDispose = this.isDisposed, old;
if (!shouldDispose) {
old = this.current;
this.current = value;
}
if (old) {
old.dispose();
}
if (shouldDispose && value) {
value.dispose();
}
};
/* @private */
serialDisposablePrototype.disposable = function (value) {
if (!value) {
return this.getDisposable();
} else {
this.setDisposable(value);
}
};
/**
* Disposes the underlying disposable as well as all future replacements.
*/
serialDisposablePrototype.dispose = function () {
var old;
if (!this.isDisposed) {
this.isDisposed = true;
old = this.current;
this.current = null;
}
if (old) {
old.dispose();
}
};
/**
* Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
*/
var RefCountDisposable = Rx.RefCountDisposable = (function () {
function InnerDisposable(disposable) {
this.disposable = disposable;
this.disposable.count++;
this.isInnerDisposed = false;
}
InnerDisposable.prototype.dispose = function () {
if (!this.disposable.isDisposed) {
if (!this.isInnerDisposed) {
this.isInnerDisposed = true;
this.disposable.count--;
if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
this.disposable.isDisposed = true;
this.disposable.underlyingDisposable.dispose();
}
}
}
};
/**
* Initializes a new instance of the RefCountDisposable with the specified disposable.
* @constructor
* @param {Disposable} disposable Underlying disposable.
*/
function RefCountDisposable(disposable) {
this.underlyingDisposable = disposable;
this.isDisposed = false;
this.isPrimaryDisposed = false;
this.count = 0;
}
/**
* Disposes the underlying disposable only when all dependent disposables have been disposed
*/
RefCountDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
if (!this.isPrimaryDisposed) {
this.isPrimaryDisposed = true;
if (this.count === 0) {
this.isDisposed = true;
this.underlyingDisposable.dispose();
}
}
}
};
/**
* Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
* @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
*/
RefCountDisposable.prototype.getDisposable = function () {
return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
};
return RefCountDisposable;
})();
/**
* @constructor
* @private
*/
function ScheduledDisposable(scheduler, disposable) {
this.scheduler = scheduler, this.disposable = disposable, this.isDisposed = false;
}
/**
* @private
* @memberOf ScheduledDisposable#
*/
ScheduledDisposable.prototype.dispose = function () {
var parent = this;
this.scheduler.schedule(function () {
if (!parent.isDisposed) {
parent.isDisposed = true;
parent.disposable.dispose();
}
});
};
var ScheduledItem = Rx.Internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
this.scheduler = scheduler;
this.state = state;
this.action = action;
this.dueTime = dueTime;
this.comparer = comparer || defaultSubComparer;
this.disposable = new SingleAssignmentDisposable();
}
ScheduledItem.prototype.invoke = function () {
this.disposable.setDisposable(this.invokeCore());
};
ScheduledItem.prototype.compareTo = function (other) {
return this.comparer(this.dueTime, other.dueTime);
};
ScheduledItem.prototype.isCancelled = function () {
return this.disposable.isDisposed;
};
ScheduledItem.prototype.invokeCore = function () {
return this.action(this.scheduler, this.state);
};
/** Provides a set of static properties to access commonly used schedulers. */
var Scheduler = Rx.Scheduler = (function () {
/**
* @constructor
* @private
*/
function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
this.now = now;
this._schedule = schedule;
this._scheduleRelative = scheduleRelative;
this._scheduleAbsolute = scheduleAbsolute;
}
function invokeRecImmediate(scheduler, pair) {
var state = pair.first, action = pair.second, group = new CompositeDisposable(),
recursiveAction = function (state1) {
action(state1, function (state2) {
var isAdded = false, isDone = false,
d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
};
recursiveAction(state);
return group;
}
function invokeRecDate(scheduler, pair, method) {
var state = pair.first, action = pair.second, group = new CompositeDisposable(),
recursiveAction = function (state1) {
action(state1, function (state2, dueTime1) {
var isAdded = false, isDone = false,
d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
};
recursiveAction(state);
return group;
}
function invokeAction(scheduler, action) {
action();
return disposableEmpty;
}
var schedulerProto = Scheduler.prototype;
/**
* Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions.
* @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false.
* @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling.
*/
schedulerProto.catchException = schedulerProto['catch'] = function (handler) {
return new CatchScheduler(this, handler);
};
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
schedulerProto.schedulePeriodic = function (period, action) {
return this.schedulePeriodicWithState(null, period, function () {
action();
});
};
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Mixed} state Initial state passed to the action upon the first iteration.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed, potentially updating the state.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
schedulerProto.schedulePeriodicWithState = function (state, period, action) {
var s = state, id = window.setInterval(function () {
s = action(s);
}, period);
return disposableCreate(function () {
window.clearInterval(id);
});
};
/**
* Schedules an action to be executed.
* @param {Function} action Action to execute.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.schedule = function (action) {
return this._schedule(action, invokeAction);
};
/**
* Schedules an action to be executed.
* @param state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithState = function (state, action) {
return this._schedule(state, action);
};
/**
* Schedules an action to be executed after the specified relative due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelative = function (dueTime, action) {
return this._scheduleRelative(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed after dueTime.
* @param state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative(state, dueTime, action);
};
/**
* Schedules an action to be executed at the specified absolute due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
return this._scheduleAbsolute(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed at dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number}dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute(state, dueTime, action);
};
/**
* Schedules an action to be executed recursively.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursive = function (action) {
return this.scheduleRecursiveWithState(action, function (_action, self) {
_action(function () {
self(_action);
});
});
};
/**
* Schedules an action to be executed recursively.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithState = function (state, action) {
return this.scheduleWithState({ first: state, second: action }, function (s, p) {
return invokeRecImmediate(s, p);
});
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
return this.scheduleRecursiveWithRelativeAndState(action, dueTime, function (_action, self) {
_action(function (dt) {
self(_action, dt);
});
});
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
});
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, function (_action, self) {
_action(function (dt) {
self(_action, dt);
});
});
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
});
};
/** Gets the current time according to the local machine's system clock. */
Scheduler.now = defaultNow;
/**
* Normalizes the specified TimeSpan value to a positive value.
* @param {Number} timeSpan The time span value to normalize.
* @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
*/
Scheduler.normalize = function (timeSpan) {
if (timeSpan < 0) {
timeSpan = 0;
}
return timeSpan;
};
return Scheduler;
}());
var SchedulePeriodicRecursive = Rx.Internals.SchedulePeriodicRecursive = (function () {
function tick(command, recurse) {
recurse(0, this._period);
try {
this._state = this._action(this._state);
} catch (e) {
this._cancel.dispose();
throw e;
}
}
function SchedulePeriodicRecursive(scheduler, state, period, action) {
this._scheduler = scheduler;
this._state = state;
this._period = period;
this._action = action;
}
SchedulePeriodicRecursive.prototype.start = function () {
var d = new SingleAssignmentDisposable();
this._cancel = d;
d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
return d;
};
return SchedulePeriodicRecursive;
}());
var schedulerNoBlockError = 'Scheduler is not allowed to block the thread';
/**
* Gets a scheduler that schedules work immediately on the current thread.
*/
var immediateScheduler = Scheduler.immediate = (function () {
function scheduleNow(state, action) {
return action(this, state);
}
function scheduleRelative(state, dueTime, action) {
if (dueTime > 0) throw new Error(schedulerNoBlockError);
return action(this, state);
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
}());
/**
* Gets a scheduler that schedules work as soon as possible on the current thread.
*/
var currentThreadScheduler = Scheduler.currentThread = (function () {
var queue;
function Trampoline() {
queue = new PriorityQueue(4);
}
Trampoline.prototype.dispose = function () {
queue = null;
};
Trampoline.prototype.run = function () {
var item;
while (queue.length > 0) {
item = queue.dequeue();
if (!item.isCancelled()) {
while (item.dueTime - Scheduler.now() > 0) {
}
if (!item.isCancelled()) {
item.invoke();
}
}
}
};
function scheduleNow(state, action) {
return this.scheduleWithRelativeAndState(state, 0, action);
}
function scheduleRelative(state, dueTime, action) {
var dt = this.now() + Scheduler.normalize(dueTime),
si = new ScheduledItem(this, state, action, dt),
t;
if (!queue) {
t = new Trampoline();
try {
queue.enqueue(si);
t.run();
} catch (e) {
throw e;
} finally {
t.dispose();
}
} else {
queue.enqueue(si);
}
return si.disposable;
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
currentScheduler.scheduleRequired = function () { return queue === null; };
currentScheduler.ensureTrampoline = function (action) {
if (queue === null) {
return this.schedule(action);
} else {
return action();
}
};
return currentScheduler;
}());
var scheduleMethod, clearMethod = noop;
(function () {
function postMessageSupported () {
// Ensure not in a worker
if (!window.postMessage || window.importScripts) { return false; }
var isAsync = false,
oldHandler = window.onmessage;
// Test for async
window.onmessage = function () { isAsync = true; };
window.postMessage('','*');
window.onmessage = oldHandler;
return isAsync;
}
// Check for setImmediate first for Node v0.11+
if (typeof window.setImmediate === 'function') {
scheduleMethod = window.setImmediate;
clearMethod = clearImmediate;
} else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
scheduleMethod = process.nextTick;
} else if (postMessageSupported()) {
var MSG_PREFIX = 'ms.rx.schedule' + Math.random(),
tasks = {},
taskId = 0;
function onGlobalPostMessage(event) {
// Only if we're a match to avoid any other global events
if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
var handleId = event.data.substring(MSG_PREFIX.length),
action = tasks[handleId];
action();
delete tasks[handleId];
}
}
if (window.addEventListener) {
window.addEventListener('message', onGlobalPostMessage, false);
} else {
window.attachEvent('onmessage', onGlobalPostMessage, false);
}
scheduleMethod = function (action) {
var currentId = taskId++;
tasks[currentId] = action;
window.postMessage(MSG_PREFIX + currentId, '*');
};
} else if (!!window.MessageChannel) {
var channel = new window.MessageChannel(),
channelTasks = {},
channelTaskId = 0;
channel.port1.onmessage = function (event) {
var id = event.data,
action = channelTasks[id];
action();
delete channelTasks[id];
};
scheduleMethod = function (action) {
var id = channelTaskId++;
channelTasks[id] = action;
channel.port2.postMessage(id);
};
} else if ('document' in window && 'onreadystatechange' in window.document.createElement('script')) {
scheduleMethod = function (action) {
var scriptElement = window.document.createElement('script');
scriptElement.onreadystatechange = function () {
action();
scriptElement.onreadystatechange = null;
scriptElement.parentNode.removeChild(scriptElement);
scriptElement = null;
};
window.document.documentElement.appendChild(scriptElement);
};
} else {
scheduleMethod = function (action) { return window.setTimeout(action, 0); };
clearMethod = window.clearTimeout;
}
}());
/**
* Gets a scheduler that schedules work via a timed callback based upon platform.
*/
var timeoutScheduler = Scheduler.timeout = (function () {
function scheduleNow(state, action) {
var scheduler = this,
disposable = new SingleAssignmentDisposable();
var id = scheduleMethod(function () {
if (!disposable.isDisposed) {
disposable.setDisposable(action(scheduler, state));
}
});
return new CompositeDisposable(disposable, disposableCreate(function () {
clearMethod(id);
}));
}
function scheduleRelative(state, dueTime, action) {
var scheduler = this,
dt = Scheduler.normalize(dueTime);
if (dt === 0) {
return scheduler.scheduleWithState(state, action);
}
var disposable = new SingleAssignmentDisposable();
var id = window.setTimeout(function () {
if (!disposable.isDisposed) {
disposable.setDisposable(action(scheduler, state));
}
}, dt);
return new CompositeDisposable(disposable, disposableCreate(function () {
window.clearTimeout(id);
}));
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
})();
/** @private */
var CatchScheduler = (function (_super) {
function localNow() {
return this._scheduler.now();
}
function scheduleNow(state, action) {
return this._scheduler.scheduleWithState(state, this._wrap(action));
}
function scheduleRelative(state, dueTime, action) {
return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action));
}
function scheduleAbsolute(state, dueTime, action) {
return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action));
}
inherits(CatchScheduler, _super);
/** @private */
function CatchScheduler(scheduler, handler) {
this._scheduler = scheduler;
this._handler = handler;
this._recursiveOriginal = null;
this._recursiveWrapper = null;
_super.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute);
}
/** @private */
CatchScheduler.prototype._clone = function (scheduler) {
return new CatchScheduler(scheduler, this._handler);
};
/** @private */
CatchScheduler.prototype._wrap = function (action) {
var parent = this;
return function (self, state) {
try {
return action(parent._getRecursiveWrapper(self), state);
} catch (e) {
if (!parent._handler(e)) { throw e; }
return disposableEmpty;
}
};
};
/** @private */
CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) {
if (this._recursiveOriginal !== scheduler) {
this._recursiveOriginal = scheduler;
var wrapper = this._clone(scheduler);
wrapper._recursiveOriginal = scheduler;
wrapper._recursiveWrapper = wrapper;
this._recursiveWrapper = wrapper;
}
return this._recursiveWrapper;
};
/** @private */
CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) {
var self = this, failed = false, d = new SingleAssignmentDisposable();
d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) {
if (failed) { return null; }
try {
return action(state1);
} catch (e) {
failed = true;
if (!self._handler(e)) { throw e; }
d.dispose();
return null;
}
}));
return d;
};
return CatchScheduler;
}(Scheduler));
/**
* Represents a notification to an observer.
*/
var Notification = Rx.Notification = (function () {
function Notification(kind, hasValue) {
this.hasValue = hasValue == null ? false : hasValue;
this.kind = kind;
}
var NotificationPrototype = Notification.prototype;
/**
* Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
*
* @memberOf Notification
* @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
* @param {Function} onError Delegate to invoke for an OnError notification.
* @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
* @returns {Any} Result produced by the observation.
*/
NotificationPrototype.accept = function (observerOrOnNext, onError, onCompleted) {
if (arguments.length === 1 && typeof observerOrOnNext === 'object') {
return this._acceptObservable(observerOrOnNext);
}
return this._accept(observerOrOnNext, onError, onCompleted);
};
/**
* Returns an observable sequence with a single notification.
*
* @memberOf Notification
* @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
* @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
*/
NotificationPrototype.toObservable = function (scheduler) {
var notification = this;
scheduler || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
notification._acceptObservable(observer);
if (notification.kind === 'N') {
observer.onCompleted();
}
});
});
};
return Notification;
})();
/**
* Creates an object that represents an OnNext notification to an observer.
* @param {Any} value The value contained in the notification.
* @returns {Notification} The OnNext notification containing the value.
*/
var notificationCreateOnNext = Notification.createOnNext = (function () {
function _accept (onNext) {
return onNext(this.value);
}
function _acceptObservable(observer) {
return observer.onNext(this.value);
}
function toString () {
return 'OnNext(' + this.value + ')';
}
return function (value) {
var notification = new Notification('N', true);
notification.value = value;
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());
/**
* Creates an object that represents an OnError notification to an observer.
* @param {Any} error The exception contained in the notification.
* @returns {Notification} The OnError notification containing the exception.
*/
var notificationCreateOnError = Notification.createOnError = (function () {
function _accept (onNext, onError) {
return onError(this.exception);
}
function _acceptObservable(observer) {
return observer.onError(this.exception);
}
function toString () {
return 'OnError(' + this.exception + ')';
}
return function (exception) {
var notification = new Notification('E');
notification.exception = exception;
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());
/**
* Creates an object that represents an OnCompleted notification to an observer.
* @returns {Notification} The OnCompleted notification.
*/
var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
function _accept (onNext, onError, onCompleted) {
return onCompleted();
}
function _acceptObservable(observer) {
return observer.onCompleted();
}
function toString () {
return 'OnCompleted()';
}
return function () {
var notification = new Notification('C');
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());
/**
* @constructor
* @private
*/
var Enumerator = Rx.Internals.Enumerator = function (moveNext, getCurrent, dispose) {
this.moveNext = moveNext;
this.getCurrent = getCurrent;
this.dispose = dispose;
};
/**
* @static
* @memberOf Enumerator
* @private
*/
var enumeratorCreate = Enumerator.create = function (moveNext, getCurrent, dispose) {
var done = false;
dispose || (dispose = noop);
return new Enumerator(function () {
if (done) {
return false;
}
var result = moveNext();
if (!result) {
done = true;
dispose();
}
return result;
}, function () { return getCurrent(); }, function () {
if (!done) {
dispose();
done = true;
}
});
};
/** @private */
var Enumerable = Rx.Internals.Enumerable = (function () {
/**
* @constructor
* @private
*/
function Enumerable(getEnumerator) {
this.getEnumerator = getEnumerator;
}
/**
* @private
* @memberOf Enumerable#
*/
Enumerable.prototype.concat = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var e = sources.getEnumerator(), isDisposed = false, subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
var current, ex, hasNext = false;
if (!isDisposed) {
try {
hasNext = e.moveNext();
if (hasNext) {
current = e.getCurrent();
} else {
e.dispose();
}
} catch (exception) {
ex = exception;
e.dispose();
}
} else {
return;
}
if (ex) {
observer.onError(ex);
return;
}
if (!hasNext) {
observer.onCompleted();
return;
}
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(current.subscribe(
observer.onNext.bind(observer),
observer.onError.bind(observer),
function () { self(); })
);
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
e.dispose();
}));
});
};
/**
* @private
* @memberOf Enumerable#
*/
Enumerable.prototype.catchException = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var e = sources.getEnumerator(), isDisposed = false, lastException;
var subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
var current, ex, hasNext;
hasNext = false;
if (!isDisposed) {
try {
hasNext = e.moveNext();
if (hasNext) {
current = e.getCurrent();
}
} catch (exception) {
ex = exception;
}
} else {
return;
}
if (ex) {
observer.onError(ex);
return;
}
if (!hasNext) {
if (lastException) {
observer.onError(lastException);
} else {
observer.onCompleted();
}
return;
}
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(current.subscribe(
observer.onNext.bind(observer),
function (exn) {
lastException = exn;
self();
},
observer.onCompleted.bind(observer)));
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
});
};
return Enumerable;
}());
/**
* @static
* @private
* @memberOf Enumerable
*/
var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
if (repeatCount === undefined) {
repeatCount = -1;
}
return new Enumerable(function () {
var current, left = repeatCount;
return enumeratorCreate(function () {
if (left === 0) {
return false;
}
if (left > 0) {
left--;
}
current = value;
return true;
}, function () { return current; });
});
};
/**
* @static
* @private
* @memberOf Enumerable
*/
var enumerableFor = Enumerable.forEach = function (source, selector) {
selector || (selector = identity);
return new Enumerable(function () {
var current, index = -1;
return enumeratorCreate(
function () {
if (++index < source.length) {
current = selector(source[index], index);
return true;
}
return false;
},
function () { return current; }
);
});
};
/**
* Supports push-style iteration over an observable sequence.
*/
var Observer = Rx.Observer = function () { };
/**
* Creates a notification callback from an observer.
*
* @param observer Observer object.
* @returns The action that forwards its input notification to the underlying observer.
*/
Observer.prototype.toNotifier = function () {
var observer = this;
return function (n) {
return n.accept(observer);
};
};
/**
* Hides the identity of an observer.
* @returns An observer that hides the identity of the specified observer.
*/
Observer.prototype.asObserver = function () {
return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this));
};
/**
* Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods.
* If a violation is detected, an Error is thrown from the offending observer method call.
*
* @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.
*/
Observer.prototype.checked = function () { return new CheckedObserver(this); };
/**
* Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
*
* @static
* @memberOf Observer
* @param {Function} [onNext] Observer's OnNext action implementation.
* @param {Function} [onError] Observer's OnError action implementation.
* @param {Function} [onCompleted] Observer's OnCompleted action implementation.
* @returns {Observer} The observer object implemented using the given actions.
*/
var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
onNext || (onNext = noop);
onError || (onError = defaultError);
onCompleted || (onCompleted = noop);
return new AnonymousObserver(onNext, onError, onCompleted);
};
/**
* Creates an observer from a notification callback.
*
* @static
* @memberOf Observer
* @param {Function} handler Action that handles a notification.
* @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
*/
Observer.fromNotifier = function (handler) {
return new AnonymousObserver(function (x) {
return handler(notificationCreateOnNext(x));
}, function (exception) {
return handler(notificationCreateOnError(exception));
}, function () {
return handler(notificationCreateOnCompleted());
});
};
/**
* Schedules the invocation of observer methods on the given scheduler.
* @param {Scheduler} scheduler Scheduler to schedule observer messages on.
* @returns {Observer} Observer whose messages are scheduled on the given scheduler.
*/
Observer.notifyOn = function (scheduler) {
return new ObserveOnObserver(scheduler, this);
};
/**
* Abstract base class for implementations of the Observer class.
* This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
*/
var AbstractObserver = Rx.Internals.AbstractObserver = (function (_super) {
inherits(AbstractObserver, _super);
/**
* Creates a new observer in a non-stopped state.
*
* @constructor
*/
function AbstractObserver() {
this.isStopped = false;
_super.call(this);
}
/**
* Notifies the observer of a new element in the sequence.
*
* @memberOf AbstractObserver
* @param {Any} value Next element in the sequence.
*/
AbstractObserver.prototype.onNext = function (value) {
if (!this.isStopped) {
this.next(value);
}
};
/**
* Notifies the observer that an exception has occurred.
*
* @memberOf AbstractObserver
* @param {Any} error The error that has occurred.
*/
AbstractObserver.prototype.onError = function (error) {
if (!this.isStopped) {
this.isStopped = true;
this.error(error);
}
};
/**
* Notifies the observer of the end of the sequence.
*/
AbstractObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.completed();
}
};
/**
* Disposes the observer, causing it to transition to the stopped state.
*/
AbstractObserver.prototype.dispose = function () {
this.isStopped = true;
};
AbstractObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.error(e);
return true;
}
return false;
};
return AbstractObserver;
}(Observer));
/**
* Class to create an Observer instance from delegate-based implementations of the on* methods.
*/
var AnonymousObserver = Rx.AnonymousObserver = (function (_super) {
inherits(AnonymousObserver, _super);
/**
* Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
*
* @constructor
* @param {Any} onNext Observer's OnNext action implementation.
* @param {Any} onError Observer's OnError action implementation.
* @param {Any} onCompleted Observer's OnCompleted action implementation.
*/
function AnonymousObserver(onNext, onError, onCompleted) {
_super.call(this);
this._onNext = onNext;
this._onError = onError;
this._onCompleted = onCompleted;
}
/**
* Calls the onNext action.
*
* @memberOf AnonymousObserver
* @param {Any} value Next element in the sequence.
*/
AnonymousObserver.prototype.next = function (value) {
this._onNext(value);
};
/**
* Calls the onError action.
*
* @memberOf AnonymousObserver
* @param {Any{ error The error that has occurred.
*/
AnonymousObserver.prototype.error = function (exception) {
this._onError(exception);
};
/**
* Calls the onCompleted action.
*
* @memberOf AnonymousObserver
*/
AnonymousObserver.prototype.completed = function () {
this._onCompleted();
};
return AnonymousObserver;
}(AbstractObserver));
var CheckedObserver = (function (_super) {
inherits(CheckedObserver, _super);
function CheckedObserver(observer) {
_super.call(this);
this._observer = observer;
this._state = 0; // 0 - idle, 1 - busy, 2 - done
}
var CheckedObserverPrototype = CheckedObserver.prototype;
CheckedObserverPrototype.onNext = function (value) {
this.checkAccess();
try {
this._observer.onNext(value);
} catch (e) {
throw e;
} finally {
this._state = 0;
}
};
CheckedObserverPrototype.onError = function (err) {
this.checkAccess();
try {
this._observer.onError(err);
} catch (e) {
throw e;
} finally {
this._state = 2;
}
};
CheckedObserverPrototype.onCompleted = function () {
this.checkAccess();
try {
this._observer.onCompleted();
} catch (e) {
throw e;
} finally {
this._state = 2;
}
};
CheckedObserverPrototype.checkAccess = function () {
if (this._state === 1) { throw new Error('Re-entrancy detected'); }
if (this._state === 2) { throw new Error('Observer completed'); }
if (this._state === 0) { this._state = 1; }
};
return CheckedObserver;
}(Observer));
/** @private */
var ScheduledObserver = Rx.Internals.ScheduledObserver = (function (_super) {
inherits(ScheduledObserver, _super);
function ScheduledObserver(scheduler, observer) {
_super.call(this);
this.scheduler = scheduler;
this.observer = observer;
this.isAcquired = false;
this.hasFaulted = false;
this.queue = [];
this.disposable = new SerialDisposable();
}
/** @private */
ScheduledObserver.prototype.next = function (value) {
var self = this;
this.queue.push(function () {
self.observer.onNext(value);
});
};
/** @private */
ScheduledObserver.prototype.error = function (exception) {
var self = this;
this.queue.push(function () {
self.observer.onError(exception);
});
};
/** @private */
ScheduledObserver.prototype.completed = function () {
var self = this;
this.queue.push(function () {
self.observer.onCompleted();
});
};
/** @private */
ScheduledObserver.prototype.ensureActive = function () {
var isOwner = false, parent = this;
if (!this.hasFaulted && this.queue.length > 0) {
isOwner = !this.isAcquired;
this.isAcquired = true;
}
if (isOwner) {
this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
var work;
if (parent.queue.length > 0) {
work = parent.queue.shift();
} else {
parent.isAcquired = false;
return;
}
try {
work();
} catch (ex) {
parent.queue = [];
parent.hasFaulted = true;
throw ex;
}
self();
}));
}
};
/** @private */
ScheduledObserver.prototype.dispose = function () {
_super.prototype.dispose.call(this);
this.disposable.dispose();
};
return ScheduledObserver;
}(AbstractObserver));
/** @private */
var ObserveOnObserver = (function (_super) {
inherits(ObserveOnObserver, _super);
/** @private */
function ObserveOnObserver() {
_super.apply(this, arguments);
}
/** @private */
ObserveOnObserver.prototype.next = function (value) {
_super.prototype.next.call(this, value);
this.ensureActive();
};
/** @private */
ObserveOnObserver.prototype.error = function (e) {
_super.prototype.error.call(this, e);
this.ensureActive();
};
/** @private */
ObserveOnObserver.prototype.completed = function () {
_super.prototype.completed.call(this);
this.ensureActive();
};
return ObserveOnObserver;
})(ScheduledObserver);
var observableProto;
/**
* Represents a push-style collection.
*/
var Observable = Rx.Observable = (function () {
/**
* @constructor
* @private
*/
function Observable(subscribe) {
this._subscribe = subscribe;
}
observableProto = Observable.prototype;
observableProto.finalValue = function () {
var source = this;
return new AnonymousObservable(function (observer) {
var hasValue = false, value;
return source.subscribe(function (x) {
hasValue = true;
value = x;
}, observer.onError.bind(observer), function () {
if (!hasValue) {
observer.onError(new Error(sequenceContainsNoElements));
} else {
observer.onNext(value);
observer.onCompleted();
}
});
});
};
/**
* Subscribes an observer to the observable sequence.
*
* @example
* 1 - source.subscribe();
* 2 - source.subscribe(observer);
* 3 - source.subscribe(function (x) { console.log(x); });
* 4 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); });
* 5 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }, function () { console.log('done'); });
* @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
* @returns {Diposable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
*/
observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
var subscriber;
if (typeof observerOrOnNext === 'object') {
subscriber = observerOrOnNext;
} else {
subscriber = observerCreate(observerOrOnNext, onError, onCompleted);
}
return this._subscribe(subscriber);
};
/**
* Creates a list from an observable sequence.
*
* @memberOf Observable
* @returns An observable sequence containing a single element with a list containing all the elements of the source sequence.
*/
observableProto.toArray = function () {
function accumulator(list, i) {
var newList = list.slice(0);
newList.push(i);
return newList;
}
return this.scan([], accumulator).startWith([]).finalValue();
};
return Observable;
})();
/**
* Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
*
* This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects
* that require to be run on a scheduler, use subscribeOn.
*
* @param {Scheduler} scheduler Scheduler to notify observers on.
* @returns {Observable} The source sequence whose observations happen on the specified scheduler.
*/
observableProto.observeOn = function (scheduler) {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(new ObserveOnObserver(scheduler, observer));
});
};
/**
* Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used;
* see the remarks section for more information on the distinction between subscribeOn and observeOn.
* This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer
* callbacks on a scheduler, use observeOn.
* @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on.
* @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
*/
observableProto.subscribeOn = function (scheduler) {
var source = this;
return new AnonymousObservable(function (observer) {
var m = new SingleAssignmentDisposable(), d = new SerialDisposable();
d.setDisposable(m);
m.setDisposable(scheduler.schedule(function () {
d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer)));
}));
return d;
});
};
/**
* Creates an observable sequence from a specified subscribe method implementation.
*
* @example
* var res = Rx.Observable.create(function (observer) { return function () { } );
*
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
*/
Observable.create = function (subscribe) {
return new AnonymousObservable(function (o) {
return disposableCreate(subscribe(o));
});
};
/**
* Creates an observable sequence from a specified subscribe method implementation.
*
* @example
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method.
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
*/
Observable.createWithDisposable = function (subscribe) {
return new AnonymousObservable(subscribe);
};
/**
* Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
*
* @example
* var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
* @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence.
* @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
*/
var observableDefer = Observable.defer = function (observableFactory) {
return new AnonymousObservable(function (observer) {
var result;
try {
result = observableFactory();
} catch (e) {
return observableThrow(e).subscribe(observer);
}
return result.subscribe(observer);
});
};
/**
* Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
*
* @example
* var res = Rx.Observable.empty();
* var res = Rx.Observable.empty(Rx.Scheduler.timeout);
* @param {Scheduler} [scheduler] Scheduler to send the termination call on.
* @returns {Observable} An observable sequence with no elements.
*/
var observableEmpty = Observable.empty = function (scheduler) {
scheduler || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onCompleted();
});
});
};
/**
* Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
*
* @example
* var res = Rx.Observable.fromArray([1,2,3]);
* var res = Rx.Observable.fromArray([1,2,3], Rx.Scheduler.timeout);
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
* @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
*/
var observableFromArray = Observable.fromArray = function (array, scheduler) {
scheduler || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (observer) {
var count = 0;
return scheduler.scheduleRecursive(function (self) {
if (count < array.length) {
observer.onNext(array[count++]);
self();
} else {
observer.onCompleted();
}
});
});
};
/**
* Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
* @static
* @memberOf Observable
* @param {Mixed} initialState Initial state.
* @param {Function} condition Condition to terminate generation (upon returning false).
* @param {Function} iterate Iteration step function.
* @param {Function} resultSelector Selector function for results produced in the sequence.
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
* @returns {Observable} The generated sequence.
*/
Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
scheduler || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (observer) {
var first = true, state = initialState;
return scheduler.scheduleRecursive(function (self) {
var hasResult, result;
try {
if (first) {
first = false;
} else {
state = iterate(state);
}
hasResult = condition(state);
if (hasResult) {
result = resultSelector(state);
}
} catch (exception) {
observer.onError(exception);
return;
}
if (hasResult) {
observer.onNext(result);
self();
} else {
observer.onCompleted();
}
});
});
};
/**
* Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
*
* @static
* @memberOf Observable
* @returns {Observable} An observable sequence whose observers will never get called.
*/
var observableNever = Observable.never = function () {
return new AnonymousObservable(function () {
return disposableEmpty;
});
};
/**
* Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.range(0, 10);
* var res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout);
* @static
* @memberOf Observable
* @param {Number} start The value of the first integer in the sequence.
* @param {Number} count The number of sequential integers to generate.
* @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
* @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
*/
Observable.range = function (start, count, scheduler) {
scheduler || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.scheduleRecursiveWithState(0, function (i, self) {
if (i < count) {
observer.onNext(start + i);
self(i + 1);
} else {
observer.onCompleted();
}
});
});
};
/**
* Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.repeat(42);
* var res = Rx.Observable.repeat(42, 4);
* 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout);
* 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout);
* @static
* @memberOf Observable
* @param {Mixed} value Element to repeat.
* @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
* @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence that repeats the given element the specified number of times.
*/
Observable.repeat = function (value, repeatCount, scheduler) {
scheduler || (scheduler = currentThreadScheduler);
if (repeatCount == null) {
repeatCount = -1;
}
return observableReturn(value, scheduler).repeat(repeatCount);
};
/**
* Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
* There is an alias called 'returnValue' for browsers <IE9.
*
* @example
* var res = Rx.Observable.return(42);
* var res = Rx.Observable.return(42, Rx.Scheduler.timeout);
* @static
* @memberOf Observable
* @param {Mixed} value Single element in the resulting observable sequence.
* @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence containing the single specified element.
*/
var observableReturn = Observable['return'] = Observable.returnValue = function (value, scheduler) {
scheduler || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onNext(value);
observer.onCompleted();
});
});
};
/**
* Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
* There is an alias to this method called 'throwException' for browsers <IE9.
*
* @example
* var res = Rx.Observable.throwException(new Error('Error'));
* var res = Rx.Observable.throwException(new Error('Error'), Rx.Scheduler.timeout);
* @static
* @memberOf Observable
* @param {Mixed} exception An object used for the sequence's termination.
* @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
*/
var observableThrow = Observable['throw'] = Observable.throwException = function (exception, scheduler) {
scheduler || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onError(exception);
});
});
};
/**
* Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
*
* @example
* var res = Rx.Observable.using(function () { return new AsyncSubject(); }, function (s) { return s; });
* @static
* @memberOf Observable
* @param {Function} resourceFactory Factory function to obtain a resource object.
* @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource.
* @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object.
*/
Observable.using = function (resourceFactory, observableFactory) {
return new AnonymousObservable(function (observer) {
var disposable = disposableEmpty, resource, source;
try {
resource = resourceFactory();
if (resource) {
disposable = resource;
}
source = observableFactory(resource);
} catch (exception) {
return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable);
}
return new CompositeDisposable(source.subscribe(observer), disposable);
});
};
/**
* Propagates the observable sequence that reacts first.
*
* @memberOf Observable#
* @param {Observable} rightSource Second observable sequence.
* @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first.
*/
observableProto.amb = function (rightSource) {
var leftSource = this;
return new AnonymousObservable(function (observer) {
var choice,
leftChoice = 'L', rightChoice = 'R',
leftSubscription = new SingleAssignmentDisposable(),
rightSubscription = new SingleAssignmentDisposable();
function choiceL() {
if (!choice) {
choice = leftChoice;
rightSubscription.dispose();
}
}
function choiceR() {
if (!choice) {
choice = rightChoice;
leftSubscription.dispose();
}
}
leftSubscription.setDisposable(leftSource.subscribe(function (left) {
choiceL();
if (choice === leftChoice) {
observer.onNext(left);
}
}, function (err) {
choiceL();
if (choice === leftChoice) {
observer.onError(err);
}
}, function () {
choiceL();
if (choice === leftChoice) {
observer.onCompleted();
}
}));
rightSubscription.setDisposable(rightSource.subscribe(function (right) {
choiceR();
if (choice === rightChoice) {
observer.onNext(right);
}
}, function (err) {
choiceR();
if (choice === rightChoice) {
observer.onError(err);
}
}, function () {
choiceR();
if (choice === rightChoice) {
observer.onCompleted();
}
}));
return new CompositeDisposable(leftSubscription, rightSubscription);
});
};
/**
* Propagates the observable sequence that reacts first.
*
* @example
* E.g. winner = Rx.Observable.amb(xs, ys, zs);
* @static
* @memberOf Observable
* @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
*/
Observable.amb = function () {
var acc = observableNever(),
items = argsOrArray(arguments, 0);
function func(previous, current) {
return previous.amb(current);
}
for (var i = 0, len = items.length; i < len; i++) {
acc = func(acc, items[i]);
}
return acc;
};
function observableCatchHandler(source, handler) {
return new AnonymousObservable(function (observer) {
var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
subscription.setDisposable(d1);
d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) {
var d, result;
try {
result = handler(exception);
} catch (ex) {
observer.onError(ex);
return;
}
d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(result.subscribe(observer));
}, observer.onCompleted.bind(observer)));
return subscription;
});
}
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
* @example
* 1 - xs.catchException(ys)
* 2 - xs.catchException(function (ex) { return ys(ex); })
* @memberOf Observable#
* @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
* @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
*/
observableProto['catch'] = observableProto.catchException = function (handlerOrSecond) {
if (typeof handlerOrSecond === 'function') {
return observableCatchHandler(this, handlerOrSecond);
}
return observableCatch([this, handlerOrSecond]);
};
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
*
* @example
* 1 - res = Rx.Observable.catchException(xs, ys, zs);
* 2 - res = Rx.Observable.catchException([xs, ys, zs]);
* @static
* @memberOf Observable
* @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
*/
var observableCatch = Observable.catchException = Observable['catch'] = function () {
var items = argsOrArray(arguments, 0);
return enumerableFor(items).catchException();
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
* This can be in the form of an argument list of observables or an array.
*
* @example
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @memberOf Observable#
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.combineLatest = function () {
var args = slice.call(arguments);
if (Array.isArray(args[0])) {
args[0].unshift(this);
} else {
args.unshift(this);
}
return combineLatest.apply(this, args);
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
*
* @example
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @static
* @memberOf Observable
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
var combineLatest = Observable.combineLatest = function () {
var args = slice.call(arguments), resultSelector = args.pop();
if (Array.isArray(args[0])) {
args = args[0];
}
return new AnonymousObservable(function (observer) {
var falseFactory = function () { return false; },
n = args.length,
hasValue = arrayInitialize(n, falseFactory),
hasValueAll = false,
isDone = arrayInitialize(n, falseFactory),
values = new Array(n);
function next(i) {
var res;
hasValue[i] = true;
if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
try {
res = resultSelector.apply(null, values);
} catch (ex) {
observer.onError(ex);
return;
}
observer.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
observer.onCompleted();
}
}
function done (i) {
isDone[i] = true;
if (isDone.every(identity)) {
observer.onCompleted();
}
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
subscriptions[i] = new SingleAssignmentDisposable();
subscriptions[i].setDisposable(args[i].subscribe(function (x) {
values[i] = x;
next(i);
}, observer.onError.bind(observer), function () {
done(i);
}));
}(idx));
}
return new CompositeDisposable(subscriptions);
});
};
/**
* Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
*
* @example
* 1 - concatenated = xs.concat(ys, zs);
* 2 - concatenated = xs.concat([ys, zs]);
* @memberOf Observable#
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
observableProto.concat = function () {
var items = slice.call(arguments, 0);
items.unshift(this);
return observableConcat.apply(this, items);
};
/**
* Concatenates all the observable sequences.
*
* @example
* 1 - res = Rx.Observable.concat(xs, ys, zs);
* 2 - res = Rx.Observable.concat([xs, ys, zs]);
* @static
* @memberOf Observable
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
var observableConcat = Observable.concat = function () {
var sources = argsOrArray(arguments, 0);
return enumerableFor(sources).concat();
};
/**
* Concatenates an observable sequence of observable sequences.
*
* @memberOf Observable#
* @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
*/
observableProto.concatObservable = observableProto.concatAll =function () {
return this.merge(1);
};
/**
* Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
* Or merges two observable sequences into a single observable sequence.
*
* @example
* 1 - merged = sources.merge(1);
* 2 - merged = source.merge(otherSource);
* @memberOf Observable#
* @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.merge = function (maxConcurrentOrOther) {
if (typeof maxConcurrentOrOther !== 'number') {
return observableMerge(this, maxConcurrentOrOther);
}
var sources = this;
return new AnonymousObservable(function (observer) {
var activeCount = 0,
group = new CompositeDisposable(),
isStopped = false,
q = [],
subscribe = function (xs) {
var subscription = new SingleAssignmentDisposable();
group.add(subscription);
subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () {
var s;
group.remove(subscription);
if (q.length > 0) {
s = q.shift();
subscribe(s);
} else {
activeCount--;
if (isStopped && activeCount === 0) {
observer.onCompleted();
}
}
}));
};
group.add(sources.subscribe(function (innerSource) {
if (activeCount < maxConcurrentOrOther) {
activeCount++;
subscribe(innerSource);
} else {
q.push(innerSource);
}
}, observer.onError.bind(observer), function () {
isStopped = true;
if (activeCount === 0) {
observer.onCompleted();
}
}));
return group;
});
};
/**
* Merges all the observable sequences into a single observable sequence.
* The scheduler is optional and if not specified, the immediate scheduler is used.
*
* @example
* 1 - merged = Rx.Observable.merge(xs, ys, zs);
* 2 - merged = Rx.Observable.merge([xs, ys, zs]);
* 3 - merged = Rx.Observable.merge(scheduler, xs, ys, zs);
* 4 - merged = Rx.Observable.merge(scheduler, [xs, ys, zs]);
*
* @static
* @memberOf Observable
* @returns {Observable} The observable sequence that merges the elements of the observable sequences.
*/
var observableMerge = Observable.merge = function () {
var scheduler, sources;
if (!arguments[0]) {
scheduler = immediateScheduler;
sources = slice.call(arguments, 1);
} else if (arguments[0].now) {
scheduler = arguments[0];
sources = slice.call(arguments, 1);
} else {
scheduler = immediateScheduler;
sources = slice.call(arguments, 0);
}
if (Array.isArray(sources[0])) {
sources = sources[0];
}
return observableFromArray(sources, scheduler).mergeObservable();
};
/**
* Merges an observable sequence of observable sequences into an observable sequence.
*
* @memberOf Observable#
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.mergeObservable = observableProto.mergeAll =function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var group = new CompositeDisposable(),
isStopped = false,
m = new SingleAssignmentDisposable();
group.add(m);
m.setDisposable(sources.subscribe(function (innerSource) {
var innerSubscription = new SingleAssignmentDisposable();
group.add(innerSubscription);
innerSubscription.setDisposable(innerSource.subscribe(function (x) {
observer.onNext(x);
}, observer.onError.bind(observer), function () {
group.remove(innerSubscription);
if (isStopped && group.length === 1) {
observer.onCompleted();
}
}));
}, observer.onError.bind(observer), function () {
isStopped = true;
if (group.length === 1) {
observer.onCompleted();
}
}));
return group;
});
};
/**
* Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
*
* @memberOf Observable
* @param {Observable} second Second observable sequence used to produce results after the first sequence terminates.
* @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally.
*/
observableProto.onErrorResumeNext = function (second) {
if (!second) {
throw new Error('Second observable is required');
}
return onErrorResumeNext([this, second]);
};
/**
* Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
*
* @example
* 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
* 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
* @static
* @memberOf Observable
* @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
*/
var onErrorResumeNext = Observable.onErrorResumeNext = function () {
var sources = argsOrArray(arguments, 0);
return new AnonymousObservable(function (observer) {
var pos = 0, subscription = new SerialDisposable(),
cancelable = immediateScheduler.scheduleRecursive(function (self) {
var current, d;
if (pos < sources.length) {
current = sources[pos++];
d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(current.subscribe(observer.onNext.bind(observer), function () {
self();
}, function () {
self();
}));
} else {
observer.onCompleted();
}
});
return new CompositeDisposable(subscription, cancelable);
});
};
/**
* Returns the values from the source observable sequence only after the other observable sequence produces a value.
*
* @memberOf Observable#
* @param {Observable} other The observable sequence that triggers propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
*/
observableProto.skipUntil = function (other) {
var source = this;
return new AnonymousObservable(function (observer) {
var isOpen = false;
var disposables = new CompositeDisposable(source.subscribe(function (left) {
if (isOpen) {
observer.onNext(left);
}
}, observer.onError.bind(observer), function () {
if (isOpen) {
observer.onCompleted();
}
}));
var rightSubscription = new SingleAssignmentDisposable();
disposables.add(rightSubscription);
rightSubscription.setDisposable(other.subscribe(function () {
isOpen = true;
rightSubscription.dispose();
}, observer.onError.bind(observer), function () {
rightSubscription.dispose();
}));
return disposables;
});
};
/**
* Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
*
* @memberOf Observable#
* @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto['switch'] = observableProto.switchLatest = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var hasLatest = false,
innerSubscription = new SerialDisposable(),
isStopped = false,
latest = 0,
subscription = sources.subscribe(function (innerSource) {
var d = new SingleAssignmentDisposable(), id = ++latest;
hasLatest = true;
innerSubscription.setDisposable(d);
d.setDisposable(innerSource.subscribe(function (x) {
if (latest === id) {
observer.onNext(x);
}
}, function (e) {
if (latest === id) {
observer.onError(e);
}
}, function () {
if (latest === id) {
hasLatest = false;
if (isStopped) {
observer.onCompleted();
}
}
}));
}, observer.onError.bind(observer), function () {
isStopped = true;
if (!hasLatest) {
observer.onCompleted();
}
});
return new CompositeDisposable(subscription, innerSubscription);
});
};
/**
* Returns the values from the source observable sequence until the other observable sequence produces a value.
*
* @memberOf Observable#
* @param {Observable} other Observable sequence that terminates propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
*/
observableProto.takeUntil = function (other) {
var source = this;
return new AnonymousObservable(function (observer) {
return new CompositeDisposable(
source.subscribe(observer),
other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop)
);
});
};
function zipArray(second, resultSelector) {
var first = this;
return new AnonymousObservable(function (observer) {
var index = 0, len = second.length;
return first.subscribe(function (left) {
if (index < len) {
var right = second[index++], result;
try {
result = resultSelector(left, right);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
} else {
observer.onCompleted();
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
}
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
* The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources.
*
* @example
* 1 - res = obs1.zip(obs2, fn);
* 1 - res = x1.zip([1,2,3], fn);
* @memberOf Observable#
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.zip = function () {
if (Array.isArray(arguments[0])) {
return zipArray.apply(this, arguments);
}
var parent = this, sources = slice.call(arguments), resultSelector = sources.pop();
sources.unshift(parent);
return new AnonymousObservable(function (observer) {
var n = sources.length,
queues = arrayInitialize(n, function () { return []; }),
isDone = arrayInitialize(n, function () { return false; });
var next = function (i) {
var res, queuedValues;
if (queues.every(function (x) { return x.length > 0; })) {
try {
queuedValues = queues.map(function (x) { return x.shift(); });
res = resultSelector.apply(parent, queuedValues);
} catch (ex) {
observer.onError(ex);
return;
}
observer.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
observer.onCompleted();
}
};
function done(i) {
isDone[i] = true;
if (isDone.every(function (x) { return x; })) {
observer.onCompleted();
}
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
subscriptions[i] = new SingleAssignmentDisposable();
subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
queues[i].push(x);
next(i);
}, observer.onError.bind(observer), function () {
done(i);
}));
})(idx);
}
return new CompositeDisposable(subscriptions);
});
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
*
* @static
* @memberOf Observable
* @param arguments Observable sources.
* @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
Observable.zip = function () {
var args = slice.call(arguments, 0),
first = args.shift();
return first.zip.apply(first, args);
};
/**
* Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
*
* @static
* @memberOf Observable
* @param arguments Observable sources.
* @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
*/
Observable.zipArray = function () {
var sources = slice.call(arguments);
return new AnonymousObservable(function (observer) {
var n = sources.length,
queues = arrayInitialize(n, function () { return []; }),
isDone = arrayInitialize(n, function () { return false; });
function next(i) {
if (queues.every(function (x) { return x.length > 0; })) {
var res = queues.map(function (x) { return x.shift(); });
observer.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
observer.onCompleted();
return;
}
};
function done(i) {
isDone[i] = true;
if (isDone.every(identity)) {
observer.onCompleted();
return;
}
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
subscriptions[i] = new SingleAssignmentDisposable();
subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
queues[i].push(x);
next(i);
}, observer.onError.bind(observer), function () {
done(i);
}));
})(idx);
}
var compositeDisposable = new CompositeDisposable(subscriptions);
compositeDisposable.add(disposableCreate(function () {
for (var qIdx = 0, qLen = queues.length; qIdx < qLen; qIdx++) {
queues[qIdx] = [];
}
}));
return compositeDisposable;
});
};
/**
* Hides the identity of an observable sequence.
* @returns {Observable} An observable sequence that hides the identity of the source sequence.
*/
observableProto.asObservable = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(observer);
});
};
/**
* Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
*
* @example
* var res = xs.bufferWithCount(10);
* var res = xs.bufferWithCount(10, 1);
* @param {Number} count Length of each buffer.
* @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count.
* @returns {Observable} An observable sequence of buffers.
*/
observableProto.bufferWithCount = function (count, skip) {
if (skip === undefined) {
skip = count;
}
return this.windowWithCount(count, skip).selectMany(function (x) {
return x.toArray();
}).where(function (x) {
return x.length > 0;
});
};
/**
* Dematerializes the explicit notification values of an observable sequence as implicit notifications.
* @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
*/
observableProto.dematerialize = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(function (x) {
return x.accept(observer);
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
*
* var res = var obs = observable.distinctUntilChanged();
* var res = var obs = observable.distinctUntilChanged(function (x) { return x.id; });
* 3 - var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
*
* @memberOf Observable#
* @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
* @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
* @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
*/
observableProto.distinctUntilChanged = function (keySelector, comparer) {
var source = this;
keySelector || (keySelector = identity);
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (observer) {
var hasCurrentKey = false, currentKey;
return source.subscribe(function (value) {
var comparerEquals = false, key;
try {
key = keySelector(value);
} catch (exception) {
observer.onError(exception);
return;
}
if (hasCurrentKey) {
try {
comparerEquals = comparer(currentKey, key);
} catch (exception) {
observer.onError(exception);
return;
}
}
if (!hasCurrentKey || !comparerEquals) {
hasCurrentKey = true;
currentKey = key;
observer.onNext(value);
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
*
* @example
* var res = observable.doAction(observer);
* var res = observable.doAction(onNext);
* 3 - observable.doAction(onNext, onError);
* 4 - observable.doAction(onNext, onError, onCompleted);
*
* @memberOf Observable#
* @param {Mixed} observerOrOnNext Action to invoke for each element in the observable sequence or an observer.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto['do'] = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
var source = this, onNextFunc;
if (typeof observerOrOnNext === 'function') {
onNextFunc = observerOrOnNext;
} else {
onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext);
onError = observerOrOnNext.onError.bind(observerOrOnNext);
onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext);
}
return new AnonymousObservable(function (observer) {
return source.subscribe(function (x) {
try {
onNextFunc(x);
} catch (e) {
observer.onError(e);
}
observer.onNext(x);
}, function (exception) {
if (!onError) {
observer.onError(exception);
} else {
try {
onError(exception);
} catch (e) {
observer.onError(e);
}
observer.onError(exception);
}
}, function () {
if (!onCompleted) {
observer.onCompleted();
} else {
try {
onCompleted();
} catch (e) {
observer.onError(e);
}
observer.onCompleted();
}
});
});
};
/**
* Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
*
* @example
* var res = obs = observable.finallyAction(function () { console.log('sequence ended'; });
*
* @memberOf Observable#
* @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
* @returns {Observable} Source sequence with the action-invoking termination behavior applied.
*/
observableProto['finally'] = observableProto.finallyAction = function (action) {
var source = this;
return new AnonymousObservable(function (observer) {
var subscription = source.subscribe(observer);
return disposableCreate(function () {
try {
subscription.dispose();
} catch (e) {
throw e;
} finally {
action();
}
});
});
};
/**
* Ignores all elements in an observable sequence leaving only the termination messages.
*
* @memberOf Observable#
* @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
*/
observableProto.ignoreElements = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Materializes the implicit notifications of an observable sequence as explicit notification values.
*
* @memberOf Observable#
* @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
*/
observableProto.materialize = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(function (value) {
observer.onNext(notificationCreateOnNext(value));
}, function (exception) {
observer.onNext(notificationCreateOnError(exception));
observer.onCompleted();
}, function () {
observer.onNext(notificationCreateOnCompleted());
observer.onCompleted();
});
});
};
/**
* Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
*
* @example
* var res = repeated = source.repeat();
* var res = repeated = source.repeat(42);
*
* @memberOf Observable#
* @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
* @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
*/
observableProto.repeat = function (repeatCount) {
return enumerableRepeat(this, repeatCount).concat();
};
/**
* Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
*
* @example
* var res = retried = retry.repeat();
* var res = retried = retry.repeat(42);
*
* @memberOf Observable#
* @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
* @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
*/
observableProto.retry = function (retryCount) {
return enumerableRepeat(this, retryCount).catchException();
};
/**
* Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
* For aggregation behavior with no intermediate results, see Observable.aggregate.
*
* var res = scanned = source.scan(function (acc, x) { return acc + x; });
* var res = scanned = source.scan(0, function (acc, x) { return acc + x; });
*
* @memberOf Observable#
* @param {Mixed} [seed] The initial accumulator value.
* @param {Function} accumulator An accumulator function to be invoked on each element.
* @returns {Observable} An observable sequence containing the accumulated values.
*/
observableProto.scan = function () {
var seed, hasSeed = false, accumulator;
if (arguments.length === 2) {
seed = arguments[0];
accumulator = arguments[1];
hasSeed = true;
} else {
accumulator = arguments[0];
}
var source = this;
return observableDefer(function () {
var hasAccumulation = false, accumulation;
return source.select(function (x) {
if (hasAccumulation) {
accumulation = accumulator(accumulation, x);
} else {
accumulation = hasSeed ? accumulator(seed, x) : x;
hasAccumulation = true;
}
return accumulation;
});
});
};
/**
* Bypasses a specified number of elements at the end of an observable sequence.
*
* @memberOf Observable#
* @description
* This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
* received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
* @param count Number of elements to bypass at the end of the source sequence.
* @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
*/
observableProto.skipLast = function (count) {
var source = this;
return new AnonymousObservable(function (observer) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
if (q.length > count) {
observer.onNext(q.shift());
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
*
* var res = source.startWith(1, 2, 3);
* var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
*
* @memberOf Observable#
* @returns {Observable} The source sequence prepended with the specified values.
*/
observableProto.startWith = function () {
var values, scheduler, start = 0;
if (!!arguments.length && 'now' in Object(arguments[0])) {
scheduler = arguments[0];
start = 1;
} else {
scheduler = immediateScheduler;
}
values = slice.call(arguments, start);
return enumerableFor([observableFromArray(values, scheduler), this]).concat();
};
/**
* Returns a specified number of contiguous elements from the end of an observable sequence, using an optional scheduler to drain the queue.
*
* @example
* var res = obs = source.takeLast(5);
* var res = obs = source.takeLast(5, Rx.Scheduler.timeout);
*
* @description
* This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
* the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
*
* @memberOf Observable#
* @param {Number} count Number of elements to take from the end of the source sequence.
* @param {Scheduler} [scheduler] Scheduler used to drain the queue upon completion of the source sequence.
* @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
*/
observableProto.takeLast = function (count, scheduler) {
return this.takeLastBuffer(count).selectMany(function (xs) { return observableFromArray(xs, scheduler); });
};
/**
* Returns an array with the specified number of contiguous elements from the end of an observable sequence.
*
* @description
* This operator accumulates a buffer with a length enough to store count elements. Upon completion of the
* source sequence, this buffer is produced on the result sequence.
*
* @memberOf Observable#
* @param {Number} count Number of elements to take from the end of the source sequence.
* @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence.
*/
observableProto.takeLastBuffer = function (count) {
var source = this;
return new AnonymousObservable(function (observer) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
if (q.length > count) {
q.shift();
}
}, observer.onError.bind(observer), function () {
observer.onNext(q);
observer.onCompleted();
});
});
};
/**
* Projects each element of an observable sequence into zero or more windows which are produced based on element count information.
*
* var res = xs.windowWithCount(10);
* var res = xs.windowWithCount(10, 1);
*
* @memberOf Observable#
* @param {Number} count Length of each window.
* @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.windowWithCount = function (count, skip) {
var source = this;
if (count <= 0) {
throw new Error(argumentOutOfRange);
}
if (skip == null) {
skip = count;
}
if (skip <= 0) {
throw new Error(argumentOutOfRange);
}
return new AnonymousObservable(function (observer) {
var m = new SingleAssignmentDisposable(),
refCountDisposable = new RefCountDisposable(m),
n = 0,
q = [],
createWindow = function () {
var s = new Subject();
q.push(s);
observer.onNext(addRef(s, refCountDisposable));
};
createWindow();
m.setDisposable(source.subscribe(function (x) {
var s;
for (var i = 0, len = q.length; i < len; i++) {
q[i].onNext(x);
}
var c = n - count + 1;
if (c >= 0 && c % skip === 0) {
s = q.shift();
s.onCompleted();
}
n++;
if (n % skip === 0) {
createWindow();
}
}, function (exception) {
while (q.length > 0) {
q.shift().onError(exception);
}
observer.onError(exception);
}, function () {
while (q.length > 0) {
q.shift().onCompleted();
}
observer.onCompleted();
}));
return refCountDisposable;
});
};
/**
* Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
*
* var res = obs = xs.defaultIfEmpty();
* 2 - obs = xs.defaultIfEmpty(false);
*
* @memberOf Observable#
* @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null.
* @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
*/
observableProto.defaultIfEmpty = function (defaultValue) {
var source = this;
if (defaultValue === undefined) {
defaultValue = null;
}
return new AnonymousObservable(function (observer) {
var found = false;
return source.subscribe(function (x) {
found = true;
observer.onNext(x);
}, observer.onError.bind(observer), function () {
if (!found) {
observer.onNext(defaultValue);
}
observer.onCompleted();
});
});
};
/**
* Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
* Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
*
* @example
* var res = obs = xs.distinct();
* 2 - obs = xs.distinct(function (x) { return x.id; });
* 2 - obs = xs.distinct(function (x) { return x.id; }, function (x) { return x.toString(); });
*
* @memberOf Observable#
* @param {Function} [keySelector] A function to compute the comparison key for each element.
* @param {Function} [keySerializer] Used to serialize the given object into a string for object comparison.
* @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.
*/
observableProto.distinct = function (keySelector, keySerializer) {
var source = this;
keySelector || (keySelector = identity);
keySerializer || (keySerializer = defaultKeySerializer);
return new AnonymousObservable(function (observer) {
var hashSet = {};
return source.subscribe(function (x) {
var key, serializedKey, otherKey, hasMatch = false;
try {
key = keySelector(x);
serializedKey = keySerializer(key);
} catch (exception) {
observer.onError(exception);
return;
}
for (otherKey in hashSet) {
if (serializedKey === otherKey) {
hasMatch = true;
break;
}
}
if (!hasMatch) {
hashSet[serializedKey] = null;
observer.onNext(x);
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
*
* @example
* var res = observable.groupBy(function (x) { return x.id; });
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
*
* @memberOf Observable#
* @param {Function} keySelector A function to extract the key for each element.
* @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
* @param {Function} [keySerializer] Used to serialize the given object into a string for object comparison.
* @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
*/
observableProto.groupBy = function (keySelector, elementSelector, keySerializer) {
return this.groupByUntil(keySelector, elementSelector, function () {
return observableNever();
}, keySerializer);
};
/**
* Groups the elements of an observable sequence according to a specified key selector function.
* A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same
* key value as a reclaimed group occurs, the group will be reborn with a new lifetime request.
*
* @example
* var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
*
* @memberOf Observable#
* @param {Function} keySelector A function to extract the key for each element.
* @param {Function} durationSelector A function to signal the expiration of a group.
* @param {Function} [keySerializer] Used to serialize the given object into a string for object comparison.
* @returns {Observable}
* A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
* If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
*
*/
observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector, keySerializer) {
var source = this;
elementSelector || (elementSelector = identity);
keySerializer || (keySerializer = defaultKeySerializer);
return new AnonymousObservable(function (observer) {
var map = {},
groupDisposable = new CompositeDisposable(),
refCountDisposable = new RefCountDisposable(groupDisposable);
groupDisposable.add(source.subscribe(function (x) {
var duration, durationGroup, element, fireNewMapEntry, group, key, serializedKey, md, writer, w;
try {
key = keySelector(x);
serializedKey = keySerializer(key);
} catch (e) {
for (w in map) {
map[w].onError(e);
}
observer.onError(e);
return;
}
fireNewMapEntry = false;
try {
writer = map[serializedKey];
if (!writer) {
writer = new Subject();
map[serializedKey] = writer;
fireNewMapEntry = true;
}
} catch (e) {
for (w in map) {
map[w].onError(e);
}
observer.onError(e);
return;
}
if (fireNewMapEntry) {
group = new GroupedObservable(key, writer, refCountDisposable);
durationGroup = new GroupedObservable(key, writer);
try {
duration = durationSelector(durationGroup);
} catch (e) {
for (w in map) {
map[w].onError(e);
}
observer.onError(e);
return;
}
observer.onNext(group);
md = new SingleAssignmentDisposable();
groupDisposable.add(md);
var expire = function () {
if (serializedKey in map) {
delete map[serializedKey];
writer.onCompleted();
}
groupDisposable.remove(md);
};
md.setDisposable(duration.take(1).subscribe(noop, function (exn) {
for (w in map) {
map[w].onError(exn);
}
observer.onError(exn);
}, function () {
expire();
}));
}
try {
element = elementSelector(x);
} catch (e) {
for (w in map) {
map[w].onError(e);
}
observer.onError(e);
return;
}
writer.onNext(element);
}, function (ex) {
for (var w in map) {
map[w].onError(ex);
}
observer.onError(ex);
}, function () {
for (var w in map) {
map[w].onCompleted();
}
observer.onCompleted();
}));
return refCountDisposable;
});
};
/**
* Projects each element of an observable sequence into a new form by incorporating the element's index.
*
* @memberOf Observable#
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
*/
observableProto.select = observableProto.map = function (selector, thisArg) {
var parent = this;
return new AnonymousObservable(function (observer) {
var count = 0;
return parent.subscribe(function (value) {
var result;
try {
result = selector.call(thisArg, value, count++, parent);
} catch (exception) {
observer.onError(exception);
return;
}
observer.onNext(result);
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Retrieves the value of a specified property from all elements in the Observable sequence.
*
* @memberOf Observable#
* @param {String} property The property to pluck.
* @returns {Observable} Returns a new Observable sequence of property values.
*/
observableProto.pluck = function (property) {
return this.select(function (x) { return x[property]; });
};
function selectMany(selector) {
return this.select(selector).mergeObservable();
}
/**
* One of the Following:
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
*
* @example
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
* Or:
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
*
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
* Or:
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
*
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
* @param selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto.
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector) {
if (resultSelector) {
return this.selectMany(function (x) {
return selector(x).select(function (y) {
return resultSelector(x, y);
});
});
}
if (typeof selector === 'function') {
return selectMany.call(this, selector);
}
return selectMany.call(this, function () {
return selector;
});
};
/**
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto.selectSwitch = observableProto.flatMapLatest = function (selector, thisArg) {
return this.select(selector, thisArg).switchLatest();
};
/**
* Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
* @param {Number} count The number of elements to skip before returning the remaining elements.
* @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
*/
observableProto.skip = function (count) {
if (count < 0) {
throw new Error(argumentOutOfRange);
}
var observable = this;
return new AnonymousObservable(function (observer) {
var remaining = count;
return observable.subscribe(function (x) {
if (remaining <= 0) {
observer.onNext(x);
} else {
remaining--;
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
* The element's index is used in the logic of the predicate function.
*
* var res = source.skipWhile(function (value) { return value < 10; });
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
*
* @memberOf Observable#
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
*/
observableProto.skipWhile = function (predicate, thisArg) {
var source = this;
return new AnonymousObservable(function (observer) {
var i = 0, running = false;
return source.subscribe(function (x) {
if (!running) {
try {
running = !predicate.call(thisArg, x, i++, source);
} catch (e) {
observer.onError(e);
return;
}
}
if (running) {
observer.onNext(x);
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
*
* var res = source.take(5);
* 2 - source.take(0, Rx.Scheduler.timeout);
*
* @memberOf Observable#
* @param {Number} count The number of elements to return.
* @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
* @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
*/
observableProto.take = function (count, scheduler) {
if (count < 0) {
throw new Error(argumentOutOfRange);
}
if (count === 0) {
return observableEmpty(scheduler);
}
var observable = this;
return new AnonymousObservable(function (observer) {
var remaining = count;
return observable.subscribe(function (x) {
if (remaining > 0) {
remaining--;
observer.onNext(x);
if (remaining === 0) {
observer.onCompleted();
}
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Returns elements from an observable sequence as long as a specified condition is true.
* The element's index is used in the logic of the predicate function.
*
* @example
* var res = source.takeWhile(function (value) { return value < 10; });
* var res = source.takeWhile(function (value, index) { return value < 10 || index < 10; });
*
* @memberOf Observable#
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
*/
observableProto.takeWhile = function (predicate, thisArg) {
var observable = this;
return new AnonymousObservable(function (observer) {
var i = 0, running = true;
return observable.subscribe(function (x) {
if (running) {
try {
running = predicate.call(thisArg, x, i++, observable);
} catch (e) {
observer.onError(e);
return;
}
if (running) {
observer.onNext(x);
} else {
observer.onCompleted();
}
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
*
* @example
* var res = source.where(function (value) { return value < 10; });
* var res = source.where(function (value, index) { return value < 10 || index < 10; });
*
* @memberOf Observable#
* @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
*/
observableProto.where = observableProto.filter = function (predicate, thisArg) {
var parent = this;
return new AnonymousObservable(function (observer) {
var count = 0;
return parent.subscribe(function (value) {
var shouldRun;
try {
shouldRun = predicate.call(thisArg, value, count++, parent);
} catch (exception) {
observer.onError(exception);
return;
}
if (shouldRun) {
observer.onNext(value);
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
var AnonymousObservable = Rx.Internals.AnonymousObservable = (function (_super) {
inherits(AnonymousObservable, _super);
function AnonymousObservable(subscribe) {
if (!(this instanceof AnonymousObservable)) {
return new AnonymousObservable(subscribe);
}
function s(observer) {
var autoDetachObserver = new AutoDetachObserver(observer);
if (currentThreadScheduler.scheduleRequired()) {
currentThreadScheduler.schedule(function () {
try {
autoDetachObserver.setDisposable(subscribe(autoDetachObserver));
} catch (e) {
if (!autoDetachObserver.fail(e)) {
throw e;
}
}
});
} else {
try {
autoDetachObserver.setDisposable(subscribe(autoDetachObserver));
} catch (e) {
if (!autoDetachObserver.fail(e)) {
throw e;
}
}
}
return autoDetachObserver;
}
_super.call(this, s);
}
return AnonymousObservable;
}(Observable));
/** @private */
var AutoDetachObserver = (function (_super) {
inherits(AutoDetachObserver, _super);
function AutoDetachObserver(observer) {
_super.call(this);
this.observer = observer;
this.m = new SingleAssignmentDisposable();
}
var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
AutoDetachObserverPrototype.next = function (value) {
var noError = false;
try {
this.observer.onNext(value);
noError = true;
} catch (e) {
throw e;
} finally {
if (!noError) {
this.dispose();
}
}
};
AutoDetachObserverPrototype.error = function (exn) {
try {
this.observer.onError(exn);
} catch (e) {
throw e;
} finally {
this.dispose();
}
};
AutoDetachObserverPrototype.completed = function () {
try {
this.observer.onCompleted();
} catch (e) {
throw e;
} finally {
this.dispose();
}
};
AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); };
/* @private */
AutoDetachObserverPrototype.disposable = function (value) {
return arguments.length ? this.getDisposable() : setDisposable(value);
};
AutoDetachObserverPrototype.dispose = function () {
_super.prototype.dispose.call(this);
this.m.dispose();
};
return AutoDetachObserver;
}(AbstractObserver));
/** @private */
var GroupedObservable = (function (_super) {
inherits(GroupedObservable, _super);
function subscribe(observer) {
return this.underlyingObservable.subscribe(observer);
}
/**
* @constructor
* @private
*/
function GroupedObservable(key, underlyingObservable, mergedDisposable) {
_super.call(this, subscribe);
this.key = key;
this.underlyingObservable = !mergedDisposable ?
underlyingObservable :
new AnonymousObservable(function (observer) {
return new CompositeDisposable(mergedDisposable.getDisposable(), underlyingObservable.subscribe(observer));
});
}
return GroupedObservable;
}(Observable));
/** @private */
var InnerSubscription = function (subject, observer) {
this.subject = subject;
this.observer = observer;
};
/**
* @private
* @memberOf InnerSubscription
*/
InnerSubscription.prototype.dispose = function () {
if (!this.subject.isDisposed && this.observer !== null) {
var idx = this.subject.observers.indexOf(this.observer);
this.subject.observers.splice(idx, 1);
this.observer = null;
}
};
/**
* Represents an object that is both an observable sequence as well as an observer.
* Each notification is broadcasted to all subscribed observers.
*/
var Subject = Rx.Subject = (function (_super) {
function subscribe(observer) {
checkDisposed.call(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
if (this.exception) {
observer.onError(this.exception);
return disposableEmpty;
}
observer.onCompleted();
return disposableEmpty;
}
inherits(Subject, _super);
/**
* Creates a subject.
* @constructor
*/
function Subject() {
_super.call(this, subscribe);
this.isDisposed = false,
this.isStopped = false,
this.observers = [];
}
addProperties(Subject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
return this.observers.length > 0;
},
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onCompleted();
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (exception) {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
this.exception = exception;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onError(exception);
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
for (var i = 0, len = os.length; i < len; i++) {
os[i].onNext(value);
}
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
}
});
/**
* Creates a subject from the specified observer and observable.
* @param {Observer} observer The observer used to send messages to the subject.
* @param {Observable} observable The observable used to subscribe to messages sent from the subject.
* @returns {Subject} Subject implemented using the given observer and observable.
*/
Subject.create = function (observer, observable) {
return new AnonymousSubject(observer, observable);
};
return Subject;
}(Observable));
/**
* Represents the result of an asynchronous operation.
* The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
*/
var AsyncSubject = Rx.AsyncSubject = (function (_super) {
function subscribe(observer) {
checkDisposed.call(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
var ex = this.exception;
var hv = this.hasValue;
var v = this.value;
if (ex) {
observer.onError(ex);
} else if (hv) {
observer.onNext(v);
observer.onCompleted();
} else {
observer.onCompleted();
}
return disposableEmpty;
}
inherits(AsyncSubject, _super);
/**
* Creates a subject that can only receive one value and that value is cached for all future observations.
* @constructor
*/
function AsyncSubject() {
_super.call(this, subscribe);
this.isDisposed = false,
this.isStopped = false,
this.value = null,
this.hasValue = false,
this.observers = [],
this.exception = null;
}
addProperties(AsyncSubject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
return this.observers.length > 0;
},
/**
* Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
*/
onCompleted: function () {
var o, i, len;
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
var v = this.value;
var hv = this.hasValue;
if (hv) {
for (i = 0, len = os.length; i < len; i++) {
o = os[i];
o.onNext(v);
o.onCompleted();
}
} else {
for (i = 0, len = os.length; i < len; i++) {
os[i].onCompleted();
}
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (exception) {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
this.exception = exception;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onError(exception);
}
this.observers = [];
}
},
/**
* Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
* @param {Mixed} value The value to store in the subject.
*/
onNext: function (value) {
checkDisposed.call(this);
if (!this.isStopped) {
this.value = value;
this.hasValue = true;
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
this.exception = null;
this.value = null;
}
});
return AsyncSubject;
}(Observable));
/** @private */
var AnonymousSubject = (function (_super) {
inherits(AnonymousSubject, _super);
function subscribe(observer) {
return this.observable.subscribe(observer);
}
/**
* @private
* @constructor
*/
function AnonymousSubject(observer, observable) {
_super.call(this, subscribe);
this.observer = observer;
this.observable = observable;
}
addProperties(AnonymousSubject.prototype, Observer, {
/**
* @private
* @memberOf AnonymousSubject#
*/
onCompleted: function () {
this.observer.onCompleted();
},
/**
* @private
* @memberOf AnonymousSubject#
*/
onError: function (exception) {
this.observer.onError(exception);
},
/**
* @private
* @memberOf AnonymousSubject#
*/
onNext: function (value) {
this.observer.onNext(value);
}
});
return AnonymousSubject;
}(Observable));
// Check for AMD
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
window.Rx = Rx;
return define(function () {
return Rx;
});
} else if (freeExports) {
if (typeof module == 'object' && module && module.exports == freeExports) {
module.exports = Rx;
} else {
freeExports = Rx;
}
} else {
window.Rx = Rx;
}
}(this)); |
examples/huge-apps/routes/Grades/components/Grades.js | tylermcginnis/react-router | import React from 'react'
class Grades extends React.Component {
render() {
return (
<div>
<h2>Grades</h2>
</div>
)
}
}
module.exports = Grades
|
ajax/libs/highmaps/1.1.1/highcharts.src.js | LSleutsky/cdnjs | // ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
/**
* @license Highcharts JS v4.1.1 (2015-02-17)
*
* (c) 2009-2014 Torstein Honsi
*
* License: www.highcharts.com/license
*/
// JSLint options:
/*global Highcharts, HighchartsAdapter, document, window, navigator, setInterval, clearInterval, clearTimeout, setTimeout, location, jQuery, $, console, each, grep */
/*jslint ass: true, sloppy: true, forin: true, plusplus: true, nomen: true, vars: true, regexp: true, newcap: true, browser: true, continue: true, white: true */
(function () {
// encapsulated variables
var UNDEFINED,
doc = document,
win = window,
math = Math,
mathRound = math.round,
mathFloor = math.floor,
mathCeil = math.ceil,
mathMax = math.max,
mathMin = math.min,
mathAbs = math.abs,
mathCos = math.cos,
mathSin = math.sin,
mathPI = math.PI,
deg2rad = mathPI * 2 / 360,
// some variables
userAgent = navigator.userAgent,
isOpera = win.opera,
isIE = /(msie|trident)/i.test(userAgent) && !isOpera,
docMode8 = doc.documentMode === 8,
isWebKit = /AppleWebKit/.test(userAgent),
isFirefox = /Firefox/.test(userAgent),
isTouchDevice = /(Mobile|Android|Windows Phone)/.test(userAgent),
SVG_NS = 'http://www.w3.org/2000/svg',
hasSVG = !!doc.createElementNS && !!doc.createElementNS(SVG_NS, 'svg').createSVGRect,
hasBidiBug = isFirefox && parseInt(userAgent.split('Firefox/')[1], 10) < 4, // issue #38
useCanVG = !hasSVG && !isIE && !!doc.createElement('canvas').getContext,
Renderer,
hasTouch,
symbolSizes = {},
idCounter = 0,
garbageBin,
defaultOptions,
dateFormat, // function
globalAnimation,
pathAnim,
timeUnits,
noop = function () { return UNDEFINED; },
charts = [],
chartCount = 0,
PRODUCT = 'Highcharts',
VERSION = '4.1.1',
// some constants for frequently used strings
DIV = 'div',
ABSOLUTE = 'absolute',
RELATIVE = 'relative',
HIDDEN = 'hidden',
PREFIX = 'highcharts-',
VISIBLE = 'visible',
PX = 'px',
NONE = 'none',
M = 'M',
L = 'L',
numRegex = /^[0-9]+$/,
NORMAL_STATE = '',
HOVER_STATE = 'hover',
SELECT_STATE = 'select',
marginNames = ['plotTop', 'marginRight', 'marginBottom', 'plotLeft'],
// Object for extending Axis
AxisPlotLineOrBandExtension,
// constants for attributes
STROKE_WIDTH = 'stroke-width',
// time methods, changed based on whether or not UTC is used
Date, // Allow using a different Date class
makeTime,
timezoneOffset,
getTimezoneOffset,
getMinutes,
getHours,
getDay,
getDate,
getMonth,
getFullYear,
setMinutes,
setHours,
setDate,
setMonth,
setFullYear,
// lookup over the types and the associated classes
seriesTypes = {},
Highcharts;
// The Highcharts namespace
Highcharts = win.Highcharts = win.Highcharts ? error(16, true) : {};
Highcharts.seriesTypes = seriesTypes;
/**
* Extend an object with the members of another
* @param {Object} a The object to be extended
* @param {Object} b The object to add to the first one
*/
var extend = Highcharts.extend = function (a, b) {
var n;
if (!a) {
a = {};
}
for (n in b) {
a[n] = b[n];
}
return a;
};
/**
* Deep merge two or more objects and return a third object. If the first argument is
* true, the contents of the second object is copied into the first object.
* Previously this function redirected to jQuery.extend(true), but this had two limitations.
* First, it deep merged arrays, which lead to workarounds in Highcharts. Second,
* it copied properties from extended prototypes.
*/
function merge() {
var i,
args = arguments,
len,
ret = {},
doCopy = function (copy, original) {
var value, key;
// An object is replacing a primitive
if (typeof copy !== 'object') {
copy = {};
}
for (key in original) {
if (original.hasOwnProperty(key)) {
value = original[key];
// Copy the contents of objects, but not arrays or DOM nodes
if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]'
&& key !== 'renderTo' && typeof value.nodeType !== 'number') {
copy[key] = doCopy(copy[key] || {}, value);
// Primitives and arrays are copied over directly
} else {
copy[key] = original[key];
}
}
}
return copy;
};
// If first argument is true, copy into the existing object. Used in setOptions.
if (args[0] === true) {
ret = args[1];
args = Array.prototype.slice.call(args, 2);
}
// For each argument, extend the return
len = args.length;
for (i = 0; i < len; i++) {
ret = doCopy(ret, args[i]);
}
return ret;
}
/**
* Shortcut for parseInt
* @param {Object} s
* @param {Number} mag Magnitude
*/
function pInt(s, mag) {
return parseInt(s, mag || 10);
}
/**
* Check for string
* @param {Object} s
*/
function isString(s) {
return typeof s === 'string';
}
/**
* Check for object
* @param {Object} obj
*/
function isObject(obj) {
return obj && typeof obj === 'object';
}
/**
* Check for array
* @param {Object} obj
*/
function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
}
/**
* Check for number
* @param {Object} n
*/
function isNumber(n) {
return typeof n === 'number';
}
function log2lin(num) {
return math.log(num) / math.LN10;
}
function lin2log(num) {
return math.pow(10, num);
}
/**
* Remove last occurence of an item from an array
* @param {Array} arr
* @param {Mixed} item
*/
function erase(arr, item) {
var i = arr.length;
while (i--) {
if (arr[i] === item) {
arr.splice(i, 1);
break;
}
}
//return arr;
}
/**
* Returns true if the object is not null or undefined. Like MooTools' $.defined.
* @param {Object} obj
*/
function defined(obj) {
return obj !== UNDEFINED && obj !== null;
}
/**
* Set or get an attribute or an object of attributes. Can't use jQuery attr because
* it attempts to set expando properties on the SVG element, which is not allowed.
*
* @param {Object} elem The DOM element to receive the attribute(s)
* @param {String|Object} prop The property or an abject of key-value pairs
* @param {String} value The value if a single property is set
*/
function attr(elem, prop, value) {
var key,
ret;
// if the prop is a string
if (isString(prop)) {
// set the value
if (defined(value)) {
elem.setAttribute(prop, value);
// get the value
} else if (elem && elem.getAttribute) { // elem not defined when printing pie demo...
ret = elem.getAttribute(prop);
}
// else if prop is defined, it is a hash of key/value pairs
} else if (defined(prop) && isObject(prop)) {
for (key in prop) {
elem.setAttribute(key, prop[key]);
}
}
return ret;
}
/**
* Check if an element is an array, and if not, make it into an array. Like
* MooTools' $.splat.
*/
function splat(obj) {
return isArray(obj) ? obj : [obj];
}
/**
* Return the first value that is defined. Like MooTools' $.pick.
*/
var pick = Highcharts.pick = function () {
var args = arguments,
i,
arg,
length = args.length;
for (i = 0; i < length; i++) {
arg = args[i];
if (arg !== UNDEFINED && arg !== null) {
return arg;
}
}
};
/**
* Set CSS on a given element
* @param {Object} el
* @param {Object} styles Style object with camel case property names
*/
function css(el, styles) {
if (isIE && !hasSVG) { // #2686
if (styles && styles.opacity !== UNDEFINED) {
styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')';
}
}
extend(el.style, styles);
}
/**
* Utility function to create element with attributes and styles
* @param {Object} tag
* @param {Object} attribs
* @param {Object} styles
* @param {Object} parent
* @param {Object} nopad
*/
function createElement(tag, attribs, styles, parent, nopad) {
var el = doc.createElement(tag);
if (attribs) {
extend(el, attribs);
}
if (nopad) {
css(el, {padding: 0, border: NONE, margin: 0});
}
if (styles) {
css(el, styles);
}
if (parent) {
parent.appendChild(el);
}
return el;
}
/**
* Extend a prototyped class by new members
* @param {Object} parent
* @param {Object} members
*/
function extendClass(parent, members) {
var object = function () { return UNDEFINED; };
object.prototype = new parent();
extend(object.prototype, members);
return object;
}
/**
* Pad a string to a given length by adding 0 to the beginning
* @param {Number} number
* @param {Number} length
*/
function pad(number, length) {
// Create an array of the remaining length +1 and join it with 0's
return new Array((length || 2) + 1 - String(number).length).join(0) + number;
}
/**
* Wrap a method with extended functionality, preserving the original function
* @param {Object} obj The context object that the method belongs to
* @param {String} method The name of the method to extend
* @param {Function} func A wrapper function callback. This function is called with the same arguments
* as the original function, except that the original function is unshifted and passed as the first
* argument.
*/
var wrap = Highcharts.wrap = function (obj, method, func) {
var proceed = obj[method];
obj[method] = function () {
var args = Array.prototype.slice.call(arguments);
args.unshift(proceed);
return func.apply(this, args);
};
};
function getTZOffset(timestamp) {
return ((getTimezoneOffset && getTimezoneOffset(timestamp)) || timezoneOffset || 0) * 60000;
}
/**
* Based on http://www.php.net/manual/en/function.strftime.php
* @param {String} format
* @param {Number} timestamp
* @param {Boolean} capitalize
*/
dateFormat = function (format, timestamp, capitalize) {
if (!defined(timestamp) || isNaN(timestamp)) {
return 'Invalid date';
}
format = pick(format, '%Y-%m-%d %H:%M:%S');
var date = new Date(timestamp - getTZOffset(timestamp)),
key, // used in for constuct below
// get the basic time values
hours = date[getHours](),
day = date[getDay](),
dayOfMonth = date[getDate](),
month = date[getMonth](),
fullYear = date[getFullYear](),
lang = defaultOptions.lang,
langWeekdays = lang.weekdays,
// List all format keys. Custom formats can be added from the outside.
replacements = extend({
// Day
'a': langWeekdays[day].substr(0, 3), // Short weekday, like 'Mon'
'A': langWeekdays[day], // Long weekday, like 'Monday'
'd': pad(dayOfMonth), // Two digit day of the month, 01 to 31
'e': dayOfMonth, // Day of the month, 1 through 31
'w': day,
// Week (none implemented)
//'W': weekNumber(),
// Month
'b': lang.shortMonths[month], // Short month, like 'Jan'
'B': lang.months[month], // Long month, like 'January'
'm': pad(month + 1), // Two digit month number, 01 through 12
// Year
'y': fullYear.toString().substr(2, 2), // Two digits year, like 09 for 2009
'Y': fullYear, // Four digits year, like 2009
// Time
'H': pad(hours), // Two digits hours in 24h format, 00 through 23
'I': pad((hours % 12) || 12), // Two digits hours in 12h format, 00 through 11
'l': (hours % 12) || 12, // Hours in 12h format, 1 through 12
'M': pad(date[getMinutes]()), // Two digits minutes, 00 through 59
'p': hours < 12 ? 'AM' : 'PM', // Upper case AM or PM
'P': hours < 12 ? 'am' : 'pm', // Lower case AM or PM
'S': pad(date.getSeconds()), // Two digits seconds, 00 through 59
'L': pad(mathRound(timestamp % 1000), 3) // Milliseconds (naming from Ruby)
}, Highcharts.dateFormats);
// do the replaces
for (key in replacements) {
while (format.indexOf('%' + key) !== -1) { // regex would do it in one line, but this is faster
format = format.replace('%' + key, typeof replacements[key] === 'function' ? replacements[key](timestamp) : replacements[key]);
}
}
// Optionally capitalize the string and return
return capitalize ? format.substr(0, 1).toUpperCase() + format.substr(1) : format;
};
/**
* Format a single variable. Similar to sprintf, without the % prefix.
*/
function formatSingle(format, val) {
var floatRegex = /f$/,
decRegex = /\.([0-9])/,
lang = defaultOptions.lang,
decimals;
if (floatRegex.test(format)) { // float
decimals = format.match(decRegex);
decimals = decimals ? decimals[1] : -1;
if (val !== null) {
val = Highcharts.numberFormat(
val,
decimals,
lang.decimalPoint,
format.indexOf(',') > -1 ? lang.thousandsSep : ''
);
}
} else {
val = dateFormat(format, val);
}
return val;
}
/**
* Format a string according to a subset of the rules of Python's String.format method.
*/
function format(str, ctx) {
var splitter = '{',
isInside = false,
segment,
valueAndFormat,
path,
i,
len,
ret = [],
val,
index;
while ((index = str.indexOf(splitter)) !== -1) {
segment = str.slice(0, index);
if (isInside) { // we're on the closing bracket looking back
valueAndFormat = segment.split(':');
path = valueAndFormat.shift().split('.'); // get first and leave format
len = path.length;
val = ctx;
// Assign deeper paths
for (i = 0; i < len; i++) {
val = val[path[i]];
}
// Format the replacement
if (valueAndFormat.length) {
val = formatSingle(valueAndFormat.join(':'), val);
}
// Push the result and advance the cursor
ret.push(val);
} else {
ret.push(segment);
}
str = str.slice(index + 1); // the rest
isInside = !isInside; // toggle
splitter = isInside ? '}' : '{'; // now look for next matching bracket
}
ret.push(str);
return ret.join('');
}
/**
* Get the magnitude of a number
*/
function getMagnitude(num) {
return math.pow(10, mathFloor(math.log(num) / math.LN10));
}
/**
* Take an interval and normalize it to multiples of 1, 2, 2.5 and 5
* @param {Number} interval
* @param {Array} multiples
* @param {Number} magnitude
* @param {Object} options
*/
function normalizeTickInterval(interval, multiples, magnitude, allowDecimals, preventExceed) {
var normalized,
i,
retInterval = interval;
// round to a tenfold of 1, 2, 2.5 or 5
magnitude = pick(magnitude, 1);
normalized = interval / magnitude;
// multiples for a linear scale
if (!multiples) {
multiples = [1, 2, 2.5, 5, 10];
// the allowDecimals option
if (allowDecimals === false) {
if (magnitude === 1) {
multiples = [1, 2, 5, 10];
} else if (magnitude <= 0.1) {
multiples = [1 / magnitude];
}
}
}
// normalize the interval to the nearest multiple
for (i = 0; i < multiples.length; i++) {
retInterval = multiples[i];
if ((preventExceed && retInterval * magnitude >= interval) || // only allow tick amounts smaller than natural
(!preventExceed && (normalized <= (multiples[i] + (multiples[i + 1] || multiples[i])) / 2))) {
break;
}
}
// multiply back to the correct magnitude
retInterval *= magnitude;
return retInterval;
}
/**
* Utility method that sorts an object array and keeping the order of equal items.
* ECMA script standard does not specify the behaviour when items are equal.
*/
function stableSort(arr, sortFunction) {
var length = arr.length,
sortValue,
i;
// Add index to each item
for (i = 0; i < length; i++) {
arr[i].ss_i = i; // stable sort index
}
arr.sort(function (a, b) {
sortValue = sortFunction(a, b);
return sortValue === 0 ? a.ss_i - b.ss_i : sortValue;
});
// Remove index from items
for (i = 0; i < length; i++) {
delete arr[i].ss_i; // stable sort index
}
}
/**
* Non-recursive method to find the lowest member of an array. Math.min raises a maximum
* call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This
* method is slightly slower, but safe.
*/
function arrayMin(data) {
var i = data.length,
min = data[0];
while (i--) {
if (data[i] < min) {
min = data[i];
}
}
return min;
}
/**
* Non-recursive method to find the lowest member of an array. Math.min raises a maximum
* call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This
* method is slightly slower, but safe.
*/
function arrayMax(data) {
var i = data.length,
max = data[0];
while (i--) {
if (data[i] > max) {
max = data[i];
}
}
return max;
}
/**
* Utility method that destroys any SVGElement or VMLElement that are properties on the given object.
* It loops all properties and invokes destroy if there is a destroy method. The property is
* then delete'ed.
* @param {Object} The object to destroy properties on
* @param {Object} Exception, do not destroy this property, only delete it.
*/
function destroyObjectProperties(obj, except) {
var n;
for (n in obj) {
// If the object is non-null and destroy is defined
if (obj[n] && obj[n] !== except && obj[n].destroy) {
// Invoke the destroy
obj[n].destroy();
}
// Delete the property from the object.
delete obj[n];
}
}
/**
* Discard an element by moving it to the bin and delete
* @param {Object} The HTML node to discard
*/
function discardElement(element) {
// create a garbage bin element, not part of the DOM
if (!garbageBin) {
garbageBin = createElement(DIV);
}
// move the node and empty bin
if (element) {
garbageBin.appendChild(element);
}
garbageBin.innerHTML = '';
}
/**
* Provide error messages for debugging, with links to online explanation
*/
function error (code, stop) {
var msg = 'Highcharts error #' + code + ': www.highcharts.com/errors/' + code;
if (stop) {
throw msg;
}
// else ...
if (win.console) {
console.log(msg);
}
}
/**
* Fix JS round off float errors
* @param {Number} num
*/
function correctFloat(num) {
return parseFloat(
num.toPrecision(14)
);
}
/**
* Set the global animation to either a given value, or fall back to the
* given chart's animation option
* @param {Object} animation
* @param {Object} chart
*/
function setAnimation(animation, chart) {
globalAnimation = pick(animation, chart.animation);
}
/**
* The time unit lookup
*/
timeUnits = {
millisecond: 1,
second: 1000,
minute: 60000,
hour: 3600000,
day: 24 * 3600000,
week: 7 * 24 * 3600000,
month: 28 * 24 * 3600000,
year: 364 * 24 * 3600000
};
/**
* Format a number and return a string based on input settings
* @param {Number} number The input number to format
* @param {Number} decimals The amount of decimals
* @param {String} decPoint The decimal point, defaults to the one given in the lang options
* @param {String} thousandsSep The thousands separator, defaults to the one given in the lang options
*/
Highcharts.numberFormat = function (number, decimals, decPoint, thousandsSep) {
var lang = defaultOptions.lang,
// http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_number_format/
n = +number || 0,
c = decimals === -1 ?
(n.toString().split('.')[1] || '').length : // preserve decimals
(isNaN(decimals = mathAbs(decimals)) ? 2 : decimals),
d = decPoint === undefined ? lang.decimalPoint : decPoint,
t = thousandsSep === undefined ? lang.thousandsSep : thousandsSep,
s = n < 0 ? "-" : "",
i = String(pInt(n = mathAbs(n).toFixed(c))),
j = i.length > 3 ? i.length % 3 : 0;
return (s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) +
(c ? d + mathAbs(n - i).toFixed(c).slice(2) : ""));
};
/**
* Path interpolation algorithm used across adapters
*/
pathAnim = {
/**
* Prepare start and end values so that the path can be animated one to one
*/
init: function (elem, fromD, toD) {
fromD = fromD || '';
var shift = elem.shift,
bezier = fromD.indexOf('C') > -1,
numParams = bezier ? 7 : 3,
endLength,
slice,
i,
start = fromD.split(' '),
end = [].concat(toD), // copy
startBaseLine,
endBaseLine,
sixify = function (arr) { // in splines make move points have six parameters like bezier curves
i = arr.length;
while (i--) {
if (arr[i] === M) {
arr.splice(i + 1, 0, arr[i + 1], arr[i + 2], arr[i + 1], arr[i + 2]);
}
}
};
if (bezier) {
sixify(start);
sixify(end);
}
// pull out the base lines before padding
if (elem.isArea) {
startBaseLine = start.splice(start.length - 6, 6);
endBaseLine = end.splice(end.length - 6, 6);
}
// if shifting points, prepend a dummy point to the end path
if (shift <= end.length / numParams && start.length === end.length) {
while (shift--) {
end = [].concat(end).splice(0, numParams).concat(end);
}
}
elem.shift = 0; // reset for following animations
// copy and append last point until the length matches the end length
if (start.length) {
endLength = end.length;
while (start.length < endLength) {
//bezier && sixify(start);
slice = [].concat(start).splice(start.length - numParams, numParams);
if (bezier) { // disable first control point
slice[numParams - 6] = slice[numParams - 2];
slice[numParams - 5] = slice[numParams - 1];
}
start = start.concat(slice);
}
}
if (startBaseLine) { // append the base lines for areas
start = start.concat(startBaseLine);
end = end.concat(endBaseLine);
}
return [start, end];
},
/**
* Interpolate each value of the path and return the array
*/
step: function (start, end, pos, complete) {
var ret = [],
i = start.length,
startVal;
if (pos === 1) { // land on the final path without adjustment points appended in the ends
ret = complete;
} else if (i === end.length && pos < 1) {
while (i--) {
startVal = parseFloat(start[i]);
ret[i] =
isNaN(startVal) ? // a letter instruction like M or L
start[i] :
pos * (parseFloat(end[i] - startVal)) + startVal;
}
} else { // if animation is finished or length not matching, land on right value
ret = end;
}
return ret;
}
};
(function ($) {
/**
* The default HighchartsAdapter for jQuery
*/
win.HighchartsAdapter = win.HighchartsAdapter || ($ && {
/**
* Initialize the adapter by applying some extensions to jQuery
*/
init: function (pathAnim) {
// extend the animate function to allow SVG animations
var Fx = $.fx;
/*jslint unparam: true*//* allow unused param x in this function */
$.extend($.easing, {
easeOutQuad: function (x, t, b, c, d) {
return -c * (t /= d) * (t - 2) + b;
}
});
/*jslint unparam: false*/
// extend some methods to check for elem.attr, which means it is a Highcharts SVG object
$.each(['cur', '_default', 'width', 'height', 'opacity'], function (i, fn) {
var obj = Fx.step,
base;
// Handle different parent objects
if (fn === 'cur') {
obj = Fx.prototype; // 'cur', the getter, relates to Fx.prototype
} else if (fn === '_default' && $.Tween) { // jQuery 1.8 model
obj = $.Tween.propHooks[fn];
fn = 'set';
}
// Overwrite the method
base = obj[fn];
if (base) { // step.width and step.height don't exist in jQuery < 1.7
// create the extended function replacement
obj[fn] = function (fx) {
var elem;
// Fx.prototype.cur does not use fx argument
fx = i ? fx : this;
// Don't run animations on textual properties like align (#1821)
if (fx.prop === 'align') {
return;
}
// shortcut
elem = fx.elem;
// Fx.prototype.cur returns the current value. The other ones are setters
// and returning a value has no effect.
return elem.attr ? // is SVG element wrapper
elem.attr(fx.prop, fn === 'cur' ? UNDEFINED : fx.now) : // apply the SVG wrapper's method
base.apply(this, arguments); // use jQuery's built-in method
};
}
});
// Extend the opacity getter, needed for fading opacity with IE9 and jQuery 1.10+
wrap($.cssHooks.opacity, 'get', function (proceed, elem, computed) {
return elem.attr ? (elem.opacity || 0) : proceed.call(this, elem, computed);
});
// Define the setter function for d (path definitions)
this.addAnimSetter('d', function (fx) {
var elem = fx.elem,
ends;
// Normally start and end should be set in state == 0, but sometimes,
// for reasons unknown, this doesn't happen. Perhaps state == 0 is skipped
// in these cases
if (!fx.started) {
ends = pathAnim.init(elem, elem.d, elem.toD);
fx.start = ends[0];
fx.end = ends[1];
fx.started = true;
}
// Interpolate each value of the path
elem.attr('d', pathAnim.step(fx.start, fx.end, fx.pos, elem.toD));
});
/**
* Utility for iterating over an array. Parameters are reversed compared to jQuery.
* @param {Array} arr
* @param {Function} fn
*/
this.each = Array.prototype.forEach ?
function (arr, fn) { // modern browsers
return Array.prototype.forEach.call(arr, fn);
} :
function (arr, fn) { // legacy
var i,
len = arr.length;
for (i = 0; i < len; i++) {
if (fn.call(arr[i], arr[i], i, arr) === false) {
return i;
}
}
};
/**
* Register Highcharts as a plugin in the respective framework
*/
$.fn.highcharts = function () {
var constr = 'Chart', // default constructor
args = arguments,
options,
ret,
chart;
if (this[0]) {
if (isString(args[0])) {
constr = args[0];
args = Array.prototype.slice.call(args, 1);
}
options = args[0];
// Create the chart
if (options !== UNDEFINED) {
/*jslint unused:false*/
options.chart = options.chart || {};
options.chart.renderTo = this[0];
chart = new Highcharts[constr](options, args[1]);
ret = this;
/*jslint unused:true*/
}
// When called without parameters or with the return argument, get a predefined chart
if (options === UNDEFINED) {
ret = charts[attr(this[0], 'data-highcharts-chart')];
}
}
return ret;
};
},
/**
* Add an animation setter for a specific property
*/
addAnimSetter: function (prop, setter) {
// jQuery 1.8 style
if ($.Tween) {
$.Tween.propHooks[prop] = {
set: setter
};
// pre 1.8
} else {
$.fx.step[prop] = setter;
}
},
/**
* Downloads a script and executes a callback when done.
* @param {String} scriptLocation
* @param {Function} callback
*/
getScript: $.getScript,
/**
* Return the index of an item in an array, or -1 if not found
*/
inArray: $.inArray,
/**
* A direct link to jQuery methods. MooTools and Prototype adapters must be implemented for each case of method.
* @param {Object} elem The HTML element
* @param {String} method Which method to run on the wrapped element
*/
adapterRun: function (elem, method) {
return $(elem)[method]();
},
/**
* Filter an array
*/
grep: $.grep,
/**
* Map an array
* @param {Array} arr
* @param {Function} fn
*/
map: function (arr, fn) {
//return jQuery.map(arr, fn);
var results = [],
i = 0,
len = arr.length;
for (; i < len; i++) {
results[i] = fn.call(arr[i], arr[i], i, arr);
}
return results;
},
/**
* Get the position of an element relative to the top left of the page
*/
offset: function (el) {
return $(el).offset();
},
/**
* Add an event listener
* @param {Object} el A HTML element or custom object
* @param {String} event The event type
* @param {Function} fn The event handler
*/
addEvent: function (el, event, fn) {
$(el).bind(event, fn);
},
/**
* Remove event added with addEvent
* @param {Object} el The object
* @param {String} eventType The event type. Leave blank to remove all events.
* @param {Function} handler The function to remove
*/
removeEvent: function (el, eventType, handler) {
// workaround for jQuery issue with unbinding custom events:
// http://forum.jQuery.com/topic/javascript-error-when-unbinding-a-custom-event-using-jQuery-1-4-2
var func = doc.removeEventListener ? 'removeEventListener' : 'detachEvent';
if (doc[func] && el && !el[func]) {
el[func] = function () {};
}
$(el).unbind(eventType, handler);
},
/**
* Fire an event on a custom object
* @param {Object} el
* @param {String} type
* @param {Object} eventArguments
* @param {Function} defaultFunction
*/
fireEvent: function (el, type, eventArguments, defaultFunction) {
var event = $.Event(type),
detachedType = 'detached' + type,
defaultPrevented;
// Remove warnings in Chrome when accessing returnValue (#2790), layerX and layerY. Although Highcharts
// never uses these properties, Chrome includes them in the default click event and
// raises the warning when they are copied over in the extend statement below.
//
// To avoid problems in IE (see #1010) where we cannot delete the properties and avoid
// testing if they are there (warning in chrome) the only option is to test if running IE.
if (!isIE && eventArguments) {
delete eventArguments.layerX;
delete eventArguments.layerY;
delete eventArguments.returnValue;
}
extend(event, eventArguments);
// Prevent jQuery from triggering the object method that is named the
// same as the event. For example, if the event is 'select', jQuery
// attempts calling el.select and it goes into a loop.
if (el[type]) {
el[detachedType] = el[type];
el[type] = null;
}
// Wrap preventDefault and stopPropagation in try/catch blocks in
// order to prevent JS errors when cancelling events on non-DOM
// objects. #615.
/*jslint unparam: true*/
$.each(['preventDefault', 'stopPropagation'], function (i, fn) {
var base = event[fn];
event[fn] = function () {
try {
base.call(event);
} catch (e) {
if (fn === 'preventDefault') {
defaultPrevented = true;
}
}
};
});
/*jslint unparam: false*/
// trigger it
$(el).trigger(event);
// attach the method
if (el[detachedType]) {
el[type] = el[detachedType];
el[detachedType] = null;
}
if (defaultFunction && !event.isDefaultPrevented() && !defaultPrevented) {
defaultFunction(event);
}
},
/**
* Extension method needed for MooTools
*/
washMouseEvent: function (e) {
var ret = e.originalEvent || e;
// computed by jQuery, needed by IE8
if (ret.pageX === UNDEFINED) { // #1236
ret.pageX = e.pageX;
ret.pageY = e.pageY;
}
return ret;
},
/**
* Animate a HTML element or SVG element wrapper
* @param {Object} el
* @param {Object} params
* @param {Object} options jQuery-like animation options: duration, easing, callback
*/
animate: function (el, params, options) {
var $el = $(el);
if (!el.style) {
el.style = {}; // #1881
}
if (params.d) {
el.toD = params.d; // keep the array form for paths, used in $.fx.step.d
params.d = 1; // because in jQuery, animating to an array has a different meaning
}
$el.stop();
if (params.opacity !== UNDEFINED && el.attr) {
params.opacity += 'px'; // force jQuery to use same logic as width and height (#2161)
}
el.hasAnim = 1; // #3342
$el.animate(params, options);
},
/**
* Stop running animation
*/
stop: function (el) {
if (el.hasAnim) { // #3342, memory leak on calling $(el) from destroy
$(el).stop();
}
}
});
}(win.jQuery));
// check for a custom HighchartsAdapter defined prior to this file
var globalAdapter = win.HighchartsAdapter,
adapter = globalAdapter || {};
// Initialize the adapter
if (globalAdapter) {
globalAdapter.init.call(globalAdapter, pathAnim);
}
// Utility functions. If the HighchartsAdapter is not defined, adapter is an empty object
// and all the utility functions will be null. In that case they are populated by the
// default adapters below.
var adapterRun = adapter.adapterRun,
getScript = adapter.getScript,
inArray = adapter.inArray,
each = Highcharts.each = adapter.each,
grep = adapter.grep,
offset = adapter.offset,
map = adapter.map,
addEvent = adapter.addEvent,
removeEvent = adapter.removeEvent,
fireEvent = adapter.fireEvent,
washMouseEvent = adapter.washMouseEvent,
animate = adapter.animate,
stop = adapter.stop;
/* ****************************************************************************
* Handle the options *
*****************************************************************************/
defaultOptions = {
colors: ['#7cb5ec', '#434348', '#90ed7d', '#f7a35c',
'#8085e9', '#f15c80', '#e4d354', '#2b908f', '#f45b5b', '#91e8e1'],
symbols: ['circle', 'diamond', 'square', 'triangle', 'triangle-down'],
lang: {
loading: 'Loading...',
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December'],
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
decimalPoint: '.',
numericSymbols: ['k', 'M', 'G', 'T', 'P', 'E'], // SI prefixes used in axis labels
resetZoom: 'Reset zoom',
resetZoomTitle: 'Reset zoom level 1:1',
thousandsSep: ' '
},
global: {
useUTC: true,
//timezoneOffset: 0,
canvasToolsURL: 'http://code.highcharts.com/4.1.1/modules/canvas-tools.js',
VMLRadialGradientURL: 'http://code.highcharts.com/4.1.1/gfx/vml-radial-gradient.png'
},
chart: {
//animation: true,
//alignTicks: false,
//reflow: true,
//className: null,
//events: { load, selection },
//margin: [null],
//marginTop: null,
//marginRight: null,
//marginBottom: null,
//marginLeft: null,
borderColor: '#4572A7',
//borderWidth: 0,
borderRadius: 0,
defaultSeriesType: 'line',
ignoreHiddenSeries: true,
//inverted: false,
//shadow: false,
spacing: [10, 10, 15, 10],
//spacingTop: 10,
//spacingRight: 10,
//spacingBottom: 15,
//spacingLeft: 10,
//style: {
// fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif', // default font
// fontSize: '12px'
//},
backgroundColor: '#FFFFFF',
//plotBackgroundColor: null,
plotBorderColor: '#C0C0C0',
//plotBorderWidth: 0,
//plotShadow: false,
//zoomType: ''
resetZoomButton: {
theme: {
zIndex: 20
},
position: {
align: 'right',
x: -10,
//verticalAlign: 'top',
y: 10
}
// relativeTo: 'plot'
}
},
title: {
text: 'Chart title',
align: 'center',
// floating: false,
margin: 15,
// x: 0,
// verticalAlign: 'top',
// y: null,
style: {
color: '#333333',
fontSize: '18px'
}
},
subtitle: {
text: '',
align: 'center',
// floating: false
// x: 0,
// verticalAlign: 'top',
// y: null,
style: {
color: '#555555'
}
},
plotOptions: {
line: { // base series options
allowPointSelect: false,
showCheckbox: false,
animation: {
duration: 1000
},
//connectNulls: false,
//cursor: 'default',
//clip: true,
//dashStyle: null,
//enableMouseTracking: true,
events: {},
//legendIndex: 0,
//linecap: 'round',
lineWidth: 2,
//shadow: false,
// stacking: null,
marker: {
//enabled: true,
//symbol: null,
lineWidth: 0,
radius: 4,
lineColor: '#FFFFFF',
//fillColor: null,
states: { // states for a single point
hover: {
enabled: true,
lineWidthPlus: 1,
radiusPlus: 2
},
select: {
fillColor: '#FFFFFF',
lineColor: '#000000',
lineWidth: 2
}
}
},
point: {
events: {}
},
dataLabels: {
align: 'center',
// defer: true,
// enabled: false,
formatter: function () {
return this.y === null ? '' : Highcharts.numberFormat(this.y, -1);
},
style: {
color: 'contrast',
fontSize: '11px',
fontWeight: 'bold',
textShadow: '0 0 6px contrast, 0 0 3px contrast'
},
verticalAlign: 'bottom', // above singular point
x: 0,
y: 0,
// backgroundColor: undefined,
// borderColor: undefined,
// borderRadius: undefined,
// borderWidth: undefined,
padding: 5
// shadow: false
},
cropThreshold: 300, // draw points outside the plot area when the number of points is less than this
pointRange: 0,
//pointStart: 0,
//pointInterval: 1,
//showInLegend: null, // auto: true for standalone series, false for linked series
states: { // states for the entire series
hover: {
//enabled: false,
lineWidthPlus: 1,
marker: {
// lineWidth: base + 1,
// radius: base + 1
},
halo: {
size: 10,
opacity: 0.25
}
},
select: {
marker: {}
}
},
stickyTracking: true,
//tooltip: {
//pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y}</b>'
//valueDecimals: null,
//xDateFormat: '%A, %b %e, %Y',
//valuePrefix: '',
//ySuffix: ''
//}
turboThreshold: 1000
// zIndex: null
}
},
labels: {
//items: [],
style: {
//font: defaultFont,
position: ABSOLUTE,
color: '#3E576F'
}
},
legend: {
enabled: true,
align: 'center',
//floating: false,
layout: 'horizontal',
labelFormatter: function () {
return this.name;
},
//borderWidth: 0,
borderColor: '#909090',
borderRadius: 0,
navigation: {
// animation: true,
activeColor: '#274b6d',
// arrowSize: 12
inactiveColor: '#CCC'
// style: {} // text styles
},
// margin: 20,
// reversed: false,
shadow: false,
// backgroundColor: null,
/*style: {
padding: '5px'
},*/
itemStyle: {
color: '#333333',
fontSize: '12px',
fontWeight: 'bold'
},
itemHoverStyle: {
//cursor: 'pointer', removed as of #601
color: '#000'
},
itemHiddenStyle: {
color: '#CCC'
},
itemCheckboxStyle: {
position: ABSOLUTE,
width: '13px', // for IE precision
height: '13px'
},
// itemWidth: undefined,
// symbolRadius: 0,
// symbolWidth: 16,
symbolPadding: 5,
verticalAlign: 'bottom',
// width: undefined,
x: 0,
y: 0,
title: {
//text: null,
style: {
fontWeight: 'bold'
}
}
},
loading: {
// hideDuration: 100,
labelStyle: {
fontWeight: 'bold',
position: RELATIVE,
top: '45%'
},
// showDuration: 0,
style: {
position: ABSOLUTE,
backgroundColor: 'white',
opacity: 0.5,
textAlign: 'center'
}
},
tooltip: {
enabled: true,
animation: hasSVG,
//crosshairs: null,
backgroundColor: 'rgba(249, 249, 249, .85)',
borderWidth: 1,
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: '',
//formatter: defaultFormatter,
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/>',
shadow: true,
//shape: 'callout',
//shared: false,
snap: isTouchDevice ? 25 : 10,
style: {
color: '#333333',
cursor: 'default',
fontSize: '12px',
padding: '8px',
whiteSpace: 'nowrap'
}
//xDateFormat: '%A, %b %e, %Y',
//valueDecimals: null,
//valuePrefix: '',
//valueSuffix: ''
},
credits: {
enabled: true,
text: 'Highcharts.com',
href: 'http://www.highcharts.com',
position: {
align: 'right',
x: -10,
verticalAlign: 'bottom',
y: -5
},
style: {
cursor: 'pointer',
color: '#909090',
fontSize: '9px'
}
}
};
// Series defaults
var defaultPlotOptions = defaultOptions.plotOptions,
defaultSeriesOptions = defaultPlotOptions.line;
// set the default time methods
setTimeMethods();
/**
* Set the time methods globally based on the useUTC option. Time method can be either
* local time or UTC (default).
*/
function setTimeMethods() {
var globalOptions = defaultOptions.global,
useUTC = globalOptions.useUTC,
GET = useUTC ? 'getUTC' : 'get',
SET = useUTC ? 'setUTC' : 'set';
Date = globalOptions.Date || window.Date;
timezoneOffset = useUTC && globalOptions.timezoneOffset;
getTimezoneOffset = useUTC && globalOptions.getTimezoneOffset;
makeTime = function (year, month, date, hours, minutes, seconds) {
var d;
if (useUTC) {
d = Date.UTC.apply(0, arguments);
d += getTZOffset(d);
} else {
d = new Date(
year,
month,
pick(date, 1),
pick(hours, 0),
pick(minutes, 0),
pick(seconds, 0)
).getTime();
}
return d;
};
getMinutes = GET + 'Minutes';
getHours = GET + 'Hours';
getDay = GET + 'Day';
getDate = GET + 'Date';
getMonth = GET + 'Month';
getFullYear = GET + 'FullYear';
setMinutes = SET + 'Minutes';
setHours = SET + 'Hours';
setDate = SET + 'Date';
setMonth = SET + 'Month';
setFullYear = SET + 'FullYear';
}
/**
* Merge the default options with custom options and return the new options structure
* @param {Object} options The new custom options
*/
function setOptions(options) {
// Copy in the default options
defaultOptions = merge(true, defaultOptions, options);
// Apply UTC
setTimeMethods();
return defaultOptions;
}
/**
* Get the updated default options. Until 3.0.7, merely exposing defaultOptions for outside modules
* wasn't enough because the setOptions method created a new object.
*/
function getOptions() {
return defaultOptions;
}
/**
* Handle color operations. The object methods are chainable.
* @param {String} input The input color in either rbga or hex format
*/
var rgbaRegEx = /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*\)/,
hexRegEx = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,
rgbRegEx = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/;
var Color = function (input) {
// declare variables
var rgba = [], result, stops;
/**
* Parse the input color to rgba array
* @param {String} input
*/
function init(input) {
// Gradients
if (input && input.stops) {
stops = map(input.stops, function (stop) {
return Color(stop[1]);
});
// Solid colors
} else {
// rgba
result = rgbaRegEx.exec(input);
if (result) {
rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), parseFloat(result[4], 10)];
} else {
// hex
result = hexRegEx.exec(input);
if (result) {
rgba = [pInt(result[1], 16), pInt(result[2], 16), pInt(result[3], 16), 1];
} else {
// rgb
result = rgbRegEx.exec(input);
if (result) {
rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), 1];
}
}
}
}
}
/**
* Return the color a specified format
* @param {String} format
*/
function get(format) {
var ret;
if (stops) {
ret = merge(input);
ret.stops = [].concat(ret.stops);
each(stops, function (stop, i) {
ret.stops[i] = [ret.stops[i][0], stop.get(format)];
});
// it's NaN if gradient colors on a column chart
} else if (rgba && !isNaN(rgba[0])) {
if (format === 'rgb') {
ret = 'rgb(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ')';
} else if (format === 'a') {
ret = rgba[3];
} else {
ret = 'rgba(' + rgba.join(',') + ')';
}
} else {
ret = input;
}
return ret;
}
/**
* Brighten the color
* @param {Number} alpha
*/
function brighten(alpha) {
if (stops) {
each(stops, function (stop) {
stop.brighten(alpha);
});
} else if (isNumber(alpha) && alpha !== 0) {
var i;
for (i = 0; i < 3; i++) {
rgba[i] += pInt(alpha * 255);
if (rgba[i] < 0) {
rgba[i] = 0;
}
if (rgba[i] > 255) {
rgba[i] = 255;
}
}
}
return this;
}
/**
* Set the color's opacity to a given alpha value
* @param {Number} alpha
*/
function setOpacity(alpha) {
rgba[3] = alpha;
return this;
}
// initialize: parse the input
init(input);
// public methods
return {
get: get,
brighten: brighten,
rgba: rgba,
setOpacity: setOpacity
};
};
/**
* A wrapper object for SVG elements
*/
function SVGElement() {}
SVGElement.prototype = {
// Default base for animation
opacity: 1,
// For labels, these CSS properties are applied to the <text> node directly
textProps: ['fontSize', 'fontWeight', 'fontFamily', 'color',
'lineHeight', 'width', 'textDecoration', 'textShadow'],
/**
* Initialize the SVG renderer
* @param {Object} renderer
* @param {String} nodeName
*/
init: function (renderer, nodeName) {
var wrapper = this;
wrapper.element = nodeName === 'span' ?
createElement(nodeName) :
doc.createElementNS(SVG_NS, nodeName);
wrapper.renderer = renderer;
},
/**
* Animate a given attribute
* @param {Object} params
* @param {Number} options The same options as in jQuery animation
* @param {Function} complete Function to perform at the end of animation
*/
animate: function (params, options, complete) {
var animOptions = pick(options, globalAnimation, true);
stop(this); // stop regardless of animation actually running, or reverting to .attr (#607)
if (animOptions) {
animOptions = merge(animOptions, {}); //#2625
if (complete) { // allows using a callback with the global animation without overwriting it
animOptions.complete = complete;
}
animate(this, params, animOptions);
} else {
this.attr(params);
if (complete) {
complete();
}
}
return this;
},
/**
* Build an SVG gradient out of a common JavaScript configuration object
*/
colorGradient: function (color, prop, elem) {
var renderer = this.renderer,
colorObject,
gradName,
gradAttr,
gradients,
gradientObject,
stops,
stopColor,
stopOpacity,
radialReference,
n,
id,
key = [];
// Apply linear or radial gradients
if (color.linearGradient) {
gradName = 'linearGradient';
} else if (color.radialGradient) {
gradName = 'radialGradient';
}
if (gradName) {
gradAttr = color[gradName];
gradients = renderer.gradients;
stops = color.stops;
radialReference = elem.radialReference;
// Keep < 2.2 kompatibility
if (isArray(gradAttr)) {
color[gradName] = gradAttr = {
x1: gradAttr[0],
y1: gradAttr[1],
x2: gradAttr[2],
y2: gradAttr[3],
gradientUnits: 'userSpaceOnUse'
};
}
// Correct the radial gradient for the radial reference system
if (gradName === 'radialGradient' && radialReference && !defined(gradAttr.gradientUnits)) {
gradAttr = merge(gradAttr, {
cx: (radialReference[0] - radialReference[2] / 2) + gradAttr.cx * radialReference[2],
cy: (radialReference[1] - radialReference[2] / 2) + gradAttr.cy * radialReference[2],
r: gradAttr.r * radialReference[2],
gradientUnits: 'userSpaceOnUse'
});
}
// Build the unique key to detect whether we need to create a new element (#1282)
for (n in gradAttr) {
if (n !== 'id') {
key.push(n, gradAttr[n]);
}
}
for (n in stops) {
key.push(stops[n]);
}
key = key.join(',');
// Check if a gradient object with the same config object is created within this renderer
if (gradients[key]) {
id = gradients[key].attr('id');
} else {
// Set the id and create the element
gradAttr.id = id = PREFIX + idCounter++;
gradients[key] = gradientObject = renderer.createElement(gradName)
.attr(gradAttr)
.add(renderer.defs);
// The gradient needs to keep a list of stops to be able to destroy them
gradientObject.stops = [];
each(stops, function (stop) {
var stopObject;
if (stop[1].indexOf('rgba') === 0) {
colorObject = Color(stop[1]);
stopColor = colorObject.get('rgb');
stopOpacity = colorObject.get('a');
} else {
stopColor = stop[1];
stopOpacity = 1;
}
stopObject = renderer.createElement('stop').attr({
offset: stop[0],
'stop-color': stopColor,
'stop-opacity': stopOpacity
}).add(gradientObject);
// Add the stop element to the gradient
gradientObject.stops.push(stopObject);
});
}
// Set the reference to the gradient object
elem.setAttribute(prop, 'url(' + renderer.url + '#' + id + ')');
}
},
/**
* Apply a polyfill to the text-stroke CSS property, by copying the text element
* and apply strokes to the copy.
*
* docs: update default, document the polyfill and the limitations on hex colors and pixel values, document contrast pseudo-color
* TODO:
* - update defaults
*/
applyTextShadow: function (textShadow) {
var elem = this.element,
tspans,
hasContrast = textShadow.indexOf('contrast') !== -1,
// Safari suffers from the double display bug (#3649)
isSafari = userAgent.indexOf('Safari') > 0 && userAgent.indexOf('Chrome') === -1,
// IE10 and IE11 report textShadow in elem.style even though it doesn't work. Check
// this again with new IE release.
supports = elem.style.textShadow !== UNDEFINED && !isIE && !isSafari;
// When the text shadow is set to contrast, use dark stroke for light text and vice versa
if (hasContrast) {
textShadow = textShadow.replace(/contrast/g, this.renderer.getContrast(elem.style.fill));
}
/* Selective side-by-side testing in supported browser (http://jsfiddle.net/highcharts/73L1ptrh/)
if (elem.textContent.indexOf('2.') === 0) {
elem.style['text-shadow'] = 'none';
supports = false;
}
// */
// No reason to polyfill, we've got native support
if (supports) {
if (hasContrast) { // Apply the altered style
css(elem, {
textShadow: textShadow
});
}
} else {
// In order to get the right y position of the clones,
// copy over the y setter
this.ySetter = this.xSetter;
tspans = [].slice.call(elem.getElementsByTagName('tspan'));
each(textShadow.split(/\s?,\s?/g), function (textShadow) {
var firstChild = elem.firstChild,
color,
strokeWidth;
textShadow = textShadow.split(' ');
color = textShadow[textShadow.length - 1];
// Approximately tune the settings to the text-shadow behaviour
strokeWidth = textShadow[textShadow.length - 2];
if (strokeWidth) {
each(tspans, function (tspan, y) {
var clone;
// Let the first line start at the correct X position
if (y === 0) {
tspan.setAttribute('x', elem.getAttribute('x'));
y = elem.getAttribute('y');
tspan.setAttribute('y', y || 0);
if (y === null) {
elem.setAttribute('y', 0);
}
}
// Create the clone and apply shadow properties
clone = tspan.cloneNode(1);
attr(clone, {
'stroke': color,
'stroke-opacity': 1 / mathMax(pInt(strokeWidth), 3),
'stroke-width': strokeWidth,
'stroke-linejoin': 'round'
});
elem.insertBefore(clone, firstChild);
});
}
});
}
},
/**
* Set or get a given attribute
* @param {Object|String} hash
* @param {Mixed|Undefined} val
*/
attr: function (hash, val) {
var key,
value,
element = this.element,
hasSetSymbolSize,
ret = this,
skipAttr;
// single key-value pair
if (typeof hash === 'string' && val !== UNDEFINED) {
key = hash;
hash = {};
hash[key] = val;
}
// used as a getter: first argument is a string, second is undefined
if (typeof hash === 'string') {
ret = (this[hash + 'Getter'] || this._defaultGetter).call(this, hash, element);
// setter
} else {
for (key in hash) {
value = hash[key];
skipAttr = false;
if (this.symbolName && /^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(key)) {
if (!hasSetSymbolSize) {
this.symbolAttr(hash);
hasSetSymbolSize = true;
}
skipAttr = true;
}
if (this.rotation && (key === 'x' || key === 'y')) {
this.doTransform = true;
}
if (!skipAttr) {
(this[key + 'Setter'] || this._defaultSetter).call(this, value, key, element);
}
// Let the shadow follow the main element
if (this.shadows && /^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(key)) {
this.updateShadows(key, value);
}
}
// Update transform. Do this outside the loop to prevent redundant updating for batch setting
// of attributes.
if (this.doTransform) {
this.updateTransform();
this.doTransform = false;
}
}
return ret;
},
updateShadows: function (key, value) {
var shadows = this.shadows,
i = shadows.length;
while (i--) {
shadows[i].setAttribute(
key,
key === 'height' ?
mathMax(value - (shadows[i].cutHeight || 0), 0) :
key === 'd' ? this.d : value
);
}
},
/**
* Add a class name to an element
*/
addClass: function (className) {
var element = this.element,
currentClassName = attr(element, 'class') || '';
if (currentClassName.indexOf(className) === -1) {
attr(element, 'class', currentClassName + ' ' + className);
}
return this;
},
/* hasClass and removeClass are not (yet) needed
hasClass: function (className) {
return attr(this.element, 'class').indexOf(className) !== -1;
},
removeClass: function (className) {
attr(this.element, 'class', attr(this.element, 'class').replace(className, ''));
return this;
},
*/
/**
* If one of the symbol size affecting parameters are changed,
* check all the others only once for each call to an element's
* .attr() method
* @param {Object} hash
*/
symbolAttr: function (hash) {
var wrapper = this;
each(['x', 'y', 'r', 'start', 'end', 'width', 'height', 'innerR', 'anchorX', 'anchorY'], function (key) {
wrapper[key] = pick(hash[key], wrapper[key]);
});
wrapper.attr({
d: wrapper.renderer.symbols[wrapper.symbolName](
wrapper.x,
wrapper.y,
wrapper.width,
wrapper.height,
wrapper
)
});
},
/**
* Apply a clipping path to this object
* @param {String} id
*/
clip: function (clipRect) {
return this.attr('clip-path', clipRect ? 'url(' + this.renderer.url + '#' + clipRect.id + ')' : NONE);
},
/**
* Calculate the coordinates needed for drawing a rectangle crisply and return the
* calculated attributes
* @param {Number} strokeWidth
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
crisp: function (rect) {
var wrapper = this,
key,
attribs = {},
normalizer,
strokeWidth = rect.strokeWidth || wrapper.strokeWidth || 0;
normalizer = mathRound(strokeWidth) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors
// normalize for crisp edges
rect.x = mathFloor(rect.x || wrapper.x || 0) + normalizer;
rect.y = mathFloor(rect.y || wrapper.y || 0) + normalizer;
rect.width = mathFloor((rect.width || wrapper.width || 0) - 2 * normalizer);
rect.height = mathFloor((rect.height || wrapper.height || 0) - 2 * normalizer);
rect.strokeWidth = strokeWidth;
for (key in rect) {
if (wrapper[key] !== rect[key]) { // only set attribute if changed
wrapper[key] = attribs[key] = rect[key];
}
}
return attribs;
},
/**
* Set styles for the element
* @param {Object} styles
*/
css: function (styles) {
var elemWrapper = this,
oldStyles = elemWrapper.styles,
newStyles = {},
elem = elemWrapper.element,
textWidth,
n,
serializedCss = '',
hyphenate,
hasNew = !oldStyles;
// convert legacy
if (styles && styles.color) {
styles.fill = styles.color;
}
// Filter out existing styles to increase performance (#2640)
if (oldStyles) {
for (n in styles) {
if (styles[n] !== oldStyles[n]) {
newStyles[n] = styles[n];
hasNew = true;
}
}
}
if (hasNew) {
textWidth = elemWrapper.textWidth =
(styles && styles.width && elem.nodeName.toLowerCase() === 'text' && pInt(styles.width)) ||
elemWrapper.textWidth; // #3501
// Merge the new styles with the old ones
if (oldStyles) {
styles = extend(
oldStyles,
newStyles
);
}
// store object
elemWrapper.styles = styles;
if (textWidth && (useCanVG || (!hasSVG && elemWrapper.renderer.forExport))) {
delete styles.width;
}
// serialize and set style attribute
if (isIE && !hasSVG) {
css(elemWrapper.element, styles);
} else {
/*jslint unparam: true*/
hyphenate = function (a, b) { return '-' + b.toLowerCase(); };
/*jslint unparam: false*/
for (n in styles) {
serializedCss += n.replace(/([A-Z])/g, hyphenate) + ':' + styles[n] + ';';
}
attr(elem, 'style', serializedCss); // #1881
}
// re-build text
if (textWidth && elemWrapper.added) {
elemWrapper.renderer.buildText(elemWrapper);
}
}
return elemWrapper;
},
/**
* Add an event listener
* @param {String} eventType
* @param {Function} handler
*/
on: function (eventType, handler) {
var svgElement = this,
element = svgElement.element;
// touch
if (hasTouch && eventType === 'click') {
element.ontouchstart = function (e) {
svgElement.touchEventFired = Date.now();
e.preventDefault();
handler.call(element, e);
};
element.onclick = function (e) {
if (userAgent.indexOf('Android') === -1 || Date.now() - (svgElement.touchEventFired || 0) > 1100) { // #2269
handler.call(element, e);
}
};
} else {
// simplest possible event model for internal use
element['on' + eventType] = handler;
}
return this;
},
/**
* Set the coordinates needed to draw a consistent radial gradient across
* pie slices regardless of positioning inside the chart. The format is
* [centerX, centerY, diameter] in pixels.
*/
setRadialReference: function (coordinates) {
this.element.radialReference = coordinates;
return this;
},
/**
* Move an object and its children by x and y values
* @param {Number} x
* @param {Number} y
*/
translate: function (x, y) {
return this.attr({
translateX: x,
translateY: y
});
},
/**
* Invert a group, rotate and flip
*/
invert: function () {
var wrapper = this;
wrapper.inverted = true;
wrapper.updateTransform();
return wrapper;
},
/**
* Private method to update the transform attribute based on internal
* properties
*/
updateTransform: function () {
var wrapper = this,
translateX = wrapper.translateX || 0,
translateY = wrapper.translateY || 0,
scaleX = wrapper.scaleX,
scaleY = wrapper.scaleY,
inverted = wrapper.inverted,
rotation = wrapper.rotation,
element = wrapper.element,
transform;
// flipping affects translate as adjustment for flipping around the group's axis
if (inverted) {
translateX += wrapper.attr('width');
translateY += wrapper.attr('height');
}
// Apply translate. Nearly all transformed elements have translation, so instead
// of checking for translate = 0, do it always (#1767, #1846).
transform = ['translate(' + translateX + ',' + translateY + ')'];
// apply rotation
if (inverted) {
transform.push('rotate(90) scale(-1,1)');
} else if (rotation) { // text rotation
transform.push('rotate(' + rotation + ' ' + (element.getAttribute('x') || 0) + ' ' + (element.getAttribute('y') || 0) + ')');
// Delete bBox memo when the rotation changes
//delete wrapper.bBox;
}
// apply scale
if (defined(scaleX) || defined(scaleY)) {
transform.push('scale(' + pick(scaleX, 1) + ' ' + pick(scaleY, 1) + ')');
}
if (transform.length) {
element.setAttribute('transform', transform.join(' '));
}
},
/**
* Bring the element to the front
*/
toFront: function () {
var element = this.element;
element.parentNode.appendChild(element);
return this;
},
/**
* Break down alignment options like align, verticalAlign, x and y
* to x and y relative to the chart.
*
* @param {Object} alignOptions
* @param {Boolean} alignByTranslate
* @param {String[Object} box The box to align to, needs a width and height. When the
* box is a string, it refers to an object in the Renderer. For example, when
* box is 'spacingBox', it refers to Renderer.spacingBox which holds width, height
* x and y properties.
*
*/
align: function (alignOptions, alignByTranslate, box) {
var align,
vAlign,
x,
y,
attribs = {},
alignTo,
renderer = this.renderer,
alignedObjects = renderer.alignedObjects;
// First call on instanciate
if (alignOptions) {
this.alignOptions = alignOptions;
this.alignByTranslate = alignByTranslate;
if (!box || isString(box)) { // boxes other than renderer handle this internally
this.alignTo = alignTo = box || 'renderer';
erase(alignedObjects, this); // prevent duplicates, like legendGroup after resize
alignedObjects.push(this);
box = null; // reassign it below
}
// When called on resize, no arguments are supplied
} else {
alignOptions = this.alignOptions;
alignByTranslate = this.alignByTranslate;
alignTo = this.alignTo;
}
box = pick(box, renderer[alignTo], renderer);
// Assign variables
align = alignOptions.align;
vAlign = alignOptions.verticalAlign;
x = (box.x || 0) + (alignOptions.x || 0); // default: left align
y = (box.y || 0) + (alignOptions.y || 0); // default: top align
// Align
if (align === 'right' || align === 'center') {
x += (box.width - (alignOptions.width || 0)) /
{ right: 1, center: 2 }[align];
}
attribs[alignByTranslate ? 'translateX' : 'x'] = mathRound(x);
// Vertical align
if (vAlign === 'bottom' || vAlign === 'middle') {
y += (box.height - (alignOptions.height || 0)) /
({ bottom: 1, middle: 2 }[vAlign] || 1);
}
attribs[alignByTranslate ? 'translateY' : 'y'] = mathRound(y);
// Animate only if already placed
this[this.placed ? 'animate' : 'attr'](attribs);
this.placed = true;
this.alignAttr = attribs;
return this;
},
/**
* Get the bounding box (width, height, x and y) for the element
*/
getBBox: function (reload) {
var wrapper = this,
bBox,// = wrapper.bBox,
renderer = wrapper.renderer,
width,
height,
rotation = wrapper.rotation,
element = wrapper.element,
styles = wrapper.styles,
rad = rotation * deg2rad,
textStr = wrapper.textStr,
cacheKey;
if (textStr !== UNDEFINED) {
// Properties that affect bounding box
cacheKey = ['', rotation || 0, styles && styles.fontSize, element.style.width].join(',');
// Since numbers are monospaced, and numerical labels appear a lot in a chart,
// we assume that a label of n characters has the same bounding box as others
// of the same length.
if (textStr === '' || numRegex.test(textStr)) {
cacheKey = 'num:' + textStr.toString().length + cacheKey;
// Caching all strings reduces rendering time by 4-5%.
} else {
cacheKey = textStr + cacheKey;
}
}
if (cacheKey && !reload) {
bBox = renderer.cache[cacheKey];
}
// No cache found
if (!bBox) {
// SVG elements
if (element.namespaceURI === SVG_NS || renderer.forExport) {
try { // Fails in Firefox if the container has display: none.
bBox = element.getBBox ?
// SVG: use extend because IE9 is not allowed to change width and height in case
// of rotation (below)
extend({}, element.getBBox()) :
// Canvas renderer and legacy IE in export mode
{
width: element.offsetWidth,
height: element.offsetHeight
};
} catch (e) {}
// If the bBox is not set, the try-catch block above failed. The other condition
// is for Opera that returns a width of -Infinity on hidden elements.
if (!bBox || bBox.width < 0) {
bBox = { width: 0, height: 0 };
}
// VML Renderer or useHTML within SVG
} else {
bBox = wrapper.htmlGetBBox();
}
// True SVG elements as well as HTML elements in modern browsers using the .useHTML option
// need to compensated for rotation
if (renderer.isSVG) {
width = bBox.width;
height = bBox.height;
// Workaround for wrong bounding box in IE9 and IE10 (#1101, #1505, #1669, #2568)
if (isIE && styles && styles.fontSize === '11px' && height.toPrecision(3) === '16.9') {
bBox.height = height = 14;
}
// Adjust for rotated text
if (rotation) {
bBox.width = mathAbs(height * mathSin(rad)) + mathAbs(width * mathCos(rad));
bBox.height = mathAbs(height * mathCos(rad)) + mathAbs(width * mathSin(rad));
}
}
// Cache it
renderer.cache[cacheKey] = bBox;
}
return bBox;
},
/**
* Show the element
*/
show: function (inherit) {
// IE9-11 doesn't handle visibilty:inherit well, so we remove the attribute instead (#2881)
if (inherit && this.element.namespaceURI === SVG_NS) {
this.element.removeAttribute('visibility');
} else {
this.attr({ visibility: inherit ? 'inherit' : VISIBLE });
}
return this;
},
/**
* Hide the element
*/
hide: function () {
return this.attr({ visibility: HIDDEN });
},
fadeOut: function (duration) {
var elemWrapper = this;
elemWrapper.animate({
opacity: 0
}, {
duration: duration || 150,
complete: function () {
elemWrapper.attr({ y: -9999 }); // #3088, assuming we're only using this for tooltips
}
});
},
/**
* Add the element
* @param {Object|Undefined} parent Can be an element, an element wrapper or undefined
* to append the element to the renderer.box.
*/
add: function (parent) {
var renderer = this.renderer,
element = this.element,
inserted;
if (parent) {
this.parentGroup = parent;
}
// mark as inverted
this.parentInverted = parent && parent.inverted;
// build formatted text
if (this.textStr !== undefined) {
renderer.buildText(this);
}
// Mark as added
this.added = true;
// If we're adding to renderer root, or other elements in the group
// have a z index, we need to handle it
if (!parent || parent.handleZ || this.zIndex) {
inserted = this.zIndexSetter();
}
// If zIndex is not handled, append at the end
if (!inserted) {
(parent ? parent.element : renderer.box).appendChild(element);
}
// fire an event for internal hooks
if (this.onAdd) {
this.onAdd();
}
return this;
},
/**
* Removes a child either by removeChild or move to garbageBin.
* Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not.
*/
safeRemoveChild: function (element) {
var parentNode = element.parentNode;
if (parentNode) {
parentNode.removeChild(element);
}
},
/**
* Destroy the element and element wrapper
*/
destroy: function () {
var wrapper = this,
element = wrapper.element || {},
shadows = wrapper.shadows,
parentToClean = wrapper.renderer.isSVG && element.nodeName === 'SPAN' && wrapper.parentGroup,
grandParent,
key,
i;
// remove events
element.onclick = element.onmouseout = element.onmouseover = element.onmousemove = element.point = null;
stop(wrapper); // stop running animations
if (wrapper.clipPath) {
wrapper.clipPath = wrapper.clipPath.destroy();
}
// Destroy stops in case this is a gradient object
if (wrapper.stops) {
for (i = 0; i < wrapper.stops.length; i++) {
wrapper.stops[i] = wrapper.stops[i].destroy();
}
wrapper.stops = null;
}
// remove element
wrapper.safeRemoveChild(element);
// destroy shadows
if (shadows) {
each(shadows, function (shadow) {
wrapper.safeRemoveChild(shadow);
});
}
// In case of useHTML, clean up empty containers emulating SVG groups (#1960, #2393, #2697).
while (parentToClean && parentToClean.div && parentToClean.div.childNodes.length === 0) {
grandParent = parentToClean.parentGroup;
wrapper.safeRemoveChild(parentToClean.div);
delete parentToClean.div;
parentToClean = grandParent;
}
// remove from alignObjects
if (wrapper.alignTo) {
erase(wrapper.renderer.alignedObjects, wrapper);
}
for (key in wrapper) {
delete wrapper[key];
}
return null;
},
/**
* Add a shadow to the element. Must be done after the element is added to the DOM
* @param {Boolean|Object} shadowOptions
*/
shadow: function (shadowOptions, group, cutOff) {
var shadows = [],
i,
shadow,
element = this.element,
strokeWidth,
shadowWidth,
shadowElementOpacity,
// compensate for inverted plot area
transform;
if (shadowOptions) {
shadowWidth = pick(shadowOptions.width, 3);
shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth;
transform = this.parentInverted ?
'(-1,-1)' :
'(' + pick(shadowOptions.offsetX, 1) + ', ' + pick(shadowOptions.offsetY, 1) + ')';
for (i = 1; i <= shadowWidth; i++) {
shadow = element.cloneNode(0);
strokeWidth = (shadowWidth * 2) + 1 - (2 * i);
attr(shadow, {
'isShadow': 'true',
'stroke': shadowOptions.color || 'black',
'stroke-opacity': shadowElementOpacity * i,
'stroke-width': strokeWidth,
'transform': 'translate' + transform,
'fill': NONE
});
if (cutOff) {
attr(shadow, 'height', mathMax(attr(shadow, 'height') - strokeWidth, 0));
shadow.cutHeight = strokeWidth;
}
if (group) {
group.element.appendChild(shadow);
} else {
element.parentNode.insertBefore(shadow, element);
}
shadows.push(shadow);
}
this.shadows = shadows;
}
return this;
},
xGetter: function (key) {
if (this.element.nodeName === 'circle') {
key = { x: 'cx', y: 'cy' }[key] || key;
}
return this._defaultGetter(key);
},
/**
* Get the current value of an attribute or pseudo attribute, used mainly
* for animation.
*/
_defaultGetter: function (key) {
var ret = pick(this[key], this.element ? this.element.getAttribute(key) : null, 0);
if (/^[\-0-9\.]+$/.test(ret)) { // is numerical
ret = parseFloat(ret);
}
return ret;
},
dSetter: function (value, key, element) {
if (value && value.join) { // join path
value = value.join(' ');
}
if (/(NaN| {2}|^$)/.test(value)) {
value = 'M 0 0';
}
element.setAttribute(key, value);
this[key] = value;
},
dashstyleSetter: function (value) {
var i;
value = value && value.toLowerCase();
if (value) {
value = value
.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(','); // ending comma
i = value.length;
while (i--) {
value[i] = pInt(value[i]) * this['stroke-width'];
}
value = value.join(',')
.replace('NaN', 'none'); // #3226
this.element.setAttribute('stroke-dasharray', value);
}
},
alignSetter: function (value) {
this.element.setAttribute('text-anchor', { left: 'start', center: 'middle', right: 'end' }[value]);
},
opacitySetter: function (value, key, element) {
this[key] = value;
element.setAttribute(key, value);
},
titleSetter: function (value) {
var titleNode = this.element.getElementsByTagName('title')[0];
if (!titleNode) {
titleNode = doc.createElementNS(SVG_NS, 'title');
this.element.appendChild(titleNode);
}
titleNode.textContent = pick(value, '').replace(/<[^>]*>/g, ''); // #3276
},
textSetter: function (value) {
if (value !== this.textStr) {
// Delete bBox memo when the text changes
delete this.bBox;
this.textStr = value;
if (this.added) {
this.renderer.buildText(this);
}
}
},
fillSetter: function (value, key, element) {
if (typeof value === 'string') {
element.setAttribute(key, value);
} else if (value) {
this.colorGradient(value, key, element);
}
},
zIndexSetter: function (value, key) {
var renderer = this.renderer,
parentGroup = this.parentGroup,
parentWrapper = parentGroup || renderer,
parentNode = parentWrapper.element || renderer.box,
childNodes,
otherElement,
otherZIndex,
element = this.element,
inserted,
i;
if (defined(value)) {
element.setAttribute(key, value); // So we can read it for other elements in the group
this[key] = +value;
}
// Insert according to this and other elements' zIndex. Before .add() is called,
// nothing is done. Then on add, or by later calls to zIndexSetter, the node
// is placed on the right place in the DOM.
if (this.added) {
value = this.zIndex;
if (value && parentGroup) {
parentGroup.handleZ = true;
}
childNodes = parentNode.childNodes;
for (i = 0; i < childNodes.length && !inserted; i++) {
otherElement = childNodes[i];
otherZIndex = attr(otherElement, 'zIndex');
if (otherElement !== element && (
// Insert before the first element with a higher zIndex
pInt(otherZIndex) > value ||
// If no zIndex given, insert before the first element with a zIndex
(!defined(value) && defined(otherZIndex))
)) {
parentNode.insertBefore(element, otherElement);
inserted = true;
}
}
if (!inserted) {
parentNode.appendChild(element);
}
}
return inserted;
},
_defaultSetter: function (value, key, element) {
element.setAttribute(key, value);
}
};
// Some shared setters and getters
SVGElement.prototype.yGetter = SVGElement.prototype.xGetter;
SVGElement.prototype.translateXSetter = SVGElement.prototype.translateYSetter =
SVGElement.prototype.rotationSetter = SVGElement.prototype.verticalAlignSetter =
SVGElement.prototype.scaleXSetter = SVGElement.prototype.scaleYSetter = function (value, key) {
this[key] = value;
this.doTransform = true;
};
// WebKit and Batik have problems with a stroke-width of zero, so in this case we remove the
// stroke attribute altogether. #1270, #1369, #3065, #3072.
SVGElement.prototype['stroke-widthSetter'] = SVGElement.prototype.strokeSetter = function (value, key, element) {
this[key] = value;
// Only apply the stroke attribute if the stroke width is defined and larger than 0
if (this.stroke && this['stroke-width']) {
this.strokeWidth = this['stroke-width'];
SVGElement.prototype.fillSetter.call(this, this.stroke, 'stroke', element); // use prototype as instance may be overridden
element.setAttribute('stroke-width', this['stroke-width']);
this.hasStroke = true;
} else if (key === 'stroke-width' && value === 0 && this.hasStroke) {
element.removeAttribute('stroke');
this.hasStroke = false;
}
};
/**
* The default SVG renderer
*/
var SVGRenderer = function () {
this.init.apply(this, arguments);
};
SVGRenderer.prototype = {
Element: SVGElement,
/**
* Initialize the SVGRenderer
* @param {Object} container
* @param {Number} width
* @param {Number} height
* @param {Boolean} forExport
*/
init: function (container, width, height, style, forExport) {
var renderer = this,
loc = location,
boxWrapper,
element,
desc;
boxWrapper = renderer.createElement('svg')
.attr({
version: '1.1'
})
.css(this.getStyle(style));
element = boxWrapper.element;
container.appendChild(element);
// For browsers other than IE, add the namespace attribute (#1978)
if (container.innerHTML.indexOf('xmlns') === -1) {
attr(element, 'xmlns', SVG_NS);
}
// object properties
renderer.isSVG = true;
renderer.box = element;
renderer.boxWrapper = boxWrapper;
renderer.alignedObjects = [];
// Page url used for internal references. #24, #672, #1070
renderer.url = (isFirefox || isWebKit) && doc.getElementsByTagName('base').length ?
loc.href
.replace(/#.*?$/, '') // remove the hash
.replace(/([\('\)])/g, '\\$1') // escape parantheses and quotes
.replace(/ /g, '%20') : // replace spaces (needed for Safari only)
'';
// Add description
desc = this.createElement('desc').add();
desc.element.appendChild(doc.createTextNode('Created with ' + PRODUCT + ' ' + VERSION));
renderer.defs = this.createElement('defs').add();
renderer.forExport = forExport;
renderer.gradients = {}; // Object where gradient SvgElements are stored
renderer.cache = {}; // Cache for numerical bounding boxes
renderer.setSize(width, height, false);
// Issue 110 workaround:
// In Firefox, if a div is positioned by percentage, its pixel position may land
// between pixels. The container itself doesn't display this, but an SVG element
// inside this container will be drawn at subpixel precision. In order to draw
// sharp lines, this must be compensated for. This doesn't seem to work inside
// iframes though (like in jsFiddle).
var subPixelFix, rect;
if (isFirefox && container.getBoundingClientRect) {
renderer.subPixelFix = subPixelFix = function () {
css(container, { left: 0, top: 0 });
rect = container.getBoundingClientRect();
css(container, {
left: (mathCeil(rect.left) - rect.left) + PX,
top: (mathCeil(rect.top) - rect.top) + PX
});
};
// run the fix now
subPixelFix();
// run it on resize
addEvent(win, 'resize', subPixelFix);
}
},
getStyle: function (style) {
return (this.style = extend({
fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif', // default font
fontSize: '12px'
}, style));
},
/**
* Detect whether the renderer is hidden. This happens when one of the parent elements
* has display: none. #608.
*/
isHidden: function () {
return !this.boxWrapper.getBBox().width;
},
/**
* Destroys the renderer and its allocated members.
*/
destroy: function () {
var renderer = this,
rendererDefs = renderer.defs;
renderer.box = null;
renderer.boxWrapper = renderer.boxWrapper.destroy();
// Call destroy on all gradient elements
destroyObjectProperties(renderer.gradients || {});
renderer.gradients = null;
// Defs are null in VMLRenderer
// Otherwise, destroy them here.
if (rendererDefs) {
renderer.defs = rendererDefs.destroy();
}
// Remove sub pixel fix handler
// We need to check that there is a handler, otherwise all functions that are registered for event 'resize' are removed
// See issue #982
if (renderer.subPixelFix) {
removeEvent(win, 'resize', renderer.subPixelFix);
}
renderer.alignedObjects = null;
return null;
},
/**
* Create a wrapper for an SVG element
* @param {Object} nodeName
*/
createElement: function (nodeName) {
var wrapper = new this.Element();
wrapper.init(this, nodeName);
return wrapper;
},
/**
* Dummy function for use in canvas renderer
*/
draw: function () {},
/**
* Parse a simple HTML string into SVG tspans
*
* @param {Object} textNode The parent text SVG node
*/
buildText: function (wrapper) {
var textNode = wrapper.element,
renderer = this,
forExport = renderer.forExport,
textStr = pick(wrapper.textStr, '').toString(),
hasMarkup = textStr.indexOf('<') !== -1,
lines,
childNodes = textNode.childNodes,
styleRegex,
hrefRegex,
parentX = attr(textNode, 'x'),
textStyles = wrapper.styles,
width = wrapper.textWidth,
textLineHeight = textStyles && textStyles.lineHeight,
textShadow = textStyles && textStyles.textShadow,
ellipsis = textStyles && textStyles.textOverflow === 'ellipsis',
i = childNodes.length,
tempParent = width && !wrapper.added && this.box,
getLineHeight = function (tspan) {
return textLineHeight ?
pInt(textLineHeight) :
renderer.fontMetrics(
/(px|em)$/.test(tspan && tspan.style.fontSize) ?
tspan.style.fontSize :
((textStyles && textStyles.fontSize) || renderer.style.fontSize || 12),
tspan
).h;
},
unescapeAngleBrackets = function (inputStr) {
return inputStr.replace(/</g, '<').replace(/>/g, '>');
};
/// remove old text
while (i--) {
textNode.removeChild(childNodes[i]);
}
// Skip tspans, add text directly to text node. The forceTSpan is a hook
// used in text outline hack.
if (!hasMarkup && !textShadow && !ellipsis && textStr.indexOf(' ') === -1) {
textNode.appendChild(doc.createTextNode(unescapeAngleBrackets(textStr)));
return;
// Complex strings, add more logic
} else {
styleRegex = /<.*style="([^"]+)".*>/;
hrefRegex = /<.*href="(http[^"]+)".*>/;
if (tempParent) {
tempParent.appendChild(textNode); // attach it to the DOM to read offset width
}
if (hasMarkup) {
lines = textStr
.replace(/<(b|strong)>/g, '<span style="font-weight:bold">')
.replace(/<(i|em)>/g, '<span style="font-style:italic">')
.replace(/<a/g, '<span')
.replace(/<\/(b|strong|i|em|a)>/g, '</span>')
.split(/<br.*?>/g);
} else {
lines = [textStr];
}
// remove empty line at end
if (lines[lines.length - 1] === '') {
lines.pop();
}
// build the lines
each(lines, function (line, lineNo) {
var spans, spanNo = 0;
line = line.replace(/<span/g, '|||<span').replace(/<\/span>/g, '</span>|||');
spans = line.split('|||');
each(spans, function (span) {
if (span !== '' || spans.length === 1) {
var attributes = {},
tspan = doc.createElementNS(SVG_NS, 'tspan'),
spanStyle; // #390
if (styleRegex.test(span)) {
spanStyle = span.match(styleRegex)[1].replace(/(;| |^)color([ :])/, '$1fill$2');
attr(tspan, 'style', spanStyle);
}
if (hrefRegex.test(span) && !forExport) { // Not for export - #1529
attr(tspan, 'onclick', 'location.href=\"' + span.match(hrefRegex)[1] + '\"');
css(tspan, { cursor: 'pointer' });
}
span = unescapeAngleBrackets(span.replace(/<(.|\n)*?>/g, '') || ' ');
// Nested tags aren't supported, and cause crash in Safari (#1596)
if (span !== ' ') {
// add the text node
tspan.appendChild(doc.createTextNode(span));
if (!spanNo) { // first span in a line, align it to the left
if (lineNo && parentX !== null) {
attributes.x = parentX;
}
} else {
attributes.dx = 0; // #16
}
// add attributes
attr(tspan, attributes);
// Append it
textNode.appendChild(tspan);
// first span on subsequent line, add the line height
if (!spanNo && lineNo) {
// allow getting the right offset height in exporting in IE
if (!hasSVG && forExport) {
css(tspan, { display: 'block' });
}
// Set the line height based on the font size of either
// the text element or the tspan element
attr(
tspan,
'dy',
getLineHeight(tspan)
);
}
/*if (width) {
renderer.breakText(wrapper, width);
}*/
// Check width and apply soft breaks or ellipsis
if (width) {
var words = span.replace(/([^\^])-/g, '$1- ').split(' '), // #1273
hasWhiteSpace = spans.length > 1 || lineNo || (words.length > 1 && textStyles.whiteSpace !== 'nowrap'),
tooLong,
wasTooLong,
actualWidth,
rest = [],
dy = getLineHeight(tspan),
softLineNo = 1,
rotation = wrapper.rotation,
wordStr = span, // for ellipsis
cursor = wordStr.length, // binary search cursor
bBox;
while ((hasWhiteSpace || ellipsis) && (words.length || rest.length)) {
wrapper.rotation = 0; // discard rotation when computing box
bBox = wrapper.getBBox(true);
actualWidth = bBox.width;
// Old IE cannot measure the actualWidth for SVG elements (#2314)
if (!hasSVG && renderer.forExport) {
actualWidth = renderer.measureSpanWidth(tspan.firstChild.data, wrapper.styles);
}
tooLong = actualWidth > width;
// For ellipsis, do a binary search for the correct string length
if (wasTooLong === undefined) {
wasTooLong = tooLong; // First time
}
if (ellipsis && wasTooLong) {
cursor /= 2;
if (wordStr === '' || (!tooLong && cursor < 0.5)) {
words = []; // All ok, break out
} else {
if (tooLong) {
wasTooLong = true;
}
wordStr = span.substring(0, wordStr.length + (tooLong ? -1 : 1) * mathCeil(cursor));
words = [wordStr + '\u2026'];
tspan.removeChild(tspan.firstChild);
}
// Looping down, this is the first word sequence that is not too long,
// so we can move on to build the next line.
} else if (!tooLong || words.length === 1) {
words = rest;
rest = [];
if (words.length) {
softLineNo++;
tspan = doc.createElementNS(SVG_NS, 'tspan');
attr(tspan, {
dy: dy,
x: parentX
});
if (spanStyle) { // #390
attr(tspan, 'style', spanStyle);
}
textNode.appendChild(tspan);
}
if (actualWidth > width) { // a single word is pressing it out
width = actualWidth;
}
} else { // append to existing line tspan
tspan.removeChild(tspan.firstChild);
rest.unshift(words.pop());
}
if (words.length) {
tspan.appendChild(doc.createTextNode(words.join(' ').replace(/- /g, '-')));
}
}
if (wasTooLong) {
wrapper.attr('title', wrapper.textStr);
}
wrapper.rotation = rotation;
}
spanNo++;
}
}
});
});
if (tempParent) {
tempParent.removeChild(textNode); // attach it to the DOM to read offset width
}
// Apply the text shadow
if (textShadow && wrapper.applyTextShadow) {
wrapper.applyTextShadow(textShadow);
}
}
},
/*
breakText: function (wrapper, width) {
var bBox = wrapper.getBBox(),
node = wrapper.element,
textLength = node.textContent.length,
pos = mathRound(width * textLength / bBox.width), // try this position first, based on average character width
increment = 0,
finalPos;
if (bBox.width > width) {
while (finalPos === undefined) {
textLength = node.getSubStringLength(0, pos);
if (textLength <= width) {
if (increment === -1) {
finalPos = pos;
} else {
increment = 1;
}
} else {
if (increment === 1) {
finalPos = pos - 1;
} else {
increment = -1;
}
}
pos += increment;
}
}
console.log(finalPos, node.getSubStringLength(0, finalPos))
},
*/
/**
* Returns white for dark colors and black for bright colors
*/
getContrast: function (color) {
color = Color(color).rgba;
return color[0] + color[1] + color[2] > 384 ? '#000' : '#FFF';
},
/**
* Create a button with preset states
* @param {String} text
* @param {Number} x
* @param {Number} y
* @param {Function} callback
* @param {Object} normalState
* @param {Object} hoverState
* @param {Object} pressedState
*/
button: function (text, x, y, callback, normalState, hoverState, pressedState, disabledState, shape) {
var label = this.label(text, x, y, shape, null, null, null, null, 'button'),
curState = 0,
stateOptions,
stateStyle,
normalStyle,
hoverStyle,
pressedStyle,
disabledStyle,
verticalGradient = { x1: 0, y1: 0, x2: 0, y2: 1 };
// Normal state - prepare the attributes
normalState = merge({
'stroke-width': 1,
stroke: '#CCCCCC',
fill: {
linearGradient: verticalGradient,
stops: [
[0, '#FEFEFE'],
[1, '#F6F6F6']
]
},
r: 2,
padding: 5,
style: {
color: 'black'
}
}, normalState);
normalStyle = normalState.style;
delete normalState.style;
// Hover state
hoverState = merge(normalState, {
stroke: '#68A',
fill: {
linearGradient: verticalGradient,
stops: [
[0, '#FFF'],
[1, '#ACF']
]
}
}, hoverState);
hoverStyle = hoverState.style;
delete hoverState.style;
// Pressed state
pressedState = merge(normalState, {
stroke: '#68A',
fill: {
linearGradient: verticalGradient,
stops: [
[0, '#9BD'],
[1, '#CDF']
]
}
}, pressedState);
pressedStyle = pressedState.style;
delete pressedState.style;
// Disabled state
disabledState = merge(normalState, {
style: {
color: '#CCC'
}
}, disabledState);
disabledStyle = disabledState.style;
delete disabledState.style;
// Add the events. IE9 and IE10 need mouseover and mouseout to funciton (#667).
addEvent(label.element, isIE ? 'mouseover' : 'mouseenter', function () {
if (curState !== 3) {
label.attr(hoverState)
.css(hoverStyle);
}
});
addEvent(label.element, isIE ? 'mouseout' : 'mouseleave', function () {
if (curState !== 3) {
stateOptions = [normalState, hoverState, pressedState][curState];
stateStyle = [normalStyle, hoverStyle, pressedStyle][curState];
label.attr(stateOptions)
.css(stateStyle);
}
});
label.setState = function (state) {
label.state = curState = state;
if (!state) {
label.attr(normalState)
.css(normalStyle);
} else if (state === 2) {
label.attr(pressedState)
.css(pressedStyle);
} else if (state === 3) {
label.attr(disabledState)
.css(disabledStyle);
}
};
return label
.on('click', function () {
if (curState !== 3) {
callback.call(label);
}
})
.attr(normalState)
.css(extend({ cursor: 'default' }, normalStyle));
},
/**
* Make a straight line crisper by not spilling out to neighbour pixels
* @param {Array} points
* @param {Number} width
*/
crispLine: function (points, width) {
// points format: [M, 0, 0, L, 100, 0]
// normalize to a crisp line
if (points[1] === points[4]) {
// Substract due to #1129. Now bottom and left axis gridlines behave the same.
points[1] = points[4] = mathRound(points[1]) - (width % 2 / 2);
}
if (points[2] === points[5]) {
points[2] = points[5] = mathRound(points[2]) + (width % 2 / 2);
}
return points;
},
/**
* Draw a path
* @param {Array} path An SVG path in array form
*/
path: function (path) {
var attr = {
fill: NONE
};
if (isArray(path)) {
attr.d = path;
} else if (isObject(path)) { // attributes
extend(attr, path);
}
return this.createElement('path').attr(attr);
},
/**
* Draw and return an SVG circle
* @param {Number} x The x position
* @param {Number} y The y position
* @param {Number} r The radius
*/
circle: function (x, y, r) {
var attr = isObject(x) ?
x :
{
x: x,
y: y,
r: r
},
wrapper = this.createElement('circle');
wrapper.xSetter = function (value) {
this.element.setAttribute('cx', value);
};
wrapper.ySetter = function (value) {
this.element.setAttribute('cy', value);
};
return wrapper.attr(attr);
},
/**
* Draw and return an arc
* @param {Number} x X position
* @param {Number} y Y position
* @param {Number} r Radius
* @param {Number} innerR Inner radius like used in donut charts
* @param {Number} start Starting angle
* @param {Number} end Ending angle
*/
arc: function (x, y, r, innerR, start, end) {
var arc;
if (isObject(x)) {
y = x.y;
r = x.r;
innerR = x.innerR;
start = x.start;
end = x.end;
x = x.x;
}
// Arcs are defined as symbols for the ability to set
// attributes in attr and animate
arc = this.symbol('arc', x || 0, y || 0, r || 0, r || 0, {
innerR: innerR || 0,
start: start || 0,
end: end || 0
});
arc.r = r; // #959
return arc;
},
/**
* Draw and return a rectangle
* @param {Number} x Left position
* @param {Number} y Top position
* @param {Number} width
* @param {Number} height
* @param {Number} r Border corner radius
* @param {Number} strokeWidth A stroke width can be supplied to allow crisp drawing
*/
rect: function (x, y, width, height, r, strokeWidth) {
r = isObject(x) ? x.r : r;
var wrapper = this.createElement('rect'),
attribs = isObject(x) ? x : x === UNDEFINED ? {} : {
x: x,
y: y,
width: mathMax(width, 0),
height: mathMax(height, 0)
};
if (strokeWidth !== UNDEFINED) {
attribs.strokeWidth = strokeWidth;
attribs = wrapper.crisp(attribs);
}
if (r) {
attribs.r = r;
}
wrapper.rSetter = function (value) {
attr(this.element, {
rx: value,
ry: value
});
};
return wrapper.attr(attribs);
},
/**
* Resize the box and re-align all aligned elements
* @param {Object} width
* @param {Object} height
* @param {Boolean} animate
*
*/
setSize: function (width, height, animate) {
var renderer = this,
alignedObjects = renderer.alignedObjects,
i = alignedObjects.length;
renderer.width = width;
renderer.height = height;
renderer.boxWrapper[pick(animate, true) ? 'animate' : 'attr']({
width: width,
height: height
});
while (i--) {
alignedObjects[i].align();
}
},
/**
* Create a group
* @param {String} name The group will be given a class name of 'highcharts-{name}'.
* This can be used for styling and scripting.
*/
g: function (name) {
var elem = this.createElement('g');
return defined(name) ? elem.attr({ 'class': PREFIX + name }) : elem;
},
/**
* Display an image
* @param {String} src
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
image: function (src, x, y, width, height) {
var attribs = {
preserveAspectRatio: NONE
},
elemWrapper;
// optional properties
if (arguments.length > 1) {
extend(attribs, {
x: x,
y: y,
width: width,
height: height
});
}
elemWrapper = this.createElement('image').attr(attribs);
// set the href in the xlink namespace
if (elemWrapper.element.setAttributeNS) {
elemWrapper.element.setAttributeNS('http://www.w3.org/1999/xlink',
'href', src);
} else {
// could be exporting in IE
// using href throws "not supported" in ie7 and under, requries regex shim to fix later
elemWrapper.element.setAttribute('hc-svg-href', src);
}
return elemWrapper;
},
/**
* Draw a symbol out of pre-defined shape paths from the namespace 'symbol' object.
*
* @param {Object} symbol
* @param {Object} x
* @param {Object} y
* @param {Object} radius
* @param {Object} options
*/
symbol: function (symbol, x, y, width, height, options) {
var obj,
// get the symbol definition function
symbolFn = this.symbols[symbol],
// check if there's a path defined for this symbol
path = symbolFn && symbolFn(
mathRound(x),
mathRound(y),
width,
height,
options
),
imageElement,
imageRegex = /^url\((.*?)\)$/,
imageSrc,
imageSize,
centerImage;
if (path) {
obj = this.path(path);
// expando properties for use in animate and attr
extend(obj, {
symbolName: symbol,
x: x,
y: y,
width: width,
height: height
});
if (options) {
extend(obj, options);
}
// image symbols
} else if (imageRegex.test(symbol)) {
// On image load, set the size and position
centerImage = function (img, size) {
if (img.element) { // it may be destroyed in the meantime (#1390)
img.attr({
width: size[0],
height: size[1]
});
if (!img.alignByTranslate) { // #185
img.translate(
mathRound((width - size[0]) / 2), // #1378
mathRound((height - size[1]) / 2)
);
}
}
};
imageSrc = symbol.match(imageRegex)[1];
imageSize = symbolSizes[imageSrc] || (options && options.width && options.height && [options.width, options.height]);
// Ireate the image synchronously, add attribs async
obj = this.image(imageSrc)
.attr({
x: x,
y: y
});
obj.isImg = true;
if (imageSize) {
centerImage(obj, imageSize);
} else {
// Initialize image to be 0 size so export will still function if there's no cached sizes.
obj.attr({ width: 0, height: 0 });
// Create a dummy JavaScript image to get the width and height. Due to a bug in IE < 8,
// the created element must be assigned to a variable in order to load (#292).
imageElement = createElement('img', {
onload: function () {
centerImage(obj, symbolSizes[imageSrc] = [this.width, this.height]);
},
src: imageSrc
});
}
}
return obj;
},
/**
* An extendable collection of functions for defining symbol paths.
*/
symbols: {
'circle': function (x, y, w, h) {
var cpw = 0.166 * w;
return [
M, x + w / 2, y,
'C', x + w + cpw, y, x + w + cpw, y + h, x + w / 2, y + h,
'C', x - cpw, y + h, x - cpw, y, x + w / 2, y,
'Z'
];
},
'square': function (x, y, w, h) {
return [
M, x, y,
L, x + w, y,
x + w, y + h,
x, y + h,
'Z'
];
},
'triangle': function (x, y, w, h) {
return [
M, x + w / 2, y,
L, x + w, y + h,
x, y + h,
'Z'
];
},
'triangle-down': function (x, y, w, h) {
return [
M, x, y,
L, x + w, y,
x + w / 2, y + h,
'Z'
];
},
'diamond': function (x, y, w, h) {
return [
M, x + w / 2, y,
L, x + w, y + h / 2,
x + w / 2, y + h,
x, y + h / 2,
'Z'
];
},
'arc': function (x, y, w, h, options) {
var start = options.start,
radius = options.r || w || h,
end = options.end - 0.001, // to prevent cos and sin of start and end from becoming equal on 360 arcs (related: #1561)
innerRadius = options.innerR,
open = options.open,
cosStart = mathCos(start),
sinStart = mathSin(start),
cosEnd = mathCos(end),
sinEnd = mathSin(end),
longArc = options.end - start < mathPI ? 0 : 1;
return [
M,
x + radius * cosStart,
y + radius * sinStart,
'A', // arcTo
radius, // x radius
radius, // y radius
0, // slanting
longArc, // long or short arc
1, // clockwise
x + radius * cosEnd,
y + radius * sinEnd,
open ? M : L,
x + innerRadius * cosEnd,
y + innerRadius * sinEnd,
'A', // arcTo
innerRadius, // x radius
innerRadius, // y radius
0, // slanting
longArc, // long or short arc
0, // clockwise
x + innerRadius * cosStart,
y + innerRadius * sinStart,
open ? '' : 'Z' // close
];
},
/**
* Callout shape used for default tooltips, also used for rounded rectangles in VML
*/
callout: function (x, y, w, h, options) {
var arrowLength = 6,
halfDistance = 6,
r = mathMin((options && options.r) || 0, w, h),
safeDistance = r + halfDistance,
anchorX = options && options.anchorX,
anchorY = options && options.anchorY,
path,
normalizer = mathRound(options.strokeWidth || 0) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors;
x += normalizer;
y += normalizer;
path = [
'M', x + r, y,
'L', x + w - r, y, // top side
'C', x + w, y, x + w, y, x + w, y + r, // top-right corner
'L', x + w, y + h - r, // right side
'C', x + w, y + h, x + w, y + h, x + w - r, y + h, // bottom-right corner
'L', x + r, y + h, // bottom side
'C', x, y + h, x, y + h, x, y + h - r, // bottom-left corner
'L', x, y + r, // left side
'C', x, y, x, y, x + r, y // top-right corner
];
if (anchorX && anchorX > w && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace right side
path.splice(13, 3,
'L', x + w, anchorY - halfDistance,
x + w + arrowLength, anchorY,
x + w, anchorY + halfDistance,
x + w, y + h - r
);
} else if (anchorX && anchorX < 0 && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace left side
path.splice(33, 3,
'L', x, anchorY + halfDistance,
x - arrowLength, anchorY,
x, anchorY - halfDistance,
x, y + r
);
} else if (anchorY && anchorY > h && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace bottom
path.splice(23, 3,
'L', anchorX + halfDistance, y + h,
anchorX, y + h + arrowLength,
anchorX - halfDistance, y + h,
x + r, y + h
);
} else if (anchorY && anchorY < 0 && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace top
path.splice(3, 3,
'L', anchorX - halfDistance, y,
anchorX, y - arrowLength,
anchorX + halfDistance, y,
w - r, y
);
}
return path;
}
},
/**
* Define a clipping rectangle
* @param {String} id
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
clipRect: function (x, y, width, height) {
var wrapper,
id = PREFIX + idCounter++,
clipPath = this.createElement('clipPath').attr({
id: id
}).add(this.defs);
wrapper = this.rect(x, y, width, height, 0).add(clipPath);
wrapper.id = id;
wrapper.clipPath = clipPath;
wrapper.count = 0;
return wrapper;
},
/**
* Add text to the SVG object
* @param {String} str
* @param {Number} x Left position
* @param {Number} y Top position
* @param {Boolean} useHTML Use HTML to render the text
*/
text: function (str, x, y, useHTML) {
// declare variables
var renderer = this,
fakeSVG = useCanVG || (!hasSVG && renderer.forExport),
wrapper,
attr = {};
if (useHTML && !renderer.forExport) {
return renderer.html(str, x, y);
}
attr.x = Math.round(x || 0); // X is always needed for line-wrap logic
if (y) {
attr.y = Math.round(y);
}
if (str || str === 0) {
attr.text = str;
}
wrapper = renderer.createElement('text')
.attr(attr);
// Prevent wrapping from creating false offsetWidths in export in legacy IE (#1079, #1063)
if (fakeSVG) {
wrapper.css({
position: ABSOLUTE
});
}
if (!useHTML) {
wrapper.xSetter = function (value, key, element) {
var tspans = element.getElementsByTagName('tspan'),
tspan,
parentVal = element.getAttribute(key),
i;
for (i = 0; i < tspans.length; i++) {
tspan = tspans[i];
// If the x values are equal, the tspan represents a linebreak
if (tspan.getAttribute(key) === parentVal) {
tspan.setAttribute(key, value);
}
}
element.setAttribute(key, value);
};
}
return wrapper;
},
/**
* Utility to return the baseline offset and total line height from the font size
*/
fontMetrics: function (fontSize, elem) {
fontSize = fontSize || this.style.fontSize;
if (elem && win.getComputedStyle) {
elem = elem.element || elem; // SVGElement
fontSize = win.getComputedStyle(elem, "").fontSize;
}
fontSize = /px/.test(fontSize) ? pInt(fontSize) : /em/.test(fontSize) ? parseFloat(fontSize) * 12 : 12;
// Empirical values found by comparing font size and bounding box height.
// Applies to the default font family. http://jsfiddle.net/highcharts/7xvn7/
var lineHeight = fontSize < 24 ? fontSize + 3 : mathRound(fontSize * 1.2),
baseline = mathRound(lineHeight * 0.8);
return {
h: lineHeight,
b: baseline,
f: fontSize
};
},
/**
* Correct X and Y positioning of a label for rotation (#1764)
*/
rotCorr: function (baseline, rotation, alterY) {
var y = baseline;
if (rotation && alterY) {
y = mathMax(y * mathCos(rotation * deg2rad), 4);
}
return {
x: (-baseline / 3) * mathSin(rotation * deg2rad),
y: y
};
},
/**
* Add a label, a text item that can hold a colored or gradient background
* as well as a border and shadow.
* @param {string} str
* @param {Number} x
* @param {Number} y
* @param {String} shape
* @param {Number} anchorX In case the shape has a pointer, like a flag, this is the
* coordinates it should be pinned to
* @param {Number} anchorY
* @param {Boolean} baseline Whether to position the label relative to the text baseline,
* like renderer.text, or to the upper border of the rectangle.
* @param {String} className Class name for the group
*/
label: function (str, x, y, shape, anchorX, anchorY, useHTML, baseline, className) {
var renderer = this,
wrapper = renderer.g(className),
text = renderer.text('', 0, 0, useHTML)
.attr({
zIndex: 1
}),
//.add(wrapper),
box,
bBox,
alignFactor = 0,
padding = 3,
paddingLeft = 0,
width,
height,
wrapperX,
wrapperY,
crispAdjust = 0,
deferredAttr = {},
baselineOffset,
needsBox;
/**
* This function runs after the label is added to the DOM (when the bounding box is
* available), and after the text of the label is updated to detect the new bounding
* box and reflect it in the border box.
*/
function updateBoxSize() {
var boxX,
boxY,
style = text.element.style;
bBox = (width === undefined || height === undefined || wrapper.styles.textAlign) && defined(text.textStr) &&
text.getBBox(); //#3295 && 3514 box failure when string equals 0
wrapper.width = (width || bBox.width || 0) + 2 * padding + paddingLeft;
wrapper.height = (height || bBox.height || 0) + 2 * padding;
// update the label-scoped y offset
baselineOffset = padding + renderer.fontMetrics(style && style.fontSize, text).b;
if (needsBox) {
// create the border box if it is not already present
if (!box) {
boxX = mathRound(-alignFactor * padding);
boxY = baseline ? -baselineOffset : 0;
wrapper.box = box = shape ?
renderer.symbol(shape, boxX, boxY, wrapper.width, wrapper.height, deferredAttr) :
renderer.rect(boxX, boxY, wrapper.width, wrapper.height, 0, deferredAttr[STROKE_WIDTH]);
box.attr('fill', NONE).add(wrapper);
}
// apply the box attributes
if (!box.isImg) { // #1630
box.attr(extend({
width: mathRound(wrapper.width),
height: mathRound(wrapper.height)
}, deferredAttr));
}
deferredAttr = null;
}
}
/**
* This function runs after setting text or padding, but only if padding is changed
*/
function updateTextPadding() {
var styles = wrapper.styles,
textAlign = styles && styles.textAlign,
x = paddingLeft + padding * (1 - alignFactor),
y;
// determin y based on the baseline
y = baseline ? 0 : baselineOffset;
// compensate for alignment
if (defined(width) && bBox && (textAlign === 'center' || textAlign === 'right')) {
x += { center: 0.5, right: 1 }[textAlign] * (width - bBox.width);
}
// update if anything changed
if (x !== text.x || y !== text.y) {
text.attr('x', x);
if (y !== UNDEFINED) {
text.attr('y', y);
}
}
// record current values
text.x = x;
text.y = y;
}
/**
* Set a box attribute, or defer it if the box is not yet created
* @param {Object} key
* @param {Object} value
*/
function boxAttr(key, value) {
if (box) {
box.attr(key, value);
} else {
deferredAttr[key] = value;
}
}
/**
* After the text element is added, get the desired size of the border box
* and add it before the text in the DOM.
*/
wrapper.onAdd = function () {
text.add(wrapper);
wrapper.attr({
text: (str || str === 0) ? str : '', // alignment is available now // #3295: 0 not rendered if given as a value
x: x,
y: y
});
if (box && defined(anchorX)) {
wrapper.attr({
anchorX: anchorX,
anchorY: anchorY
});
}
};
/*
* Add specific attribute setters.
*/
// only change local variables
wrapper.widthSetter = function (value) {
width = value;
};
wrapper.heightSetter = function (value) {
height = value;
};
wrapper.paddingSetter = function (value) {
if (defined(value) && value !== padding) {
padding = wrapper.padding = value;
updateTextPadding();
}
};
wrapper.paddingLeftSetter = function (value) {
if (defined(value) && value !== paddingLeft) {
paddingLeft = value;
updateTextPadding();
}
};
// change local variable and prevent setting attribute on the group
wrapper.alignSetter = function (value) {
alignFactor = { left: 0, center: 0.5, right: 1 }[value];
};
// apply these to the box and the text alike
wrapper.textSetter = function (value) {
if (value !== UNDEFINED) {
text.textSetter(value);
}
updateBoxSize();
updateTextPadding();
};
// apply these to the box but not to the text
wrapper['stroke-widthSetter'] = function (value, key) {
if (value) {
needsBox = true;
}
crispAdjust = value % 2 / 2;
boxAttr(key, value);
};
wrapper.strokeSetter = wrapper.fillSetter = wrapper.rSetter = function (value, key) {
if (key === 'fill' && value) {
needsBox = true;
}
boxAttr(key, value);
};
wrapper.anchorXSetter = function (value, key) {
anchorX = value;
boxAttr(key, value + crispAdjust - wrapperX);
};
wrapper.anchorYSetter = function (value, key) {
anchorY = value;
boxAttr(key, value - wrapperY);
};
// rename attributes
wrapper.xSetter = function (value) {
wrapper.x = value; // for animation getter
if (alignFactor) {
value -= alignFactor * ((width || bBox.width) + padding);
}
wrapperX = mathRound(value);
wrapper.attr('translateX', wrapperX);
};
wrapper.ySetter = function (value) {
wrapperY = wrapper.y = mathRound(value);
wrapper.attr('translateY', wrapperY);
};
// Redirect certain methods to either the box or the text
var baseCss = wrapper.css;
return extend(wrapper, {
/**
* Pick up some properties and apply them to the text instead of the wrapper
*/
css: function (styles) {
if (styles) {
var textStyles = {};
styles = merge(styles); // create a copy to avoid altering the original object (#537)
each(wrapper.textProps, function (prop) {
if (styles[prop] !== UNDEFINED) {
textStyles[prop] = styles[prop];
delete styles[prop];
}
});
text.css(textStyles);
}
return baseCss.call(wrapper, styles);
},
/**
* Return the bounding box of the box, not the group
*/
getBBox: function () {
return {
width: bBox.width + 2 * padding,
height: bBox.height + 2 * padding,
x: bBox.x - padding,
y: bBox.y - padding
};
},
/**
* Apply the shadow to the box
*/
shadow: function (b) {
if (box) {
box.shadow(b);
}
return wrapper;
},
/**
* Destroy and release memory.
*/
destroy: function () {
// Added by button implementation
removeEvent(wrapper.element, 'mouseenter');
removeEvent(wrapper.element, 'mouseleave');
if (text) {
text = text.destroy();
}
if (box) {
box = box.destroy();
}
// Call base implementation to destroy the rest
SVGElement.prototype.destroy.call(wrapper);
// Release local pointers (#1298)
wrapper = renderer = updateBoxSize = updateTextPadding = boxAttr = null;
}
});
}
}; // end SVGRenderer
// general renderer
Renderer = SVGRenderer;
// extend SvgElement for useHTML option
extend(SVGElement.prototype, {
/**
* Apply CSS to HTML elements. This is used in text within SVG rendering and
* by the VML renderer
*/
htmlCss: function (styles) {
var wrapper = this,
element = wrapper.element,
textWidth = styles && element.tagName === 'SPAN' && styles.width;
if (textWidth) {
delete styles.width;
wrapper.textWidth = textWidth;
wrapper.updateTransform();
}
if (styles && styles.textOverflow === 'ellipsis') {
styles.whiteSpace = 'nowrap';
styles.overflow = 'hidden';
}
wrapper.styles = extend(wrapper.styles, styles);
css(wrapper.element, styles);
return wrapper;
},
/**
* VML and useHTML method for calculating the bounding box based on offsets
* @param {Boolean} refresh Whether to force a fresh value from the DOM or to
* use the cached value
*
* @return {Object} A hash containing values for x, y, width and height
*/
htmlGetBBox: function () {
var wrapper = this,
element = wrapper.element;
// faking getBBox in exported SVG in legacy IE
// faking getBBox in exported SVG in legacy IE (is this a duplicate of the fix for #1079?)
if (element.nodeName === 'text') {
element.style.position = ABSOLUTE;
}
return {
x: element.offsetLeft,
y: element.offsetTop,
width: element.offsetWidth,
height: element.offsetHeight
};
},
/**
* VML override private method to update elements based on internal
* properties based on SVG transform
*/
htmlUpdateTransform: function () {
// aligning non added elements is expensive
if (!this.added) {
this.alignOnAdd = true;
return;
}
var wrapper = this,
renderer = wrapper.renderer,
elem = wrapper.element,
translateX = wrapper.translateX || 0,
translateY = wrapper.translateY || 0,
x = wrapper.x || 0,
y = wrapper.y || 0,
align = wrapper.textAlign || 'left',
alignCorrection = { left: 0, center: 0.5, right: 1 }[align],
shadows = wrapper.shadows,
styles = wrapper.styles;
// apply translate
css(elem, {
marginLeft: translateX,
marginTop: translateY
});
if (shadows) { // used in labels/tooltip
each(shadows, function (shadow) {
css(shadow, {
marginLeft: translateX + 1,
marginTop: translateY + 1
});
});
}
// apply inversion
if (wrapper.inverted) { // wrapper is a group
each(elem.childNodes, function (child) {
renderer.invertChild(child, elem);
});
}
if (elem.tagName === 'SPAN') {
var width,
rotation = wrapper.rotation,
baseline,
textWidth = pInt(wrapper.textWidth),
currentTextTransform = [rotation, align, elem.innerHTML, wrapper.textWidth].join(',');
if (currentTextTransform !== wrapper.cTT) { // do the calculations and DOM access only if properties changed
baseline = renderer.fontMetrics(elem.style.fontSize).b;
// Renderer specific handling of span rotation
if (defined(rotation)) {
wrapper.setSpanRotation(rotation, alignCorrection, baseline);
}
width = pick(wrapper.elemWidth, elem.offsetWidth);
// Update textWidth
if (width > textWidth && /[ \-]/.test(elem.textContent || elem.innerText)) { // #983, #1254
css(elem, {
width: textWidth + PX,
display: 'block',
whiteSpace: (styles && styles.whiteSpace) || 'normal' // #3331
});
width = textWidth;
}
wrapper.getSpanCorrection(width, baseline, alignCorrection, rotation, align);
}
// apply position with correction
css(elem, {
left: (x + (wrapper.xCorr || 0)) + PX,
top: (y + (wrapper.yCorr || 0)) + PX
});
// force reflow in webkit to apply the left and top on useHTML element (#1249)
if (isWebKit) {
baseline = elem.offsetHeight; // assigned to baseline for JSLint purpose
}
// record current text transform
wrapper.cTT = currentTextTransform;
}
},
/**
* Set the rotation of an individual HTML span
*/
setSpanRotation: function (rotation, alignCorrection, baseline) {
var rotationStyle = {},
cssTransformKey = isIE ? '-ms-transform' : isWebKit ? '-webkit-transform' : isFirefox ? 'MozTransform' : isOpera ? '-o-transform' : '';
rotationStyle[cssTransformKey] = rotationStyle.transform = 'rotate(' + rotation + 'deg)';
rotationStyle[cssTransformKey + (isFirefox ? 'Origin' : '-origin')] = rotationStyle.transformOrigin = (alignCorrection * 100) + '% ' + baseline + 'px';
css(this.element, rotationStyle);
},
/**
* Get the correction in X and Y positioning as the element is rotated.
*/
getSpanCorrection: function (width, baseline, alignCorrection) {
this.xCorr = -width * alignCorrection;
this.yCorr = -baseline;
}
});
// Extend SvgRenderer for useHTML option.
extend(SVGRenderer.prototype, {
/**
* Create HTML text node. This is used by the VML renderer as well as the SVG
* renderer through the useHTML option.
*
* @param {String} str
* @param {Number} x
* @param {Number} y
*/
html: function (str, x, y) {
var wrapper = this.createElement('span'),
element = wrapper.element,
renderer = wrapper.renderer;
// Text setter
wrapper.textSetter = function (value) {
if (value !== element.innerHTML) {
delete this.bBox;
}
element.innerHTML = this.textStr = value;
};
// Various setters which rely on update transform
wrapper.xSetter = wrapper.ySetter = wrapper.alignSetter = wrapper.rotationSetter = function (value, key) {
if (key === 'align') {
key = 'textAlign'; // Do not overwrite the SVGElement.align method. Same as VML.
}
wrapper[key] = value;
wrapper.htmlUpdateTransform();
};
// Set the default attributes
wrapper.attr({
text: str,
x: mathRound(x),
y: mathRound(y)
})
.css({
position: ABSOLUTE,
fontFamily: this.style.fontFamily,
fontSize: this.style.fontSize
});
// Keep the whiteSpace style outside the wrapper.styles collection
element.style.whiteSpace = 'nowrap';
// Use the HTML specific .css method
wrapper.css = wrapper.htmlCss;
// This is specific for HTML within SVG
if (renderer.isSVG) {
wrapper.add = function (svgGroupWrapper) {
var htmlGroup,
container = renderer.box.parentNode,
parentGroup,
parents = [];
this.parentGroup = svgGroupWrapper;
// Create a mock group to hold the HTML elements
if (svgGroupWrapper) {
htmlGroup = svgGroupWrapper.div;
if (!htmlGroup) {
// Read the parent chain into an array and read from top down
parentGroup = svgGroupWrapper;
while (parentGroup) {
parents.push(parentGroup);
// Move up to the next parent group
parentGroup = parentGroup.parentGroup;
}
// Ensure dynamically updating position when any parent is translated
each(parents.reverse(), function (parentGroup) {
var htmlGroupStyle;
// Create a HTML div and append it to the parent div to emulate
// the SVG group structure
htmlGroup = parentGroup.div = parentGroup.div || createElement(DIV, {
className: attr(parentGroup.element, 'class')
}, {
position: ABSOLUTE,
left: (parentGroup.translateX || 0) + PX,
top: (parentGroup.translateY || 0) + PX
}, htmlGroup || container); // the top group is appended to container
// Shortcut
htmlGroupStyle = htmlGroup.style;
// Set listeners to update the HTML div's position whenever the SVG group
// position is changed
extend(parentGroup, {
translateXSetter: function (value, key) {
htmlGroupStyle.left = value + PX;
parentGroup[key] = value;
parentGroup.doTransform = true;
},
translateYSetter: function (value, key) {
htmlGroupStyle.top = value + PX;
parentGroup[key] = value;
parentGroup.doTransform = true;
},
visibilitySetter: function (value, key) {
htmlGroupStyle[key] = value;
}
});
});
}
} else {
htmlGroup = container;
}
htmlGroup.appendChild(element);
// Shared with VML:
wrapper.added = true;
if (wrapper.alignOnAdd) {
wrapper.htmlUpdateTransform();
}
return wrapper;
};
}
return wrapper;
}
});
/* ****************************************************************************
* *
* START OF INTERNET EXPLORER <= 8 SPECIFIC CODE *
* *
* For applications and websites that don't need IE support, like platform *
* targeted mobile apps and web apps, this code can be removed. *
* *
*****************************************************************************/
/**
* @constructor
*/
var VMLRenderer, VMLElement;
if (!hasSVG && !useCanVG) {
/**
* The VML element wrapper.
*/
VMLElement = {
/**
* Initialize a new VML element wrapper. It builds the markup as a string
* to minimize DOM traffic.
* @param {Object} renderer
* @param {Object} nodeName
*/
init: function (renderer, nodeName) {
var wrapper = this,
markup = ['<', nodeName, ' filled="f" stroked="f"'],
style = ['position: ', ABSOLUTE, ';'],
isDiv = nodeName === DIV;
// divs and shapes need size
if (nodeName === 'shape' || isDiv) {
style.push('left:0;top:0;width:1px;height:1px;');
}
style.push('visibility: ', isDiv ? HIDDEN : VISIBLE);
markup.push(' style="', style.join(''), '"/>');
// create element with default attributes and style
if (nodeName) {
markup = isDiv || nodeName === 'span' || nodeName === 'img' ?
markup.join('')
: renderer.prepVML(markup);
wrapper.element = createElement(markup);
}
wrapper.renderer = renderer;
},
/**
* Add the node to the given parent
* @param {Object} parent
*/
add: function (parent) {
var wrapper = this,
renderer = wrapper.renderer,
element = wrapper.element,
box = renderer.box,
inverted = parent && parent.inverted,
// get the parent node
parentNode = parent ?
parent.element || parent :
box;
// if the parent group is inverted, apply inversion on all children
if (inverted) { // only on groups
renderer.invertChild(element, parentNode);
}
// append it
parentNode.appendChild(element);
// align text after adding to be able to read offset
wrapper.added = true;
if (wrapper.alignOnAdd && !wrapper.deferUpdateTransform) {
wrapper.updateTransform();
}
// fire an event for internal hooks
if (wrapper.onAdd) {
wrapper.onAdd();
}
return wrapper;
},
/**
* VML always uses htmlUpdateTransform
*/
updateTransform: SVGElement.prototype.htmlUpdateTransform,
/**
* Set the rotation of a span with oldIE's filter
*/
setSpanRotation: function () {
// Adjust for alignment and rotation. Rotation of useHTML content is not yet implemented
// but it can probably be implemented for Firefox 3.5+ on user request. FF3.5+
// has support for CSS3 transform. The getBBox method also needs to be updated
// to compensate for the rotation, like it currently does for SVG.
// Test case: http://jsfiddle.net/highcharts/Ybt44/
var rotation = this.rotation,
costheta = mathCos(rotation * deg2rad),
sintheta = mathSin(rotation * deg2rad);
css(this.element, {
filter: rotation ? ['progid:DXImageTransform.Microsoft.Matrix(M11=', costheta,
', M12=', -sintheta, ', M21=', sintheta, ', M22=', costheta,
', sizingMethod=\'auto expand\')'].join('') : NONE
});
},
/**
* Get the positioning correction for the span after rotating.
*/
getSpanCorrection: function (width, baseline, alignCorrection, rotation, align) {
var costheta = rotation ? mathCos(rotation * deg2rad) : 1,
sintheta = rotation ? mathSin(rotation * deg2rad) : 0,
height = pick(this.elemHeight, this.element.offsetHeight),
quad,
nonLeft = align && align !== 'left';
// correct x and y
this.xCorr = costheta < 0 && -width;
this.yCorr = sintheta < 0 && -height;
// correct for baseline and corners spilling out after rotation
quad = costheta * sintheta < 0;
this.xCorr += sintheta * baseline * (quad ? 1 - alignCorrection : alignCorrection);
this.yCorr -= costheta * baseline * (rotation ? (quad ? alignCorrection : 1 - alignCorrection) : 1);
// correct for the length/height of the text
if (nonLeft) {
this.xCorr -= width * alignCorrection * (costheta < 0 ? -1 : 1);
if (rotation) {
this.yCorr -= height * alignCorrection * (sintheta < 0 ? -1 : 1);
}
css(this.element, {
textAlign: align
});
}
},
/**
* Converts a subset of an SVG path definition to its VML counterpart. Takes an array
* as the parameter and returns a string.
*/
pathToVML: function (value) {
// convert paths
var i = value.length,
path = [];
while (i--) {
// Multiply by 10 to allow subpixel precision.
// Substracting half a pixel seems to make the coordinates
// align with SVG, but this hasn't been tested thoroughly
if (isNumber(value[i])) {
path[i] = mathRound(value[i] * 10) - 5;
} else if (value[i] === 'Z') { // close the path
path[i] = 'x';
} else {
path[i] = value[i];
// When the start X and end X coordinates of an arc are too close,
// they are rounded to the same value above. In this case, substract or
// add 1 from the end X and Y positions. #186, #760, #1371, #1410.
if (value.isArc && (value[i] === 'wa' || value[i] === 'at')) {
// Start and end X
if (path[i + 5] === path[i + 7]) {
path[i + 7] += value[i + 7] > value[i + 5] ? 1 : -1;
}
// Start and end Y
if (path[i + 6] === path[i + 8]) {
path[i + 8] += value[i + 8] > value[i + 6] ? 1 : -1;
}
}
}
}
// Loop up again to handle path shortcuts (#2132)
/*while (i++ < path.length) {
if (path[i] === 'H') { // horizontal line to
path[i] = 'L';
path.splice(i + 2, 0, path[i - 1]);
} else if (path[i] === 'V') { // vertical line to
path[i] = 'L';
path.splice(i + 1, 0, path[i - 2]);
}
}*/
return path.join(' ') || 'x';
},
/**
* Set the element's clipping to a predefined rectangle
*
* @param {String} id The id of the clip rectangle
*/
clip: function (clipRect) {
var wrapper = this,
clipMembers,
cssRet;
if (clipRect) {
clipMembers = clipRect.members;
erase(clipMembers, wrapper); // Ensure unique list of elements (#1258)
clipMembers.push(wrapper);
wrapper.destroyClip = function () {
erase(clipMembers, wrapper);
};
cssRet = clipRect.getCSS(wrapper);
} else {
if (wrapper.destroyClip) {
wrapper.destroyClip();
}
cssRet = { clip: docMode8 ? 'inherit' : 'rect(auto)' }; // #1214
}
return wrapper.css(cssRet);
},
/**
* Set styles for the element
* @param {Object} styles
*/
css: SVGElement.prototype.htmlCss,
/**
* Removes a child either by removeChild or move to garbageBin.
* Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not.
*/
safeRemoveChild: function (element) {
// discardElement will detach the node from its parent before attaching it
// to the garbage bin. Therefore it is important that the node is attached and have parent.
if (element.parentNode) {
discardElement(element);
}
},
/**
* Extend element.destroy by removing it from the clip members array
*/
destroy: function () {
if (this.destroyClip) {
this.destroyClip();
}
return SVGElement.prototype.destroy.apply(this);
},
/**
* Add an event listener. VML override for normalizing event parameters.
* @param {String} eventType
* @param {Function} handler
*/
on: function (eventType, handler) {
// simplest possible event model for internal use
this.element['on' + eventType] = function () {
var evt = win.event;
evt.target = evt.srcElement;
handler(evt);
};
return this;
},
/**
* In stacked columns, cut off the shadows so that they don't overlap
*/
cutOffPath: function (path, length) {
var len;
path = path.split(/[ ,]/);
len = path.length;
if (len === 9 || len === 11) {
path[len - 4] = path[len - 2] = pInt(path[len - 2]) - 10 * length;
}
return path.join(' ');
},
/**
* Apply a drop shadow by copying elements and giving them different strokes
* @param {Boolean|Object} shadowOptions
*/
shadow: function (shadowOptions, group, cutOff) {
var shadows = [],
i,
element = this.element,
renderer = this.renderer,
shadow,
elemStyle = element.style,
markup,
path = element.path,
strokeWidth,
modifiedPath,
shadowWidth,
shadowElementOpacity;
// some times empty paths are not strings
if (path && typeof path.value !== 'string') {
path = 'x';
}
modifiedPath = path;
if (shadowOptions) {
shadowWidth = pick(shadowOptions.width, 3);
shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth;
for (i = 1; i <= 3; i++) {
strokeWidth = (shadowWidth * 2) + 1 - (2 * i);
// Cut off shadows for stacked column items
if (cutOff) {
modifiedPath = this.cutOffPath(path.value, strokeWidth + 0.5);
}
markup = ['<shape isShadow="true" strokeweight="', strokeWidth,
'" filled="false" path="', modifiedPath,
'" coordsize="10 10" style="', element.style.cssText, '" />'];
shadow = createElement(renderer.prepVML(markup),
null, {
left: pInt(elemStyle.left) + pick(shadowOptions.offsetX, 1),
top: pInt(elemStyle.top) + pick(shadowOptions.offsetY, 1)
}
);
if (cutOff) {
shadow.cutOff = strokeWidth + 1;
}
// apply the opacity
markup = ['<stroke color="', shadowOptions.color || 'black', '" opacity="', shadowElementOpacity * i, '"/>'];
createElement(renderer.prepVML(markup), null, null, shadow);
// insert it
if (group) {
group.element.appendChild(shadow);
} else {
element.parentNode.insertBefore(shadow, element);
}
// record it
shadows.push(shadow);
}
this.shadows = shadows;
}
return this;
},
updateShadows: noop, // Used in SVG only
setAttr: function (key, value) {
if (docMode8) { // IE8 setAttribute bug
this.element[key] = value;
} else {
this.element.setAttribute(key, value);
}
},
classSetter: function (value) {
// IE8 Standards mode has problems retrieving the className unless set like this
this.element.className = value;
},
dashstyleSetter: function (value, key, element) {
var strokeElem = element.getElementsByTagName('stroke')[0] ||
createElement(this.renderer.prepVML(['<stroke/>']), null, null, element);
strokeElem[key] = value || 'solid';
this[key] = value; /* because changing stroke-width will change the dash length
and cause an epileptic effect */
},
dSetter: function (value, key, element) {
var i,
shadows = this.shadows;
value = value || [];
this.d = value.join && value.join(' '); // used in getter for animation
element.path = value = this.pathToVML(value);
// update shadows
if (shadows) {
i = shadows.length;
while (i--) {
shadows[i].path = shadows[i].cutOff ? this.cutOffPath(value, shadows[i].cutOff) : value;
}
}
this.setAttr(key, value);
},
fillSetter: function (value, key, element) {
var nodeName = element.nodeName;
if (nodeName === 'SPAN') { // text color
element.style.color = value;
} else if (nodeName !== 'IMG') { // #1336
element.filled = value !== NONE;
this.setAttr('fillcolor', this.renderer.color(value, element, key, this));
}
},
opacitySetter: noop, // Don't bother - animation is too slow and filters introduce artifacts
rotationSetter: function (value, key, element) {
var style = element.style;
this[key] = style[key] = value; // style is for #1873
// Correction for the 1x1 size of the shape container. Used in gauge needles.
style.left = -mathRound(mathSin(value * deg2rad) + 1) + PX;
style.top = mathRound(mathCos(value * deg2rad)) + PX;
},
strokeSetter: function (value, key, element) {
this.setAttr('strokecolor', this.renderer.color(value, element, key));
},
'stroke-widthSetter': function (value, key, element) {
element.stroked = !!value; // VML "stroked" attribute
this[key] = value; // used in getter, issue #113
if (isNumber(value)) {
value += PX;
}
this.setAttr('strokeweight', value);
},
titleSetter: function (value, key) {
this.setAttr(key, value);
},
visibilitySetter: function (value, key, element) {
// Handle inherited visibility
if (value === 'inherit') {
value = VISIBLE;
}
// Let the shadow follow the main element
if (this.shadows) {
each(this.shadows, function (shadow) {
shadow.style[key] = value;
});
}
// Instead of toggling the visibility CSS property, move the div out of the viewport.
// This works around #61 and #586
if (element.nodeName === 'DIV') {
value = value === HIDDEN ? '-999em' : 0;
// In order to redraw, IE7 needs the div to be visible when tucked away
// outside the viewport. So the visibility is actually opposite of
// the expected value. This applies to the tooltip only.
if (!docMode8) {
element.style[key] = value ? VISIBLE : HIDDEN;
}
key = 'top';
}
element.style[key] = value;
},
xSetter: function (value, key, element) {
this[key] = value; // used in getter
if (key === 'x') {
key = 'left';
} else if (key === 'y') {
key = 'top';
}/* else {
value = mathMax(0, value); // don't set width or height below zero (#311)
}*/
// clipping rectangle special
if (this.updateClipping) {
this[key] = value; // the key is now 'left' or 'top' for 'x' and 'y'
this.updateClipping();
} else {
// normal
element.style[key] = value;
}
},
zIndexSetter: function (value, key, element) {
element.style[key] = value;
}
};
Highcharts.VMLElement = VMLElement = extendClass(SVGElement, VMLElement);
// Some shared setters
VMLElement.prototype.ySetter =
VMLElement.prototype.widthSetter =
VMLElement.prototype.heightSetter =
VMLElement.prototype.xSetter;
/**
* The VML renderer
*/
var VMLRendererExtension = { // inherit SVGRenderer
Element: VMLElement,
isIE8: userAgent.indexOf('MSIE 8.0') > -1,
/**
* Initialize the VMLRenderer
* @param {Object} container
* @param {Number} width
* @param {Number} height
*/
init: function (container, width, height, style) {
var renderer = this,
boxWrapper,
box,
css;
renderer.alignedObjects = [];
boxWrapper = renderer.createElement(DIV)
.css(extend(this.getStyle(style), { position: RELATIVE}));
box = boxWrapper.element;
container.appendChild(boxWrapper.element);
// generate the containing box
renderer.isVML = true;
renderer.box = box;
renderer.boxWrapper = boxWrapper;
renderer.cache = {};
renderer.setSize(width, height, false);
// The only way to make IE6 and IE7 print is to use a global namespace. However,
// with IE8 the only way to make the dynamic shapes visible in screen and print mode
// seems to be to add the xmlns attribute and the behaviour style inline.
if (!doc.namespaces.hcv) {
doc.namespaces.add('hcv', 'urn:schemas-microsoft-com:vml');
// Setup default CSS (#2153, #2368, #2384)
css = 'hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke' +
'{ behavior:url(#default#VML); display: inline-block; } ';
try {
doc.createStyleSheet().cssText = css;
} catch (e) {
doc.styleSheets[0].cssText += css;
}
}
},
/**
* Detect whether the renderer is hidden. This happens when one of the parent elements
* has display: none
*/
isHidden: function () {
return !this.box.offsetWidth;
},
/**
* Define a clipping rectangle. In VML it is accomplished by storing the values
* for setting the CSS style to all associated members.
*
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
clipRect: function (x, y, width, height) {
// create a dummy element
var clipRect = this.createElement(),
isObj = isObject(x);
// mimic a rectangle with its style object for automatic updating in attr
return extend(clipRect, {
members: [],
count: 0,
left: (isObj ? x.x : x) + 1,
top: (isObj ? x.y : y) + 1,
width: (isObj ? x.width : width) - 1,
height: (isObj ? x.height : height) - 1,
getCSS: function (wrapper) {
var element = wrapper.element,
nodeName = element.nodeName,
isShape = nodeName === 'shape',
inverted = wrapper.inverted,
rect = this,
top = rect.top - (isShape ? element.offsetTop : 0),
left = rect.left,
right = left + rect.width,
bottom = top + rect.height,
ret = {
clip: 'rect(' +
mathRound(inverted ? left : top) + 'px,' +
mathRound(inverted ? bottom : right) + 'px,' +
mathRound(inverted ? right : bottom) + 'px,' +
mathRound(inverted ? top : left) + 'px)'
};
// issue 74 workaround
if (!inverted && docMode8 && nodeName === 'DIV') {
extend(ret, {
width: right + PX,
height: bottom + PX
});
}
return ret;
},
// used in attr and animation to update the clipping of all members
updateClipping: function () {
each(clipRect.members, function (member) {
if (member.element) { // Deleted series, like in stock/members/series-remove demo. Should be removed from members, but this will do.
member.css(clipRect.getCSS(member));
}
});
}
});
},
/**
* Take a color and return it if it's a string, make it a gradient if it's a
* gradient configuration object, and apply opacity.
*
* @param {Object} color The color or config object
*/
color: function (color, elem, prop, wrapper) {
var renderer = this,
colorObject,
regexRgba = /^rgba/,
markup,
fillType,
ret = NONE;
// Check for linear or radial gradient
if (color && color.linearGradient) {
fillType = 'gradient';
} else if (color && color.radialGradient) {
fillType = 'pattern';
}
if (fillType) {
var stopColor,
stopOpacity,
gradient = color.linearGradient || color.radialGradient,
x1,
y1,
x2,
y2,
opacity1,
opacity2,
color1,
color2,
fillAttr = '',
stops = color.stops,
firstStop,
lastStop,
colors = [],
addFillNode = function () {
// Add the fill subnode. When colors attribute is used, the meanings of opacity and o:opacity2
// are reversed.
markup = ['<fill colors="' + colors.join(',') + '" opacity="', opacity2, '" o:opacity2="', opacity1,
'" type="', fillType, '" ', fillAttr, 'focus="100%" method="any" />'];
createElement(renderer.prepVML(markup), null, null, elem);
};
// Extend from 0 to 1
firstStop = stops[0];
lastStop = stops[stops.length - 1];
if (firstStop[0] > 0) {
stops.unshift([
0,
firstStop[1]
]);
}
if (lastStop[0] < 1) {
stops.push([
1,
lastStop[1]
]);
}
// Compute the stops
each(stops, function (stop, i) {
if (regexRgba.test(stop[1])) {
colorObject = Color(stop[1]);
stopColor = colorObject.get('rgb');
stopOpacity = colorObject.get('a');
} else {
stopColor = stop[1];
stopOpacity = 1;
}
// Build the color attribute
colors.push((stop[0] * 100) + '% ' + stopColor);
// Only start and end opacities are allowed, so we use the first and the last
if (!i) {
opacity1 = stopOpacity;
color2 = stopColor;
} else {
opacity2 = stopOpacity;
color1 = stopColor;
}
});
// Apply the gradient to fills only.
if (prop === 'fill') {
// Handle linear gradient angle
if (fillType === 'gradient') {
x1 = gradient.x1 || gradient[0] || 0;
y1 = gradient.y1 || gradient[1] || 0;
x2 = gradient.x2 || gradient[2] || 0;
y2 = gradient.y2 || gradient[3] || 0;
fillAttr = 'angle="' + (90 - math.atan(
(y2 - y1) / // y vector
(x2 - x1) // x vector
) * 180 / mathPI) + '"';
addFillNode();
// Radial (circular) gradient
} else {
var r = gradient.r,
sizex = r * 2,
sizey = r * 2,
cx = gradient.cx,
cy = gradient.cy,
radialReference = elem.radialReference,
bBox,
applyRadialGradient = function () {
if (radialReference) {
bBox = wrapper.getBBox();
cx += (radialReference[0] - bBox.x) / bBox.width - 0.5;
cy += (radialReference[1] - bBox.y) / bBox.height - 0.5;
sizex *= radialReference[2] / bBox.width;
sizey *= radialReference[2] / bBox.height;
}
fillAttr = 'src="' + defaultOptions.global.VMLRadialGradientURL + '" ' +
'size="' + sizex + ',' + sizey + '" ' +
'origin="0.5,0.5" ' +
'position="' + cx + ',' + cy + '" ' +
'color2="' + color2 + '" ';
addFillNode();
};
// Apply radial gradient
if (wrapper.added) {
applyRadialGradient();
} else {
// We need to know the bounding box to get the size and position right
wrapper.onAdd = applyRadialGradient;
}
// The fill element's color attribute is broken in IE8 standards mode, so we
// need to set the parent shape's fillcolor attribute instead.
ret = color1;
}
// Gradients are not supported for VML stroke, return the first color. #722.
} else {
ret = stopColor;
}
// if the color is an rgba color, split it and add a fill node
// to hold the opacity component
} else if (regexRgba.test(color) && elem.tagName !== 'IMG') {
colorObject = Color(color);
markup = ['<', prop, ' opacity="', colorObject.get('a'), '"/>'];
createElement(this.prepVML(markup), null, null, elem);
ret = colorObject.get('rgb');
} else {
var propNodes = elem.getElementsByTagName(prop); // 'stroke' or 'fill' node
if (propNodes.length) {
propNodes[0].opacity = 1;
propNodes[0].type = 'solid';
}
ret = color;
}
return ret;
},
/**
* Take a VML string and prepare it for either IE8 or IE6/IE7.
* @param {Array} markup A string array of the VML markup to prepare
*/
prepVML: function (markup) {
var vmlStyle = 'display:inline-block;behavior:url(#default#VML);',
isIE8 = this.isIE8;
markup = markup.join('');
if (isIE8) { // add xmlns and style inline
markup = markup.replace('/>', ' xmlns="urn:schemas-microsoft-com:vml" />');
if (markup.indexOf('style="') === -1) {
markup = markup.replace('/>', ' style="' + vmlStyle + '" />');
} else {
markup = markup.replace('style="', 'style="' + vmlStyle);
}
} else { // add namespace
markup = markup.replace('<', '<hcv:');
}
return markup;
},
/**
* Create rotated and aligned text
* @param {String} str
* @param {Number} x
* @param {Number} y
*/
text: SVGRenderer.prototype.html,
/**
* Create and return a path element
* @param {Array} path
*/
path: function (path) {
var attr = {
// subpixel precision down to 0.1 (width and height = 1px)
coordsize: '10 10'
};
if (isArray(path)) {
attr.d = path;
} else if (isObject(path)) { // attributes
extend(attr, path);
}
// create the shape
return this.createElement('shape').attr(attr);
},
/**
* Create and return a circle element. In VML circles are implemented as
* shapes, which is faster than v:oval
* @param {Number} x
* @param {Number} y
* @param {Number} r
*/
circle: function (x, y, r) {
var circle = this.symbol('circle');
if (isObject(x)) {
r = x.r;
y = x.y;
x = x.x;
}
circle.isCircle = true; // Causes x and y to mean center (#1682)
circle.r = r;
return circle.attr({ x: x, y: y });
},
/**
* Create a group using an outer div and an inner v:group to allow rotating
* and flipping. A simple v:group would have problems with positioning
* child HTML elements and CSS clip.
*
* @param {String} name The name of the group
*/
g: function (name) {
var wrapper,
attribs;
// set the class name
if (name) {
attribs = { 'className': PREFIX + name, 'class': PREFIX + name };
}
// the div to hold HTML and clipping
wrapper = this.createElement(DIV).attr(attribs);
return wrapper;
},
/**
* VML override to create a regular HTML image
* @param {String} src
* @param {Number} x
* @param {Number} y
* @param {Number} width
* @param {Number} height
*/
image: function (src, x, y, width, height) {
var obj = this.createElement('img')
.attr({ src: src });
if (arguments.length > 1) {
obj.attr({
x: x,
y: y,
width: width,
height: height
});
}
return obj;
},
/**
* For rectangles, VML uses a shape for rect to overcome bugs and rotation problems
*/
createElement: function (nodeName) {
return nodeName === 'rect' ? this.symbol(nodeName) : SVGRenderer.prototype.createElement.call(this, nodeName);
},
/**
* In the VML renderer, each child of an inverted div (group) is inverted
* @param {Object} element
* @param {Object} parentNode
*/
invertChild: function (element, parentNode) {
var ren = this,
parentStyle = parentNode.style,
imgStyle = element.tagName === 'IMG' && element.style; // #1111
css(element, {
flip: 'x',
left: pInt(parentStyle.width) - (imgStyle ? pInt(imgStyle.top) : 1),
top: pInt(parentStyle.height) - (imgStyle ? pInt(imgStyle.left) : 1),
rotation: -90
});
// Recursively invert child elements, needed for nested composite shapes like box plots and error bars. #1680, #1806.
each(element.childNodes, function (child) {
ren.invertChild(child, element);
});
},
/**
* Symbol definitions that override the parent SVG renderer's symbols
*
*/
symbols: {
// VML specific arc function
arc: function (x, y, w, h, options) {
var start = options.start,
end = options.end,
radius = options.r || w || h,
innerRadius = options.innerR,
cosStart = mathCos(start),
sinStart = mathSin(start),
cosEnd = mathCos(end),
sinEnd = mathSin(end),
ret;
if (end - start === 0) { // no angle, don't show it.
return ['x'];
}
ret = [
'wa', // clockwise arc to
x - radius, // left
y - radius, // top
x + radius, // right
y + radius, // bottom
x + radius * cosStart, // start x
y + radius * sinStart, // start y
x + radius * cosEnd, // end x
y + radius * sinEnd // end y
];
if (options.open && !innerRadius) {
ret.push(
'e',
M,
x,// - innerRadius,
y// - innerRadius
);
}
ret.push(
'at', // anti clockwise arc to
x - innerRadius, // left
y - innerRadius, // top
x + innerRadius, // right
y + innerRadius, // bottom
x + innerRadius * cosEnd, // start x
y + innerRadius * sinEnd, // start y
x + innerRadius * cosStart, // end x
y + innerRadius * sinStart, // end y
'x', // finish path
'e' // close
);
ret.isArc = true;
return ret;
},
// Add circle symbol path. This performs significantly faster than v:oval.
circle: function (x, y, w, h, wrapper) {
if (wrapper) {
w = h = 2 * wrapper.r;
}
// Center correction, #1682
if (wrapper && wrapper.isCircle) {
x -= w / 2;
y -= h / 2;
}
// Return the path
return [
'wa', // clockwisearcto
x, // left
y, // top
x + w, // right
y + h, // bottom
x + w, // start x
y + h / 2, // start y
x + w, // end x
y + h / 2, // end y
//'x', // finish path
'e' // close
];
},
/**
* Add rectangle symbol path which eases rotation and omits arcsize problems
* compared to the built-in VML roundrect shape. When borders are not rounded,
* use the simpler square path, else use the callout path without the arrow.
*/
rect: function (x, y, w, h, options) {
return SVGRenderer.prototype.symbols[
!defined(options) || !options.r ? 'square' : 'callout'
].call(0, x, y, w, h, options);
}
}
};
Highcharts.VMLRenderer = VMLRenderer = function () {
this.init.apply(this, arguments);
};
VMLRenderer.prototype = merge(SVGRenderer.prototype, VMLRendererExtension);
// general renderer
Renderer = VMLRenderer;
}
// This method is used with exporting in old IE, when emulating SVG (see #2314)
SVGRenderer.prototype.measureSpanWidth = function (text, styles) {
var measuringSpan = doc.createElement('span'),
offsetWidth,
textNode = doc.createTextNode(text);
measuringSpan.appendChild(textNode);
css(measuringSpan, styles);
this.box.appendChild(measuringSpan);
offsetWidth = measuringSpan.offsetWidth;
discardElement(measuringSpan); // #2463
return offsetWidth;
};
/* ****************************************************************************
* *
* END OF INTERNET EXPLORER <= 8 SPECIFIC CODE *
* *
*****************************************************************************/
/* ****************************************************************************
* *
* START OF ANDROID < 3 SPECIFIC CODE. THIS CAN BE REMOVED IF YOU'RE NOT *
* TARGETING THAT SYSTEM. *
* *
*****************************************************************************/
var CanVGRenderer,
CanVGController;
if (useCanVG) {
/**
* The CanVGRenderer is empty from start to keep the source footprint small.
* When requested, the CanVGController downloads the rest of the source packaged
* together with the canvg library.
*/
Highcharts.CanVGRenderer = CanVGRenderer = function () {
// Override the global SVG namespace to fake SVG/HTML that accepts CSS
SVG_NS = 'http://www.w3.org/1999/xhtml';
};
/**
* Start with an empty symbols object. This is needed when exporting is used (exporting.src.js will add a few symbols), but
* the implementation from SvgRenderer will not be merged in until first render.
*/
CanVGRenderer.prototype.symbols = {};
/**
* Handles on demand download of canvg rendering support.
*/
CanVGController = (function () {
// List of renderering calls
var deferredRenderCalls = [];
/**
* When downloaded, we are ready to draw deferred charts.
*/
function drawDeferred() {
var callLength = deferredRenderCalls.length,
callIndex;
// Draw all pending render calls
for (callIndex = 0; callIndex < callLength; callIndex++) {
deferredRenderCalls[callIndex]();
}
// Clear the list
deferredRenderCalls = [];
}
return {
push: function (func, scriptLocation) {
// Only get the script once
if (deferredRenderCalls.length === 0) {
getScript(scriptLocation, drawDeferred);
}
// Register render call
deferredRenderCalls.push(func);
}
};
}());
Renderer = CanVGRenderer;
} // end CanVGRenderer
/* ****************************************************************************
* *
* END OF ANDROID < 3 SPECIFIC CODE *
* *
*****************************************************************************/
/**
* The Tick class
*/
function Tick(axis, pos, type, noLabel) {
this.axis = axis;
this.pos = pos;
this.type = type || '';
this.isNew = true;
if (!type && !noLabel) {
this.addLabel();
}
}
Tick.prototype = {
/**
* Write the tick label
*/
addLabel: function () {
var tick = this,
axis = tick.axis,
options = axis.options,
chart = axis.chart,
categories = axis.categories,
names = axis.names,
pos = tick.pos,
labelOptions = options.labels,
str,
tickPositions = axis.tickPositions,
isFirst = pos === tickPositions[0],
isLast = pos === tickPositions[tickPositions.length - 1],
value = categories ?
pick(categories[pos], names[pos], pos) :
pos,
label = tick.label,
tickPositionInfo = tickPositions.info,
dateTimeLabelFormat;
// Set the datetime label format. If a higher rank is set for this position, use that. If not,
// use the general format.
if (axis.isDatetimeAxis && tickPositionInfo) {
dateTimeLabelFormat = options.dateTimeLabelFormats[tickPositionInfo.higherRanks[pos] || tickPositionInfo.unitName];
}
// set properties for access in render method
tick.isFirst = isFirst;
tick.isLast = isLast;
// get the string
str = axis.labelFormatter.call({
axis: axis,
chart: chart,
isFirst: isFirst,
isLast: isLast,
dateTimeLabelFormat: dateTimeLabelFormat,
value: axis.isLog ? correctFloat(lin2log(value)) : value
});
// prepare CSS
//css = width && { width: mathMax(1, mathRound(width - 2 * (labelOptions.padding || 10))) + PX };
// first call
if (!defined(label)) {
tick.label = label =
defined(str) && labelOptions.enabled ?
chart.renderer.text(
str,
0,
0,
labelOptions.useHTML
)
//.attr(attr)
// without position absolute, IE export sometimes is wrong
.css(merge(labelOptions.style))
.add(axis.labelGroup) :
null;
tick.labelLength = label && label.getBBox().width; // Un-rotated length
tick.rotation = 0; // Base value to detect change for new calls to getBBox
// update
} else if (label) {
label.attr({ text: str });
}
},
/**
* Get the offset height or width of the label
*/
getLabelSize: function () {
return this.label ?
this.label.getBBox()[this.axis.horiz ? 'height' : 'width'] :
0;
},
/**
* Handle the label overflow by adjusting the labels to the left and right edge, or
* hide them if they collide into the neighbour label.
*/
handleOverflow: function (xy) {
var axis = this.axis,
pxPos = xy.x,
chartWidth = axis.chart.chartWidth,
spacing = axis.chart.spacing,
leftBound = pick(axis.labelLeft, spacing[3]),
rightBound = pick(axis.labelRight, chartWidth - spacing[1]),
label = this.label,
rotation = this.rotation,
factor = { left: 0, center: 0.5, right: 1 }[axis.labelAlign],
labelWidth = label.getBBox().width,
slotWidth = axis.slotWidth,
leftPos,
rightPos,
textWidth;
// Check if the label overshoots the chart spacing box. If it does, move it.
// If it now overshoots the slotWidth, add ellipsis.
if (!rotation) {
leftPos = pxPos - factor * labelWidth;
rightPos = pxPos + factor * labelWidth;
if (leftPos < leftBound) {
slotWidth -= leftBound - leftPos;
xy.x = leftBound;
label.attr({ align: 'left' });
} else if (rightPos > rightBound) {
slotWidth -= rightPos - rightBound;
xy.x = rightBound;
label.attr({ align: 'right' });
}
if (labelWidth > slotWidth) {
textWidth = slotWidth;
}
// Add ellipsis to prevent rotated labels to be clipped against the edge of the chart
} else if (rotation < 0 && pxPos - factor * labelWidth < leftBound) {
textWidth = mathRound(pxPos / mathCos(rotation * deg2rad) - leftBound);
} else if (rotation > 0 && pxPos + factor * labelWidth > rightBound) {
textWidth = mathRound((chartWidth - pxPos) / mathCos(rotation * deg2rad));
}
if (textWidth) {
label.css({
width: textWidth,
textOverflow: 'ellipsis'
});
}
},
/**
* Get the x and y position for ticks and labels
*/
getPosition: function (horiz, pos, tickmarkOffset, old) {
var axis = this.axis,
chart = axis.chart,
cHeight = (old && chart.oldChartHeight) || chart.chartHeight;
return {
x: horiz ?
axis.translate(pos + tickmarkOffset, null, null, old) + axis.transB :
axis.left + axis.offset + (axis.opposite ? ((old && chart.oldChartWidth) || chart.chartWidth) - axis.right - axis.left : 0),
y: horiz ?
cHeight - axis.bottom + axis.offset - (axis.opposite ? axis.height : 0) :
cHeight - axis.translate(pos + tickmarkOffset, null, null, old) - axis.transB
};
},
/**
* Get the x, y position of the tick label
*/
getLabelPosition: function (x, y, label, horiz, labelOptions, tickmarkOffset, index, step) {
var axis = this.axis,
transA = axis.transA,
reversed = axis.reversed,
staggerLines = axis.staggerLines,
rotCorr = axis.tickRotCorr || { x: 0, y: 0 },
yOffset = pick(labelOptions.y, rotCorr.y + (axis.side === 2 ? 8 : -(label.getBBox().height / 2))),
line;
x = x + labelOptions.x + rotCorr.x - (tickmarkOffset && horiz ?
tickmarkOffset * transA * (reversed ? -1 : 1) : 0);
y = y + yOffset - (tickmarkOffset && !horiz ?
tickmarkOffset * transA * (reversed ? 1 : -1) : 0);
// Correct for staggered labels
if (staggerLines) {
line = (index / (step || 1) % staggerLines);
y += line * (axis.labelOffset / staggerLines);
}
return {
x: x,
y: mathRound(y)
};
},
/**
* Extendible method to return the path of the marker
*/
getMarkPath: function (x, y, tickLength, tickWidth, horiz, renderer) {
return renderer.crispLine([
M,
x,
y,
L,
x + (horiz ? 0 : -tickLength),
y + (horiz ? tickLength : 0)
], tickWidth);
},
/**
* Put everything in place
*
* @param index {Number}
* @param old {Boolean} Use old coordinates to prepare an animation into new position
*/
render: function (index, old, opacity) {
var tick = this,
axis = tick.axis,
options = axis.options,
chart = axis.chart,
renderer = chart.renderer,
horiz = axis.horiz,
type = tick.type,
label = tick.label,
pos = tick.pos,
labelOptions = options.labels,
gridLine = tick.gridLine,
gridPrefix = type ? type + 'Grid' : 'grid',
tickPrefix = type ? type + 'Tick' : 'tick',
gridLineWidth = options[gridPrefix + 'LineWidth'],
gridLineColor = options[gridPrefix + 'LineColor'],
dashStyle = options[gridPrefix + 'LineDashStyle'],
tickLength = options[tickPrefix + 'Length'],
tickWidth = options[tickPrefix + 'Width'] || 0,
tickColor = options[tickPrefix + 'Color'],
tickPosition = options[tickPrefix + 'Position'],
gridLinePath,
mark = tick.mark,
markPath,
step = /*axis.labelStep || */labelOptions.step,
attribs,
show = true,
tickmarkOffset = axis.tickmarkOffset,
xy = tick.getPosition(horiz, pos, tickmarkOffset, old),
x = xy.x,
y = xy.y,
reverseCrisp = ((horiz && x === axis.pos + axis.len) || (!horiz && y === axis.pos)) ? -1 : 1; // #1480, #1687
opacity = pick(opacity, 1);
this.isActive = true;
// create the grid line
if (gridLineWidth) {
gridLinePath = axis.getPlotLinePath(pos + tickmarkOffset, gridLineWidth * reverseCrisp, old, true);
if (gridLine === UNDEFINED) {
attribs = {
stroke: gridLineColor,
'stroke-width': gridLineWidth
};
if (dashStyle) {
attribs.dashstyle = dashStyle;
}
if (!type) {
attribs.zIndex = 1;
}
if (old) {
attribs.opacity = 0;
}
tick.gridLine = gridLine =
gridLineWidth ?
renderer.path(gridLinePath)
.attr(attribs).add(axis.gridGroup) :
null;
}
// If the parameter 'old' is set, the current call will be followed
// by another call, therefore do not do any animations this time
if (!old && gridLine && gridLinePath) {
gridLine[tick.isNew ? 'attr' : 'animate']({
d: gridLinePath,
opacity: opacity
});
}
}
// create the tick mark
if (tickWidth && tickLength) {
// negate the length
if (tickPosition === 'inside') {
tickLength = -tickLength;
}
if (axis.opposite) {
tickLength = -tickLength;
}
markPath = tick.getMarkPath(x, y, tickLength, tickWidth * reverseCrisp, horiz, renderer);
if (mark) { // updating
mark.animate({
d: markPath,
opacity: opacity
});
} else { // first time
tick.mark = renderer.path(
markPath
).attr({
stroke: tickColor,
'stroke-width': tickWidth,
opacity: opacity
}).add(axis.axisGroup);
}
}
// the label is created on init - now move it into place
if (label && !isNaN(x)) {
label.xy = xy = tick.getLabelPosition(x, y, label, horiz, labelOptions, tickmarkOffset, index, step);
// Apply show first and show last. If the tick is both first and last, it is
// a single centered tick, in which case we show the label anyway (#2100).
if ((tick.isFirst && !tick.isLast && !pick(options.showFirstLabel, 1)) ||
(tick.isLast && !tick.isFirst && !pick(options.showLastLabel, 1))) {
show = false;
// Handle label overflow and show or hide accordingly
} else if (horiz && !axis.isRadial && !labelOptions.step && !labelOptions.rotation && !old && opacity !== 0) {
tick.handleOverflow(xy);
}
// apply step
if (step && index % step) {
// show those indices dividable by step
show = false;
}
// Set the new position, and show or hide
if (show && !isNaN(xy.y)) {
xy.opacity = opacity;
label[tick.isNew ? 'attr' : 'animate'](xy);
tick.isNew = false;
} else {
label.attr('y', -9999); // #1338
}
}
},
/**
* Destructor for the tick prototype
*/
destroy: function () {
destroyObjectProperties(this, this.axis);
}
};
/**
* The object wrapper for plot lines and plot bands
* @param {Object} options
*/
Highcharts.PlotLineOrBand = function (axis, options) {
this.axis = axis;
if (options) {
this.options = options;
this.id = options.id;
}
};
Highcharts.PlotLineOrBand.prototype = {
/**
* Render the plot line or plot band. If it is already existing,
* move it.
*/
render: function () {
var plotLine = this,
axis = plotLine.axis,
horiz = axis.horiz,
options = plotLine.options,
optionsLabel = options.label,
label = plotLine.label,
width = options.width,
to = options.to,
from = options.from,
isBand = defined(from) && defined(to),
value = options.value,
dashStyle = options.dashStyle,
svgElem = plotLine.svgElem,
path = [],
addEvent,
eventType,
xs,
ys,
x,
y,
color = options.color,
zIndex = options.zIndex,
events = options.events,
attribs = {},
renderer = axis.chart.renderer;
// logarithmic conversion
if (axis.isLog) {
from = log2lin(from);
to = log2lin(to);
value = log2lin(value);
}
// plot line
if (width) {
path = axis.getPlotLinePath(value, width);
attribs = {
stroke: color,
'stroke-width': width
};
if (dashStyle) {
attribs.dashstyle = dashStyle;
}
} else if (isBand) { // plot band
path = axis.getPlotBandPath(from, to, options);
if (color) {
attribs.fill = color;
}
if (options.borderWidth) {
attribs.stroke = options.borderColor;
attribs['stroke-width'] = options.borderWidth;
}
} else {
return;
}
// zIndex
if (defined(zIndex)) {
attribs.zIndex = zIndex;
}
// common for lines and bands
if (svgElem) {
if (path) {
svgElem.animate({
d: path
}, null, svgElem.onGetPath);
} else {
svgElem.hide();
svgElem.onGetPath = function () {
svgElem.show();
};
if (label) {
plotLine.label = label = label.destroy();
}
}
} else if (path && path.length) {
plotLine.svgElem = svgElem = renderer.path(path)
.attr(attribs).add();
// events
if (events) {
addEvent = function (eventType) {
svgElem.on(eventType, function (e) {
events[eventType].apply(plotLine, [e]);
});
};
for (eventType in events) {
addEvent(eventType);
}
}
}
// the plot band/line label
if (optionsLabel && defined(optionsLabel.text) && path && path.length && axis.width > 0 && axis.height > 0) {
// apply defaults
optionsLabel = merge({
align: horiz && isBand && 'center',
x: horiz ? !isBand && 4 : 10,
verticalAlign : !horiz && isBand && 'middle',
y: horiz ? isBand ? 16 : 10 : isBand ? 6 : -4,
rotation: horiz && !isBand && 90
}, optionsLabel);
// add the SVG element
if (!label) {
attribs = {
align: optionsLabel.textAlign || optionsLabel.align,
rotation: optionsLabel.rotation
};
if (defined(zIndex)) {
attribs.zIndex = zIndex;
}
plotLine.label = label = renderer.text(
optionsLabel.text,
0,
0,
optionsLabel.useHTML
)
.attr(attribs)
.css(optionsLabel.style)
.add();
}
// get the bounding box and align the label
// #3000 changed to better handle choice between plotband or plotline
xs = [path[1], path[4], (isBand ? path[6] : path[1])];
ys = [path[2], path[5], (isBand ? path[7] : path[2])];
x = arrayMin(xs);
y = arrayMin(ys);
label.align(optionsLabel, false, {
x: x,
y: y,
width: arrayMax(xs) - x,
height: arrayMax(ys) - y
});
label.show();
} else if (label) { // move out of sight
label.hide();
}
// chainable
return plotLine;
},
/**
* Remove the plot line or band
*/
destroy: function () {
// remove it from the lookup
erase(this.axis.plotLinesAndBands, this);
delete this.axis;
destroyObjectProperties(this);
}
};
/**
* Object with members for extending the Axis prototype
*/
AxisPlotLineOrBandExtension = {
/**
* Create the path for a plot band
*/
getPlotBandPath: function (from, to) {
var toPath = this.getPlotLinePath(to, null, null, true),
path = this.getPlotLinePath(from, null, null, true);
if (path && toPath) {
path.push(
toPath[4],
toPath[5],
toPath[1],
toPath[2]
);
} else { // outside the axis area
path = null;
}
return path;
},
addPlotBand: function (options) {
return this.addPlotBandOrLine(options, 'plotBands');
},
addPlotLine: function (options) {
return this.addPlotBandOrLine(options, 'plotLines');
},
/**
* Add a plot band or plot line after render time
*
* @param options {Object} The plotBand or plotLine configuration object
*/
addPlotBandOrLine: function (options, coll) {
var obj = new Highcharts.PlotLineOrBand(this, options).render(),
userOptions = this.userOptions;
if (obj) { // #2189
// Add it to the user options for exporting and Axis.update
if (coll) {
userOptions[coll] = userOptions[coll] || [];
userOptions[coll].push(options);
}
this.plotLinesAndBands.push(obj);
}
return obj;
},
/**
* Remove a plot band or plot line from the chart by id
* @param {Object} id
*/
removePlotBandOrLine: function (id) {
var plotLinesAndBands = this.plotLinesAndBands,
options = this.options,
userOptions = this.userOptions,
i = plotLinesAndBands.length;
while (i--) {
if (plotLinesAndBands[i].id === id) {
plotLinesAndBands[i].destroy();
}
}
each([options.plotLines || [], userOptions.plotLines || [], options.plotBands || [], userOptions.plotBands || []], function (arr) {
i = arr.length;
while (i--) {
if (arr[i].id === id) {
erase(arr, arr[i]);
}
}
});
}
};
/**
* Create a new axis object
* @param {Object} chart
* @param {Object} options
*/
var Axis = Highcharts.Axis = function () {
this.init.apply(this, arguments);
};
Axis.prototype = {
/**
* Default options for the X axis - the Y axis has extended defaults
*/
defaultOptions: {
// allowDecimals: null,
// alternateGridColor: null,
// categories: [],
dateTimeLabelFormats: {
millisecond: '%H:%M:%S.%L',
second: '%H:%M:%S',
minute: '%H:%M',
hour: '%H:%M',
day: '%e. %b',
week: '%e. %b',
month: '%b \'%y',
year: '%Y'
},
endOnTick: false,
gridLineColor: '#D8D8D8',
// gridLineDashStyle: 'solid',
// gridLineWidth: 0,
// reversed: false,
labels: {
enabled: true,
// rotation: 0,
// align: 'center',
// step: null,
style: {
color: '#606060',
cursor: 'default',
fontSize: '11px'
},
x: 0,
y: 15
/*formatter: function () {
return this.value;
},*/
},
lineColor: '#C0D0E0',
lineWidth: 1,
//linkedTo: null,
//max: undefined,
//min: undefined,
minPadding: 0.01,
maxPadding: 0.01,
//minRange: null,
minorGridLineColor: '#E0E0E0',
// minorGridLineDashStyle: null,
minorGridLineWidth: 1,
minorTickColor: '#A0A0A0',
//minorTickInterval: null,
minorTickLength: 2,
minorTickPosition: 'outside', // inside or outside
//minorTickWidth: 0,
//opposite: false,
//offset: 0,
//plotBands: [{
// events: {},
// zIndex: 1,
// labels: { align, x, verticalAlign, y, style, rotation, textAlign }
//}],
//plotLines: [{
// events: {}
// dashStyle: {}
// zIndex:
// labels: { align, x, verticalAlign, y, style, rotation, textAlign }
//}],
//reversed: false,
// showFirstLabel: true,
// showLastLabel: true,
startOfWeek: 1,
startOnTick: false,
tickColor: '#C0D0E0',
//tickInterval: null,
tickLength: 10,
tickmarkPlacement: 'between', // on or between
tickPixelInterval: 100,
tickPosition: 'outside',
tickWidth: 1,
title: {
//text: null,
align: 'middle', // low, middle or high
//margin: 0 for horizontal, 10 for vertical axes,
//rotation: 0,
//side: 'outside',
style: {
color: '#707070'
}
//x: 0,
//y: 0
},
type: 'linear' // linear, logarithmic or datetime
},
/**
* This options set extends the defaultOptions for Y axes
*/
defaultYAxisOptions: {
endOnTick: true,
gridLineWidth: 1,
tickPixelInterval: 72,
showLastLabel: true,
labels: {
x: -8,
y: 3
},
lineWidth: 0,
maxPadding: 0.05,
minPadding: 0.05,
startOnTick: true,
tickWidth: 0,
title: {
rotation: 270,
text: 'Values'
},
stackLabels: {
enabled: false,
//align: dynamic,
//y: dynamic,
//x: dynamic,
//verticalAlign: dynamic,
//textAlign: dynamic,
//rotation: 0,
formatter: function () {
return Highcharts.numberFormat(this.total, -1);
},
style: defaultPlotOptions.line.dataLabels.style
}
},
/**
* These options extend the defaultOptions for left axes
*/
defaultLeftAxisOptions: {
labels: {
x: -15,
y: null
},
title: {
rotation: 270
}
},
/**
* These options extend the defaultOptions for right axes
*/
defaultRightAxisOptions: {
labels: {
x: 15,
y: null
},
title: {
rotation: 90
}
},
/**
* These options extend the defaultOptions for bottom axes
*/
defaultBottomAxisOptions: {
labels: {
autoRotation: [-45],
x: 0,
y: null // based on font size
// overflow: undefined,
// staggerLines: null
},
title: {
rotation: 0
}
},
/**
* These options extend the defaultOptions for top axes
*/
defaultTopAxisOptions: {
labels: {
autoRotation: [-45],
x: 0,
y: -15
// overflow: undefined
// staggerLines: null
},
title: {
rotation: 0
}
},
/**
* Initialize the axis
*/
init: function (chart, userOptions) {
var isXAxis = userOptions.isX,
axis = this;
// Flag, is the axis horizontal
axis.horiz = chart.inverted ? !isXAxis : isXAxis;
// Flag, isXAxis
axis.isXAxis = isXAxis;
axis.coll = isXAxis ? 'xAxis' : 'yAxis';
axis.opposite = userOptions.opposite; // needed in setOptions
axis.side = userOptions.side || (axis.horiz ?
(axis.opposite ? 0 : 2) : // top : bottom
(axis.opposite ? 1 : 3)); // right : left
axis.setOptions(userOptions);
var options = this.options,
type = options.type,
isDatetimeAxis = type === 'datetime';
axis.labelFormatter = options.labels.formatter || axis.defaultLabelFormatter; // can be overwritten by dynamic format
// Flag, stagger lines or not
axis.userOptions = userOptions;
//axis.axisTitleMargin = UNDEFINED,// = options.title.margin,
axis.minPixelPadding = 0;
//axis.ignoreMinPadding = UNDEFINED; // can be set to true by a column or bar series
//axis.ignoreMaxPadding = UNDEFINED;
axis.chart = chart;
axis.reversed = options.reversed;
axis.zoomEnabled = options.zoomEnabled !== false;
// Initial categories
axis.categories = options.categories || type === 'category';
axis.names = [];
// Elements
//axis.axisGroup = UNDEFINED;
//axis.gridGroup = UNDEFINED;
//axis.axisTitle = UNDEFINED;
//axis.axisLine = UNDEFINED;
// Shorthand types
axis.isLog = type === 'logarithmic';
axis.isDatetimeAxis = isDatetimeAxis;
// Flag, if axis is linked to another axis
axis.isLinked = defined(options.linkedTo);
// Linked axis.
//axis.linkedParent = UNDEFINED;
// Tick positions
//axis.tickPositions = UNDEFINED; // array containing predefined positions
// Tick intervals
//axis.tickInterval = UNDEFINED;
//axis.minorTickInterval = UNDEFINED;
// Major ticks
axis.ticks = {};
axis.labelEdge = [];
// Minor ticks
axis.minorTicks = {};
// List of plotLines/Bands
axis.plotLinesAndBands = [];
// Alternate bands
axis.alternateBands = {};
// Axis metrics
//axis.left = UNDEFINED;
//axis.top = UNDEFINED;
//axis.width = UNDEFINED;
//axis.height = UNDEFINED;
//axis.bottom = UNDEFINED;
//axis.right = UNDEFINED;
//axis.transA = UNDEFINED;
//axis.transB = UNDEFINED;
//axis.oldTransA = UNDEFINED;
axis.len = 0;
//axis.oldMin = UNDEFINED;
//axis.oldMax = UNDEFINED;
//axis.oldUserMin = UNDEFINED;
//axis.oldUserMax = UNDEFINED;
//axis.oldAxisLength = UNDEFINED;
axis.minRange = axis.userMinRange = options.minRange || options.maxZoom;
axis.range = options.range;
axis.offset = options.offset || 0;
// Dictionary for stacks
axis.stacks = {};
axis.oldStacks = {};
// Min and max in the data
//axis.dataMin = UNDEFINED,
//axis.dataMax = UNDEFINED,
// The axis range
axis.max = null;
axis.min = null;
// User set min and max
//axis.userMin = UNDEFINED,
//axis.userMax = UNDEFINED,
// Crosshair options
axis.crosshair = pick(options.crosshair, splat(chart.options.tooltip.crosshairs)[isXAxis ? 0 : 1], false);
// Run Axis
var eventType,
events = axis.options.events;
// Register
if (inArray(axis, chart.axes) === -1) { // don't add it again on Axis.update()
if (isXAxis && !this.isColorAxis) { // #2713
chart.axes.splice(chart.xAxis.length, 0, axis);
} else {
chart.axes.push(axis);
}
chart[axis.coll].push(axis);
}
axis.series = axis.series || []; // populated by Series
// inverted charts have reversed xAxes as default
if (chart.inverted && isXAxis && axis.reversed === UNDEFINED) {
axis.reversed = true;
}
axis.removePlotBand = axis.removePlotBandOrLine;
axis.removePlotLine = axis.removePlotBandOrLine;
// register event listeners
for (eventType in events) {
addEvent(axis, eventType, events[eventType]);
}
// extend logarithmic axis
if (axis.isLog) {
axis.val2lin = log2lin;
axis.lin2val = lin2log;
}
},
/**
* Merge and set options
*/
setOptions: function (userOptions) {
this.options = merge(
this.defaultOptions,
this.isXAxis ? {} : this.defaultYAxisOptions,
[this.defaultTopAxisOptions, this.defaultRightAxisOptions,
this.defaultBottomAxisOptions, this.defaultLeftAxisOptions][this.side],
merge(
defaultOptions[this.coll], // if set in setOptions (#1053)
userOptions
)
);
},
/**
* The default label formatter. The context is a special config object for the label.
*/
defaultLabelFormatter: function () {
var axis = this.axis,
value = this.value,
categories = axis.categories,
dateTimeLabelFormat = this.dateTimeLabelFormat,
numericSymbols = defaultOptions.lang.numericSymbols,
i = numericSymbols && numericSymbols.length,
multi,
ret,
formatOption = axis.options.labels.format,
// make sure the same symbol is added for all labels on a linear axis
numericSymbolDetector = axis.isLog ? value : axis.tickInterval;
if (formatOption) {
ret = format(formatOption, this);
} else if (categories) {
ret = value;
} else if (dateTimeLabelFormat) { // datetime axis
ret = dateFormat(dateTimeLabelFormat, value);
} else if (i && numericSymbolDetector >= 1000) {
// Decide whether we should add a numeric symbol like k (thousands) or M (millions).
// If we are to enable this in tooltip or other places as well, we can move this
// logic to the numberFormatter and enable it by a parameter.
while (i-- && ret === UNDEFINED) {
multi = Math.pow(1000, i + 1);
if (numericSymbolDetector >= multi && numericSymbols[i] !== null) {
ret = Highcharts.numberFormat(value / multi, -1) + numericSymbols[i];
}
}
}
if (ret === UNDEFINED) {
if (mathAbs(value) >= 10000) { // add thousands separators
ret = Highcharts.numberFormat(value, 0);
} else { // small numbers
ret = Highcharts.numberFormat(value, -1, UNDEFINED, ''); // #2466
}
}
return ret;
},
/**
* Get the minimum and maximum for the series of each axis
*/
getSeriesExtremes: function () {
var axis = this,
chart = axis.chart;
axis.hasVisibleSeries = false;
// Reset properties in case we're redrawing (#3353)
axis.dataMin = axis.dataMax = axis.ignoreMinPadding = axis.ignoreMaxPadding = null;
if (axis.buildStacks) {
axis.buildStacks();
}
// loop through this axis' series
each(axis.series, function (series) {
if (series.visible || !chart.options.chart.ignoreHiddenSeries) {
var seriesOptions = series.options,
xData,
threshold = seriesOptions.threshold,
seriesDataMin,
seriesDataMax;
axis.hasVisibleSeries = true;
// Validate threshold in logarithmic axes
if (axis.isLog && threshold <= 0) {
threshold = null;
}
// Get dataMin and dataMax for X axes
if (axis.isXAxis) {
xData = series.xData;
if (xData.length) {
axis.dataMin = mathMin(pick(axis.dataMin, xData[0]), arrayMin(xData));
axis.dataMax = mathMax(pick(axis.dataMax, xData[0]), arrayMax(xData));
}
// Get dataMin and dataMax for Y axes, as well as handle stacking and processed data
} else {
// Get this particular series extremes
series.getExtremes();
seriesDataMax = series.dataMax;
seriesDataMin = series.dataMin;
// Get the dataMin and dataMax so far. If percentage is used, the min and max are
// always 0 and 100. If seriesDataMin and seriesDataMax is null, then series
// doesn't have active y data, we continue with nulls
if (defined(seriesDataMin) && defined(seriesDataMax)) {
axis.dataMin = mathMin(pick(axis.dataMin, seriesDataMin), seriesDataMin);
axis.dataMax = mathMax(pick(axis.dataMax, seriesDataMax), seriesDataMax);
}
// Adjust to threshold
if (defined(threshold)) {
if (axis.dataMin >= threshold) {
axis.dataMin = threshold;
axis.ignoreMinPadding = true;
} else if (axis.dataMax < threshold) {
axis.dataMax = threshold;
axis.ignoreMaxPadding = true;
}
}
}
}
});
},
/**
* Translate from axis value to pixel position on the chart, or back
*
*/
translate: function (val, backwards, cvsCoord, old, handleLog, pointPlacement) {
var axis = this,
sign = 1,
cvsOffset = 0,
localA = old ? axis.oldTransA : axis.transA,
localMin = old ? axis.oldMin : axis.min,
returnValue,
minPixelPadding = axis.minPixelPadding,
postTranslate = (axis.postTranslate || (axis.isLog && handleLog)) && axis.lin2val;
if (!localA) {
localA = axis.transA;
}
// In vertical axes, the canvas coordinates start from 0 at the top like in
// SVG.
if (cvsCoord) {
sign *= -1; // canvas coordinates inverts the value
cvsOffset = axis.len;
}
// Handle reversed axis
if (axis.reversed) {
sign *= -1;
cvsOffset -= sign * (axis.sector || axis.len);
}
// From pixels to value
if (backwards) { // reverse translation
val = val * sign + cvsOffset;
val -= minPixelPadding;
returnValue = val / localA + localMin; // from chart pixel to value
if (postTranslate) { // log and ordinal axes
returnValue = axis.lin2val(returnValue);
}
// From value to pixels
} else {
if (postTranslate) { // log and ordinal axes
val = axis.val2lin(val);
}
if (pointPlacement === 'between') {
pointPlacement = 0.5;
}
returnValue = sign * (val - localMin) * localA + cvsOffset + (sign * minPixelPadding) +
(isNumber(pointPlacement) ? localA * pointPlacement * axis.pointRange : 0);
}
return returnValue;
},
/**
* Utility method to translate an axis value to pixel position.
* @param {Number} value A value in terms of axis units
* @param {Boolean} paneCoordinates Whether to return the pixel coordinate relative to the chart
* or just the axis/pane itself.
*/
toPixels: function (value, paneCoordinates) {
return this.translate(value, false, !this.horiz, null, true) + (paneCoordinates ? 0 : this.pos);
},
/*
* Utility method to translate a pixel position in to an axis value
* @param {Number} pixel The pixel value coordinate
* @param {Boolean} paneCoordiantes Whether the input pixel is relative to the chart or just the
* axis/pane itself.
*/
toValue: function (pixel, paneCoordinates) {
return this.translate(pixel - (paneCoordinates ? 0 : this.pos), true, !this.horiz, null, true);
},
/**
* Create the path for a plot line that goes from the given value on
* this axis, across the plot to the opposite side
* @param {Number} value
* @param {Number} lineWidth Used for calculation crisp line
* @param {Number] old Use old coordinates (for resizing and rescaling)
*/
getPlotLinePath: function (value, lineWidth, old, force, translatedValue) {
var axis = this,
chart = axis.chart,
axisLeft = axis.left,
axisTop = axis.top,
x1,
y1,
x2,
y2,
cHeight = (old && chart.oldChartHeight) || chart.chartHeight,
cWidth = (old && chart.oldChartWidth) || chart.chartWidth,
skip,
transB = axis.transB,
/**
* Check if x is between a and b. If not, either move to a/b or skip,
* depending on the force parameter.
*/
between = function (x, a, b) {
if (x < a || x > b) {
if (force) {
x = mathMin(mathMax(a, x), b);
} else {
skip = true;
}
}
return x;
};
translatedValue = pick(translatedValue, axis.translate(value, null, null, old));
x1 = x2 = mathRound(translatedValue + transB);
y1 = y2 = mathRound(cHeight - translatedValue - transB);
if (isNaN(translatedValue)) { // no min or max
skip = true;
} else if (axis.horiz) {
y1 = axisTop;
y2 = cHeight - axis.bottom;
x1 = x2 = between(x1, axisLeft, axisLeft + axis.width);
} else {
x1 = axisLeft;
x2 = cWidth - axis.right;
y1 = y2 = between(y1, axisTop, axisTop + axis.height);
}
return skip && !force ?
null :
chart.renderer.crispLine([M, x1, y1, L, x2, y2], lineWidth || 1);
},
/**
* Set the tick positions of a linear axis to round values like whole tens or every five.
*/
getLinearTickPositions: function (tickInterval, min, max) {
var pos,
lastPos,
roundedMin = correctFloat(mathFloor(min / tickInterval) * tickInterval),
roundedMax = correctFloat(mathCeil(max / tickInterval) * tickInterval),
tickPositions = [];
// For single points, add a tick regardless of the relative position (#2662)
if (min === max && isNumber(min)) {
return [min];
}
// Populate the intermediate values
pos = roundedMin;
while (pos <= roundedMax) {
// Place the tick on the rounded value
tickPositions.push(pos);
// Always add the raw tickInterval, not the corrected one.
pos = correctFloat(pos + tickInterval);
// If the interval is not big enough in the current min - max range to actually increase
// the loop variable, we need to break out to prevent endless loop. Issue #619
if (pos === lastPos) {
break;
}
// Record the last value
lastPos = pos;
}
return tickPositions;
},
/**
* Return the minor tick positions. For logarithmic axes, reuse the same logic
* as for major ticks.
*/
getMinorTickPositions: function () {
var axis = this,
options = axis.options,
tickPositions = axis.tickPositions,
minorTickInterval = axis.minorTickInterval,
minorTickPositions = [],
pos,
i,
min = axis.min,
max = axis.max,
len;
// If minor ticks get too dense, they are hard to read, and may cause long running script. So we don't draw them.
if ((max - min) / minorTickInterval < axis.len / 3) {
if (axis.isLog) {
len = tickPositions.length;
for (i = 1; i < len; i++) {
minorTickPositions = minorTickPositions.concat(
axis.getLogTickPositions(minorTickInterval, tickPositions[i - 1], tickPositions[i], true)
);
}
} else if (axis.isDatetimeAxis && options.minorTickInterval === 'auto') { // #1314
minorTickPositions = minorTickPositions.concat(
axis.getTimeTicks(
axis.normalizeTimeTickInterval(minorTickInterval),
min,
max,
options.startOfWeek
)
);
} else if (axis.isDatetimeAxis && options.minorTickInterval === 'auto') { // #1314
minorTickPositions = minorTickPositions.concat(
axis.getTimeTicks(
axis.normalizeTimeTickInterval(minorTickInterval),
axis.min,
axis.max,
options.startOfWeek
)
);
} else {
for (pos = axis.min + (tickPositions[0] - axis.min) % minorTickInterval; pos <= axis.max; pos += minorTickInterval) {
minorTickPositions.push(pos);
}
}
}
axis.trimTicks(minorTickPositions); // #3652 #3743
return minorTickPositions;
},
/**
* Adjust the min and max for the minimum range. Keep in mind that the series data is
* not yet processed, so we don't have information on data cropping and grouping, or
* updated axis.pointRange or series.pointRange. The data can't be processed until
* we have finally established min and max.
*/
adjustForMinRange: function () {
var axis = this,
options = axis.options,
min = axis.min,
max = axis.max,
zoomOffset,
spaceAvailable = axis.dataMax - axis.dataMin >= axis.minRange,
closestDataRange,
i,
distance,
xData,
loopLength,
minArgs,
maxArgs;
// Set the automatic minimum range based on the closest point distance
if (axis.isXAxis && axis.minRange === UNDEFINED && !axis.isLog) {
if (defined(options.min) || defined(options.max)) {
axis.minRange = null; // don't do this again
} else {
// Find the closest distance between raw data points, as opposed to
// closestPointRange that applies to processed points (cropped and grouped)
each(axis.series, function (series) {
xData = series.xData;
loopLength = series.xIncrement ? 1 : xData.length - 1;
for (i = loopLength; i > 0; i--) {
distance = xData[i] - xData[i - 1];
if (closestDataRange === UNDEFINED || distance < closestDataRange) {
closestDataRange = distance;
}
}
});
axis.minRange = mathMin(closestDataRange * 5, axis.dataMax - axis.dataMin);
}
}
// if minRange is exceeded, adjust
if (max - min < axis.minRange) {
var minRange = axis.minRange;
zoomOffset = (minRange - max + min) / 2;
// if min and max options have been set, don't go beyond it
minArgs = [min - zoomOffset, pick(options.min, min - zoomOffset)];
if (spaceAvailable) { // if space is available, stay within the data range
minArgs[2] = axis.dataMin;
}
min = arrayMax(minArgs);
maxArgs = [min + minRange, pick(options.max, min + minRange)];
if (spaceAvailable) { // if space is availabe, stay within the data range
maxArgs[2] = axis.dataMax;
}
max = arrayMin(maxArgs);
// now if the max is adjusted, adjust the min back
if (max - min < minRange) {
minArgs[0] = max - minRange;
minArgs[1] = pick(options.min, max - minRange);
min = arrayMax(minArgs);
}
}
// Record modified extremes
axis.min = min;
axis.max = max;
},
/**
* Update translation information
*/
setAxisTranslation: function (saveOld) {
var axis = this,
range = axis.max - axis.min,
pointRange = axis.axisPointRange || 0,
closestPointRange,
minPointOffset = 0,
pointRangePadding = 0,
linkedParent = axis.linkedParent,
ordinalCorrection,
hasCategories = !!axis.categories,
transA = axis.transA;
// Adjust translation for padding. Y axis with categories need to go through the same (#1784).
if (axis.isXAxis || hasCategories || pointRange) {
if (linkedParent) {
minPointOffset = linkedParent.minPointOffset;
pointRangePadding = linkedParent.pointRangePadding;
} else {
each(axis.series, function (series) {
var seriesPointRange = hasCategories ? 1 : (axis.isXAxis ? series.pointRange : (axis.axisPointRange || 0)), // #2806
pointPlacement = series.options.pointPlacement,
seriesClosestPointRange = series.closestPointRange;
if (seriesPointRange > range) { // #1446
seriesPointRange = 0;
}
pointRange = mathMax(pointRange, seriesPointRange);
if (!axis.single) {
// minPointOffset is the value padding to the left of the axis in order to make
// room for points with a pointRange, typically columns. When the pointPlacement option
// is 'between' or 'on', this padding does not apply.
minPointOffset = mathMax(
minPointOffset,
isString(pointPlacement) ? 0 : seriesPointRange / 2
);
// Determine the total padding needed to the length of the axis to make room for the
// pointRange. If the series' pointPlacement is 'on', no padding is added.
pointRangePadding = mathMax(
pointRangePadding,
pointPlacement === 'on' ? 0 : seriesPointRange
);
}
// Set the closestPointRange
if (!series.noSharedTooltip && defined(seriesClosestPointRange)) {
closestPointRange = defined(closestPointRange) ?
mathMin(closestPointRange, seriesClosestPointRange) :
seriesClosestPointRange;
}
});
}
// Record minPointOffset and pointRangePadding
ordinalCorrection = axis.ordinalSlope && closestPointRange ? axis.ordinalSlope / closestPointRange : 1; // #988, #1853
axis.minPointOffset = minPointOffset = minPointOffset * ordinalCorrection;
axis.pointRangePadding = pointRangePadding = pointRangePadding * ordinalCorrection;
// pointRange means the width reserved for each point, like in a column chart
axis.pointRange = mathMin(pointRange, range);
// closestPointRange means the closest distance between points. In columns
// it is mostly equal to pointRange, but in lines pointRange is 0 while closestPointRange
// is some other value
axis.closestPointRange = closestPointRange;
}
// Secondary values
if (saveOld) {
axis.oldTransA = transA;
}
axis.translationSlope = axis.transA = transA = axis.len / ((range + pointRangePadding) || 1);
axis.transB = axis.horiz ? axis.left : axis.bottom; // translation addend
axis.minPixelPadding = transA * minPointOffset;
},
/**
* Set the tick positions to round values and optionally extend the extremes
* to the nearest tick
*/
setTickInterval: function (secondPass) {
var axis = this,
chart = axis.chart,
options = axis.options,
isLog = axis.isLog,
isDatetimeAxis = axis.isDatetimeAxis,
isXAxis = axis.isXAxis,
isLinked = axis.isLinked,
maxPadding = options.maxPadding,
minPadding = options.minPadding,
length,
linkedParentExtremes,
tickIntervalOption = options.tickInterval,
minTickInterval,
tickPixelIntervalOption = options.tickPixelInterval,
categories = axis.categories;
if (!isDatetimeAxis && !categories && !isLinked) {
this.getTickAmount();
}
// linked axis gets the extremes from the parent axis
if (isLinked) {
axis.linkedParent = chart[axis.coll][options.linkedTo];
linkedParentExtremes = axis.linkedParent.getExtremes();
axis.min = pick(linkedParentExtremes.min, linkedParentExtremes.dataMin);
axis.max = pick(linkedParentExtremes.max, linkedParentExtremes.dataMax);
if (options.type !== axis.linkedParent.options.type) {
error(11, 1); // Can't link axes of different type
}
} else { // initial min and max from the extreme data values
axis.min = pick(axis.userMin, options.min, axis.dataMin);
axis.max = pick(axis.userMax, options.max, axis.dataMax);
}
if (isLog) {
if (!secondPass && mathMin(axis.min, pick(axis.dataMin, axis.min)) <= 0) { // #978
error(10, 1); // Can't plot negative values on log axis
}
axis.min = correctFloat(log2lin(axis.min)); // correctFloat cures #934
axis.max = correctFloat(log2lin(axis.max));
}
// handle zoomed range
if (axis.range && defined(axis.max)) {
axis.userMin = axis.min = mathMax(axis.min, axis.max - axis.range); // #618
axis.userMax = axis.max;
axis.range = null; // don't use it when running setExtremes
}
// Hook for adjusting this.min and this.max. Used by bubble series.
if (axis.beforePadding) {
axis.beforePadding();
}
// adjust min and max for the minimum range
axis.adjustForMinRange();
// Pad the values to get clear of the chart's edges. To avoid tickInterval taking the padding
// into account, we do this after computing tick interval (#1337).
if (!categories && !axis.axisPointRange && !axis.usePercentage && !isLinked && defined(axis.min) && defined(axis.max)) {
length = axis.max - axis.min;
if (length) {
if (!defined(options.min) && !defined(axis.userMin) && minPadding && (axis.dataMin < 0 || !axis.ignoreMinPadding)) {
axis.min -= length * minPadding;
}
if (!defined(options.max) && !defined(axis.userMax) && maxPadding && (axis.dataMax > 0 || !axis.ignoreMaxPadding)) {
axis.max += length * maxPadding;
}
}
}
// Stay within floor and ceiling
if (isNumber(options.floor)) {
axis.min = mathMax(axis.min, options.floor);
}
if (isNumber(options.ceiling)) {
axis.max = mathMin(axis.max, options.ceiling);
}
// get tickInterval
if (axis.min === axis.max || axis.min === undefined || axis.max === undefined) {
axis.tickInterval = 1;
} else if (isLinked && !tickIntervalOption &&
tickPixelIntervalOption === axis.linkedParent.options.tickPixelInterval) {
axis.tickInterval = axis.linkedParent.tickInterval;
} else {
axis.tickInterval = pick(
tickIntervalOption,
this.tickAmount ? ((axis.max - axis.min) / mathMax(this.tickAmount - 1, 1)) : undefined,
categories ? // for categoried axis, 1 is default, for linear axis use tickPix
1 :
// don't let it be more than the data range
(axis.max - axis.min) * tickPixelIntervalOption / mathMax(axis.len, tickPixelIntervalOption)
);
}
// Now we're finished detecting min and max, crop and group series data. This
// is in turn needed in order to find tick positions in ordinal axes.
if (isXAxis && !secondPass) {
each(axis.series, function (series) {
series.processData(axis.min !== axis.oldMin || axis.max !== axis.oldMax);
});
}
// set the translation factor used in translate function
axis.setAxisTranslation(true);
// hook for ordinal axes and radial axes
if (axis.beforeSetTickPositions) {
axis.beforeSetTickPositions();
}
// hook for extensions, used in Highstock ordinal axes
if (axis.postProcessTickInterval) {
axis.tickInterval = axis.postProcessTickInterval(axis.tickInterval);
}
// In column-like charts, don't cramp in more ticks than there are points (#1943)
if (axis.pointRange) {
axis.tickInterval = mathMax(axis.pointRange, axis.tickInterval);
}
// Before normalizing the tick interval, handle minimum tick interval. This applies only if tickInterval is not defined.
minTickInterval = pick(options.minTickInterval, axis.isDatetimeAxis && axis.closestPointRange);
if (!tickIntervalOption && axis.tickInterval < minTickInterval) {
axis.tickInterval = minTickInterval;
}
// for linear axes, get magnitude and normalize the interval
if (!isDatetimeAxis && !isLog) { // linear
if (!tickIntervalOption) {
axis.tickInterval = normalizeTickInterval(
axis.tickInterval,
null,
getMagnitude(axis.tickInterval),
// If the tick interval is between 0.5 and 5 and the axis max is in the order of
// thousands, chances are we are dealing with years. Don't allow decimals. #3363.
pick(options.allowDecimals, !(axis.tickInterval > 0.5 && axis.tickInterval < 5 && axis.max > 1000 && axis.max < 9999)),
!!this.tickAmount
);
}
}
// Prevent ticks from getting so close that we can't draw the labels
if (!this.tickAmount && this.len) { // Color axis with disabled legend has no length
axis.tickInterval = axis.unsquish();
}
this.setTickPositions();
},
/**
* Now we have computed the normalized tickInterval, get the tick positions
*/
setTickPositions: function () {
var options = this.options,
tickPositions,
tickPositionsOption = options.tickPositions,
tickPositioner = options.tickPositioner,
startOnTick = options.startOnTick,
endOnTick = options.endOnTick,
single;
// Set the tickmarkOffset
this.tickmarkOffset = (this.categories && options.tickmarkPlacement === 'between' &&
this.tickInterval === 1) ? 0.5 : 0; // #3202
// get minorTickInterval
this.minorTickInterval = options.minorTickInterval === 'auto' && this.tickInterval ?
this.tickInterval / 5 : options.minorTickInterval;
// Find the tick positions
this.tickPositions = tickPositions = options.tickPositions && options.tickPositions.slice(); // Work on a copy (#1565)
if (!tickPositions) {
if (this.isDatetimeAxis) {
tickPositions = this.getTimeTicks(
this.normalizeTimeTickInterval(this.tickInterval, options.units),
this.min,
this.max,
options.startOfWeek,
this.ordinalPositions,
this.closestPointRange,
true
);
} else if (this.isLog) {
tickPositions = this.getLogTickPositions(this.tickInterval, this.min, this.max);
} else {
tickPositions = this.getLinearTickPositions(this.tickInterval, this.min, this.max);
}
this.tickPositions = tickPositions;
// Run the tick positioner callback, that allows modifying auto tick positions.
if (tickPositioner) {
tickPositioner = tickPositioner.apply(this, [this.min, this.max]);
if (tickPositioner) {
this.tickPositions = tickPositions = tickPositioner;
}
}
}
if (!this.isLinked) {
// reset min/max or remove extremes based on start/end on tick
this.trimTicks(tickPositions, startOnTick, endOnTick);
// When there is only one point, or all points have the same value on this axis, then min
// and max are equal and tickPositions.length is 0 or 1. In this case, add some padding
// in order to center the point, but leave it with one tick. #1337.
if (this.min === this.max && defined(this.min) && !this.tickAmount) {
// Substract half a unit (#2619, #2846, #2515, #3390)
single = true;
this.min -= 0.5;
this.max += 0.5;
}
this.single = single;
if (!tickPositionsOption && !tickPositioner) {
this.adjustTickAmount();
}
}
},
/**
* Handle startOnTick and endOnTick by either adapting to padding min/max or rounded min/max
*/
trimTicks: function (tickPositions, startOnTick, endOnTick) {
var roundedMin = tickPositions[0],
roundedMax = tickPositions[tickPositions.length - 1],
minPointOffset = this.minPointOffset || 0;
if (startOnTick) {
this.min = roundedMin;
} else if (this.min - minPointOffset > roundedMin) {
tickPositions.shift();
}
if (endOnTick) {
this.max = roundedMax;
} else if (this.max + minPointOffset < roundedMax) {
tickPositions.pop();
}
// If no tick are left, set one tick in the middle (#3195)
if (tickPositions.length === 0 && defined(roundedMin)) {
tickPositions.push((roundedMax + roundedMin) / 2);
}
},
/**
* Set the max ticks of either the x and y axis collection
*/
getTickAmount: function () {
var others = {}, // Whether there is another axis to pair with this one
hasOther,
options = this.options,
tickAmount = options.tickAmount,
tickPixelInterval = options.tickPixelInterval;
if (!defined(options.tickInterval) && this.len < tickPixelInterval && !this.isRadial &&
!this.isLog && options.startOnTick && options.endOnTick) {
tickAmount = 2;
}
if (!tickAmount && this.chart.options.chart.alignTicks !== false && options.alignTicks !== false) {
// Check if there are multiple axes in the same pane
each(this.chart[this.coll], function (axis) {
var options = axis.options,
horiz = axis.horiz,
key = [horiz ? options.left : options.top, horiz ? options.width : options.height, options.pane].join(',');
if (others[key]) {
hasOther = true;
} else {
others[key] = 1;
}
});
if (hasOther) {
// Add 1 because 4 tick intervals require 5 ticks (including first and last)
tickAmount = mathCeil(this.len / tickPixelInterval) + 1;
}
}
// For tick amounts of 2 and 3, compute five ticks and remove the intermediate ones. This
// prevents the axis from adding ticks that are too far away from the data extremes.
if (tickAmount < 4) {
this.finalTickAmt = tickAmount;
tickAmount = 5;
}
this.tickAmount = tickAmount;
},
/**
* When using multiple axes, adjust the number of ticks to match the highest
* number of ticks in that group
*/
adjustTickAmount: function () {
var tickInterval = this.tickInterval,
tickPositions = this.tickPositions,
tickAmount = this.tickAmount,
finalTickAmt = this.finalTickAmt,
currentTickAmount = tickPositions && tickPositions.length,
i,
len;
if (currentTickAmount < tickAmount) { // TODO: Check #3411
while (tickPositions.length < tickAmount) {
tickPositions.push(correctFloat(
tickPositions[tickPositions.length - 1] + tickInterval
));
}
this.transA *= (currentTickAmount - 1) / (tickAmount - 1);
this.max = tickPositions[tickPositions.length - 1];
// We have too many ticks, run second pass to try to reduce ticks
} else if (currentTickAmount > tickAmount) {
this.tickInterval *= 2;
this.setTickPositions();
}
// The finalTickAmt property is set in getTickAmount
if (defined(finalTickAmt)) {
i = len = tickPositions.length;
while (i--) {
if (
(finalTickAmt === 3 && i % 2 === 1) || // Remove every other tick
(finalTickAmt <= 2 && i > 0 && i < len - 1) // Remove all but first and last
) {
tickPositions.splice(i, 1);
}
}
this.finalTickAmt = UNDEFINED;
}
},
/**
* Set the scale based on data min and max, user set min and max or options
*
*/
setScale: function () {
var axis = this,
stacks = axis.stacks,
type,
i,
isDirtyData,
isDirtyAxisLength;
axis.oldMin = axis.min;
axis.oldMax = axis.max;
axis.oldAxisLength = axis.len;
// set the new axisLength
axis.setAxisSize();
//axisLength = horiz ? axisWidth : axisHeight;
isDirtyAxisLength = axis.len !== axis.oldAxisLength;
// is there new data?
each(axis.series, function (series) {
if (series.isDirtyData || series.isDirty ||
series.xAxis.isDirty) { // when x axis is dirty, we need new data extremes for y as well
isDirtyData = true;
}
});
// do we really need to go through all this?
if (isDirtyAxisLength || isDirtyData || axis.isLinked || axis.forceRedraw ||
axis.userMin !== axis.oldUserMin || axis.userMax !== axis.oldUserMax) {
// reset stacks
if (!axis.isXAxis) {
for (type in stacks) {
for (i in stacks[type]) {
stacks[type][i].total = null;
stacks[type][i].cum = 0;
}
}
}
axis.forceRedraw = false;
// get data extremes if needed
axis.getSeriesExtremes();
// get fixed positions based on tickInterval
axis.setTickInterval();
// record old values to decide whether a rescale is necessary later on (#540)
axis.oldUserMin = axis.userMin;
axis.oldUserMax = axis.userMax;
// Mark as dirty if it is not already set to dirty and extremes have changed. #595.
if (!axis.isDirty) {
axis.isDirty = isDirtyAxisLength || axis.min !== axis.oldMin || axis.max !== axis.oldMax;
}
} else if (!axis.isXAxis) {
if (axis.oldStacks) {
stacks = axis.stacks = axis.oldStacks;
}
// reset stacks
for (type in stacks) {
for (i in stacks[type]) {
stacks[type][i].cum = stacks[type][i].total;
}
}
}
},
/**
* Set the extremes and optionally redraw
* @param {Number} newMin
* @param {Number} newMax
* @param {Boolean} redraw
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
* @param {Object} eventArguments
*
*/
setExtremes: function (newMin, newMax, redraw, animation, eventArguments) {
var axis = this,
chart = axis.chart;
redraw = pick(redraw, true); // defaults to true
each(axis.series, function (serie) {
delete serie.kdTree;
});
// Extend the arguments with min and max
eventArguments = extend(eventArguments, {
min: newMin,
max: newMax
});
// Fire the event
fireEvent(axis, 'setExtremes', eventArguments, function () { // the default event handler
axis.userMin = newMin;
axis.userMax = newMax;
axis.eventArgs = eventArguments;
// Mark for running afterSetExtremes
axis.isDirtyExtremes = true;
// redraw
if (redraw) {
chart.redraw(animation);
}
});
},
/**
* Overridable method for zooming chart. Pulled out in a separate method to allow overriding
* in stock charts.
*/
zoom: function (newMin, newMax) {
var dataMin = this.dataMin,
dataMax = this.dataMax,
options = this.options;
// Prevent pinch zooming out of range. Check for defined is for #1946. #1734.
if (!this.allowZoomOutside) {
if (defined(dataMin) && newMin <= mathMin(dataMin, pick(options.min, dataMin))) {
newMin = UNDEFINED;
}
if (defined(dataMax) && newMax >= mathMax(dataMax, pick(options.max, dataMax))) {
newMax = UNDEFINED;
}
}
// In full view, displaying the reset zoom button is not required
this.displayBtn = newMin !== UNDEFINED || newMax !== UNDEFINED;
// Do it
this.setExtremes(
newMin,
newMax,
false,
UNDEFINED,
{ trigger: 'zoom' }
);
return true;
},
/**
* Update the axis metrics
*/
setAxisSize: function () {
var chart = this.chart,
options = this.options,
offsetLeft = options.offsetLeft || 0,
offsetRight = options.offsetRight || 0,
horiz = this.horiz,
width = pick(options.width, chart.plotWidth - offsetLeft + offsetRight),
height = pick(options.height, chart.plotHeight),
top = pick(options.top, chart.plotTop),
left = pick(options.left, chart.plotLeft + offsetLeft),
percentRegex = /%$/;
// Check for percentage based input values
if (percentRegex.test(height)) {
height = parseFloat(height) / 100 * chart.plotHeight;
}
if (percentRegex.test(top)) {
top = parseFloat(top) / 100 * chart.plotHeight + chart.plotTop;
}
// Expose basic values to use in Series object and navigator
this.left = left;
this.top = top;
this.width = width;
this.height = height;
this.bottom = chart.chartHeight - height - top;
this.right = chart.chartWidth - width - left;
// Direction agnostic properties
this.len = mathMax(horiz ? width : height, 0); // mathMax fixes #905
this.pos = horiz ? left : top; // distance from SVG origin
},
/**
* Get the actual axis extremes
*/
getExtremes: function () {
var axis = this,
isLog = axis.isLog;
return {
min: isLog ? correctFloat(lin2log(axis.min)) : axis.min,
max: isLog ? correctFloat(lin2log(axis.max)) : axis.max,
dataMin: axis.dataMin,
dataMax: axis.dataMax,
userMin: axis.userMin,
userMax: axis.userMax
};
},
/**
* Get the zero plane either based on zero or on the min or max value.
* Used in bar and area plots
*/
getThreshold: function (threshold) {
var axis = this,
isLog = axis.isLog;
var realMin = isLog ? lin2log(axis.min) : axis.min,
realMax = isLog ? lin2log(axis.max) : axis.max;
if (realMin > threshold || threshold === null) {
threshold = realMin;
} else if (realMax < threshold) {
threshold = realMax;
}
return axis.translate(threshold, 0, 1, 0, 1);
},
/**
* Compute auto alignment for the axis label based on which side the axis is on
* and the given rotation for the label
*/
autoLabelAlign: function (rotation) {
var ret,
angle = (pick(rotation, 0) - (this.side * 90) + 720) % 360;
if (angle > 15 && angle < 165) {
ret = 'right';
} else if (angle > 195 && angle < 345) {
ret = 'left';
} else {
ret = 'center';
}
return ret;
},
/**
* Prevent the ticks from getting so close we can't draw the labels. On a horizontal
* axis, this is handled by rotating the labels, removing ticks and adding ellipsis.
* On a vertical axis remove ticks and add ellipsis.
*/
unsquish: function () {
var chart = this.chart,
ticks = this.ticks,
labelOptions = this.options.labels,
horiz = this.horiz,
tickInterval = this.tickInterval,
newTickInterval = tickInterval,
slotSize = this.len / (((this.categories ? 1 : 0) + this.max - this.min) / tickInterval),
rotation,
rotationOption = labelOptions.rotation,
labelMetrics = chart.renderer.fontMetrics(labelOptions.style.fontSize, ticks[0] && ticks[0].label),
step,
bestScore = Number.MAX_VALUE,
autoRotation,
// Return the multiple of tickInterval that is needed to avoid collision
getStep = function (spaceNeeded) {
var step = spaceNeeded / (slotSize || 1);
step = step > 1 ? mathCeil(step) : 1;
return step * tickInterval;
};
if (horiz) {
autoRotation = defined(rotationOption) ?
[rotationOption] :
slotSize < 80 && !labelOptions.staggerLines && !labelOptions.step && labelOptions.autoRotation;
if (autoRotation) {
// Loop over the given autoRotation options, and determine which gives the best score. The
// best score is that with the lowest number of steps and a rotation closest to horizontal.
each(autoRotation, function (rot) {
var score;
if (rot && rot >= -90 && rot <= 90) {
step = getStep(mathAbs(labelMetrics.h / mathSin(deg2rad * rot)));
score = step + mathAbs(rot / 360);
if (score < bestScore) {
bestScore = score;
rotation = rot;
newTickInterval = step;
}
}
});
}
} else {
newTickInterval = getStep(labelMetrics.h);
}
this.autoRotation = autoRotation;
this.labelRotation = rotation;
return newTickInterval;
},
renderUnsquish: function () {
var chart = this.chart,
renderer = chart.renderer,
tickPositions = this.tickPositions,
ticks = this.ticks,
labelOptions = this.options.labels,
horiz = this.horiz,
margin = chart.margin,
slotWidth = this.slotWidth = (horiz && !labelOptions.step && !labelOptions.rotation &&
((this.staggerLines || 1) * chart.plotWidth) / tickPositions.length) ||
(!horiz && ((margin[3] && (margin[3] - chart.spacing[3])) || chart.chartWidth * 0.33)), // #1580, #1931,
innerWidth = mathMax(1, mathRound(slotWidth - 2 * (labelOptions.padding || 5))),
attr = {},
labelMetrics = renderer.fontMetrics(labelOptions.style.fontSize, ticks[0] && ticks[0].label),
css,
labelLength = 0,
label,
i,
pos;
// Set rotation option unless it is "auto", like in gauges
if (!isString(labelOptions.rotation)) {
attr.rotation = labelOptions.rotation;
}
// Handle auto rotation on horizontal axis
if (this.autoRotation) {
// Get the longest label length
each(tickPositions, function (tick) {
tick = ticks[tick];
if (tick && tick.labelLength > labelLength) {
labelLength = tick.labelLength;
}
});
// Apply rotation only if the label is too wide for the slot, and
// the label is wider than its height.
if (labelLength > innerWidth && labelLength > labelMetrics.h) {
attr.rotation = this.labelRotation;
} else {
this.labelRotation = 0;
}
// Handle word-wrap or ellipsis on vertical axis
} else if (slotWidth) {
// For word-wrap or ellipsis
css = { width: innerWidth + PX, textOverflow: 'clip' };
// On vertical axis, only allow word wrap if there is room for more lines.
i = tickPositions.length;
while (!horiz && i--) {
pos = tickPositions[i];
label = ticks[pos].label;
if (label) {
if (this.len / tickPositions.length - 4 < label.getBBox().height) {
label.specCss = { textOverflow: 'ellipsis' };
}
}
}
}
// Add ellipsis if the label length is significantly longer than ideal
if (attr.rotation) {
css = {
width: (labelLength > chart.chartHeight * 0.5 ? chart.chartHeight * 0.33 : chart.chartHeight) + PX,
textOverflow: 'ellipsis'
};
}
// Set the explicit or automatic label alignment
this.labelAlign = attr.align = labelOptions.align || this.autoLabelAlign(this.labelRotation);
// Apply general and specific CSS
each(tickPositions, function (pos) {
var tick = ticks[pos],
label = tick && tick.label;
if (label) {
if (css) {
label.css(merge(css, label.specCss));
}
delete label.specCss;
label.attr(attr);
tick.rotation = attr.rotation;
}
});
// TODO: Why not part of getLabelPosition?
this.tickRotCorr = renderer.rotCorr(labelMetrics.b, this.labelRotation || 0, this.side === 2);
},
/**
* Render the tick labels to a preliminary position to get their sizes
*/
getOffset: function () {
var axis = this,
chart = axis.chart,
renderer = chart.renderer,
options = axis.options,
tickPositions = axis.tickPositions,
ticks = axis.ticks,
horiz = axis.horiz,
side = axis.side,
invertedSide = chart.inverted ? [1, 0, 3, 2][side] : side,
hasData,
showAxis,
titleOffset = 0,
titleOffsetOption,
titleMargin = 0,
axisTitleOptions = options.title,
labelOptions = options.labels,
labelOffset = 0, // reset
labelOffsetPadded,
axisOffset = chart.axisOffset,
clipOffset = chart.clipOffset,
directionFactor = [-1, 1, 1, -1][side],
n,
lineHeightCorrection;
// For reuse in Axis.render
axis.hasData = hasData = (axis.hasVisibleSeries || (defined(axis.min) && defined(axis.max) && !!tickPositions));
axis.showAxis = showAxis = hasData || pick(options.showEmpty, true);
// Set/reset staggerLines
axis.staggerLines = axis.horiz && labelOptions.staggerLines;
// Create the axisGroup and gridGroup elements on first iteration
if (!axis.axisGroup) {
axis.gridGroup = renderer.g('grid')
.attr({ zIndex: options.gridZIndex || 1 })
.add();
axis.axisGroup = renderer.g('axis')
.attr({ zIndex: options.zIndex || 2 })
.add();
axis.labelGroup = renderer.g('axis-labels')
.attr({ zIndex: labelOptions.zIndex || 7 })
.addClass(PREFIX + axis.coll.toLowerCase() + '-labels')
.add();
}
if (hasData || axis.isLinked) {
// Generate ticks
each(tickPositions, function (pos) {
if (!ticks[pos]) {
ticks[pos] = new Tick(axis, pos);
} else {
ticks[pos].addLabel(); // update labels depending on tick interval
}
});
axis.renderUnsquish();
each(tickPositions, function (pos) {
// left side must be align: right and right side must have align: left for labels
if (side === 0 || side === 2 || { 1: 'left', 3: 'right' }[side] === axis.labelAlign) {
// get the highest offset
labelOffset = mathMax(
ticks[pos].getLabelSize(),
labelOffset
);
}
});
if (axis.staggerLines) {
labelOffset *= axis.staggerLines;
axis.labelOffset = labelOffset;
}
} else { // doesn't have data
for (n in ticks) {
ticks[n].destroy();
delete ticks[n];
}
}
if (axisTitleOptions && axisTitleOptions.text && axisTitleOptions.enabled !== false) {
if (!axis.axisTitle) {
axis.axisTitle = renderer.text(
axisTitleOptions.text,
0,
0,
axisTitleOptions.useHTML
)
.attr({
zIndex: 7,
rotation: axisTitleOptions.rotation || 0,
align:
axisTitleOptions.textAlign ||
{ low: 'left', middle: 'center', high: 'right' }[axisTitleOptions.align]
})
.addClass(PREFIX + this.coll.toLowerCase() + '-title')
.css(axisTitleOptions.style)
.add(axis.axisGroup);
axis.axisTitle.isNew = true;
}
if (showAxis) {
titleOffset = axis.axisTitle.getBBox()[horiz ? 'height' : 'width'];
titleOffsetOption = axisTitleOptions.offset;
titleMargin = defined(titleOffsetOption) ? 0 : pick(axisTitleOptions.margin, horiz ? 5 : 10);
}
// hide or show the title depending on whether showEmpty is set
axis.axisTitle[showAxis ? 'show' : 'hide']();
}
// handle automatic or user set offset
axis.offset = directionFactor * pick(options.offset, axisOffset[side]);
axis.tickRotCorr = axis.tickRotCorr || { x: 0, y: 0 }; // polar
lineHeightCorrection = side === 2 ? axis.tickRotCorr.y : 0;
labelOffsetPadded = labelOffset + titleMargin +
(labelOffset && (directionFactor * (horiz ? pick(labelOptions.y, axis.tickRotCorr.y + 8) : labelOptions.x) - lineHeightCorrection));
axis.axisTitleMargin = pick(titleOffsetOption, labelOffsetPadded);
axisOffset[side] = mathMax(
axisOffset[side],
axis.axisTitleMargin + titleOffset + directionFactor * axis.offset,
labelOffsetPadded // #3027
);
clipOffset[invertedSide] = mathMax(clipOffset[invertedSide], mathFloor(options.lineWidth / 2) * 2);
},
/**
* Get the path for the axis line
*/
getLinePath: function (lineWidth) {
var chart = this.chart,
opposite = this.opposite,
offset = this.offset,
horiz = this.horiz,
lineLeft = this.left + (opposite ? this.width : 0) + offset,
lineTop = chart.chartHeight - this.bottom - (opposite ? this.height : 0) + offset;
if (opposite) {
lineWidth *= -1; // crispify the other way - #1480, #1687
}
return chart.renderer.crispLine([
M,
horiz ?
this.left :
lineLeft,
horiz ?
lineTop :
this.top,
L,
horiz ?
chart.chartWidth - this.right :
lineLeft,
horiz ?
lineTop :
chart.chartHeight - this.bottom
], lineWidth);
},
/**
* Position the title
*/
getTitlePosition: function () {
// compute anchor points for each of the title align options
var horiz = this.horiz,
axisLeft = this.left,
axisTop = this.top,
axisLength = this.len,
axisTitleOptions = this.options.title,
margin = horiz ? axisLeft : axisTop,
opposite = this.opposite,
offset = this.offset,
fontSize = pInt(axisTitleOptions.style.fontSize || 12),
// the position in the length direction of the axis
alongAxis = {
low: margin + (horiz ? 0 : axisLength),
middle: margin + axisLength / 2,
high: margin + (horiz ? axisLength : 0)
}[axisTitleOptions.align],
// the position in the perpendicular direction of the axis
offAxis = (horiz ? axisTop + this.height : axisLeft) +
(horiz ? 1 : -1) * // horizontal axis reverses the margin
(opposite ? -1 : 1) * // so does opposite axes
this.axisTitleMargin +
(this.side === 2 ? fontSize : 0);
return {
x: horiz ?
alongAxis :
offAxis + (opposite ? this.width : 0) + offset +
(axisTitleOptions.x || 0), // x
y: horiz ?
offAxis - (opposite ? this.height : 0) + offset :
alongAxis + (axisTitleOptions.y || 0) // y
};
},
/**
* Render the axis
*/
render: function () {
var axis = this,
chart = axis.chart,
renderer = chart.renderer,
options = axis.options,
isLog = axis.isLog,
isLinked = axis.isLinked,
tickPositions = axis.tickPositions,
axisTitle = axis.axisTitle,
ticks = axis.ticks,
minorTicks = axis.minorTicks,
alternateBands = axis.alternateBands,
stackLabelOptions = options.stackLabels,
alternateGridColor = options.alternateGridColor,
tickmarkOffset = axis.tickmarkOffset,
lineWidth = options.lineWidth,
linePath,
hasRendered = chart.hasRendered,
slideInTicks = hasRendered && defined(axis.oldMin) && !isNaN(axis.oldMin),
hasData = axis.hasData,
showAxis = axis.showAxis,
from,
to;
// Reset
axis.labelEdge.length = 0;
//axis.justifyToPlot = overflow === 'justify';
axis.overlap = false;
// Mark all elements inActive before we go over and mark the active ones
each([ticks, minorTicks, alternateBands], function (coll) {
var pos;
for (pos in coll) {
coll[pos].isActive = false;
}
});
// If the series has data draw the ticks. Else only the line and title
if (hasData || isLinked) {
// minor ticks
if (axis.minorTickInterval && !axis.categories) {
each(axis.getMinorTickPositions(), function (pos) {
if (!minorTicks[pos]) {
minorTicks[pos] = new Tick(axis, pos, 'minor');
}
// render new ticks in old position
if (slideInTicks && minorTicks[pos].isNew) {
minorTicks[pos].render(null, true);
}
minorTicks[pos].render(null, false, 1);
});
}
// Major ticks. Pull out the first item and render it last so that
// we can get the position of the neighbour label. #808.
if (tickPositions.length) { // #1300
each(tickPositions, function (pos, i) {
// linked axes need an extra check to find out if
if (!isLinked || (pos >= axis.min && pos <= axis.max)) {
if (!ticks[pos]) {
ticks[pos] = new Tick(axis, pos);
}
// render new ticks in old position
if (slideInTicks && ticks[pos].isNew) {
ticks[pos].render(i, true, 0.1);
}
ticks[pos].render(i);
}
});
// In a categorized axis, the tick marks are displayed between labels. So
// we need to add a tick mark and grid line at the left edge of the X axis.
if (tickmarkOffset && (axis.min === 0 || axis.single)) {
if (!ticks[-1]) {
ticks[-1] = new Tick(axis, -1, null, true);
}
ticks[-1].render(-1);
}
}
// alternate grid color
if (alternateGridColor) {
each(tickPositions, function (pos, i) {
if (i % 2 === 0 && pos < axis.max) {
if (!alternateBands[pos]) {
alternateBands[pos] = new Highcharts.PlotLineOrBand(axis);
}
from = pos + tickmarkOffset; // #949
to = tickPositions[i + 1] !== UNDEFINED ? tickPositions[i + 1] + tickmarkOffset : axis.max;
alternateBands[pos].options = {
from: isLog ? lin2log(from) : from,
to: isLog ? lin2log(to) : to,
color: alternateGridColor
};
alternateBands[pos].render();
alternateBands[pos].isActive = true;
}
});
}
// custom plot lines and bands
if (!axis._addedPlotLB) { // only first time
each((options.plotLines || []).concat(options.plotBands || []), function (plotLineOptions) {
axis.addPlotBandOrLine(plotLineOptions);
});
axis._addedPlotLB = true;
}
} // end if hasData
// Remove inactive ticks
each([ticks, minorTicks, alternateBands], function (coll) {
var pos,
i,
forDestruction = [],
delay = globalAnimation ? globalAnimation.duration || 500 : 0,
destroyInactiveItems = function () {
i = forDestruction.length;
while (i--) {
// When resizing rapidly, the same items may be destroyed in different timeouts,
// or the may be reactivated
if (coll[forDestruction[i]] && !coll[forDestruction[i]].isActive) {
coll[forDestruction[i]].destroy();
delete coll[forDestruction[i]];
}
}
};
for (pos in coll) {
if (!coll[pos].isActive) {
// Render to zero opacity
coll[pos].render(pos, false, 0);
coll[pos].isActive = false;
forDestruction.push(pos);
}
}
// When the objects are finished fading out, destroy them
if (coll === alternateBands || !chart.hasRendered || !delay) {
destroyInactiveItems();
} else if (delay) {
setTimeout(destroyInactiveItems, delay);
}
});
// Static items. As the axis group is cleared on subsequent calls
// to render, these items are added outside the group.
// axis line
if (lineWidth) {
linePath = axis.getLinePath(lineWidth);
if (!axis.axisLine) {
axis.axisLine = renderer.path(linePath)
.attr({
stroke: options.lineColor,
'stroke-width': lineWidth,
zIndex: 7
})
.add(axis.axisGroup);
} else {
axis.axisLine.animate({ d: linePath });
}
// show or hide the line depending on options.showEmpty
axis.axisLine[showAxis ? 'show' : 'hide']();
}
if (axisTitle && showAxis) {
axisTitle[axisTitle.isNew ? 'attr' : 'animate'](
axis.getTitlePosition()
);
axisTitle.isNew = false;
}
// Stacked totals:
if (stackLabelOptions && stackLabelOptions.enabled) {
axis.renderStackTotals();
}
// End stacked totals
axis.isDirty = false;
},
/**
* Redraw the axis to reflect changes in the data or axis extremes
*/
redraw: function () {
// render the axis
this.render();
// move plot lines and bands
each(this.plotLinesAndBands, function (plotLine) {
plotLine.render();
});
// mark associated series as dirty and ready for redraw
each(this.series, function (series) {
series.isDirty = true;
});
},
/**
* Destroys an Axis instance.
*/
destroy: function (keepEvents) {
var axis = this,
stacks = axis.stacks,
stackKey,
plotLinesAndBands = axis.plotLinesAndBands,
i;
// Remove the events
if (!keepEvents) {
removeEvent(axis);
}
// Destroy each stack total
for (stackKey in stacks) {
destroyObjectProperties(stacks[stackKey]);
stacks[stackKey] = null;
}
// Destroy collections
each([axis.ticks, axis.minorTicks, axis.alternateBands], function (coll) {
destroyObjectProperties(coll);
});
i = plotLinesAndBands.length;
while (i--) { // #1975
plotLinesAndBands[i].destroy();
}
// Destroy local variables
each(['stackTotalGroup', 'axisLine', 'axisTitle', 'axisGroup', 'cross', 'gridGroup', 'labelGroup'], function (prop) {
if (axis[prop]) {
axis[prop] = axis[prop].destroy();
}
});
// Destroy crosshair
if (this.cross) {
this.cross.destroy();
}
},
/**
* Draw the crosshair
*/
drawCrosshair: function (e, point) { // docs: Missing docs for Axis.crosshair. Also for properties.
var path,
options = this.crosshair,
animation = options.animation,
pos,
attribs,
categorized;
if (
// Disabled in options
!this.crosshair ||
// snap
((defined(point) || !pick(this.crosshair.snap, true)) === false) ||
// Do not draw the crosshair if this axis is not part of the point
(defined(point) && pick(this.crosshair.snap, true) && (!point.series || point.series[this.isXAxis ? 'xAxis' : 'yAxis'] !== this))
) {
this.hideCrosshair();
} else {
// Get the path
if (!pick(options.snap, true)) {
pos = (this.horiz ? e.chartX - this.pos : this.len - e.chartY + this.pos);
} else if (defined(point)) {
/*jslint eqeq: true*/
pos = (this.chart.inverted != this.horiz) ? point.plotX : this.len - point.plotY;
/*jslint eqeq: false*/
}
if (this.isRadial) {
path = this.getPlotLinePath(this.isXAxis ? point.x : pick(point.stackY, point.y)) || null; // #3189
} else {
path = this.getPlotLinePath(null, null, null, null, pos) || null; // #3189
}
if (path === null) {
this.hideCrosshair();
return;
}
// Draw the cross
if (this.cross) {
this.cross
.attr({ visibility: VISIBLE })[animation ? 'animate' : 'attr']({ d: path }, animation);
} else {
categorized = this.categories && !this.isRadial;
attribs = {
'stroke-width': options.width || (categorized ? this.transA : 1),
stroke: options.color || (categorized ? 'rgba(155,200,255,0.2)' : '#C0C0C0'),
zIndex: options.zIndex || 2
};
if (options.dashStyle) {
attribs.dashstyle = options.dashStyle;
}
this.cross = this.chart.renderer.path(path).attr(attribs).add();
}
}
},
/**
* Hide the crosshair.
*/
hideCrosshair: function () {
if (this.cross) {
this.cross.hide();
}
}
}; // end Axis
extend(Axis.prototype, AxisPlotLineOrBandExtension);
/**
* Set the tick positions to a time unit that makes sense, for example
* on the first of each month or on every Monday. Return an array
* with the time positions. Used in datetime axes as well as for grouping
* data on a datetime axis.
*
* @param {Object} normalizedInterval The interval in axis values (ms) and the count
* @param {Number} min The minimum in axis values
* @param {Number} max The maximum in axis values
* @param {Number} startOfWeek
*/
Axis.prototype.getTimeTicks = function (normalizedInterval, min, max, startOfWeek) {
var tickPositions = [],
i,
higherRanks = {},
useUTC = defaultOptions.global.useUTC,
minYear, // used in months and years as a basis for Date.UTC()
minDate = new Date(min - getTZOffset(min)),
interval = normalizedInterval.unitRange,
count = normalizedInterval.count;
if (defined(min)) { // #1300
minDate.setMilliseconds(interval >= timeUnits.second ? 0 :
count * mathFloor(minDate.getMilliseconds() / count)); // #3652, #3654
if (interval >= timeUnits.second) { // second
minDate.setSeconds(interval >= timeUnits.minute ? 0 :
count * mathFloor(minDate.getSeconds() / count));
}
if (interval >= timeUnits.minute) { // minute
minDate[setMinutes](interval >= timeUnits.hour ? 0 :
count * mathFloor(minDate[getMinutes]() / count));
}
if (interval >= timeUnits.hour) { // hour
minDate[setHours](interval >= timeUnits.day ? 0 :
count * mathFloor(minDate[getHours]() / count));
}
if (interval >= timeUnits.day) { // day
minDate[setDate](interval >= timeUnits.month ? 1 :
count * mathFloor(minDate[getDate]() / count));
}
if (interval >= timeUnits.month) { // month
minDate[setMonth](interval >= timeUnits.year ? 0 :
count * mathFloor(minDate[getMonth]() / count));
minYear = minDate[getFullYear]();
}
if (interval >= timeUnits.year) { // year
minYear -= minYear % count;
minDate[setFullYear](minYear);
}
// week is a special case that runs outside the hierarchy
if (interval === timeUnits.week) {
// get start of current week, independent of count
minDate[setDate](minDate[getDate]() - minDate[getDay]() +
pick(startOfWeek, 1));
}
// get tick positions
i = 1;
if (timezoneOffset || getTimezoneOffset) {
minDate = minDate.getTime();
minDate = new Date(minDate + getTZOffset(minDate));
}
minYear = minDate[getFullYear]();
var time = minDate.getTime(),
minMonth = minDate[getMonth](),
minDateDate = minDate[getDate](),
localTimezoneOffset = (timeUnits.day +
(useUTC ? getTZOffset(minDate) : minDate.getTimezoneOffset() * 60 * 1000)
) % timeUnits.day; // #950, #3359
// iterate and add tick positions at appropriate values
while (time < max) {
tickPositions.push(time);
// if the interval is years, use Date.UTC to increase years
if (interval === timeUnits.year) {
time = makeTime(minYear + i * count, 0);
// if the interval is months, use Date.UTC to increase months
} else if (interval === timeUnits.month) {
time = makeTime(minYear, minMonth + i * count);
// if we're using global time, the interval is not fixed as it jumps
// one hour at the DST crossover
} else if (!useUTC && (interval === timeUnits.day || interval === timeUnits.week)) {
time = makeTime(minYear, minMonth, minDateDate +
i * count * (interval === timeUnits.day ? 1 : 7));
// else, the interval is fixed and we use simple addition
} else {
time += interval * count;
}
i++;
}
// push the last time
tickPositions.push(time);
// mark new days if the time is dividible by day (#1649, #1760)
each(grep(tickPositions, function (time) {
return interval <= timeUnits.hour && time % timeUnits.day === localTimezoneOffset;
}), function (time) {
higherRanks[time] = 'day';
});
}
// record information on the chosen unit - for dynamic label formatter
tickPositions.info = extend(normalizedInterval, {
higherRanks: higherRanks,
totalRange: interval * count
});
return tickPositions;
};
/**
* Get a normalized tick interval for dates. Returns a configuration object with
* unit range (interval), count and name. Used to prepare data for getTimeTicks.
* Previously this logic was part of getTimeTicks, but as getTimeTicks now runs
* of segments in stock charts, the normalizing logic was extracted in order to
* prevent it for running over again for each segment having the same interval.
* #662, #697.
*/
Axis.prototype.normalizeTimeTickInterval = function (tickInterval, unitsOption) {
var units = unitsOption || [[
'millisecond', // unit name
[1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples
], [
'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
]],
unit = units[units.length - 1], // default unit is years
interval = timeUnits[unit[0]],
multiples = unit[1],
count,
i;
// loop through the units to find the one that best fits the tickInterval
for (i = 0; i < units.length; i++) {
unit = units[i];
interval = timeUnits[unit[0]];
multiples = unit[1];
if (units[i + 1]) {
// lessThan is in the middle between the highest multiple and the next unit.
var lessThan = (interval * multiples[multiples.length - 1] +
timeUnits[units[i + 1][0]]) / 2;
// break and keep the current unit
if (tickInterval <= lessThan) {
break;
}
}
}
// prevent 2.5 years intervals, though 25, 250 etc. are allowed
if (interval === timeUnits.year && tickInterval < 5 * interval) {
multiples = [1, 2, 5];
}
// get the count
count = normalizeTickInterval(
tickInterval / interval,
multiples,
unit[0] === 'year' ? mathMax(getMagnitude(tickInterval / interval), 1) : 1 // #1913, #2360
);
return {
unitRange: interval,
count: count,
unitName: unit[0]
};
};/**
* Methods defined on the Axis prototype
*/
/**
* Set the tick positions of a logarithmic axis
*/
Axis.prototype.getLogTickPositions = function (interval, min, max, minor) {
var axis = this,
options = axis.options,
axisLength = axis.len,
// Since we use this method for both major and minor ticks,
// use a local variable and return the result
positions = [];
// Reset
if (!minor) {
axis._minorAutoInterval = null;
}
// First case: All ticks fall on whole logarithms: 1, 10, 100 etc.
if (interval >= 0.5) {
interval = mathRound(interval);
positions = axis.getLinearTickPositions(interval, min, max);
// Second case: We need intermediary ticks. For example
// 1, 2, 4, 6, 8, 10, 20, 40 etc.
} else if (interval >= 0.08) {
var roundedMin = mathFloor(min),
intermediate,
i,
j,
len,
pos,
lastPos,
break2;
if (interval > 0.3) {
intermediate = [1, 2, 4];
} else if (interval > 0.15) { // 0.2 equals five minor ticks per 1, 10, 100 etc
intermediate = [1, 2, 4, 6, 8];
} else { // 0.1 equals ten minor ticks per 1, 10, 100 etc
intermediate = [1, 2, 3, 4, 5, 6, 7, 8, 9];
}
for (i = roundedMin; i < max + 1 && !break2; i++) {
len = intermediate.length;
for (j = 0; j < len && !break2; j++) {
pos = log2lin(lin2log(i) * intermediate[j]);
if (pos > min && (!minor || lastPos <= max) && lastPos !== UNDEFINED) { // #1670, lastPos is #3113
positions.push(lastPos);
}
if (lastPos > max) {
break2 = true;
}
lastPos = pos;
}
}
// Third case: We are so deep in between whole logarithmic values that
// we might as well handle the tick positions like a linear axis. For
// example 1.01, 1.02, 1.03, 1.04.
} else {
var realMin = lin2log(min),
realMax = lin2log(max),
tickIntervalOption = options[minor ? 'minorTickInterval' : 'tickInterval'],
filteredTickIntervalOption = tickIntervalOption === 'auto' ? null : tickIntervalOption,
tickPixelIntervalOption = options.tickPixelInterval / (minor ? 5 : 1),
totalPixelLength = minor ? axisLength / axis.tickPositions.length : axisLength;
interval = pick(
filteredTickIntervalOption,
axis._minorAutoInterval,
(realMax - realMin) * tickPixelIntervalOption / (totalPixelLength || 1)
);
interval = normalizeTickInterval(
interval,
null,
getMagnitude(interval)
);
positions = map(axis.getLinearTickPositions(
interval,
realMin,
realMax
), log2lin);
if (!minor) {
axis._minorAutoInterval = interval / 5;
}
}
// Set the axis-level tickInterval variable
if (!minor) {
axis.tickInterval = interval;
}
return positions;
};/**
* The tooltip object
* @param {Object} chart The chart instance
* @param {Object} options Tooltip options
*/
var Tooltip = Highcharts.Tooltip = function () {
this.init.apply(this, arguments);
};
Tooltip.prototype = {
init: function (chart, options) {
var borderWidth = options.borderWidth,
style = options.style,
padding = pInt(style.padding);
// Save the chart and options
this.chart = chart;
this.options = options;
// Keep track of the current series
//this.currentSeries = UNDEFINED;
// List of crosshairs
this.crosshairs = [];
// Current values of x and y when animating
this.now = { x: 0, y: 0 };
// The tooltip is initially hidden
this.isHidden = true;
// create the label
this.label = chart.renderer.label('', 0, 0, options.shape || 'callout', null, null, options.useHTML, null, 'tooltip')
.attr({
padding: padding,
fill: options.backgroundColor,
'stroke-width': borderWidth,
r: options.borderRadius,
zIndex: 8
})
.css(style)
.css({ padding: 0 }) // Remove it from VML, the padding is applied as an attribute instead (#1117)
.add()
.attr({ y: -9999 }); // #2301, #2657
// When using canVG the shadow shows up as a gray circle
// even if the tooltip is hidden.
if (!useCanVG) {
this.label.shadow(options.shadow);
}
// Public property for getting the shared state.
this.shared = options.shared;
},
/**
* Destroy the tooltip and its elements.
*/
destroy: function () {
// Destroy and clear local variables
if (this.label) {
this.label = this.label.destroy();
}
clearTimeout(this.hideTimer);
clearTimeout(this.tooltipTimeout);
},
/**
* Provide a soft movement for the tooltip
*
* @param {Number} x
* @param {Number} y
* @private
*/
move: function (x, y, anchorX, anchorY) {
var tooltip = this,
now = tooltip.now,
animate = tooltip.options.animation !== false && !tooltip.isHidden &&
// When we get close to the target position, abort animation and land on the right place (#3056)
(mathAbs(x - now.x) > 1 || mathAbs(y - now.y) > 1),
skipAnchor = tooltip.followPointer || tooltip.len > 1;
// Get intermediate values for animation
extend(now, {
x: animate ? (2 * now.x + x) / 3 : x,
y: animate ? (now.y + y) / 2 : y,
anchorX: skipAnchor ? UNDEFINED : animate ? (2 * now.anchorX + anchorX) / 3 : anchorX,
anchorY: skipAnchor ? UNDEFINED : animate ? (now.anchorY + anchorY) / 2 : anchorY
});
// Move to the intermediate value
tooltip.label.attr(now);
// Run on next tick of the mouse tracker
if (animate) {
// Never allow two timeouts
clearTimeout(this.tooltipTimeout);
// Set the fixed interval ticking for the smooth tooltip
this.tooltipTimeout = setTimeout(function () {
// The interval function may still be running during destroy, so check that the chart is really there before calling.
if (tooltip) {
tooltip.move(x, y, anchorX, anchorY);
}
}, 32);
}
},
/**
* Hide the tooltip
*/
hide: function (delay) {
var tooltip = this,
hoverPoints;
clearTimeout(this.hideTimer); // disallow duplicate timers (#1728, #1766)
if (!this.isHidden) {
hoverPoints = this.chart.hoverPoints;
this.hideTimer = setTimeout(function () {
tooltip.label.fadeOut();
tooltip.isHidden = true;
}, pick(delay, this.options.hideDelay, 500));
// hide previous hoverPoints and set new
if (hoverPoints) {
each(hoverPoints, function (point) {
point.setState();
});
}
this.chart.hoverPoints = null;
this.chart.hoverSeries = null;
}
},
/**
* Extendable method to get the anchor position of the tooltip
* from a point or set of points
*/
getAnchor: function (points, mouseEvent) {
var ret,
chart = this.chart,
inverted = chart.inverted,
plotTop = chart.plotTop,
plotLeft = chart.plotLeft,
plotX = 0,
plotY = 0,
yAxis,
xAxis;
points = splat(points);
// Pie uses a special tooltipPos
ret = points[0].tooltipPos;
// When tooltip follows mouse, relate the position to the mouse
if (this.followPointer && mouseEvent) {
if (mouseEvent.chartX === UNDEFINED) {
mouseEvent = chart.pointer.normalize(mouseEvent);
}
ret = [
mouseEvent.chartX - chart.plotLeft,
mouseEvent.chartY - plotTop
];
}
// When shared, use the average position
if (!ret) {
each(points, function (point) {
yAxis = point.series.yAxis;
xAxis = point.series.xAxis;
plotX += point.plotX + (!inverted && xAxis ? xAxis.left - plotLeft : 0);
plotY += (point.plotLow ? (point.plotLow + point.plotHigh) / 2 : point.plotY) +
(!inverted && yAxis ? yAxis.top - plotTop : 0); // #1151
});
plotX /= points.length;
plotY /= points.length;
ret = [
inverted ? chart.plotWidth - plotY : plotX,
this.shared && !inverted && points.length > 1 && mouseEvent ?
mouseEvent.chartY - plotTop : // place shared tooltip next to the mouse (#424)
inverted ? chart.plotHeight - plotX : plotY
];
}
return map(ret, mathRound);
},
/**
* Place the tooltip in a chart without spilling over
* and not covering the point it self.
*/
getPosition: function (boxWidth, boxHeight, point) {
var chart = this.chart,
distance = this.distance,
ret = {},
swapped,
first = ['y', chart.chartHeight, boxHeight, point.plotY + chart.plotTop],
second = ['x', chart.chartWidth, boxWidth, point.plotX + chart.plotLeft],
// The far side is right or bottom
preferFarSide = pick(point.ttBelow, (chart.inverted && !point.negative) || (!chart.inverted && point.negative)),
/**
* Handle the preferred dimension. When the preferred dimension is tooltip
* on top or bottom of the point, it will look for space there.
*/
firstDimension = function (dim, outerSize, innerSize, point) {
var roomLeft = innerSize < point - distance,
roomRight = point + distance + innerSize < outerSize,
alignedLeft = point - distance - innerSize,
alignedRight = point + distance;
if (preferFarSide && roomRight) {
ret[dim] = alignedRight;
} else if (!preferFarSide && roomLeft) {
ret[dim] = alignedLeft;
} else if (roomLeft) {
ret[dim] = alignedLeft;
} else if (roomRight) {
ret[dim] = alignedRight;
} else {
return false;
}
},
/**
* Handle the secondary dimension. If the preferred dimension is tooltip
* on top or bottom of the point, the second dimension is to align the tooltip
* above the point, trying to align center but allowing left or right
* align within the chart box.
*/
secondDimension = function (dim, outerSize, innerSize, point) {
// Too close to the edge, return false and swap dimensions
if (point < distance || point > outerSize - distance) {
return false;
// Align left/top
} else if (point < innerSize / 2) {
ret[dim] = 1;
// Align right/bottom
} else if (point > outerSize - innerSize / 2) {
ret[dim] = outerSize - innerSize - 2;
// Align center
} else {
ret[dim] = point - innerSize / 2;
}
},
/**
* Swap the dimensions
*/
swap = function (count) {
var temp = first;
first = second;
second = temp;
swapped = count;
},
run = function () {
if (firstDimension.apply(0, first) !== false) {
if (secondDimension.apply(0, second) === false && !swapped) {
swap(true);
run();
}
} else if (!swapped) {
swap(true);
run();
} else {
ret.x = ret.y = 0;
}
};
// Under these conditions, prefer the tooltip on the side of the point
if (chart.inverted || this.len > 1) {
swap();
}
run();
return ret;
},
/**
* In case no user defined formatter is given, this will be used. Note that the context
* here is an object holding point, series, x, y etc.
*/
defaultFormatter: function (tooltip) {
var items = this.points || splat(this),
s;
// build the header
s = [tooltip.tooltipFooterHeaderFormatter(items[0])]; //#3397: abstraction to enable formatting of footer and header
// build the values
s = s.concat(tooltip.bodyFormatter(items));
// footer
s.push(tooltip.tooltipFooterHeaderFormatter(items[0], true)); //#3397: abstraction to enable formatting of footer and header
return s.join('');
},
/**
* Refresh the tooltip's text and position.
* @param {Object} point
*/
refresh: function (point, mouseEvent) {
var tooltip = this,
chart = tooltip.chart,
label = tooltip.label,
options = tooltip.options,
x,
y,
anchor,
textConfig = {},
text,
pointConfig = [],
formatter = options.formatter || tooltip.defaultFormatter,
hoverPoints = chart.hoverPoints,
borderColor,
shared = tooltip.shared,
currentSeries;
clearTimeout(this.hideTimer);
// get the reference point coordinates (pie charts use tooltipPos)
tooltip.followPointer = splat(point)[0].series.tooltipOptions.followPointer;
anchor = tooltip.getAnchor(point, mouseEvent);
x = anchor[0];
y = anchor[1];
// shared tooltip, array is sent over
if (shared && !(point.series && point.series.noSharedTooltip)) {
// hide previous hoverPoints and set new
chart.hoverPoints = point;
if (hoverPoints) {
each(hoverPoints, function (point) {
point.setState();
});
}
each(point, function (item) {
item.setState(HOVER_STATE);
pointConfig.push(item.getLabelConfig());
});
textConfig = {
x: point[0].category,
y: point[0].y
};
textConfig.points = pointConfig;
this.len = pointConfig.length;
point = point[0];
// single point tooltip
} else {
textConfig = point.getLabelConfig();
}
text = formatter.call(textConfig, tooltip);
// register the current series
currentSeries = point.series;
this.distance = pick(currentSeries.tooltipOptions.distance, 16);
// update the inner HTML
if (text === false) {
this.hide();
} else {
// show it
if (tooltip.isHidden) {
stop(label);
label.attr('opacity', 1).show();
}
// update text
label.attr({
text: text
});
// set the stroke color of the box
borderColor = options.borderColor || point.color || currentSeries.color || '#606060';
label.attr({
stroke: borderColor
});
tooltip.updatePosition({ plotX: x, plotY: y, negative: point.negative, ttBelow: point.ttBelow });
this.isHidden = false;
}
fireEvent(chart, 'tooltipRefresh', {
text: text,
x: x + chart.plotLeft,
y: y + chart.plotTop,
borderColor: borderColor
});
},
/**
* Find the new position and perform the move
*/
updatePosition: function (point) {
var chart = this.chart,
label = this.label,
pos = (this.options.positioner || this.getPosition).call(
this,
label.width,
label.height,
point
);
// do the move
this.move(
mathRound(pos.x),
mathRound(pos.y),
point.plotX + chart.plotLeft,
point.plotY + chart.plotTop
);
},
/**
* Get the best X date format based on the closest point range on the axis.
*/
getXDateFormat: function (point, options, xAxis) {
var xDateFormat,
dateTimeLabelFormats = options.dateTimeLabelFormats,
closestPointRange = xAxis && xAxis.closestPointRange,
n,
blank = '01-01 00:00:00.000',
strpos = {
millisecond: 15,
second: 12,
minute: 9,
hour: 6,
day: 3
},
date,
lastN;
if (closestPointRange) {
date = dateFormat('%m-%d %H:%M:%S.%L', point.x);
for (n in timeUnits) {
// If the range is exactly one week and we're looking at a Sunday/Monday, go for the week format
if (closestPointRange === timeUnits.week && +dateFormat('%w', point.x) === xAxis.options.startOfWeek &&
date.substr(6) === blank.substr(6)) {
n = 'week';
break;
// The first format that is too great for the range
} else if (timeUnits[n] > closestPointRange) {
n = lastN;
break;
// If the point is placed every day at 23:59, we need to show
// the minutes as well. #2637.
} else if (strpos[n] && date.substr(strpos[n]) !== blank.substr(strpos[n])) {
break;
}
// Weeks are outside the hierarchy, only apply them on Mondays/Sundays like in the first condition
if (n !== 'week') {
lastN = n;
}
}
if (n) {
xDateFormat = dateTimeLabelFormats[n];
}
} else {
xDateFormat = dateTimeLabelFormats.day;
}
return xDateFormat || dateTimeLabelFormats.year; // #2546, 2581
},
/**
* Format the footer/header of the tooltip
* #3397: abstraction to enable formatting of footer and header
*/
tooltipFooterHeaderFormatter: function (point, isFooter) {
var footOrHead = isFooter ? 'footer' : 'header',
series = point.series,
tooltipOptions = series.tooltipOptions,
xDateFormat = tooltipOptions.xDateFormat,
xAxis = series.xAxis,
isDateTime = xAxis && xAxis.options.type === 'datetime' && isNumber(point.key),
formatString = tooltipOptions[footOrHead+'Format'];
// Guess the best date format based on the closest point distance (#568, #3418)
if (isDateTime && !xDateFormat) {
xDateFormat = this.getXDateFormat(point, tooltipOptions, xAxis);
}
// Insert the footer date format if any
if (isDateTime && xDateFormat) {
formatString = formatString.replace('{point.key}', '{point.key:' + xDateFormat + '}');
}
return format(formatString, {
point: point,
series: series
});
},
/**
* Build the body (lines) of the tooltip by iterating over the items and returning one entry for each item,
* abstracting this functionality allows to easily overwrite and extend it.
*/
bodyFormatter: function (items) {
return map(items, function (item) {
var tooltipOptions = item.series.tooltipOptions;
return (tooltipOptions.pointFormatter || item.point.tooltipFormatter).call(item.point, tooltipOptions.pointFormat);
});
}
};
var hoverChartIndex;
// Global flag for touch support
hasTouch = doc.documentElement.ontouchstart !== UNDEFINED;
/**
* The mouse tracker object. All methods starting with "on" are primary DOM event handlers.
* Subsequent methods should be named differently from what they are doing.
* @param {Object} chart The Chart instance
* @param {Object} options The root options object
*/
var Pointer = Highcharts.Pointer = function (chart, options) {
this.init(chart, options);
};
Pointer.prototype = {
/**
* Initialize Pointer
*/
init: function (chart, options) {
var chartOptions = options.chart,
chartEvents = chartOptions.events,
zoomType = useCanVG ? '' : chartOptions.zoomType,
inverted = chart.inverted,
zoomX,
zoomY;
// Store references
this.options = options;
this.chart = chart;
// Zoom status
this.zoomX = zoomX = /x/.test(zoomType);
this.zoomY = zoomY = /y/.test(zoomType);
this.zoomHor = (zoomX && !inverted) || (zoomY && inverted);
this.zoomVert = (zoomY && !inverted) || (zoomX && inverted);
this.hasZoom = zoomX || zoomY;
// Do we need to handle click on a touch device?
this.runChartClick = chartEvents && !!chartEvents.click;
this.pinchDown = [];
this.lastValidTouch = {};
if (Highcharts.Tooltip && options.tooltip.enabled) {
chart.tooltip = new Tooltip(chart, options.tooltip);
this.followTouchMove = pick(options.tooltip.followTouchMove, true);
}
this.setDOMEvents();
},
/**
* Add crossbrowser support for chartX and chartY
* @param {Object} e The event object in standard browsers
*/
normalize: function (e, chartPosition) {
var chartX,
chartY,
ePos;
// common IE normalizing
e = e || window.event;
// Framework specific normalizing (#1165)
e = washMouseEvent(e);
// More IE normalizing, needs to go after washMouseEvent
if (!e.target) {
e.target = e.srcElement;
}
// iOS (#2757)
ePos = e.touches ? (e.touches.length ? e.touches.item(0) : e.changedTouches[0]) : e;
// Get mouse position
if (!chartPosition) {
this.chartPosition = chartPosition = offset(this.chart.container);
}
// chartX and chartY
if (ePos.pageX === UNDEFINED) { // IE < 9. #886.
chartX = mathMax(e.x, e.clientX - chartPosition.left); // #2005, #2129: the second case is
// for IE10 quirks mode within framesets
chartY = e.y;
} else {
chartX = ePos.pageX - chartPosition.left;
chartY = ePos.pageY - chartPosition.top;
}
return extend(e, {
chartX: mathRound(chartX),
chartY: mathRound(chartY)
});
},
/**
* Get the click position in terms of axis values.
*
* @param {Object} e A pointer event
*/
getCoordinates: function (e) {
var coordinates = {
xAxis: [],
yAxis: []
};
each(this.chart.axes, function (axis) {
coordinates[axis.isXAxis ? 'xAxis' : 'yAxis'].push({
axis: axis,
value: axis.toValue(e[axis.horiz ? 'chartX' : 'chartY'])
});
});
return coordinates;
},
/**
* With line type charts with a single tracker, get the point closest to the mouse.
* Run Point.onMouseOver and display tooltip for the point or points.
*/
runPointActions: function (e) {
var pointer = this,
chart = pointer.chart,
series = chart.series,
tooltip = chart.tooltip,
shared = tooltip ? tooltip.shared : false,
followPointer,
//point,
//points,
hoverPoint = chart.hoverPoint,
hoverSeries = chart.hoverSeries,
i,
trueXkd,
trueX,
//j,
distance = chart.chartWidth,
rdistance = chart.chartWidth,
anchor,
noSharedTooltip,
kdpoints = [],
kdpoint;
// For hovering over the empty parts of the plot area (hoverSeries is undefined).
// If there is one series with point tracking (combo chart), don't go to nearest neighbour.
if (!shared && !hoverSeries) {
for (i = 0; i < series.length; i++) {
if (series[i].directTouch || !series[i].options.stickyTracking) {
series = [];
}
}
}
if (!(hoverSeries && hoverSeries.noSharedTooltip) && (shared || !hoverSeries)) { // #3821
// Find nearest points on all series
each(series, function (s) {
// Skip hidden series
noSharedTooltip = s.noSharedTooltip && shared;
if (s.visible && !noSharedTooltip && pick(s.options.enableMouseTracking, true)) { // #3821
kdpoints.push(s.searchPoint(e));
}
});
// Find absolute nearest point
each(kdpoints, function (p) {
if (p && defined(p.plotX) && defined(p.plotY)) {
if ((p.dist.distX < distance) || ((p.dist.distX === distance || p.series.kdDimensions > 1) && p.dist.distR < rdistance)) {
distance = p.dist.distX;
rdistance = p.dist.distR;
kdpoint = p;
}
}
//point = kdpoints[0];
});
} else {
kdpoint = hoverSeries ? hoverSeries.searchPoint(e) : UNDEFINED;
}
// Refresh tooltip for kdpoint
if (kdpoint && tooltip && kdpoint !== hoverPoint) {
// Draw tooltip if necessary
if (shared && !kdpoint.series.noSharedTooltip) {
i = kdpoints.length;
trueXkd = kdpoint.plotX + kdpoint.series.xAxis.left;
while (i--) {
trueX = kdpoints[i].plotX + kdpoints[i].series.xAxis.left;
if (kdpoints[i].x !== kdpoint.x || trueX !== trueXkd || !defined(kdpoints[i].y) || (kdpoints[i].series.noSharedTooltip || false)) {
kdpoints.splice(i, 1);
}
}
tooltip.refresh(kdpoints, e);
each(kdpoints, function (point) {
point.onMouseOver(e);
});
} else {
tooltip.refresh(kdpoint, e);
kdpoint.onMouseOver(e);
}
// Update positions (regardless of kdpoint or hoverPoint)
} else {
followPointer = hoverSeries && hoverSeries.tooltipOptions.followPointer;
if (tooltip && followPointer && !tooltip.isHidden) {
anchor = tooltip.getAnchor([{}], e);
tooltip.updatePosition({ plotX: anchor[0], plotY: anchor[1] });
}
}
// Crosshair
each(chart.axes, function (axis) {
axis.drawCrosshair(e, pick(kdpoint, hoverPoint));
});
},
/**
* Reset the tracking by hiding the tooltip, the hover series state and the hover point
*
* @param allowMove {Boolean} Instead of destroying the tooltip altogether, allow moving it if possible
*/
reset: function (allowMove, delay) {
var pointer = this,
chart = pointer.chart,
hoverSeries = chart.hoverSeries,
hoverPoint = chart.hoverPoint,
tooltip = chart.tooltip,
tooltipPoints = tooltip && tooltip.shared ? chart.hoverPoints : hoverPoint;
// Narrow in allowMove
allowMove = allowMove && tooltip && tooltipPoints;
// Check if the points have moved outside the plot area, #1003
if (allowMove && splat(tooltipPoints)[0].plotX === UNDEFINED) {
allowMove = false;
}
// Just move the tooltip, #349
if (allowMove) {
tooltip.refresh(tooltipPoints);
if (hoverPoint) { // #2500
hoverPoint.setState(hoverPoint.state, true);
each(chart.axes, function (axis) {
if (pick(axis.options.crosshair && axis.options.crosshair.snap, true)) {
axis.drawCrosshair(null, allowMove);
} else {
axis.hideCrosshair();
}
});
}
// Full reset
} else {
if (hoverPoint) {
hoverPoint.onMouseOut();
}
if (hoverSeries) {
hoverSeries.onMouseOut();
}
if (tooltip) {
tooltip.hide(delay);
}
if (pointer._onDocumentMouseMove) {
removeEvent(doc, 'mousemove', pointer._onDocumentMouseMove);
pointer._onDocumentMouseMove = null;
}
// Remove crosshairs
each(chart.axes, function (axis) {
axis.hideCrosshair();
});
pointer.hoverX = null;
}
},
/**
* Scale series groups to a certain scale and translation
*/
scaleGroups: function (attribs, clip) {
var chart = this.chart,
seriesAttribs;
// Scale each series
each(chart.series, function (series) {
seriesAttribs = attribs || series.getPlotBox(); // #1701
if (series.xAxis && series.xAxis.zoomEnabled) {
series.group.attr(seriesAttribs);
if (series.markerGroup) {
series.markerGroup.attr(seriesAttribs);
series.markerGroup.clip(clip ? chart.clipRect : null);
}
if (series.dataLabelsGroup) {
series.dataLabelsGroup.attr(seriesAttribs);
}
}
});
// Clip
chart.clipRect.attr(clip || chart.clipBox);
},
/**
* Start a drag operation
*/
dragStart: function (e) {
var chart = this.chart;
// Record the start position
chart.mouseIsDown = e.type;
chart.cancelClick = false;
chart.mouseDownX = this.mouseDownX = e.chartX;
chart.mouseDownY = this.mouseDownY = e.chartY;
},
/**
* Perform a drag operation in response to a mousemove event while the mouse is down
*/
drag: function (e) {
var chart = this.chart,
chartOptions = chart.options.chart,
chartX = e.chartX,
chartY = e.chartY,
zoomHor = this.zoomHor,
zoomVert = this.zoomVert,
plotLeft = chart.plotLeft,
plotTop = chart.plotTop,
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
clickedInside,
size,
mouseDownX = this.mouseDownX,
mouseDownY = this.mouseDownY,
panKey = chartOptions.panKey && e[chartOptions.panKey + 'Key'];
// If the mouse is outside the plot area, adjust to cooordinates
// inside to prevent the selection marker from going outside
if (chartX < plotLeft) {
chartX = plotLeft;
} else if (chartX > plotLeft + plotWidth) {
chartX = plotLeft + plotWidth;
}
if (chartY < plotTop) {
chartY = plotTop;
} else if (chartY > plotTop + plotHeight) {
chartY = plotTop + plotHeight;
}
// determine if the mouse has moved more than 10px
this.hasDragged = Math.sqrt(
Math.pow(mouseDownX - chartX, 2) +
Math.pow(mouseDownY - chartY, 2)
);
if (this.hasDragged > 10) {
clickedInside = chart.isInsidePlot(mouseDownX - plotLeft, mouseDownY - plotTop);
// make a selection
if (chart.hasCartesianSeries && (this.zoomX || this.zoomY) && clickedInside && !panKey) {
if (!this.selectionMarker) {
this.selectionMarker = chart.renderer.rect(
plotLeft,
plotTop,
zoomHor ? 1 : plotWidth,
zoomVert ? 1 : plotHeight,
0
)
.attr({
fill: chartOptions.selectionMarkerFill || 'rgba(69,114,167,0.25)',
zIndex: 7
})
.add();
}
}
// adjust the width of the selection marker
if (this.selectionMarker && zoomHor) {
size = chartX - mouseDownX;
this.selectionMarker.attr({
width: mathAbs(size),
x: (size > 0 ? 0 : size) + mouseDownX
});
}
// adjust the height of the selection marker
if (this.selectionMarker && zoomVert) {
size = chartY - mouseDownY;
this.selectionMarker.attr({
height: mathAbs(size),
y: (size > 0 ? 0 : size) + mouseDownY
});
}
// panning
if (clickedInside && !this.selectionMarker && chartOptions.panning) {
chart.pan(e, chartOptions.panning);
}
}
},
/**
* On mouse up or touch end across the entire document, drop the selection.
*/
drop: function (e) {
var pointer = this,
chart = this.chart,
hasPinched = this.hasPinched;
if (this.selectionMarker) {
var selectionData = {
xAxis: [],
yAxis: [],
originalEvent: e.originalEvent || e
},
selectionBox = this.selectionMarker,
selectionLeft = selectionBox.attr ? selectionBox.attr('x') : selectionBox.x,
selectionTop = selectionBox.attr ? selectionBox.attr('y') : selectionBox.y,
selectionWidth = selectionBox.attr ? selectionBox.attr('width') : selectionBox.width,
selectionHeight = selectionBox.attr ? selectionBox.attr('height') : selectionBox.height,
runZoom;
// a selection has been made
if (this.hasDragged || hasPinched) {
// record each axis' min and max
each(chart.axes, function (axis) {
if (axis.zoomEnabled && defined(axis.min) && (hasPinched || pointer[{ xAxis: 'zoomX', yAxis: 'zoomY' }[axis.coll]])) { // #859, #3569
var horiz = axis.horiz,
minPixelPadding = e.type === 'touchend' ? axis.minPixelPadding: 0, // #1207, #3075
selectionMin = axis.toValue((horiz ? selectionLeft : selectionTop) + minPixelPadding),
selectionMax = axis.toValue((horiz ? selectionLeft + selectionWidth : selectionTop + selectionHeight) - minPixelPadding);
selectionData[axis.coll].push({
axis: axis,
min: mathMin(selectionMin, selectionMax), // for reversed axes
max: mathMax(selectionMin, selectionMax)
});
runZoom = true;
}
});
if (runZoom) {
fireEvent(chart, 'selection', selectionData, function (args) {
chart.zoom(extend(args, hasPinched ? { animation: false } : null));
});
}
}
this.selectionMarker = this.selectionMarker.destroy();
// Reset scaling preview
if (hasPinched) {
this.scaleGroups();
}
}
// Reset all
if (chart) { // it may be destroyed on mouse up - #877
css(chart.container, { cursor: chart._cursor });
chart.cancelClick = this.hasDragged > 10; // #370
chart.mouseIsDown = this.hasDragged = this.hasPinched = false;
this.pinchDown = [];
}
},
onContainerMouseDown: function (e) {
e = this.normalize(e);
// issue #295, dragging not always working in Firefox
if (e.preventDefault) {
e.preventDefault();
}
this.dragStart(e);
},
onDocumentMouseUp: function (e) {
if (charts[hoverChartIndex]) {
charts[hoverChartIndex].pointer.drop(e);
}
},
/**
* Special handler for mouse move that will hide the tooltip when the mouse leaves the plotarea.
* Issue #149 workaround. The mouseleave event does not always fire.
*/
onDocumentMouseMove: function (e) {
var chart = this.chart,
chartPosition = this.chartPosition,
hoverSeries = chart.hoverSeries;
e = this.normalize(e, chartPosition);
// If we're outside, hide the tooltip
if (chartPosition && hoverSeries && !this.inClass(e.target, 'highcharts-tracker') &&
!chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {
this.reset();
}
},
/**
* When mouse leaves the container, hide the tooltip.
*/
onContainerMouseLeave: function () {
var chart = charts[hoverChartIndex];
if (chart) {
chart.pointer.reset();
chart.pointer.chartPosition = null; // also reset the chart position, used in #149 fix
}
},
// The mousemove, touchmove and touchstart event handler
onContainerMouseMove: function (e) {
var chart = this.chart;
hoverChartIndex = chart.index;
e = this.normalize(e);
e.returnValue = false; // #2251, #3224
if (chart.mouseIsDown === 'mousedown') {
this.drag(e);
}
// Show the tooltip and run mouse over events (#977)
if ((this.inClass(e.target, 'highcharts-tracker') ||
chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) && !chart.openMenu) {
this.runPointActions(e);
}
},
/**
* Utility to detect whether an element has, or has a parent with, a specific
* class name. Used on detection of tracker objects and on deciding whether
* hovering the tooltip should cause the active series to mouse out.
*/
inClass: function (element, className) {
var elemClassName;
while (element) {
elemClassName = attr(element, 'class');
if (elemClassName) {
if (elemClassName.indexOf(className) !== -1) {
return true;
} else if (elemClassName.indexOf(PREFIX + 'container') !== -1) {
return false;
}
}
element = element.parentNode;
}
},
onTrackerMouseOut: function (e) {
var series = this.chart.hoverSeries,
relatedTarget = e.relatedTarget || e.toElement,
relatedSeries = relatedTarget && relatedTarget.point && relatedTarget.point.series; // #2499
if (series && !series.options.stickyTracking && !this.inClass(relatedTarget, PREFIX + 'tooltip') &&
relatedSeries !== series) {
series.onMouseOut();
}
},
onContainerClick: function (e) {
var chart = this.chart,
hoverPoint = chart.hoverPoint,
plotLeft = chart.plotLeft,
plotTop = chart.plotTop;
e = this.normalize(e);
e.cancelBubble = true; // IE specific
if (!chart.cancelClick) {
// On tracker click, fire the series and point events. #783, #1583
if (hoverPoint && this.inClass(e.target, PREFIX + 'tracker')) {
// the series click event
fireEvent(hoverPoint.series, 'click', extend(e, {
point: hoverPoint
}));
// the point click event
if (chart.hoverPoint) { // it may be destroyed (#1844)
hoverPoint.firePointEvent('click', e);
}
// When clicking outside a tracker, fire a chart event
} else {
extend(e, this.getCoordinates(e));
// fire a click event in the chart
if (chart.isInsidePlot(e.chartX - plotLeft, e.chartY - plotTop)) {
fireEvent(chart, 'click', e);
}
}
}
},
/**
* Set the JS DOM events on the container and document. This method should contain
* a one-to-one assignment between methods and their handlers. Any advanced logic should
* be moved to the handler reflecting the event's name.
*/
setDOMEvents: function () {
var pointer = this,
container = pointer.chart.container;
container.onmousedown = function (e) {
pointer.onContainerMouseDown(e);
};
container.onmousemove = function (e) {
pointer.onContainerMouseMove(e);
};
container.onclick = function (e) {
pointer.onContainerClick(e);
};
addEvent(container, 'mouseleave', pointer.onContainerMouseLeave);
if (chartCount === 1) {
addEvent(doc, 'mouseup', pointer.onDocumentMouseUp);
}
if (hasTouch) {
container.ontouchstart = function (e) {
pointer.onContainerTouchStart(e);
};
container.ontouchmove = function (e) {
pointer.onContainerTouchMove(e);
};
if (chartCount === 1) {
addEvent(doc, 'touchend', pointer.onDocumentTouchEnd);
}
}
},
/**
* Destroys the Pointer object and disconnects DOM events.
*/
destroy: function () {
var prop;
removeEvent(this.chart.container, 'mouseleave', this.onContainerMouseLeave);
if (!chartCount) {
removeEvent(doc, 'mouseup', this.onDocumentMouseUp);
removeEvent(doc, 'touchend', this.onDocumentTouchEnd);
}
// memory and CPU leak
clearInterval(this.tooltipTimeout);
for (prop in this) {
this[prop] = null;
}
}
};
/* Support for touch devices */
extend(Highcharts.Pointer.prototype, {
/**
* Run translation operations
*/
pinchTranslate: function (pinchDown, touches, transform, selectionMarker, clip, lastValidTouch) {
if (this.zoomHor || this.pinchHor) {
this.pinchTranslateDirection(true, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
}
if (this.zoomVert || this.pinchVert) {
this.pinchTranslateDirection(false, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
}
},
/**
* Run translation operations for each direction (horizontal and vertical) independently
*/
pinchTranslateDirection: function (horiz, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch, forcedScale) {
var chart = this.chart,
xy = horiz ? 'x' : 'y',
XY = horiz ? 'X' : 'Y',
sChartXY = 'chart' + XY,
wh = horiz ? 'width' : 'height',
plotLeftTop = chart['plot' + (horiz ? 'Left' : 'Top')],
selectionWH,
selectionXY,
clipXY,
scale = forcedScale || 1,
inverted = chart.inverted,
bounds = chart.bounds[horiz ? 'h' : 'v'],
singleTouch = pinchDown.length === 1,
touch0Start = pinchDown[0][sChartXY],
touch0Now = touches[0][sChartXY],
touch1Start = !singleTouch && pinchDown[1][sChartXY],
touch1Now = !singleTouch && touches[1][sChartXY],
outOfBounds,
transformScale,
scaleKey,
setScale = function () {
if (!singleTouch && mathAbs(touch0Start - touch1Start) > 20) { // Don't zoom if fingers are too close on this axis
scale = forcedScale || mathAbs(touch0Now - touch1Now) / mathAbs(touch0Start - touch1Start);
}
clipXY = ((plotLeftTop - touch0Now) / scale) + touch0Start;
selectionWH = chart['plot' + (horiz ? 'Width' : 'Height')] / scale;
};
// Set the scale, first pass
setScale();
selectionXY = clipXY; // the clip position (x or y) is altered if out of bounds, the selection position is not
// Out of bounds
if (selectionXY < bounds.min) {
selectionXY = bounds.min;
outOfBounds = true;
} else if (selectionXY + selectionWH > bounds.max) {
selectionXY = bounds.max - selectionWH;
outOfBounds = true;
}
// Is the chart dragged off its bounds, determined by dataMin and dataMax?
if (outOfBounds) {
// Modify the touchNow position in order to create an elastic drag movement. This indicates
// to the user that the chart is responsive but can't be dragged further.
touch0Now -= 0.8 * (touch0Now - lastValidTouch[xy][0]);
if (!singleTouch) {
touch1Now -= 0.8 * (touch1Now - lastValidTouch[xy][1]);
}
// Set the scale, second pass to adapt to the modified touchNow positions
setScale();
} else {
lastValidTouch[xy] = [touch0Now, touch1Now];
}
// Set geometry for clipping, selection and transformation
if (!inverted) { // TODO: implement clipping for inverted charts
clip[xy] = clipXY - plotLeftTop;
clip[wh] = selectionWH;
}
scaleKey = inverted ? (horiz ? 'scaleY' : 'scaleX') : 'scale' + XY;
transformScale = inverted ? 1 / scale : scale;
selectionMarker[wh] = selectionWH;
selectionMarker[xy] = selectionXY;
transform[scaleKey] = scale;
transform['translate' + XY] = (transformScale * plotLeftTop) + (touch0Now - (transformScale * touch0Start));
},
/**
* Handle touch events with two touches
*/
pinch: function (e) {
var self = this,
chart = self.chart,
pinchDown = self.pinchDown,
touches = e.touches,
touchesLength = touches.length,
lastValidTouch = self.lastValidTouch,
hasZoom = self.hasZoom,
selectionMarker = self.selectionMarker,
transform = {},
fireClickEvent = touchesLength === 1 && ((self.inClass(e.target, PREFIX + 'tracker') &&
chart.runTrackerClick) || self.runChartClick),
clip = {};
// On touch devices, only proceed to trigger click if a handler is defined
if (hasZoom && !fireClickEvent) {
e.preventDefault();
}
// Normalize each touch
map(touches, function (e) {
return self.normalize(e);
});
// Register the touch start position
if (e.type === 'touchstart') {
each(touches, function (e, i) {
pinchDown[i] = { chartX: e.chartX, chartY: e.chartY };
});
lastValidTouch.x = [pinchDown[0].chartX, pinchDown[1] && pinchDown[1].chartX];
lastValidTouch.y = [pinchDown[0].chartY, pinchDown[1] && pinchDown[1].chartY];
// Identify the data bounds in pixels
each(chart.axes, function (axis) {
if (axis.zoomEnabled) {
var bounds = chart.bounds[axis.horiz ? 'h' : 'v'],
minPixelPadding = axis.minPixelPadding,
min = axis.toPixels(pick(axis.options.min, axis.dataMin)),
max = axis.toPixels(pick(axis.options.max, axis.dataMax)),
absMin = mathMin(min, max),
absMax = mathMax(min, max);
// Store the bounds for use in the touchmove handler
bounds.min = mathMin(axis.pos, absMin - minPixelPadding);
bounds.max = mathMax(axis.pos + axis.len, absMax + minPixelPadding);
}
});
self.res = true; // reset on next move
// Event type is touchmove, handle panning and pinching
} else if (pinchDown.length) { // can be 0 when releasing, if touchend fires first
// Set the marker
if (!selectionMarker) {
self.selectionMarker = selectionMarker = extend({
destroy: noop
}, chart.plotBox);
}
self.pinchTranslate(pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
self.hasPinched = hasZoom;
// Scale and translate the groups to provide visual feedback during pinching
self.scaleGroups(transform, clip);
// Optionally move the tooltip on touchmove
if (!hasZoom && self.followTouchMove && touchesLength === 1) {
this.runPointActions(self.normalize(e));
} else if (self.res) {
self.res = false;
this.reset(false, 0);
}
}
},
onContainerTouchStart: function (e) {
var chart = this.chart;
hoverChartIndex = chart.index;
if (e.touches.length === 1) {
e = this.normalize(e);
if (chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop) && !chart.openMenu) {
// Run mouse events and display tooltip etc
this.runPointActions(e);
this.pinch(e);
} else {
// Hide the tooltip on touching outside the plot area (#1203)
this.reset();
}
} else if (e.touches.length === 2) {
this.pinch(e);
}
},
onContainerTouchMove: function (e) {
if (e.touches.length === 1 || e.touches.length === 2) {
this.pinch(e);
}
},
onDocumentTouchEnd: function (e) {
if (charts[hoverChartIndex]) {
charts[hoverChartIndex].pointer.drop(e);
}
}
});
if (win.PointerEvent || win.MSPointerEvent) {
// The touches object keeps track of the points being touched at all times
var touches = {},
hasPointerEvent = !!win.PointerEvent,
getWebkitTouches = function () {
var key, fake = [];
fake.item = function (i) { return this[i]; };
for (key in touches) {
if (touches.hasOwnProperty(key)) {
fake.push({
pageX: touches[key].pageX,
pageY: touches[key].pageY,
target: touches[key].target
});
}
}
return fake;
},
translateMSPointer = function (e, method, wktype, callback) {
var p;
e = e.originalEvent || e;
if ((e.pointerType === 'touch' || e.pointerType === e.MSPOINTER_TYPE_TOUCH) && charts[hoverChartIndex]) {
callback(e);
p = charts[hoverChartIndex].pointer;
p[method]({
type: wktype,
target: e.currentTarget,
preventDefault: noop,
touches: getWebkitTouches()
});
}
};
/**
* Extend the Pointer prototype with methods for each event handler and more
*/
extend(Pointer.prototype, {
onContainerPointerDown: function (e) {
translateMSPointer(e, 'onContainerTouchStart', 'touchstart', function (e) {
touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY, target: e.currentTarget };
});
},
onContainerPointerMove: function (e) {
translateMSPointer(e, 'onContainerTouchMove', 'touchmove', function (e) {
touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY };
if (!touches[e.pointerId].target) {
touches[e.pointerId].target = e.currentTarget;
}
});
},
onDocumentPointerUp: function (e) {
translateMSPointer(e, 'onContainerTouchEnd', 'touchend', function (e) {
delete touches[e.pointerId];
});
},
/**
* Add or remove the MS Pointer specific events
*/
batchMSEvents: function (fn) {
fn(this.chart.container, hasPointerEvent ? 'pointerdown' : 'MSPointerDown', this.onContainerPointerDown);
fn(this.chart.container, hasPointerEvent ? 'pointermove' : 'MSPointerMove', this.onContainerPointerMove);
fn(doc, hasPointerEvent ? 'pointerup' : 'MSPointerUp', this.onDocumentPointerUp);
}
});
// Disable default IE actions for pinch and such on chart element
wrap(Pointer.prototype, 'init', function (proceed, chart, options) {
proceed.call(this, chart, options);
if (this.hasZoom || this.followTouchMove) {
css(chart.container, {
'-ms-touch-action': NONE,
'touch-action': NONE
});
}
});
// Add IE specific touch events to chart
wrap(Pointer.prototype, 'setDOMEvents', function (proceed) {
proceed.apply(this);
if (this.hasZoom || this.followTouchMove) {
this.batchMSEvents(addEvent);
}
});
// Destroy MS events also
wrap(Pointer.prototype, 'destroy', function (proceed) {
this.batchMSEvents(removeEvent);
proceed.call(this);
});
}
/**
* The overview of the chart's series
*/
var Legend = Highcharts.Legend = function (chart, options) {
this.init(chart, options);
};
Legend.prototype = {
/**
* Initialize the legend
*/
init: function (chart, options) {
var legend = this,
itemStyle = options.itemStyle,
padding,
itemMarginTop = options.itemMarginTop || 0;
this.options = options;
if (!options.enabled) {
return;
}
legend.itemStyle = itemStyle;
legend.itemHiddenStyle = merge(itemStyle, options.itemHiddenStyle);
legend.itemMarginTop = itemMarginTop;
legend.padding = padding = pick(options.padding, 8);
legend.initialItemX = padding;
legend.initialItemY = padding - 5; // 5 is the number of pixels above the text
legend.maxItemWidth = 0;
legend.chart = chart;
legend.itemHeight = 0;
legend.symbolWidth = pick(options.symbolWidth, 16);
legend.pages = [];
// Render it
legend.render();
// move checkboxes
addEvent(legend.chart, 'endResize', function () {
legend.positionCheckboxes();
});
},
/**
* Set the colors for the legend item
* @param {Object} item A Series or Point instance
* @param {Object} visible Dimmed or colored
*/
colorizeItem: function (item, visible) {
var legend = this,
options = legend.options,
legendItem = item.legendItem,
legendLine = item.legendLine,
legendSymbol = item.legendSymbol,
hiddenColor = legend.itemHiddenStyle.color,
textColor = visible ? options.itemStyle.color : hiddenColor,
symbolColor = visible ? (item.legendColor || item.color || '#CCC') : hiddenColor,
markerOptions = item.options && item.options.marker,
symbolAttr = { fill: symbolColor },
key,
val;
if (legendItem) {
legendItem.css({ fill: textColor, color: textColor }); // color for #1553, oldIE
}
if (legendLine) {
legendLine.attr({ stroke: symbolColor });
}
if (legendSymbol) {
// Apply marker options
if (markerOptions && legendSymbol.isMarker) { // #585
symbolAttr.stroke = symbolColor;
markerOptions = item.convertAttribs(markerOptions);
for (key in markerOptions) {
val = markerOptions[key];
if (val !== UNDEFINED) {
symbolAttr[key] = val;
}
}
}
legendSymbol.attr(symbolAttr);
}
},
/**
* Position the legend item
* @param {Object} item A Series or Point instance
*/
positionItem: function (item) {
var legend = this,
options = legend.options,
symbolPadding = options.symbolPadding,
ltr = !options.rtl,
legendItemPos = item._legendItemPos,
itemX = legendItemPos[0],
itemY = legendItemPos[1],
checkbox = item.checkbox;
if (item.legendGroup) {
item.legendGroup.translate(
ltr ? itemX : legend.legendWidth - itemX - 2 * symbolPadding - 4,
itemY
);
}
if (checkbox) {
checkbox.x = itemX;
checkbox.y = itemY;
}
},
/**
* Destroy a single legend item
* @param {Object} item The series or point
*/
destroyItem: function (item) {
var checkbox = item.checkbox;
// destroy SVG elements
each(['legendItem', 'legendLine', 'legendSymbol', 'legendGroup'], function (key) {
if (item[key]) {
item[key] = item[key].destroy();
}
});
if (checkbox) {
discardElement(item.checkbox);
}
},
/**
* Destroys the legend.
*/
destroy: function () {
var legend = this,
legendGroup = legend.group,
box = legend.box;
if (box) {
legend.box = box.destroy();
}
if (legendGroup) {
legend.group = legendGroup.destroy();
}
},
/**
* Position the checkboxes after the width is determined
*/
positionCheckboxes: function (scrollOffset) {
var alignAttr = this.group.alignAttr,
translateY,
clipHeight = this.clipHeight || this.legendHeight;
if (alignAttr) {
translateY = alignAttr.translateY;
each(this.allItems, function (item) {
var checkbox = item.checkbox,
top;
if (checkbox) {
top = (translateY + checkbox.y + (scrollOffset || 0) + 3);
css(checkbox, {
left: (alignAttr.translateX + item.checkboxOffset + checkbox.x - 20) + PX,
top: top + PX,
display: top > translateY - 6 && top < translateY + clipHeight - 6 ? '' : NONE
});
}
});
}
},
/**
* Render the legend title on top of the legend
*/
renderTitle: function () {
var options = this.options,
padding = this.padding,
titleOptions = options.title,
titleHeight = 0,
bBox;
if (titleOptions.text) {
if (!this.title) {
this.title = this.chart.renderer.label(titleOptions.text, padding - 3, padding - 4, null, null, null, null, null, 'legend-title')
.attr({ zIndex: 1 })
.css(titleOptions.style)
.add(this.group);
}
bBox = this.title.getBBox();
titleHeight = bBox.height;
this.offsetWidth = bBox.width; // #1717
this.contentGroup.attr({ translateY: titleHeight });
}
this.titleHeight = titleHeight;
},
/**
* Render a single specific legend item
* @param {Object} item A series or point
*/
renderItem: function (item) {
var legend = this,
chart = legend.chart,
renderer = chart.renderer,
options = legend.options,
horizontal = options.layout === 'horizontal',
symbolWidth = legend.symbolWidth,
symbolPadding = options.symbolPadding,
itemStyle = legend.itemStyle,
itemHiddenStyle = legend.itemHiddenStyle,
padding = legend.padding,
itemDistance = horizontal ? pick(options.itemDistance, 20) : 0,
ltr = !options.rtl,
itemHeight,
widthOption = options.width,
itemMarginBottom = options.itemMarginBottom || 0,
itemMarginTop = legend.itemMarginTop,
initialItemX = legend.initialItemX,
bBox,
itemWidth,
li = item.legendItem,
series = item.series && item.series.drawLegendSymbol ? item.series : item,
seriesOptions = series.options,
showCheckbox = legend.createCheckboxForItem && seriesOptions && seriesOptions.showCheckbox,
useHTML = options.useHTML;
if (!li) { // generate it once, later move it
// Generate the group box
// A group to hold the symbol and text. Text is to be appended in Legend class.
item.legendGroup = renderer.g('legend-item')
.attr({ zIndex: 1 })
.add(legend.scrollGroup);
// Generate the list item text and add it to the group
item.legendItem = li = renderer.text(
options.labelFormat ? format(options.labelFormat, item) : options.labelFormatter.call(item),
ltr ? symbolWidth + symbolPadding : -symbolPadding,
legend.baseline || 0,
useHTML
)
.css(merge(item.visible ? itemStyle : itemHiddenStyle)) // merge to prevent modifying original (#1021)
.attr({
align: ltr ? 'left' : 'right',
zIndex: 2
})
.add(item.legendGroup);
// Get the baseline for the first item - the font size is equal for all
if (!legend.baseline) {
legend.baseline = renderer.fontMetrics(itemStyle.fontSize, li).f + 3 + itemMarginTop;
li.attr('y', legend.baseline);
}
// Draw the legend symbol inside the group box
series.drawLegendSymbol(legend, item);
if (legend.setItemEvents) {
legend.setItemEvents(item, li, useHTML, itemStyle, itemHiddenStyle);
}
// Colorize the items
legend.colorizeItem(item, item.visible);
// add the HTML checkbox on top
if (showCheckbox) {
legend.createCheckboxForItem(item);
}
}
// calculate the positions for the next line
bBox = li.getBBox();
itemWidth = item.checkboxOffset =
options.itemWidth ||
item.legendItemWidth ||
symbolWidth + symbolPadding + bBox.width + itemDistance + (showCheckbox ? 20 : 0);
legend.itemHeight = itemHeight = mathRound(item.legendItemHeight || bBox.height);
// if the item exceeds the width, start a new line
if (horizontal && legend.itemX - initialItemX + itemWidth >
(widthOption || (chart.chartWidth - 2 * padding - initialItemX - options.x))) {
legend.itemX = initialItemX;
legend.itemY += itemMarginTop + legend.lastLineHeight + itemMarginBottom;
}
// If the item exceeds the height, start a new column
/*if (!horizontal && legend.itemY + options.y + itemHeight > chart.chartHeight - spacingTop - spacingBottom) {
legend.itemY = legend.initialItemY;
legend.itemX += legend.maxItemWidth;
legend.maxItemWidth = 0;
}*/
// Set the edge positions
legend.maxItemWidth = mathMax(legend.maxItemWidth, itemWidth);
legend.lastItemY = itemMarginTop + legend.itemY + itemMarginBottom;
legend.lastLineHeight = mathMax(itemHeight, legend.lastLineHeight); // #915
// cache the position of the newly generated or reordered items
item._legendItemPos = [legend.itemX, legend.itemY];
// advance
if (horizontal) {
legend.itemX += itemWidth;
} else {
legend.itemY += itemMarginTop + itemHeight + itemMarginBottom;
legend.lastLineHeight = itemHeight;
}
// the width of the widest item
legend.offsetWidth = widthOption || mathMax(
(horizontal ? legend.itemX - initialItemX - itemDistance : itemWidth) + padding,
legend.offsetWidth
);
},
/**
* Get all items, which is one item per series for normal series and one item per point
* for pie series.
*/
getAllItems: function () {
var allItems = [];
each(this.chart.series, function (series) {
var seriesOptions = series.options;
// Handle showInLegend. If the series is linked to another series, defaults to false.
if (!pick(seriesOptions.showInLegend, !defined(seriesOptions.linkedTo) ? UNDEFINED : false, true)) {
return;
}
// use points or series for the legend item depending on legendType
allItems = allItems.concat(
series.legendItems ||
(seriesOptions.legendType === 'point' ?
series.data :
series)
);
});
return allItems;
},
/**
* Adjust the chart margins by reserving space for the legend on only one side
* of the chart. If the position is set to a corner, top or bottom is reserved
* for horizontal legends and left or right for vertical ones.
*/
adjustMargins: function (margin, spacing) {
var chart = this.chart,
options = this.options,
// Use the first letter of each alignment option in order to detect the side
alignment = options.align[0] + options.verticalAlign[0] + options.layout[0];
if (this.display && !options.floating) {
each([
/(lth|ct|rth)/,
/(rtv|rm|rbv)/,
/(rbh|cb|lbh)/,
/(lbv|lm|ltv)/
], function (alignments, side) {
if (alignments.test(alignment) && !defined(margin[side])) {
// Now we have detected on which side of the chart we should reserve space for the legend
chart[marginNames[side]] = mathMax(
chart[marginNames[side]],
chart.legend[(side + 1) % 2 ? 'legendHeight' : 'legendWidth'] +
[1, -1, -1, 1][side] * options[(side % 2) ? 'x' : 'y'] +
pick(options.margin, 12) +
spacing[side]
);
}
});
}
},
/**
* Render the legend. This method can be called both before and after
* chart.render. If called after, it will only rearrange items instead
* of creating new ones.
*/
render: function () {
var legend = this,
chart = legend.chart,
renderer = chart.renderer,
legendGroup = legend.group,
allItems,
display,
legendWidth,
legendHeight,
box = legend.box,
options = legend.options,
padding = legend.padding,
legendBorderWidth = options.borderWidth,
legendBackgroundColor = options.backgroundColor;
legend.itemX = legend.initialItemX;
legend.itemY = legend.initialItemY;
legend.offsetWidth = 0;
legend.lastItemY = 0;
if (!legendGroup) {
legend.group = legendGroup = renderer.g('legend')
.attr({ zIndex: 7 })
.add();
legend.contentGroup = renderer.g()
.attr({ zIndex: 1 }) // above background
.add(legendGroup);
legend.scrollGroup = renderer.g()
.add(legend.contentGroup);
}
legend.renderTitle();
// add each series or point
allItems = legend.getAllItems();
// sort by legendIndex
stableSort(allItems, function (a, b) {
return ((a.options && a.options.legendIndex) || 0) - ((b.options && b.options.legendIndex) || 0);
});
// reversed legend
if (options.reversed) {
allItems.reverse();
}
legend.allItems = allItems;
legend.display = display = !!allItems.length;
// render the items
legend.lastLineHeight = 0;
each(allItems, function (item) {
legend.renderItem(item);
});
// Get the box
legendWidth = (options.width || legend.offsetWidth) + padding;
legendHeight = legend.lastItemY + legend.lastLineHeight + legend.titleHeight;
legendHeight = legend.handleOverflow(legendHeight);
legendHeight += padding;
// Draw the border and/or background
if (legendBorderWidth || legendBackgroundColor) {
if (!box) {
legend.box = box = renderer.rect(
0,
0,
legendWidth,
legendHeight,
options.borderRadius,
legendBorderWidth || 0
).attr({
stroke: options.borderColor,
'stroke-width': legendBorderWidth || 0,
fill: legendBackgroundColor || NONE
})
.add(legendGroup)
.shadow(options.shadow);
box.isNew = true;
} else if (legendWidth > 0 && legendHeight > 0) {
box[box.isNew ? 'attr' : 'animate'](
box.crisp({ width: legendWidth, height: legendHeight })
);
box.isNew = false;
}
// hide the border if no items
box[display ? 'show' : 'hide']();
}
legend.legendWidth = legendWidth;
legend.legendHeight = legendHeight;
// Now that the legend width and height are established, put the items in the
// final position
each(allItems, function (item) {
legend.positionItem(item);
});
// 1.x compatibility: positioning based on style
/*var props = ['left', 'right', 'top', 'bottom'],
prop,
i = 4;
while (i--) {
prop = props[i];
if (options.style[prop] && options.style[prop] !== 'auto') {
options[i < 2 ? 'align' : 'verticalAlign'] = prop;
options[i < 2 ? 'x' : 'y'] = pInt(options.style[prop]) * (i % 2 ? -1 : 1);
}
}*/
if (display) {
legendGroup.align(extend({
width: legendWidth,
height: legendHeight
}, options), true, 'spacingBox');
}
if (!chart.isResizing) {
this.positionCheckboxes();
}
},
/**
* Set up the overflow handling by adding navigation with up and down arrows below the
* legend.
*/
handleOverflow: function (legendHeight) {
var legend = this,
chart = this.chart,
renderer = chart.renderer,
options = this.options,
optionsY = options.y,
alignTop = options.verticalAlign === 'top',
spaceHeight = chart.spacingBox.height + (alignTop ? -optionsY : optionsY) - this.padding,
maxHeight = options.maxHeight,
clipHeight,
clipRect = this.clipRect,
navOptions = options.navigation,
animation = pick(navOptions.animation, true),
arrowSize = navOptions.arrowSize || 12,
nav = this.nav,
pages = this.pages,
lastY,
allItems = this.allItems;
// Adjust the height
if (options.layout === 'horizontal') {
spaceHeight /= 2;
}
if (maxHeight) {
spaceHeight = mathMin(spaceHeight, maxHeight);
}
// Reset the legend height and adjust the clipping rectangle
pages.length = 0;
if (legendHeight > spaceHeight && !options.useHTML) {
this.clipHeight = clipHeight = mathMax(spaceHeight - 20 - this.titleHeight - this.padding, 0);
this.currentPage = pick(this.currentPage, 1);
this.fullHeight = legendHeight;
// Fill pages with Y positions so that the top of each a legend item defines
// the scroll top for each page (#2098)
each(allItems, function (item, i) {
var y = item._legendItemPos[1],
h = mathRound(item.legendItem.getBBox().height),
len = pages.length;
if (!len || (y - pages[len - 1] > clipHeight && (lastY || y) !== pages[len - 1])) {
pages.push(lastY || y);
len++;
}
if (i === allItems.length - 1 && y + h - pages[len - 1] > clipHeight) {
pages.push(y);
}
if (y !== lastY) {
lastY = y;
}
});
// Only apply clipping if needed. Clipping causes blurred legend in PDF export (#1787)
if (!clipRect) {
clipRect = legend.clipRect = renderer.clipRect(0, this.padding, 9999, 0);
legend.contentGroup.clip(clipRect);
}
clipRect.attr({
height: clipHeight
});
// Add navigation elements
if (!nav) {
this.nav = nav = renderer.g().attr({ zIndex: 1 }).add(this.group);
this.up = renderer.symbol('triangle', 0, 0, arrowSize, arrowSize)
.on('click', function () {
legend.scroll(-1, animation);
})
.add(nav);
this.pager = renderer.text('', 15, 10)
.css(navOptions.style)
.add(nav);
this.down = renderer.symbol('triangle-down', 0, 0, arrowSize, arrowSize)
.on('click', function () {
legend.scroll(1, animation);
})
.add(nav);
}
// Set initial position
legend.scroll(0);
legendHeight = spaceHeight;
} else if (nav) {
clipRect.attr({
height: chart.chartHeight
});
nav.hide();
this.scrollGroup.attr({
translateY: 1
});
this.clipHeight = 0; // #1379
}
return legendHeight;
},
/**
* Scroll the legend by a number of pages
* @param {Object} scrollBy
* @param {Object} animation
*/
scroll: function (scrollBy, animation) {
var pages = this.pages,
pageCount = pages.length,
currentPage = this.currentPage + scrollBy,
clipHeight = this.clipHeight,
navOptions = this.options.navigation,
activeColor = navOptions.activeColor,
inactiveColor = navOptions.inactiveColor,
pager = this.pager,
padding = this.padding,
scrollOffset;
// When resizing while looking at the last page
if (currentPage > pageCount) {
currentPage = pageCount;
}
if (currentPage > 0) {
if (animation !== UNDEFINED) {
setAnimation(animation, this.chart);
}
this.nav.attr({
translateX: padding,
translateY: clipHeight + this.padding + 7 + this.titleHeight,
visibility: VISIBLE
});
this.up.attr({
fill: currentPage === 1 ? inactiveColor : activeColor
})
.css({
cursor: currentPage === 1 ? 'default' : 'pointer'
});
pager.attr({
text: currentPage + '/' + pageCount
});
this.down.attr({
x: 18 + this.pager.getBBox().width, // adjust to text width
fill: currentPage === pageCount ? inactiveColor : activeColor
})
.css({
cursor: currentPage === pageCount ? 'default' : 'pointer'
});
scrollOffset = -pages[currentPage - 1] + this.initialItemY;
this.scrollGroup.animate({
translateY: scrollOffset
});
this.currentPage = currentPage;
this.positionCheckboxes(scrollOffset);
}
}
};
/*
* LegendSymbolMixin
*/
var LegendSymbolMixin = Highcharts.LegendSymbolMixin = {
/**
* Get the series' symbol in the legend
*
* @param {Object} legend The legend object
* @param {Object} item The series (this) or point
*/
drawRectangle: function (legend, item) {
var symbolHeight = legend.options.symbolHeight || 12;
item.legendSymbol = this.chart.renderer.rect(
0,
legend.baseline - 5 - (symbolHeight / 2),
legend.symbolWidth,
symbolHeight,
legend.options.symbolRadius || 0
).attr({
zIndex: 3
}).add(item.legendGroup);
},
/**
* Get the series' symbol in the legend. This method should be overridable to create custom
* symbols through Highcharts.seriesTypes[type].prototype.drawLegendSymbols.
*
* @param {Object} legend The legend object
*/
drawLineMarker: function (legend) {
var options = this.options,
markerOptions = options.marker,
radius,
legendOptions = legend.options,
legendSymbol,
symbolWidth = legend.symbolWidth,
renderer = this.chart.renderer,
legendItemGroup = this.legendGroup,
verticalCenter = legend.baseline - mathRound(renderer.fontMetrics(legendOptions.itemStyle.fontSize, this.legendItem).b * 0.3),
attr;
// Draw the line
if (options.lineWidth) {
attr = {
'stroke-width': options.lineWidth
};
if (options.dashStyle) {
attr.dashstyle = options.dashStyle;
}
this.legendLine = renderer.path([
M,
0,
verticalCenter,
L,
symbolWidth,
verticalCenter
])
.attr(attr)
.add(legendItemGroup);
}
// Draw the marker
if (markerOptions && markerOptions.enabled !== false) {
radius = markerOptions.radius;
this.legendSymbol = legendSymbol = renderer.symbol(
this.symbol,
(symbolWidth / 2) - radius,
verticalCenter - radius,
2 * radius,
2 * radius
)
.add(legendItemGroup);
legendSymbol.isMarker = true;
}
}
};
// Workaround for #2030, horizontal legend items not displaying in IE11 Preview,
// and for #2580, a similar drawing flaw in Firefox 26.
// TODO: Explore if there's a general cause for this. The problem may be related
// to nested group elements, as the legend item texts are within 4 group elements.
if (/Trident\/7\.0/.test(userAgent) || isFirefox) {
wrap(Legend.prototype, 'positionItem', function (proceed, item) {
var legend = this,
runPositionItem = function () { // If chart destroyed in sync, this is undefined (#2030)
if (item._legendItemPos) {
proceed.call(legend, item);
}
};
// Do it now, for export and to get checkbox placement
runPositionItem();
// Do it after to work around the core issue
setTimeout(runPositionItem);
});
}
/**
* The chart class
* @param {Object} options
* @param {Function} callback Function to run when the chart has loaded
*/
var Chart = Highcharts.Chart = function () {
this.init.apply(this, arguments);
};
Chart.prototype = {
/**
* Hook for modules
*/
callbacks: [],
/**
* Initialize the chart
*/
init: function (userOptions, callback) {
// Handle regular options
var options,
seriesOptions = userOptions.series; // skip merging data points to increase performance
userOptions.series = null;
options = merge(defaultOptions, userOptions); // do the merge
options.series = userOptions.series = seriesOptions; // set back the series data
this.userOptions = userOptions;
var optionsChart = options.chart;
// Create margin & spacing array
this.margin = this.splashArray('margin', optionsChart);
this.spacing = this.splashArray('spacing', optionsChart);
var chartEvents = optionsChart.events;
//this.runChartClick = chartEvents && !!chartEvents.click;
this.bounds = { h: {}, v: {} }; // Pixel data bounds for touch zoom
this.callback = callback;
this.isResizing = 0;
this.options = options;
//chartTitleOptions = UNDEFINED;
//chartSubtitleOptions = UNDEFINED;
this.axes = [];
this.series = [];
this.hasCartesianSeries = optionsChart.showAxes;
//this.axisOffset = UNDEFINED;
//this.maxTicks = UNDEFINED; // handle the greatest amount of ticks on grouped axes
//this.inverted = UNDEFINED;
//this.loadingShown = UNDEFINED;
//this.container = UNDEFINED;
//this.chartWidth = UNDEFINED;
//this.chartHeight = UNDEFINED;
//this.marginRight = UNDEFINED;
//this.marginBottom = UNDEFINED;
//this.containerWidth = UNDEFINED;
//this.containerHeight = UNDEFINED;
//this.oldChartWidth = UNDEFINED;
//this.oldChartHeight = UNDEFINED;
//this.renderTo = UNDEFINED;
//this.renderToClone = UNDEFINED;
//this.spacingBox = UNDEFINED
//this.legend = UNDEFINED;
// Elements
//this.chartBackground = UNDEFINED;
//this.plotBackground = UNDEFINED;
//this.plotBGImage = UNDEFINED;
//this.plotBorder = UNDEFINED;
//this.loadingDiv = UNDEFINED;
//this.loadingSpan = UNDEFINED;
var chart = this,
eventType;
// Add the chart to the global lookup
chart.index = charts.length;
charts.push(chart);
chartCount++;
// Set up auto resize
if (optionsChart.reflow !== false) {
addEvent(chart, 'load', function () {
chart.initReflow();
});
}
// Chart event handlers
if (chartEvents) {
for (eventType in chartEvents) {
addEvent(chart, eventType, chartEvents[eventType]);
}
}
chart.xAxis = [];
chart.yAxis = [];
// Expose methods and variables
chart.animation = useCanVG ? false : pick(optionsChart.animation, true);
chart.pointCount = chart.colorCounter = chart.symbolCounter = 0;
chart.firstRender();
},
/**
* Initialize an individual series, called internally before render time
*/
initSeries: function (options) {
var chart = this,
optionsChart = chart.options.chart,
type = options.type || optionsChart.type || optionsChart.defaultSeriesType,
series,
constr = seriesTypes[type];
// No such series type
if (!constr) {
error(17, true);
}
series = new constr();
series.init(this, options);
return series;
},
/**
* Check whether a given point is within the plot area
*
* @param {Number} plotX Pixel x relative to the plot area
* @param {Number} plotY Pixel y relative to the plot area
* @param {Boolean} inverted Whether the chart is inverted
*/
isInsidePlot: function (plotX, plotY, inverted) {
var x = inverted ? plotY : plotX,
y = inverted ? plotX : plotY;
return x >= 0 &&
x <= this.plotWidth &&
y >= 0 &&
y <= this.plotHeight;
},
/**
* Redraw legend, axes or series based on updated data
*
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
redraw: function (animation) {
var chart = this,
axes = chart.axes,
series = chart.series,
pointer = chart.pointer,
legend = chart.legend,
redrawLegend = chart.isDirtyLegend,
hasStackedSeries,
hasDirtyStacks,
hasCartesianSeries = chart.hasCartesianSeries,
isDirtyBox = chart.isDirtyBox, // todo: check if it has actually changed?
seriesLength = series.length,
i = seriesLength,
serie,
renderer = chart.renderer,
isHiddenChart = renderer.isHidden(),
afterRedraw = [];
setAnimation(animation, chart);
if (isHiddenChart) {
chart.cloneRenderTo();
}
// Adjust title layout (reflow multiline text)
chart.layOutTitles();
// link stacked series
while (i--) {
serie = series[i];
if (serie.options.stacking) {
hasStackedSeries = true;
if (serie.isDirty) {
hasDirtyStacks = true;
break;
}
}
}
if (hasDirtyStacks) { // mark others as dirty
i = seriesLength;
while (i--) {
serie = series[i];
if (serie.options.stacking) {
serie.isDirty = true;
}
}
}
// handle updated data in the series
each(series, function (serie) {
if (serie.isDirty) { // prepare the data so axis can read it
if (serie.options.legendType === 'point') {
redrawLegend = true;
}
}
});
// handle added or removed series
if (redrawLegend && legend.options.enabled) { // series or pie points are added or removed
// draw legend graphics
legend.render();
chart.isDirtyLegend = false;
}
// reset stacks
if (hasStackedSeries) {
chart.getStacks();
}
if (hasCartesianSeries) {
if (!chart.isResizing) {
// reset maxTicks
chart.maxTicks = null;
// set axes scales
each(axes, function (axis) {
axis.setScale();
});
}
}
chart.getMargins(); // #3098
if (hasCartesianSeries) {
// If one axis is dirty, all axes must be redrawn (#792, #2169)
each(axes, function (axis) {
if (axis.isDirty) {
isDirtyBox = true;
}
});
// redraw axes
each(axes, function (axis) {
// Fire 'afterSetExtremes' only if extremes are set
if (axis.isDirtyExtremes) { // #821
axis.isDirtyExtremes = false;
afterRedraw.push(function () { // prevent a recursive call to chart.redraw() (#1119)
fireEvent(axis, 'afterSetExtremes', extend(axis.eventArgs, axis.getExtremes())); // #747, #751
delete axis.eventArgs;
});
}
if (isDirtyBox || hasStackedSeries) {
axis.redraw();
}
});
}
// the plot areas size has changed
if (isDirtyBox) {
chart.drawChartBox();
}
// redraw affected series
each(series, function (serie) {
if (serie.isDirty && serie.visible &&
(!serie.isCartesian || serie.xAxis)) { // issue #153
serie.redraw();
}
});
// move tooltip or reset
if (pointer) {
pointer.reset(true);
}
// redraw if canvas
renderer.draw();
// fire the event
fireEvent(chart, 'redraw'); // jQuery breaks this when calling it from addEvent. Overwrites chart.redraw
if (isHiddenChart) {
chart.cloneRenderTo(true);
}
// Fire callbacks that are put on hold until after the redraw
each(afterRedraw, function (callback) {
callback.call();
});
},
/**
* Get an axis, series or point object by id.
* @param id {String} The id as given in the configuration options
*/
get: function (id) {
var chart = this,
axes = chart.axes,
series = chart.series;
var i,
j,
points;
// search axes
for (i = 0; i < axes.length; i++) {
if (axes[i].options.id === id) {
return axes[i];
}
}
// search series
for (i = 0; i < series.length; i++) {
if (series[i].options.id === id) {
return series[i];
}
}
// search points
for (i = 0; i < series.length; i++) {
points = series[i].points || [];
for (j = 0; j < points.length; j++) {
if (points[j].id === id) {
return points[j];
}
}
}
return null;
},
/**
* Create the Axis instances based on the config options
*/
getAxes: function () {
var chart = this,
options = this.options,
xAxisOptions = options.xAxis = splat(options.xAxis || {}),
yAxisOptions = options.yAxis = splat(options.yAxis || {}),
optionsArray,
axis;
// make sure the options are arrays and add some members
each(xAxisOptions, function (axis, i) {
axis.index = i;
axis.isX = true;
});
each(yAxisOptions, function (axis, i) {
axis.index = i;
});
// concatenate all axis options into one array
optionsArray = xAxisOptions.concat(yAxisOptions);
each(optionsArray, function (axisOptions) {
axis = new Axis(chart, axisOptions);
});
},
/**
* Get the currently selected points from all series
*/
getSelectedPoints: function () {
var points = [];
each(this.series, function (serie) {
points = points.concat(grep(serie.points || [], function (point) {
return point.selected;
}));
});
return points;
},
/**
* Get the currently selected series
*/
getSelectedSeries: function () {
return grep(this.series, function (serie) {
return serie.selected;
});
},
/**
* Generate stacks for each series and calculate stacks total values
*/
getStacks: function () {
var chart = this;
// reset stacks for each yAxis
each(chart.yAxis, function (axis) {
if (axis.stacks && axis.hasVisibleSeries) {
axis.oldStacks = axis.stacks;
}
});
each(chart.series, function (series) {
if (series.options.stacking && (series.visible === true || chart.options.chart.ignoreHiddenSeries === false)) {
series.stackKey = series.type + pick(series.options.stack, '');
}
});
},
/**
* Show the title and subtitle of the chart
*
* @param titleOptions {Object} New title options
* @param subtitleOptions {Object} New subtitle options
*
*/
setTitle: function (titleOptions, subtitleOptions, redraw) {
var chart = this,
options = chart.options,
chartTitleOptions,
chartSubtitleOptions;
chartTitleOptions = options.title = merge(options.title, titleOptions);
chartSubtitleOptions = options.subtitle = merge(options.subtitle, subtitleOptions);
// add title and subtitle
each([
['title', titleOptions, chartTitleOptions],
['subtitle', subtitleOptions, chartSubtitleOptions]
], function (arr) {
var name = arr[0],
title = chart[name],
titleOptions = arr[1],
chartTitleOptions = arr[2];
if (title && titleOptions) {
chart[name] = title = title.destroy(); // remove old
}
if (chartTitleOptions && chartTitleOptions.text && !title) {
chart[name] = chart.renderer.text(
chartTitleOptions.text,
0,
0,
chartTitleOptions.useHTML
)
.attr({
align: chartTitleOptions.align,
'class': PREFIX + name,
zIndex: chartTitleOptions.zIndex || 4
})
.css(chartTitleOptions.style)
.add();
}
});
chart.layOutTitles(redraw);
},
/**
* Lay out the chart titles and cache the full offset height for use in getMargins
*/
layOutTitles: function (redraw) {
var titleOffset = 0,
title = this.title,
subtitle = this.subtitle,
options = this.options,
titleOptions = options.title,
subtitleOptions = options.subtitle,
requiresDirtyBox,
renderer = this.renderer,
autoWidth = this.spacingBox.width - 44; // 44 makes room for default context button
if (title) {
title
.css({ width: (titleOptions.width || autoWidth) + PX })
.align(extend({
y: renderer.fontMetrics(titleOptions.style.fontSize, title).b - 3
}, titleOptions), false, 'spacingBox');
if (!titleOptions.floating && !titleOptions.verticalAlign) {
titleOffset = title.getBBox().height;
}
}
if (subtitle) {
subtitle
.css({ width: (subtitleOptions.width || autoWidth) + PX })
.align(extend({
y: titleOffset + (titleOptions.margin - 13) + renderer.fontMetrics(titleOptions.style.fontSize, subtitle).b
}, subtitleOptions), false, 'spacingBox');
if (!subtitleOptions.floating && !subtitleOptions.verticalAlign) {
titleOffset = mathCeil(titleOffset + subtitle.getBBox().height);
}
}
requiresDirtyBox = this.titleOffset !== titleOffset;
this.titleOffset = titleOffset; // used in getMargins
if (!this.isDirtyBox && requiresDirtyBox) {
this.isDirtyBox = requiresDirtyBox;
// Redraw if necessary (#2719, #2744)
if (this.hasRendered && pick(redraw, true) && this.isDirtyBox) {
this.redraw();
}
}
},
/**
* Get chart width and height according to options and container size
*/
getChartSize: function () {
var chart = this,
optionsChart = chart.options.chart,
widthOption = optionsChart.width,
heightOption = optionsChart.height,
renderTo = chart.renderToClone || chart.renderTo;
// get inner width and height from jQuery (#824)
if (!defined(widthOption)) {
chart.containerWidth = adapterRun(renderTo, 'width');
}
if (!defined(heightOption)) {
chart.containerHeight = adapterRun(renderTo, 'height');
}
chart.chartWidth = mathMax(0, widthOption || chart.containerWidth || 600); // #1393, 1460
chart.chartHeight = mathMax(0, pick(heightOption,
// the offsetHeight of an empty container is 0 in standard browsers, but 19 in IE7:
chart.containerHeight > 19 ? chart.containerHeight : 400));
},
/**
* Create a clone of the chart's renderTo div and place it outside the viewport to allow
* size computation on chart.render and chart.redraw
*/
cloneRenderTo: function (revert) {
var clone = this.renderToClone,
container = this.container;
// Destroy the clone and bring the container back to the real renderTo div
if (revert) {
if (clone) {
this.renderTo.appendChild(container);
discardElement(clone);
delete this.renderToClone;
}
// Set up the clone
} else {
if (container && container.parentNode === this.renderTo) {
this.renderTo.removeChild(container); // do not clone this
}
this.renderToClone = clone = this.renderTo.cloneNode(0);
css(clone, {
position: ABSOLUTE,
top: '-9999px',
display: 'block' // #833
});
if (clone.style.setProperty) { // #2631
clone.style.setProperty('display', 'block', 'important');
}
doc.body.appendChild(clone);
if (container) {
clone.appendChild(container);
}
}
},
/**
* Get the containing element, determine the size and create the inner container
* div to hold the chart
*/
getContainer: function () {
var chart = this,
container,
optionsChart = chart.options.chart,
chartWidth,
chartHeight,
renderTo,
indexAttrName = 'data-highcharts-chart',
oldChartIndex,
containerId;
chart.renderTo = renderTo = optionsChart.renderTo;
containerId = PREFIX + idCounter++;
if (isString(renderTo)) {
chart.renderTo = renderTo = doc.getElementById(renderTo);
}
// Display an error if the renderTo is wrong
if (!renderTo) {
error(13, true);
}
// If the container already holds a chart, destroy it. The check for hasRendered is there
// because web pages that are saved to disk from the browser, will preserve the data-highcharts-chart
// attribute and the SVG contents, but not an interactive chart. So in this case,
// charts[oldChartIndex] will point to the wrong chart if any (#2609).
oldChartIndex = pInt(attr(renderTo, indexAttrName));
if (!isNaN(oldChartIndex) && charts[oldChartIndex] && charts[oldChartIndex].hasRendered) {
charts[oldChartIndex].destroy();
}
// Make a reference to the chart from the div
attr(renderTo, indexAttrName, chart.index);
// remove previous chart
renderTo.innerHTML = '';
// If the container doesn't have an offsetWidth, it has or is a child of a node
// that has display:none. We need to temporarily move it out to a visible
// state to determine the size, else the legend and tooltips won't render
// properly. The allowClone option is used in sparklines as a micro optimization,
// saving about 1-2 ms each chart.
if (!optionsChart.skipClone && !renderTo.offsetWidth) {
chart.cloneRenderTo();
}
// get the width and height
chart.getChartSize();
chartWidth = chart.chartWidth;
chartHeight = chart.chartHeight;
// create the inner container
chart.container = container = createElement(DIV, {
className: PREFIX + 'container' +
(optionsChart.className ? ' ' + optionsChart.className : ''),
id: containerId
}, extend({
position: RELATIVE,
overflow: HIDDEN, // needed for context menu (avoid scrollbars) and
// content overflow in IE
width: chartWidth + PX,
height: chartHeight + PX,
textAlign: 'left',
lineHeight: 'normal', // #427
zIndex: 0, // #1072
'-webkit-tap-highlight-color': 'rgba(0,0,0,0)'
}, optionsChart.style),
chart.renderToClone || renderTo
);
// cache the cursor (#1650)
chart._cursor = container.style.cursor;
// Initialize the renderer
chart.renderer =
optionsChart.forExport ? // force SVG, used for SVG export
new SVGRenderer(container, chartWidth, chartHeight, optionsChart.style, true) :
new Renderer(container, chartWidth, chartHeight, optionsChart.style);
if (useCanVG) {
// If we need canvg library, extend and configure the renderer
// to get the tracker for translating mouse events
chart.renderer.create(chart, container, chartWidth, chartHeight);
}
// Add a reference to the charts index
chart.renderer.chartIndex = chart.index;
},
/**
* Calculate margins by rendering axis labels in a preliminary position. Title,
* subtitle and legend have already been rendered at this stage, but will be
* moved into their final positions
*/
getMargins: function (skipAxes) {
var chart = this,
spacing = chart.spacing,
margin = chart.margin,
titleOffset = chart.titleOffset;
chart.resetMargins();
// Adjust for title and subtitle
if (titleOffset && !defined(margin[0])) {
chart.plotTop = mathMax(chart.plotTop, titleOffset + chart.options.title.margin + spacing[0]);
}
// Adjust for legend
chart.legend.adjustMargins(margin, spacing);
// adjust for scroller
if (chart.extraBottomMargin) {
chart.marginBottom += chart.extraBottomMargin;
}
if (chart.extraTopMargin) {
chart.plotTop += chart.extraTopMargin;
}
if (!skipAxes) {
this.getAxisMargins();
}
},
getAxisMargins: function () {
var chart = this,
axisOffset = chart.axisOffset = [0, 0, 0, 0], // top, right, bottom, left
margin = chart.margin;
// pre-render axes to get labels offset width
if (chart.hasCartesianSeries) {
each(chart.axes, function (axis) {
axis.getOffset();
});
}
// Add the axis offsets
each(marginNames, function (m, side) {
if (!defined(margin[side])) {
chart[m] += axisOffset[side];
}
});
chart.setChartSize();
},
/**
* Resize the chart to its container if size is not explicitly set
*/
reflow: function (e) {
var chart = this,
optionsChart = chart.options.chart,
renderTo = chart.renderTo,
width = optionsChart.width || adapterRun(renderTo, 'width'),
height = optionsChart.height || adapterRun(renderTo, 'height'),
target = e ? e.target : win, // #805 - MooTools doesn't supply e
doReflow = function () {
if (chart.container) { // It may have been destroyed in the meantime (#1257)
chart.setSize(width, height, false);
chart.hasUserSize = null;
}
};
// Width and height checks for display:none. Target is doc in IE8 and Opera,
// win in Firefox, Chrome and IE9.
if (!chart.hasUserSize && width && height && (target === win || target === doc)) {
if (width !== chart.containerWidth || height !== chart.containerHeight) {
clearTimeout(chart.reflowTimeout);
if (e) { // Called from window.resize
chart.reflowTimeout = setTimeout(doReflow, 100);
} else { // Called directly (#2224)
doReflow();
}
}
chart.containerWidth = width;
chart.containerHeight = height;
}
},
/**
* Add the event handlers necessary for auto resizing
*/
initReflow: function () {
var chart = this,
reflow = function (e) {
chart.reflow(e);
};
addEvent(win, 'resize', reflow);
addEvent(chart, 'destroy', function () {
removeEvent(win, 'resize', reflow);
});
},
/**
* Resize the chart to a given width and height
* @param {Number} width
* @param {Number} height
* @param {Object|Boolean} animation
*/
setSize: function (width, height, animation) {
var chart = this,
chartWidth,
chartHeight,
fireEndResize;
// Handle the isResizing counter
chart.isResizing += 1;
fireEndResize = function () {
if (chart) {
fireEvent(chart, 'endResize', null, function () {
chart.isResizing -= 1;
});
}
};
// set the animation for the current process
setAnimation(animation, chart);
chart.oldChartHeight = chart.chartHeight;
chart.oldChartWidth = chart.chartWidth;
if (defined(width)) {
chart.chartWidth = chartWidth = mathMax(0, mathRound(width));
chart.hasUserSize = !!chartWidth;
}
if (defined(height)) {
chart.chartHeight = chartHeight = mathMax(0, mathRound(height));
}
// Resize the container with the global animation applied if enabled (#2503)
(globalAnimation ? animate : css)(chart.container, {
width: chartWidth + PX,
height: chartHeight + PX
}, globalAnimation);
chart.setChartSize(true);
chart.renderer.setSize(chartWidth, chartHeight, animation);
// handle axes
chart.maxTicks = null;
each(chart.axes, function (axis) {
axis.isDirty = true;
axis.setScale();
});
// make sure non-cartesian series are also handled
each(chart.series, function (serie) {
serie.isDirty = true;
});
chart.isDirtyLegend = true; // force legend redraw
chart.isDirtyBox = true; // force redraw of plot and chart border
chart.layOutTitles(); // #2857
chart.getMargins();
chart.redraw(animation);
chart.oldChartHeight = null;
fireEvent(chart, 'resize');
// fire endResize and set isResizing back
// If animation is disabled, fire without delay
if (globalAnimation === false) {
fireEndResize();
} else { // else set a timeout with the animation duration
setTimeout(fireEndResize, (globalAnimation && globalAnimation.duration) || 500);
}
},
/**
* Set the public chart properties. This is done before and after the pre-render
* to determine margin sizes
*/
setChartSize: function (skipAxes) {
var chart = this,
inverted = chart.inverted,
renderer = chart.renderer,
chartWidth = chart.chartWidth,
chartHeight = chart.chartHeight,
optionsChart = chart.options.chart,
spacing = chart.spacing,
clipOffset = chart.clipOffset,
clipX,
clipY,
plotLeft,
plotTop,
plotWidth,
plotHeight,
plotBorderWidth;
chart.plotLeft = plotLeft = mathRound(chart.plotLeft);
chart.plotTop = plotTop = mathRound(chart.plotTop);
chart.plotWidth = plotWidth = mathMax(0, mathRound(chartWidth - plotLeft - chart.marginRight));
chart.plotHeight = plotHeight = mathMax(0, mathRound(chartHeight - plotTop - chart.marginBottom));
chart.plotSizeX = inverted ? plotHeight : plotWidth;
chart.plotSizeY = inverted ? plotWidth : plotHeight;
chart.plotBorderWidth = optionsChart.plotBorderWidth || 0;
// Set boxes used for alignment
chart.spacingBox = renderer.spacingBox = {
x: spacing[3],
y: spacing[0],
width: chartWidth - spacing[3] - spacing[1],
height: chartHeight - spacing[0] - spacing[2]
};
chart.plotBox = renderer.plotBox = {
x: plotLeft,
y: plotTop,
width: plotWidth,
height: plotHeight
};
plotBorderWidth = 2 * mathFloor(chart.plotBorderWidth / 2);
clipX = mathCeil(mathMax(plotBorderWidth, clipOffset[3]) / 2);
clipY = mathCeil(mathMax(plotBorderWidth, clipOffset[0]) / 2);
chart.clipBox = {
x: clipX,
y: clipY,
width: mathFloor(chart.plotSizeX - mathMax(plotBorderWidth, clipOffset[1]) / 2 - clipX),
height: mathMax(0, mathFloor(chart.plotSizeY - mathMax(plotBorderWidth, clipOffset[2]) / 2 - clipY))
};
if (!skipAxes) {
each(chart.axes, function (axis) {
axis.setAxisSize();
axis.setAxisTranslation();
});
}
},
/**
* Initial margins before auto size margins are applied
*/
resetMargins: function () {
var chart = this;
each(marginNames, function (m, side) {
chart[m] = pick(chart.margin[side], chart.spacing[side]);
});
chart.axisOffset = [0, 0, 0, 0]; // top, right, bottom, left
chart.clipOffset = [0, 0, 0, 0];
},
/**
* Draw the borders and backgrounds for chart and plot area
*/
drawChartBox: function () {
var chart = this,
optionsChart = chart.options.chart,
renderer = chart.renderer,
chartWidth = chart.chartWidth,
chartHeight = chart.chartHeight,
chartBackground = chart.chartBackground,
plotBackground = chart.plotBackground,
plotBorder = chart.plotBorder,
plotBGImage = chart.plotBGImage,
chartBorderWidth = optionsChart.borderWidth || 0,
chartBackgroundColor = optionsChart.backgroundColor,
plotBackgroundColor = optionsChart.plotBackgroundColor,
plotBackgroundImage = optionsChart.plotBackgroundImage,
plotBorderWidth = optionsChart.plotBorderWidth || 0,
mgn,
bgAttr,
plotLeft = chart.plotLeft,
plotTop = chart.plotTop,
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
plotBox = chart.plotBox,
clipRect = chart.clipRect,
clipBox = chart.clipBox;
// Chart area
mgn = chartBorderWidth + (optionsChart.shadow ? 8 : 0);
if (chartBorderWidth || chartBackgroundColor) {
if (!chartBackground) {
bgAttr = {
fill: chartBackgroundColor || NONE
};
if (chartBorderWidth) { // #980
bgAttr.stroke = optionsChart.borderColor;
bgAttr['stroke-width'] = chartBorderWidth;
}
chart.chartBackground = renderer.rect(mgn / 2, mgn / 2, chartWidth - mgn, chartHeight - mgn,
optionsChart.borderRadius, chartBorderWidth)
.attr(bgAttr)
.addClass(PREFIX + 'background')
.add()
.shadow(optionsChart.shadow);
} else { // resize
chartBackground.animate(
chartBackground.crisp({ width: chartWidth - mgn, height: chartHeight - mgn })
);
}
}
// Plot background
if (plotBackgroundColor) {
if (!plotBackground) {
chart.plotBackground = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0)
.attr({
fill: plotBackgroundColor
})
.add()
.shadow(optionsChart.plotShadow);
} else {
plotBackground.animate(plotBox);
}
}
if (plotBackgroundImage) {
if (!plotBGImage) {
chart.plotBGImage = renderer.image(plotBackgroundImage, plotLeft, plotTop, plotWidth, plotHeight)
.add();
} else {
plotBGImage.animate(plotBox);
}
}
// Plot clip
if (!clipRect) {
chart.clipRect = renderer.clipRect(clipBox);
} else {
clipRect.animate({
width: clipBox.width,
height: clipBox.height
});
}
// Plot area border
if (plotBorderWidth) {
if (!plotBorder) {
chart.plotBorder = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0, -plotBorderWidth)
.attr({
stroke: optionsChart.plotBorderColor,
'stroke-width': plotBorderWidth,
fill: NONE,
zIndex: 1
})
.add();
} else {
plotBorder.animate(
plotBorder.crisp({ x: plotLeft, y: plotTop, width: plotWidth, height: plotHeight, strokeWidth: -plotBorderWidth }) //#3282 plotBorder should be negative
);
}
}
// reset
chart.isDirtyBox = false;
},
/**
* Detect whether a certain chart property is needed based on inspecting its options
* and series. This mainly applies to the chart.invert property, and in extensions to
* the chart.angular and chart.polar properties.
*/
propFromSeries: function () {
var chart = this,
optionsChart = chart.options.chart,
klass,
seriesOptions = chart.options.series,
i,
value;
each(['inverted', 'angular', 'polar'], function (key) {
// The default series type's class
klass = seriesTypes[optionsChart.type || optionsChart.defaultSeriesType];
// Get the value from available chart-wide properties
value = (
chart[key] || // 1. it is set before
optionsChart[key] || // 2. it is set in the options
(klass && klass.prototype[key]) // 3. it's default series class requires it
);
// 4. Check if any the chart's series require it
i = seriesOptions && seriesOptions.length;
while (!value && i--) {
klass = seriesTypes[seriesOptions[i].type];
if (klass && klass.prototype[key]) {
value = true;
}
}
// Set the chart property
chart[key] = value;
});
},
/**
* Link two or more series together. This is done initially from Chart.render,
* and after Chart.addSeries and Series.remove.
*/
linkSeries: function () {
var chart = this,
chartSeries = chart.series;
// Reset links
each(chartSeries, function (series) {
series.linkedSeries.length = 0;
});
// Apply new links
each(chartSeries, function (series) {
var linkedTo = series.options.linkedTo;
if (isString(linkedTo)) {
if (linkedTo === ':previous') {
linkedTo = chart.series[series.index - 1];
} else {
linkedTo = chart.get(linkedTo);
}
if (linkedTo) {
linkedTo.linkedSeries.push(series);
series.linkedParent = linkedTo;
}
}
});
},
/**
* Render series for the chart
*/
renderSeries: function () {
each(this.series, function (serie) {
serie.translate();
serie.render();
});
},
/**
* Render labels for the chart
*/
renderLabels: function () {
var chart = this,
labels = chart.options.labels;
if (labels.items) {
each(labels.items, function (label) {
var style = extend(labels.style, label.style),
x = pInt(style.left) + chart.plotLeft,
y = pInt(style.top) + chart.plotTop + 12;
// delete to prevent rewriting in IE
delete style.left;
delete style.top;
chart.renderer.text(
label.html,
x,
y
)
.attr({ zIndex: 2 })
.css(style)
.add();
});
}
},
/**
* Render all graphics for the chart
*/
render: function () {
var chart = this,
axes = chart.axes,
renderer = chart.renderer,
options = chart.options,
tempWidth,
tempHeight,
redoHorizontal,
redoVertical;
// Title
chart.setTitle();
// Legend
chart.legend = new Legend(chart, options.legend);
chart.getStacks(); // render stacks
// Get chart margins
chart.getMargins(true);
chart.setChartSize();
// Record preliminary dimensions for later comparison
tempWidth = chart.plotWidth;
tempHeight = chart.plotHeight = chart.plotHeight - 13; // 13 is the most common height of X axis labels
// Get margins by pre-rendering axes
each(axes, function (axis) {
axis.setScale();
});
chart.getAxisMargins();
// If the plot area size has changed significantly, calculate tick positions again
redoHorizontal = tempWidth / chart.plotWidth > 1.2;
redoVertical = tempHeight / chart.plotHeight > 1.1;
if (redoHorizontal || redoVertical) {
chart.maxTicks = null; // reset for second pass
each(axes, function (axis) {
if ((axis.horiz && redoHorizontal) || (!axis.horiz && redoVertical)) {
axis.setTickInterval(true); // update to reflect the new margins
}
});
chart.getMargins(); // second pass to check for new labels
}
// Draw the borders and backgrounds
chart.drawChartBox();
// Axes
if (chart.hasCartesianSeries) {
each(axes, function (axis) {
axis.render();
});
}
// The series
if (!chart.seriesGroup) {
chart.seriesGroup = renderer.g('series-group')
.attr({ zIndex: 3 })
.add();
}
chart.renderSeries();
// Labels
chart.renderLabels();
// Credits
chart.showCredits(options.credits);
// Set flag
chart.hasRendered = true;
},
/**
* Show chart credits based on config options
*/
showCredits: function (credits) {
if (credits.enabled && !this.credits) {
this.credits = this.renderer.text(
credits.text,
0,
0
)
.on('click', function () {
if (credits.href) {
location.href = credits.href;
}
})
.attr({
align: credits.position.align,
zIndex: 8
})
.css(credits.style)
.add()
.align(credits.position);
}
},
/**
* Clean up memory usage
*/
destroy: function () {
var chart = this,
axes = chart.axes,
series = chart.series,
container = chart.container,
i,
parentNode = container && container.parentNode;
// fire the chart.destoy event
fireEvent(chart, 'destroy');
// Delete the chart from charts lookup array
charts[chart.index] = UNDEFINED;
chartCount--;
chart.renderTo.removeAttribute('data-highcharts-chart');
// remove events
removeEvent(chart);
// ==== Destroy collections:
// Destroy axes
i = axes.length;
while (i--) {
axes[i] = axes[i].destroy();
}
// Destroy each series
i = series.length;
while (i--) {
series[i] = series[i].destroy();
}
// ==== Destroy chart properties:
each(['title', 'subtitle', 'chartBackground', 'plotBackground', 'plotBGImage',
'plotBorder', 'seriesGroup', 'clipRect', 'credits', 'pointer', 'scroller',
'rangeSelector', 'legend', 'resetZoomButton', 'tooltip', 'renderer'], function (name) {
var prop = chart[name];
if (prop && prop.destroy) {
chart[name] = prop.destroy();
}
});
// remove container and all SVG
if (container) { // can break in IE when destroyed before finished loading
container.innerHTML = '';
removeEvent(container);
if (parentNode) {
discardElement(container);
}
}
// clean it all up
for (i in chart) {
delete chart[i];
}
},
/**
* VML namespaces can't be added until after complete. Listening
* for Perini's doScroll hack is not enough.
*/
isReadyToRender: function () {
var chart = this;
// Note: in spite of JSLint's complaints, win == win.top is required
/*jslint eqeq: true*/
if ((!hasSVG && (win == win.top && doc.readyState !== 'complete')) || (useCanVG && !win.canvg)) {
/*jslint eqeq: false*/
if (useCanVG) {
// Delay rendering until canvg library is downloaded and ready
CanVGController.push(function () { chart.firstRender(); }, chart.options.global.canvasToolsURL);
} else {
doc.attachEvent('onreadystatechange', function () {
doc.detachEvent('onreadystatechange', chart.firstRender);
if (doc.readyState === 'complete') {
chart.firstRender();
}
});
}
return false;
}
return true;
},
/**
* Prepare for first rendering after all data are loaded
*/
firstRender: function () {
var chart = this,
options = chart.options,
callback = chart.callback;
// Check whether the chart is ready to render
if (!chart.isReadyToRender()) {
return;
}
// Create the container
chart.getContainer();
// Run an early event after the container and renderer are established
fireEvent(chart, 'init');
chart.resetMargins();
chart.setChartSize();
// Set the common chart properties (mainly invert) from the given series
chart.propFromSeries();
// get axes
chart.getAxes();
// Initialize the series
each(options.series || [], function (serieOptions) {
chart.initSeries(serieOptions);
});
chart.linkSeries();
// Run an event after axes and series are initialized, but before render. At this stage,
// the series data is indexed and cached in the xData and yData arrays, so we can access
// those before rendering. Used in Highstock.
fireEvent(chart, 'beforeRender');
// depends on inverted and on margins being set
if (Highcharts.Pointer) {
chart.pointer = new Pointer(chart, options);
}
chart.render();
// add canvas
chart.renderer.draw();
// run callbacks
if (callback) {
callback.apply(chart, [chart]);
}
each(chart.callbacks, function (fn) {
if (chart.index !== UNDEFINED) { // Chart destroyed in its own callback (#3600)
fn.apply(chart, [chart]);
}
});
// Fire the load event
fireEvent(chart, 'load');
// If the chart was rendered outside the top container, put it back in (#3679)
chart.cloneRenderTo(true);
},
/**
* Creates arrays for spacing and margin from given options.
*/
splashArray: function (target, options) {
var oVar = options[target],
tArray = isObject(oVar) ? oVar : [oVar, oVar, oVar, oVar];
return [pick(options[target + 'Top'], tArray[0]),
pick(options[target + 'Right'], tArray[1]),
pick(options[target + 'Bottom'], tArray[2]),
pick(options[target + 'Left'], tArray[3])];
}
}; // end Chart
var CenteredSeriesMixin = Highcharts.CenteredSeriesMixin = {
/**
* Get the center of the pie based on the size and center options relative to the
* plot area. Borrowed by the polar and gauge series types.
*/
getCenter: function () {
var options = this.options,
chart = this.chart,
slicingRoom = 2 * (options.slicedOffset || 0),
handleSlicingRoom,
plotWidth = chart.plotWidth - 2 * slicingRoom,
plotHeight = chart.plotHeight - 2 * slicingRoom,
centerOption = options.center,
positions = [pick(centerOption[0], '50%'), pick(centerOption[1], '50%'), options.size || '100%', options.innerSize || 0],
smallestSize = mathMin(plotWidth, plotHeight),
isPercent;
return map(positions, function (length, i) {
isPercent = /%$/.test(length);
handleSlicingRoom = i < 2 || (i === 2 && isPercent);
return (isPercent ?
// i == 0: centerX, relative to width
// i == 1: centerY, relative to height
// i == 2: size, relative to smallestSize
// i == 4: innerSize, relative to smallestSize
[plotWidth, plotHeight, smallestSize, smallestSize][i] *
pInt(length) / 100 :
length) + (handleSlicingRoom ? slicingRoom : 0);
});
}
};
/**
* The Point object and prototype. Inheritable and used as base for PiePoint
*/
var Point = function () {};
Point.prototype = {
/**
* Initialize the point
* @param {Object} series The series object containing this point
* @param {Object} options The data in either number, array or object format
*/
init: function (series, options, x) {
var point = this,
colors;
point.series = series;
point.color = series.color; // #3445
point.applyOptions(options, x);
point.pointAttr = {};
if (series.options.colorByPoint) {
colors = series.options.colors || series.chart.options.colors;
point.color = point.color || colors[series.colorCounter++];
// loop back to zero
if (series.colorCounter === colors.length) {
series.colorCounter = 0;
}
}
series.chart.pointCount++;
return point;
},
/**
* Apply the options containing the x and y data and possible some extra properties.
* This is called on point init or from point.update.
*
* @param {Object} options
*/
applyOptions: function (options, x) {
var point = this,
series = point.series,
pointValKey = series.options.pointValKey || series.pointValKey;
options = Point.prototype.optionsToObject.call(this, options);
// copy options directly to point
extend(point, options);
point.options = point.options ? extend(point.options, options) : options;
// For higher dimension series types. For instance, for ranges, point.y is mapped to point.low.
if (pointValKey) {
point.y = point[pointValKey];
}
// If no x is set by now, get auto incremented value. All points must have an
// x value, however the y value can be null to create a gap in the series
if (point.x === UNDEFINED && series) {
point.x = x === UNDEFINED ? series.autoIncrement() : x;
}
return point;
},
/**
* Transform number or array configs into objects
*/
optionsToObject: function (options) {
var ret = {},
series = this.series,
pointArrayMap = series.pointArrayMap || ['y'],
valueCount = pointArrayMap.length,
firstItemType,
i = 0,
j = 0;
if (typeof options === 'number' || options === null) {
ret[pointArrayMap[0]] = options;
} else if (isArray(options)) {
// with leading x value
if (options.length > valueCount) {
firstItemType = typeof options[0];
if (firstItemType === 'string') {
ret.name = options[0];
} else if (firstItemType === 'number') {
ret.x = options[0];
}
i++;
}
while (j < valueCount) {
ret[pointArrayMap[j++]] = options[i++];
}
} else if (typeof options === 'object') {
ret = options;
// This is the fastest way to detect if there are individual point dataLabels that need
// to be considered in drawDataLabels. These can only occur in object configs.
if (options.dataLabels) {
series._hasPointLabels = true;
}
// Same approach as above for markers
if (options.marker) {
series._hasPointMarkers = true;
}
}
return ret;
},
/**
* Destroy a point to clear memory. Its reference still stays in series.data.
*/
destroy: function () {
var point = this,
series = point.series,
chart = series.chart,
hoverPoints = chart.hoverPoints,
prop;
chart.pointCount--;
if (hoverPoints) {
point.setState();
erase(hoverPoints, point);
if (!hoverPoints.length) {
chart.hoverPoints = null;
}
}
if (point === chart.hoverPoint) {
point.onMouseOut();
}
// remove all events
if (point.graphic || point.dataLabel) { // removeEvent and destroyElements are performance expensive
removeEvent(point);
point.destroyElements();
}
if (point.legendItem) { // pies have legend items
chart.legend.destroyItem(point);
}
for (prop in point) {
point[prop] = null;
}
},
/**
* Destroy SVG elements associated with the point
*/
destroyElements: function () {
var point = this,
props = ['graphic', 'dataLabel', 'dataLabelUpper', 'group', 'connector', 'shadowGroup'],
prop,
i = 6;
while (i--) {
prop = props[i];
if (point[prop]) {
point[prop] = point[prop].destroy();
}
}
},
/**
* Return the configuration hash needed for the data label and tooltip formatters
*/
getLabelConfig: function () {
var point = this;
return {
x: point.category,
y: point.y,
key: point.name || point.category,
series: point.series,
point: point,
percentage: point.percentage,
total: point.total || point.stackTotal
};
},
/**
* Extendable method for formatting each point's tooltip line
*
* @return {String} A string to be concatenated in to the common tooltip text
*/
tooltipFormatter: function (pointFormat) {
// Insert options for valueDecimals, valuePrefix, and valueSuffix
var series = this.series,
seriesTooltipOptions = series.tooltipOptions,
valueDecimals = pick(seriesTooltipOptions.valueDecimals, ''),
valuePrefix = seriesTooltipOptions.valuePrefix || '',
valueSuffix = seriesTooltipOptions.valueSuffix || '';
// Loop over the point array map and replace unformatted values with sprintf formatting markup
each(series.pointArrayMap || ['y'], function (key) {
key = '{point.' + key; // without the closing bracket
if (valuePrefix || valueSuffix) {
pointFormat = pointFormat.replace(key + '}', valuePrefix + key + '}' + valueSuffix);
}
pointFormat = pointFormat.replace(key + '}', key + ':,.' + valueDecimals + 'f}');
});
return format(pointFormat, {
point: this,
series: this.series
});
},
/**
* Fire an event on the Point object. Must not be renamed to fireEvent, as this
* causes a name clash in MooTools
* @param {String} eventType
* @param {Object} eventArgs Additional event arguments
* @param {Function} defaultFunction Default event handler
*/
firePointEvent: function (eventType, eventArgs, defaultFunction) {
var point = this,
series = this.series,
seriesOptions = series.options;
// load event handlers on demand to save time on mouseover/out
if (seriesOptions.point.events[eventType] || (point.options && point.options.events && point.options.events[eventType])) {
this.importEvents();
}
// add default handler if in selection mode
if (eventType === 'click' && seriesOptions.allowPointSelect) {
defaultFunction = function (event) {
// Control key is for Windows, meta (= Cmd key) for Mac, Shift for Opera
point.select(null, event.ctrlKey || event.metaKey || event.shiftKey);
};
}
fireEvent(this, eventType, eventArgs, defaultFunction);
}
};/**
* @classDescription The base function which all other series types inherit from. The data in the series is stored
* in various arrays.
*
* - First, series.options.data contains all the original config options for
* each point whether added by options or methods like series.addPoint.
* - Next, series.data contains those values converted to points, but in case the series data length
* exceeds the cropThreshold, or if the data is grouped, series.data doesn't contain all the points. It
* only contains the points that have been created on demand.
* - Then there's series.points that contains all currently visible point objects. In case of cropping,
* the cropped-away points are not part of this array. The series.points array starts at series.cropStart
* compared to series.data and series.options.data. If however the series data is grouped, these can't
* be correlated one to one.
* - series.xData and series.processedXData contain clean x values, equivalent to series.data and series.points.
* - series.yData and series.processedYData contain clean x values, equivalent to series.data and series.points.
*
* @param {Object} chart
* @param {Object} options
*/
var Series = Highcharts.Series = function () {};
Series.prototype = {
isCartesian: true,
type: 'line',
pointClass: Point,
sorted: true, // requires the data to be sorted
requireSorting: true,
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
stroke: 'lineColor',
'stroke-width': 'lineWidth',
fill: 'fillColor',
r: 'radius'
},
axisTypes: ['xAxis', 'yAxis'],
colorCounter: 0,
parallelArrays: ['x', 'y'], // each point's x and y values are stored in this.xData and this.yData
init: function (chart, options) {
var series = this,
eventType,
events,
chartSeries = chart.series,
sortByIndex = function (a, b) {
return pick(a.options.index, a._i) - pick(b.options.index, b._i);
};
series.chart = chart;
series.options = options = series.setOptions(options); // merge with plotOptions
series.linkedSeries = [];
// bind the axes
series.bindAxes();
// set some variables
extend(series, {
name: options.name,
state: NORMAL_STATE,
pointAttr: {},
visible: options.visible !== false, // true by default
selected: options.selected === true // false by default
});
// special
if (useCanVG) {
options.animation = false;
}
// register event listeners
events = options.events;
for (eventType in events) {
addEvent(series, eventType, events[eventType]);
}
if (
(events && events.click) ||
(options.point && options.point.events && options.point.events.click) ||
options.allowPointSelect
) {
chart.runTrackerClick = true;
}
series.getColor();
series.getSymbol();
// Set the data
each(series.parallelArrays, function (key) {
series[key + 'Data'] = [];
});
series.setData(options.data, false);
// Mark cartesian
if (series.isCartesian) {
chart.hasCartesianSeries = true;
}
// Register it in the chart
chartSeries.push(series);
series._i = chartSeries.length - 1;
// Sort series according to index option (#248, #1123, #2456)
stableSort(chartSeries, sortByIndex);
if (this.yAxis) {
stableSort(this.yAxis.series, sortByIndex);
}
each(chartSeries, function (series, i) {
series.index = i;
series.name = series.name || 'Series ' + (i + 1);
});
},
/**
* Set the xAxis and yAxis properties of cartesian series, and register the series
* in the axis.series array
*/
bindAxes: function () {
var series = this,
seriesOptions = series.options,
chart = series.chart,
axisOptions;
each(series.axisTypes || [], function (AXIS) { // repeat for xAxis and yAxis
each(chart[AXIS], function (axis) { // loop through the chart's axis objects
axisOptions = axis.options;
// apply if the series xAxis or yAxis option mathches the number of the
// axis, or if undefined, use the first axis
if ((seriesOptions[AXIS] === axisOptions.index) ||
(seriesOptions[AXIS] !== UNDEFINED && seriesOptions[AXIS] === axisOptions.id) ||
(seriesOptions[AXIS] === UNDEFINED && axisOptions.index === 0)) {
// register this series in the axis.series lookup
axis.series.push(series);
// set this series.xAxis or series.yAxis reference
series[AXIS] = axis;
// mark dirty for redraw
axis.isDirty = true;
}
});
// The series needs an X and an Y axis
if (!series[AXIS] && series.optionalAxis !== AXIS) {
error(18, true);
}
});
},
/**
* For simple series types like line and column, the data values are held in arrays like
* xData and yData for quick lookup to find extremes and more. For multidimensional series
* like bubble and map, this can be extended with arrays like zData and valueData by
* adding to the series.parallelArrays array.
*/
updateParallelArrays: function (point, i) {
var series = point.series,
args = arguments,
fn = typeof i === 'number' ?
// Insert the value in the given position
function (key) {
var val = key === 'y' && series.toYData ? series.toYData(point) : point[key];
series[key + 'Data'][i] = val;
} :
// Apply the method specified in i with the following arguments as arguments
function (key) {
Array.prototype[i].apply(series[key + 'Data'], Array.prototype.slice.call(args, 2));
};
each(series.parallelArrays, fn);
},
/**
* Return an auto incremented x value based on the pointStart and pointInterval options.
* This is only used if an x value is not given for the point that calls autoIncrement.
*/
autoIncrement: function () {
var options = this.options,
xIncrement = this.xIncrement,
date,
pointInterval,
pointIntervalUnit = options.pointIntervalUnit;
xIncrement = pick(xIncrement, options.pointStart, 0);
this.pointInterval = pointInterval = pick(this.pointInterval, options.pointInterval, 1);
// Added code for pointInterval strings
if (pointIntervalUnit === 'month' || pointIntervalUnit === 'year') {
date = new Date(xIncrement);
date = (pointIntervalUnit === 'month') ?
+date[setMonth](date[getMonth]() + pointInterval) :
+date[setFullYear](date[getFullYear]() + pointInterval);
pointInterval = date - xIncrement;
}
this.xIncrement = xIncrement + pointInterval;
return xIncrement;
},
/**
* Divide the series data into segments divided by null values.
*/
getSegments: function () {
var series = this,
lastNull = -1,
segments = [],
i,
points = series.points,
pointsLength = points.length;
if (pointsLength) { // no action required for []
// if connect nulls, just remove null points
if (series.options.connectNulls) {
i = pointsLength;
while (i--) {
if (points[i].y === null) {
points.splice(i, 1);
}
}
if (points.length) {
segments = [points];
}
// else, split on null points
} else {
each(points, function (point, i) {
if (point.y === null) {
if (i > lastNull + 1) {
segments.push(points.slice(lastNull + 1, i));
}
lastNull = i;
} else if (i === pointsLength - 1) { // last value
segments.push(points.slice(lastNull + 1, i + 1));
}
});
}
}
// register it
series.segments = segments;
},
/**
* Set the series options by merging from the options tree
* @param {Object} itemOptions
*/
setOptions: function (itemOptions) {
var chart = this.chart,
chartOptions = chart.options,
plotOptions = chartOptions.plotOptions,
userOptions = chart.userOptions || {},
userPlotOptions = userOptions.plotOptions || {},
typeOptions = plotOptions[this.type],
options,
zones;
this.userOptions = itemOptions;
options = merge(
typeOptions,
plotOptions.series,
itemOptions
);
// The tooltip options are merged between global and series specific options
this.tooltipOptions = merge(
defaultOptions.tooltip,
defaultOptions.plotOptions[this.type].tooltip,
userOptions.tooltip,
userPlotOptions.series && userPlotOptions.series.tooltip,
userPlotOptions[this.type] && userPlotOptions[this.type].tooltip,
itemOptions.tooltip
);
// Delete marker object if not allowed (#1125)
if (typeOptions.marker === null) {
delete options.marker;
}
// Handle color zones
this.zoneAxis = options.zoneAxis;
zones = this.zones = (options.zones || []).slice();
if ((options.negativeColor || options.negativeFillColor) && !options.zones) {
zones.push({
value: options[this.zoneAxis + 'Threshold'] || options.threshold || 0,
color: options.negativeColor,
fillColor: options.negativeFillColor
});
}
if (zones.length) { // Push one extra zone for the rest
if (defined(zones[zones.length - 1].value)) {
zones.push({
color: this.color,
fillColor: this.fillColor
});
}
}
return options;
},
getCyclic: function (prop, value, defaults) {
var i,
userOptions = this.userOptions,
indexName = '_' + prop + 'Index',
counterName = prop + 'Counter';
if (!value) {
if (defined(userOptions[indexName])) { // after Series.update()
i = userOptions[indexName];
} else {
userOptions[indexName] = i = this.chart[counterName] % defaults.length;
this.chart[counterName] += 1;
}
value = defaults[i];
}
this[prop] = value;
},
/**
* Get the series' color
*/
getColor: function () {
if (!this.options.colorByPoint) {
this.getCyclic('color', this.options.color || defaultPlotOptions[this.type].color, this.chart.options.colors);
}
},
/**
* Get the series' symbol
*/
getSymbol: function () {
var seriesMarkerOption = this.options.marker;
this.getCyclic('symbol', seriesMarkerOption.symbol, this.chart.options.symbols);
// don't substract radius in image symbols (#604)
if (/^url/.test(this.symbol)) {
seriesMarkerOption.radius = 0;
}
},
drawLegendSymbol: LegendSymbolMixin.drawLineMarker,
/**
* Replace the series data with a new set of data
* @param {Object} data
* @param {Object} redraw
*/
setData: function (data, redraw, animation, updatePoints) {
var series = this,
oldData = series.points,
oldDataLength = (oldData && oldData.length) || 0,
dataLength,
options = series.options,
chart = series.chart,
firstPoint = null,
xAxis = series.xAxis,
hasCategories = xAxis && !!xAxis.categories,
i,
turboThreshold = options.turboThreshold,
pt,
xData = this.xData,
yData = this.yData,
pointArrayMap = series.pointArrayMap,
valueCount = pointArrayMap && pointArrayMap.length;
data = data || [];
dataLength = data.length;
redraw = pick(redraw, true);
// If the point count is the same as is was, just run Point.update which is
// cheaper, allows animation, and keeps references to points.
if (updatePoints !== false && dataLength && oldDataLength === dataLength && !series.cropped && !series.hasGroupedData && series.visible) {
each(data, function (point, i) {
oldData[i].update(point, false, null, false);
});
} else {
// Reset properties
series.xIncrement = null;
series.pointRange = hasCategories ? 1 : options.pointRange;
series.colorCounter = 0; // for series with colorByPoint (#1547)
// Update parallel arrays
each(this.parallelArrays, function (key) {
series[key + 'Data'].length = 0;
});
// In turbo mode, only one- or twodimensional arrays of numbers are allowed. The
// first value is tested, and we assume that all the rest are defined the same
// way. Although the 'for' loops are similar, they are repeated inside each
// if-else conditional for max performance.
if (turboThreshold && dataLength > turboThreshold) {
// find the first non-null point
i = 0;
while (firstPoint === null && i < dataLength) {
firstPoint = data[i];
i++;
}
if (isNumber(firstPoint)) { // assume all points are numbers
var x = pick(options.pointStart, 0),
pointInterval = pick(options.pointInterval, 1);
for (i = 0; i < dataLength; i++) {
xData[i] = x;
yData[i] = data[i];
x += pointInterval;
}
series.xIncrement = x;
} else if (isArray(firstPoint)) { // assume all points are arrays
if (valueCount) { // [x, low, high] or [x, o, h, l, c]
for (i = 0; i < dataLength; i++) {
pt = data[i];
xData[i] = pt[0];
yData[i] = pt.slice(1, valueCount + 1);
}
} else { // [x, y]
for (i = 0; i < dataLength; i++) {
pt = data[i];
xData[i] = pt[0];
yData[i] = pt[1];
}
}
} else {
error(12); // Highcharts expects configs to be numbers or arrays in turbo mode
}
} else {
for (i = 0; i < dataLength; i++) {
if (data[i] !== UNDEFINED) { // stray commas in oldIE
pt = { series: series };
series.pointClass.prototype.applyOptions.apply(pt, [data[i]]);
series.updateParallelArrays(pt, i);
if (hasCategories && pt.name) {
xAxis.names[pt.x] = pt.name; // #2046
}
}
}
}
// Forgetting to cast strings to numbers is a common caveat when handling CSV or JSON
if (isString(yData[0])) {
error(14, true);
}
series.data = [];
series.options.data = data;
//series.zData = zData;
// destroy old points
i = oldDataLength;
while (i--) {
if (oldData[i] && oldData[i].destroy) {
oldData[i].destroy();
}
}
// reset minRange (#878)
if (xAxis) {
xAxis.minRange = xAxis.userMinRange;
}
// redraw
series.isDirty = series.isDirtyData = chart.isDirtyBox = true;
animation = false;
}
if (redraw) {
chart.redraw(animation);
}
},
/**
* Process the data by cropping away unused data points if the series is longer
* than the crop threshold. This saves computing time for lage series.
*/
processData: function (force) {
var series = this,
processedXData = series.xData, // copied during slice operation below
processedYData = series.yData,
dataLength = processedXData.length,
croppedData,
cropStart = 0,
cropped,
distance,
closestPointRange,
xAxis = series.xAxis,
i, // loop variable
options = series.options,
cropThreshold = options.cropThreshold,
isCartesian = series.isCartesian,
xExtremes,
min,
max;
// If the series data or axes haven't changed, don't go through this. Return false to pass
// the message on to override methods like in data grouping.
if (isCartesian && !series.isDirty && !xAxis.isDirty && !series.yAxis.isDirty && !force) {
return false;
}
if (xAxis) {
xExtremes = xAxis.getExtremes(); // corrected for log axis (#3053)
min = xExtremes.min;
max = xExtremes.max;
}
// optionally filter out points outside the plot area
if (isCartesian && series.sorted && (!cropThreshold || dataLength > cropThreshold || series.forceCrop)) {
// it's outside current extremes
if (processedXData[dataLength - 1] < min || processedXData[0] > max) {
processedXData = [];
processedYData = [];
// only crop if it's actually spilling out
} else if (processedXData[0] < min || processedXData[dataLength - 1] > max) {
croppedData = this.cropData(series.xData, series.yData, min, max);
processedXData = croppedData.xData;
processedYData = croppedData.yData;
cropStart = croppedData.start;
cropped = true;
}
}
// Find the closest distance between processed points
for (i = processedXData.length - 1; i >= 0; i--) {
distance = processedXData[i] - processedXData[i - 1];
if (distance > 0 && (closestPointRange === UNDEFINED || distance < closestPointRange)) {
closestPointRange = distance;
// Unsorted data is not supported by the line tooltip, as well as data grouping and
// navigation in Stock charts (#725) and width calculation of columns (#1900)
} else if (distance < 0 && series.requireSorting) {
error(15);
}
}
// Record the properties
series.cropped = cropped; // undefined or true
series.cropStart = cropStart;
series.processedXData = processedXData;
series.processedYData = processedYData;
if (options.pointRange === null) { // null means auto, as for columns, candlesticks and OHLC
series.pointRange = closestPointRange || 1;
}
series.closestPointRange = closestPointRange;
},
/**
* Iterate over xData and crop values between min and max. Returns object containing crop start/end
* cropped xData with corresponding part of yData, dataMin and dataMax within the cropped range
*/
cropData: function (xData, yData, min, max) {
var dataLength = xData.length,
cropStart = 0,
cropEnd = dataLength,
cropShoulder = pick(this.cropShoulder, 1), // line-type series need one point outside
i;
// iterate up to find slice start
for (i = 0; i < dataLength; i++) {
if (xData[i] >= min) {
cropStart = mathMax(0, i - cropShoulder);
break;
}
}
// proceed to find slice end
for (; i < dataLength; i++) {
if (xData[i] > max) {
cropEnd = i + cropShoulder;
break;
}
}
return {
xData: xData.slice(cropStart, cropEnd),
yData: yData.slice(cropStart, cropEnd),
start: cropStart,
end: cropEnd
};
},
/**
* Generate the data point after the data has been processed by cropping away
* unused points and optionally grouped in Highcharts Stock.
*/
generatePoints: function () {
var series = this,
options = series.options,
dataOptions = options.data,
data = series.data,
dataLength,
processedXData = series.processedXData,
processedYData = series.processedYData,
pointClass = series.pointClass,
processedDataLength = processedXData.length,
cropStart = series.cropStart || 0,
cursor,
hasGroupedData = series.hasGroupedData,
point,
points = [],
i;
if (!data && !hasGroupedData) {
var arr = [];
arr.length = dataOptions.length;
data = series.data = arr;
}
for (i = 0; i < processedDataLength; i++) {
cursor = cropStart + i;
if (!hasGroupedData) {
if (data[cursor]) {
point = data[cursor];
} else if (dataOptions[cursor] !== UNDEFINED) { // #970
data[cursor] = point = (new pointClass()).init(series, dataOptions[cursor], processedXData[i]);
}
points[i] = point;
} else {
// splat the y data in case of ohlc data array
points[i] = (new pointClass()).init(series, [processedXData[i]].concat(splat(processedYData[i])));
}
points[i].index = cursor; // For faster access in Point.update
}
// Hide cropped-away points - this only runs when the number of points is above cropThreshold, or when
// swithching view from non-grouped data to grouped data (#637)
if (data && (processedDataLength !== (dataLength = data.length) || hasGroupedData)) {
for (i = 0; i < dataLength; i++) {
if (i === cropStart && !hasGroupedData) { // when has grouped data, clear all points
i += processedDataLength;
}
if (data[i]) {
data[i].destroyElements();
data[i].plotX = UNDEFINED; // #1003
}
}
}
series.data = data;
series.points = points;
},
/**
* Calculate Y extremes for visible data
*/
getExtremes: function (yData) {
var xAxis = this.xAxis,
yAxis = this.yAxis,
xData = this.processedXData,
yDataLength,
activeYData = [],
activeCounter = 0,
xExtremes = xAxis.getExtremes(), // #2117, need to compensate for log X axis
xMin = xExtremes.min,
xMax = xExtremes.max,
validValue,
withinRange,
dataMin,
dataMax,
x,
y,
i,
j;
yData = yData || this.stackedYData || this.processedYData;
yDataLength = yData.length;
for (i = 0; i < yDataLength; i++) {
x = xData[i];
y = yData[i];
// For points within the visible range, including the first point outside the
// visible range, consider y extremes
validValue = y !== null && y !== UNDEFINED && (!yAxis.isLog || (y.length || y > 0));
withinRange = this.getExtremesFromAll || this.cropped || ((xData[i + 1] || x) >= xMin &&
(xData[i - 1] || x) <= xMax);
if (validValue && withinRange) {
j = y.length;
if (j) { // array, like ohlc or range data
while (j--) {
if (y[j] !== null) {
activeYData[activeCounter++] = y[j];
}
}
} else {
activeYData[activeCounter++] = y;
}
}
}
this.dataMin = pick(dataMin, arrayMin(activeYData));
this.dataMax = pick(dataMax, arrayMax(activeYData));
},
/**
* Translate data points from raw data values to chart specific positioning data
* needed later in drawPoints, drawGraph and drawTracker.
*/
translate: function () {
if (!this.processedXData) { // hidden series
this.processData();
}
this.generatePoints();
var series = this,
options = series.options,
stacking = options.stacking,
xAxis = series.xAxis,
categories = xAxis.categories,
yAxis = series.yAxis,
points = series.points,
dataLength = points.length,
hasModifyValue = !!series.modifyValue,
i,
pointPlacement = options.pointPlacement,
dynamicallyPlaced = pointPlacement === 'between' || isNumber(pointPlacement),
threshold = options.threshold,
plotX,
plotY,
lastPlotX,
closestPointRangePx = Number.MAX_VALUE;
// Translate each point
for (i = 0; i < dataLength; i++) {
var point = points[i],
xValue = point.x,
yValue = point.y,
yBottom = point.low,
stack = stacking && yAxis.stacks[(series.negStacks && yValue < threshold ? '-' : '') + series.stackKey],
pointStack,
stackValues;
// Discard disallowed y values for log axes (#3434)
if (yAxis.isLog && yValue !== null && yValue <= 0) {
point.y = yValue = null;
error(10);
}
// Get the plotX translation
point.plotX = plotX = xAxis.translate(xValue, 0, 0, 0, 1, pointPlacement, this.type === 'flags'); // Math.round fixes #591
// Calculate the bottom y value for stacked series
if (stacking && series.visible && stack && stack[xValue]) {
pointStack = stack[xValue];
stackValues = pointStack.points[series.index + ',' + i];
yBottom = stackValues[0];
yValue = stackValues[1];
if (yBottom === 0) {
yBottom = pick(threshold, yAxis.min);
}
if (yAxis.isLog && yBottom <= 0) { // #1200, #1232
yBottom = null;
}
point.total = point.stackTotal = pointStack.total;
point.percentage = pointStack.total && (point.y / pointStack.total * 100);
point.stackY = yValue;
// Place the stack label
pointStack.setOffset(series.pointXOffset || 0, series.barW || 0);
}
// Set translated yBottom or remove it
point.yBottom = defined(yBottom) ?
yAxis.translate(yBottom, 0, 1, 0, 1) :
null;
// general hook, used for Highstock compare mode
if (hasModifyValue) {
yValue = series.modifyValue(yValue, point);
}
// Set the the plotY value, reset it for redraws
point.plotY = plotY = (typeof yValue === 'number' && yValue !== Infinity) ?
mathMin(mathMax(-1e5, yAxis.translate(yValue, 0, 1, 0, 1)), 1e5) : // #3201
UNDEFINED;
point.isInside = plotY !== UNDEFINED && plotY >= 0 && plotY <= yAxis.len && // #3519
plotX >= 0 && plotX <= xAxis.len;
// Set client related positions for mouse tracking
point.clientX = dynamicallyPlaced ? xAxis.translate(xValue, 0, 0, 0, 1) : plotX; // #1514
point.negative = point.y < (threshold || 0);
// some API data
point.category = categories && categories[point.x] !== UNDEFINED ?
categories[point.x] : point.x;
// Determine auto enabling of markers (#3635)
if (i) {
closestPointRangePx = mathMin(closestPointRangePx, mathAbs(plotX - lastPlotX));
}
lastPlotX = plotX;
}
series.closestPointRangePx = closestPointRangePx;
// now that we have the cropped data, build the segments
series.getSegments();
},
/**
* Set the clipping for the series. For animated series it is called twice, first to initiate
* animating the clip then the second time without the animation to set the final clip.
*/
setClip: function (animation) {
var chart = this.chart,
renderer = chart.renderer,
inverted = chart.inverted,
seriesClipBox = this.clipBox,
clipBox = seriesClipBox || chart.clipBox,
sharedClipKey = this.sharedClipKey || ['_sharedClip', animation && animation.duration, animation && animation.easing, clipBox.height].join(','),
clipRect = chart[sharedClipKey],
markerClipRect = chart[sharedClipKey + 'm'];
// If a clipping rectangle with the same properties is currently present in the chart, use that.
if (!clipRect) {
// When animation is set, prepare the initial positions
if (animation) {
clipBox.width = 0;
chart[sharedClipKey + 'm'] = markerClipRect = renderer.clipRect(
-99, // include the width of the first marker
inverted ? -chart.plotLeft : -chart.plotTop,
99,
inverted ? chart.chartWidth : chart.chartHeight
);
}
chart[sharedClipKey] = clipRect = renderer.clipRect(clipBox);
}
if (animation) {
clipRect.count += 1;
}
if (this.options.clip !== false) {
this.group.clip(animation || seriesClipBox ? clipRect : chart.clipRect);
this.markerGroup.clip(markerClipRect);
this.sharedClipKey = sharedClipKey;
}
// Remove the shared clipping rectancgle when all series are shown
if (!animation) {
clipRect.count -= 1;
if (clipRect.count <= 0 && sharedClipKey && chart[sharedClipKey]) {
if (!seriesClipBox) {
chart[sharedClipKey] = chart[sharedClipKey].destroy();
}
if (chart[sharedClipKey + 'm']) {
chart[sharedClipKey + 'm'] = chart[sharedClipKey + 'm'].destroy();
}
}
}
},
/**
* Animate in the series
*/
animate: function (init) {
var series = this,
chart = series.chart,
clipRect,
animation = series.options.animation,
sharedClipKey;
// Animation option is set to true
if (animation && !isObject(animation)) {
animation = defaultPlotOptions[series.type].animation;
}
// Initialize the animation. Set up the clipping rectangle.
if (init) {
series.setClip(animation);
// Run the animation
} else {
sharedClipKey = this.sharedClipKey;
clipRect = chart[sharedClipKey];
if (clipRect) {
clipRect.animate({
width: chart.plotSizeX
}, animation);
}
if (chart[sharedClipKey + 'm']) {
chart[sharedClipKey + 'm'].animate({
width: chart.plotSizeX + 99
}, animation);
}
// Delete this function to allow it only once
series.animate = null;
}
},
/**
* This runs after animation to land on the final plot clipping
*/
afterAnimate: function () {
this.setClip();
fireEvent(this, 'afterAnimate');
},
/**
* Draw the markers
*/
drawPoints: function () {
var series = this,
pointAttr,
points = series.points,
chart = series.chart,
plotX,
plotY,
i,
point,
radius,
symbol,
isImage,
graphic,
options = series.options,
seriesMarkerOptions = options.marker,
seriesPointAttr = series.pointAttr[''],
pointMarkerOptions,
hasPointMarker,
enabled,
isInside,
markerGroup = series.markerGroup,
xAxis = series.xAxis,
globallyEnabled = pick(
seriesMarkerOptions.enabled,
xAxis.isRadial,
series.closestPointRangePx > 2 * seriesMarkerOptions.radius
);
if (seriesMarkerOptions.enabled !== false || series._hasPointMarkers) {
i = points.length;
while (i--) {
point = points[i];
plotX = mathFloor(point.plotX); // #1843
plotY = point.plotY;
graphic = point.graphic;
pointMarkerOptions = point.marker || {};
hasPointMarker = !!point.marker;
enabled = (globallyEnabled && pointMarkerOptions.enabled === UNDEFINED) || pointMarkerOptions.enabled;
isInside = point.isInside;
// only draw the point if y is defined
if (enabled && plotY !== UNDEFINED && !isNaN(plotY) && point.y !== null) {
// shortcuts
pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || seriesPointAttr;
radius = pointAttr.r;
symbol = pick(pointMarkerOptions.symbol, series.symbol);
isImage = symbol.indexOf('url') === 0;
if (graphic) { // update
graphic[isInside ? 'show' : 'hide'](true) // Since the marker group isn't clipped, each individual marker must be toggled
.animate(extend({
x: plotX - radius,
y: plotY - radius
}, graphic.symbolName ? { // don't apply to image symbols #507
width: 2 * radius,
height: 2 * radius
} : {}));
} else if (isInside && (radius > 0 || isImage)) {
point.graphic = graphic = chart.renderer.symbol(
symbol,
plotX - radius,
plotY - radius,
2 * radius,
2 * radius,
hasPointMarker ? pointMarkerOptions : seriesMarkerOptions
)
.attr(pointAttr)
.add(markerGroup);
}
} else if (graphic) {
point.graphic = graphic.destroy(); // #1269
}
}
}
},
/**
* Convert state properties from API naming conventions to SVG attributes
*
* @param {Object} options API options object
* @param {Object} base1 SVG attribute object to inherit from
* @param {Object} base2 Second level SVG attribute object to inherit from
*/
convertAttribs: function (options, base1, base2, base3) {
var conversion = this.pointAttrToOptions,
attr,
option,
obj = {};
options = options || {};
base1 = base1 || {};
base2 = base2 || {};
base3 = base3 || {};
for (attr in conversion) {
option = conversion[attr];
obj[attr] = pick(options[option], base1[attr], base2[attr], base3[attr]);
}
return obj;
},
/**
* Get the state attributes. Each series type has its own set of attributes
* that are allowed to change on a point's state change. Series wide attributes are stored for
* all series, and additionally point specific attributes are stored for all
* points with individual marker options. If such options are not defined for the point,
* a reference to the series wide attributes is stored in point.pointAttr.
*/
getAttribs: function () {
var series = this,
seriesOptions = series.options,
normalOptions = defaultPlotOptions[series.type].marker ? seriesOptions.marker : seriesOptions,
stateOptions = normalOptions.states,
stateOptionsHover = stateOptions[HOVER_STATE],
pointStateOptionsHover,
seriesColor = series.color,
seriesNegativeColor = series.options.negativeColor,
normalDefaults = {
stroke: seriesColor,
fill: seriesColor
},
points = series.points || [], // #927
i,
point,
seriesPointAttr = [],
pointAttr,
pointAttrToOptions = series.pointAttrToOptions,
hasPointSpecificOptions = series.hasPointSpecificOptions,
defaultLineColor = normalOptions.lineColor,
defaultFillColor = normalOptions.fillColor,
turboThreshold = seriesOptions.turboThreshold,
zones = series.zones,
zoneAxis = series.zoneAxis || 'y',
attr,
key;
// series type specific modifications
if (seriesOptions.marker) { // line, spline, area, areaspline, scatter
// if no hover radius is given, default to normal radius + 2
stateOptionsHover.radius = stateOptionsHover.radius || normalOptions.radius + stateOptionsHover.radiusPlus;
stateOptionsHover.lineWidth = stateOptionsHover.lineWidth || normalOptions.lineWidth + stateOptionsHover.lineWidthPlus;
} else { // column, bar, pie
// if no hover color is given, brighten the normal color
stateOptionsHover.color = stateOptionsHover.color ||
Color(stateOptionsHover.color || seriesColor)
.brighten(stateOptionsHover.brightness).get();
// if no hover negativeColor is given, brighten the normal negativeColor
stateOptionsHover.negativeColor = stateOptionsHover.negativeColor ||
Color(stateOptionsHover.negativeColor || seriesNegativeColor)
.brighten(stateOptionsHover.brightness).get();
}
// general point attributes for the series normal state
seriesPointAttr[NORMAL_STATE] = series.convertAttribs(normalOptions, normalDefaults);
// HOVER_STATE and SELECT_STATE states inherit from normal state except the default radius
each([HOVER_STATE, SELECT_STATE], function (state) {
seriesPointAttr[state] =
series.convertAttribs(stateOptions[state], seriesPointAttr[NORMAL_STATE]);
});
// set it
series.pointAttr = seriesPointAttr;
// Generate the point-specific attribute collections if specific point
// options are given. If not, create a referance to the series wide point
// attributes
i = points.length;
if (!turboThreshold || i < turboThreshold || hasPointSpecificOptions) {
while (i--) {
point = points[i];
normalOptions = (point.options && point.options.marker) || point.options;
if (normalOptions && normalOptions.enabled === false) {
normalOptions.radius = 0;
}
if (zones.length) {
var j = 0,
threshold = zones[j];
while (point[zoneAxis] >= threshold.value) {
threshold = zones[++j];
}
point.color = point.fillColor = threshold.color;
}
hasPointSpecificOptions = seriesOptions.colorByPoint || point.color; // #868
// check if the point has specific visual options
if (point.options) {
for (key in pointAttrToOptions) {
if (defined(normalOptions[pointAttrToOptions[key]])) {
hasPointSpecificOptions = true;
}
}
}
// a specific marker config object is defined for the individual point:
// create it's own attribute collection
if (hasPointSpecificOptions) {
normalOptions = normalOptions || {};
pointAttr = [];
stateOptions = normalOptions.states || {}; // reassign for individual point
pointStateOptionsHover = stateOptions[HOVER_STATE] = stateOptions[HOVER_STATE] || {};
// Handle colors for column and pies
if (!seriesOptions.marker) { // column, bar, point
// If no hover color is given, brighten the normal color. #1619, #2579
pointStateOptionsHover.color = pointStateOptionsHover.color || (!point.options.color && stateOptionsHover[(point.negative && seriesNegativeColor ? 'negativeColor' : 'color')]) ||
Color(point.color)
.brighten(pointStateOptionsHover.brightness || stateOptionsHover.brightness)
.get();
}
// normal point state inherits series wide normal state
attr = { color: point.color }; // #868
if (!defaultFillColor) { // Individual point color or negative color markers (#2219)
attr.fillColor = point.color;
}
if (!defaultLineColor) {
attr.lineColor = point.color; // Bubbles take point color, line markers use white
}
pointAttr[NORMAL_STATE] = series.convertAttribs(extend(attr, normalOptions), seriesPointAttr[NORMAL_STATE]);
// inherit from point normal and series hover
pointAttr[HOVER_STATE] = series.convertAttribs(
stateOptions[HOVER_STATE],
seriesPointAttr[HOVER_STATE],
pointAttr[NORMAL_STATE]
);
// inherit from point normal and series hover
pointAttr[SELECT_STATE] = series.convertAttribs(
stateOptions[SELECT_STATE],
seriesPointAttr[SELECT_STATE],
pointAttr[NORMAL_STATE]
);
// no marker config object is created: copy a reference to the series-wide
// attribute collection
} else {
pointAttr = seriesPointAttr;
}
point.pointAttr = pointAttr;
}
}
},
/**
* Clear DOM objects and free up memory
*/
destroy: function () {
var series = this,
chart = series.chart,
issue134 = /AppleWebKit\/533/.test(userAgent),
destroy,
i,
data = series.data || [],
point,
prop,
axis;
// add event hook
fireEvent(series, 'destroy');
// remove all events
removeEvent(series);
// erase from axes
each(series.axisTypes || [], function (AXIS) {
axis = series[AXIS];
if (axis) {
erase(axis.series, series);
axis.isDirty = axis.forceRedraw = true;
}
});
// remove legend items
if (series.legendItem) {
series.chart.legend.destroyItem(series);
}
// destroy all points with their elements
i = data.length;
while (i--) {
point = data[i];
if (point && point.destroy) {
point.destroy();
}
}
series.points = null;
// Clear the animation timeout if we are destroying the series during initial animation
clearTimeout(series.animationTimeout);
// destroy all SVGElements associated to the series
each(['area', 'graph', 'dataLabelsGroup', 'group', 'markerGroup', 'tracker',
'graphNeg', 'areaNeg', 'posClip', 'negClip'], function (prop) {
if (series[prop]) {
// issue 134 workaround
destroy = issue134 && prop === 'group' ?
'hide' :
'destroy';
series[prop][destroy]();
}
});
// remove from hoverSeries
if (chart.hoverSeries === series) {
chart.hoverSeries = null;
}
erase(chart.series, series);
// clear all members
for (prop in series) {
delete series[prop];
}
},
/**
* Return the graph path of a segment
*/
getSegmentPath: function (segment) {
var series = this,
segmentPath = [],
step = series.options.step;
// build the segment line
each(segment, function (point, i) {
var plotX = point.plotX,
plotY = point.plotY,
lastPoint;
if (series.getPointSpline) { // generate the spline as defined in the SplineSeries object
segmentPath.push.apply(segmentPath, series.getPointSpline(segment, point, i));
} else {
// moveTo or lineTo
segmentPath.push(i ? L : M);
// step line?
if (step && i) {
lastPoint = segment[i - 1];
if (step === 'right') {
segmentPath.push(
lastPoint.plotX,
plotY
);
} else if (step === 'center') {
segmentPath.push(
(lastPoint.plotX + plotX) / 2,
lastPoint.plotY,
(lastPoint.plotX + plotX) / 2,
plotY
);
} else {
segmentPath.push(
plotX,
lastPoint.plotY
);
}
}
// normal line to next point
segmentPath.push(
point.plotX,
point.plotY
);
}
});
return segmentPath;
},
/**
* Get the graph path
*/
getGraphPath: function () {
var series = this,
graphPath = [],
segmentPath,
singlePoints = []; // used in drawTracker
// Divide into segments and build graph and area paths
each(series.segments, function (segment) {
segmentPath = series.getSegmentPath(segment);
// add the segment to the graph, or a single point for tracking
if (segment.length > 1) {
graphPath = graphPath.concat(segmentPath);
} else {
singlePoints.push(segment[0]);
}
});
// Record it for use in drawGraph and drawTracker, and return graphPath
series.singlePoints = singlePoints;
series.graphPath = graphPath;
return graphPath;
},
/**
* Draw the actual graph
*/
drawGraph: function () {
var series = this,
options = this.options,
props = [['graph', options.lineColor || this.color, options.dashStyle]],
lineWidth = options.lineWidth,
roundCap = options.linecap !== 'square',
graphPath = this.getGraphPath(),
fillColor = (this.fillGraph && this.color) || NONE, // polygon series use filled graph
zones = this.zones;
each(zones, function (threshold, i) {
props.push(['colorGraph' + i, threshold.color || series.color, threshold.dashStyle || options.dashStyle]);
});
// Draw the graph
each(props, function (prop, i) {
var graphKey = prop[0],
graph = series[graphKey],
attribs;
if (graph) {
stop(graph); // cancel running animations, #459
graph.animate({ d: graphPath });
} else if ((lineWidth || fillColor) && graphPath.length) { // #1487
attribs = {
stroke: prop[1],
'stroke-width': lineWidth,
fill: fillColor,
zIndex: 1 // #1069
};
if (prop[2]) {
attribs.dashstyle = prop[2];
} else if (roundCap) {
attribs['stroke-linecap'] = attribs['stroke-linejoin'] = 'round';
}
series[graphKey] = series.chart.renderer.path(graphPath)
.attr(attribs)
.add(series.group)
.shadow(!i && options.shadow);
}
});
},
/**
* Clip the graphs into the positive and negative coloured graphs
*/
applyZones: function () {
var series = this,
chart = this.chart,
renderer = chart.renderer,
zones = this.zones,
translatedFrom,
translatedTo,
clips = this.clips || [],
clipAttr,
graph = this.graph,
area = this.area,
chartSizeMax = mathMax(chart.chartWidth, chart.chartHeight),
zoneAxis = this.zoneAxis || 'y',
axis = this[zoneAxis + 'Axis'],
reversed = axis.reversed,
horiz = axis.horiz;
if (zones.length && (graph || area)) {
// The use of the Color Threshold assumes there are no gaps
// so it is safe to hide the original graph and area
graph.hide();
if (area) { area.hide(); }
// Create the clips
each(zones, function (threshold, i) {
translatedFrom = pick(translatedTo, (reversed ? (horiz ? chart.plotWidth : 0) : (horiz ? 0 : axis.toPixels(axis.min))));
translatedTo = mathRound(axis.toPixels(pick(threshold.value, axis.max), true));
if (axis.isXAxis) {
clipAttr = {
x: reversed ? translatedTo : translatedFrom,
y: 0,
width: Math.abs(translatedFrom - translatedTo),
height: chartSizeMax
};
if (!horiz) {
clipAttr.x = chart.plotHeight - clipAttr.x;
}
} else {
clipAttr = {
x: 0,
y: reversed ? translatedFrom : translatedTo,
width: chartSizeMax,
height: Math.abs(translatedFrom - translatedTo)
};
if (horiz) {
clipAttr.y = chart.plotWidth - clipAttr.y;
}
}
/// VML SUPPPORT
if (chart.inverted && renderer.isVML) {
if (axis.isXAxis) {
clipAttr = {
x: 0,
y: reversed ? translatedFrom : translatedTo,
height: clipAttr.width,
width: chart.chartWidth
};
} else {
clipAttr = {
x: clipAttr.y - chart.plotLeft - chart.spacingBox.x,
y: 0,
width: clipAttr.height,
height: chart.chartHeight
};
}
}
/// END OF VML SUPPORT
if (clips[i]) {
clips[i].animate(clipAttr);
} else {
clips[i] = renderer.clipRect(clipAttr);
series['colorGraph' + i].clip(clips[i]);
if (area) {
series['colorArea' + i].clip(clips[i]);
}
}
});
this.clips = clips;
}
},
/**
* Initialize and perform group inversion on series.group and series.markerGroup
*/
invertGroups: function () {
var series = this,
chart = series.chart;
// Pie, go away (#1736)
if (!series.xAxis) {
return;
}
// A fixed size is needed for inversion to work
function setInvert() {
var size = {
width: series.yAxis.len,
height: series.xAxis.len
};
each(['group', 'markerGroup'], function (groupName) {
if (series[groupName]) {
series[groupName].attr(size).invert();
}
});
}
addEvent(chart, 'resize', setInvert); // do it on resize
addEvent(series, 'destroy', function () {
removeEvent(chart, 'resize', setInvert);
});
// Do it now
setInvert(); // do it now
// On subsequent render and redraw, just do setInvert without setting up events again
series.invertGroups = setInvert;
},
/**
* General abstraction for creating plot groups like series.group, series.dataLabelsGroup and
* series.markerGroup. On subsequent calls, the group will only be adjusted to the updated plot size.
*/
plotGroup: function (prop, name, visibility, zIndex, parent) {
var group = this[prop],
isNew = !group;
// Generate it on first call
if (isNew) {
this[prop] = group = this.chart.renderer.g(name)
.attr({
visibility: visibility,
zIndex: zIndex || 0.1 // IE8 needs this
})
.add(parent);
}
// Place it on first and subsequent (redraw) calls
group[isNew ? 'attr' : 'animate'](this.getPlotBox());
return group;
},
/**
* Get the translation and scale for the plot area of this series
*/
getPlotBox: function () {
var chart = this.chart,
xAxis = this.xAxis,
yAxis = this.yAxis;
// Swap axes for inverted (#2339)
if (chart.inverted) {
xAxis = yAxis;
yAxis = this.xAxis;
}
return {
translateX: xAxis ? xAxis.left : chart.plotLeft,
translateY: yAxis ? yAxis.top : chart.plotTop,
scaleX: 1, // #1623
scaleY: 1
};
},
/**
* Render the graph and markers
*/
render: function () {
var series = this,
chart = series.chart,
group,
options = series.options,
animation = options.animation,
// Animation doesn't work in IE8 quirks when the group div is hidden,
// and looks bad in other oldIE
animDuration = (animation && !!series.animate && chart.renderer.isSVG && pick(animation.duration, 500)) || 0,
visibility = series.visible ? VISIBLE : HIDDEN,
zIndex = options.zIndex,
hasRendered = series.hasRendered,
chartSeriesGroup = chart.seriesGroup;
// the group
group = series.plotGroup(
'group',
'series',
visibility,
zIndex,
chartSeriesGroup
);
series.markerGroup = series.plotGroup(
'markerGroup',
'markers',
visibility,
zIndex,
chartSeriesGroup
);
// initiate the animation
if (animDuration) {
series.animate(true);
}
// cache attributes for shapes
series.getAttribs();
// SVGRenderer needs to know this before drawing elements (#1089, #1795)
group.inverted = series.isCartesian ? chart.inverted : false;
// draw the graph if any
if (series.drawGraph) {
series.drawGraph();
series.applyZones();
}
each(series.points, function (point) {
if (point.redraw) {
point.redraw();
}
});
// draw the data labels (inn pies they go before the points)
if (series.drawDataLabels) {
series.drawDataLabels();
}
// draw the points
if (series.visible) {
series.drawPoints();
}
// draw the mouse tracking area
if (series.drawTracker && series.options.enableMouseTracking !== false) {
series.drawTracker();
}
// Handle inverted series and tracker groups
if (chart.inverted) {
series.invertGroups();
}
// Run the animation
if (animDuration) {
series.animate();
}
// Call the afterAnimate function on animation complete (but don't overwrite the animation.complete option
// which should be available to the user).
if (!hasRendered) {
if (animDuration) {
series.animationTimeout = setTimeout(function () {
series.afterAnimate();
}, animDuration);
} else {
series.afterAnimate();
}
}
series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see
// (See #322) series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see
series.hasRendered = true;
},
/**
* Redraw the series after an update in the axes.
*/
redraw: function () {
var series = this,
chart = series.chart,
wasDirtyData = series.isDirtyData, // cache it here as it is set to false in render, but used after
group = series.group,
xAxis = series.xAxis,
yAxis = series.yAxis;
// reposition on resize
if (group) {
if (chart.inverted) {
group.attr({
width: chart.plotWidth,
height: chart.plotHeight
});
}
group.animate({
translateX: pick(xAxis && xAxis.left, chart.plotLeft),
translateY: pick(yAxis && yAxis.top, chart.plotTop)
});
}
series.translate();
series.render();
if (wasDirtyData) {
fireEvent(series, 'updatedData');
}
},
/**
* KD Tree && PointSearching Implementation
*/
kdDimensions: 1,
kdTree: null,
kdAxisArray: ['plotX', 'plotY'],
kdComparer: 'distX',
searchPoint: function (e) {
var series = this,
xAxis = series.xAxis,
yAxis = series.yAxis,
inverted = series.chart.inverted;
e.plotX = inverted ? xAxis.len - e.chartY + xAxis.pos : e.chartX - xAxis.pos;
e.plotY = inverted ? yAxis.len - e.chartX + yAxis.pos : e.chartY - yAxis.pos;
return this.searchKDTree(e);
},
buildKDTree: function () {
var series = this,
dimensions = series.kdDimensions;
// Internal function
function _kdtree(points, depth, dimensions) {
var axis, median, length = points && points.length;
if (length) {
// alternate between the axis
axis = series.kdAxisArray[depth % dimensions];
// sort point array
points.sort(function(a, b) {
return a[axis] - b[axis];
});
median = Math.floor(length / 2);
// build and return node
return {
point: points[median],
left: _kdtree(points.slice(0, median), depth + 1, dimensions),
right: _kdtree(points.slice(median + 1), depth + 1, dimensions)
};
}
}
function startRecursive() {
series.kdTree = _kdtree(series.points, dimensions, dimensions);
}
delete series.kdTree;
if (series.options.kdSync) { // For testing tooltips, don't build async
startRecursive();
} else {
setTimeout(startRecursive);
}
},
searchKDTree: function (point) {
var series = this,
kdComparer = this.kdComparer,
kdX = this.kdAxisArray[0],
kdY = this.kdAxisArray[1];
// Internal function
function _distance(p1, p2) {
var x = (defined(p1[kdX]) && defined(p2[kdX])) ? Math.pow(p1[kdX] - p2[kdX], 2) : null,
y = (defined(p1[kdY]) && defined(p2[kdY])) ? Math.pow(p1[kdY] - p2[kdY], 2) : null,
r = (x || 0) + (y || 0);
return {
distX: defined(x) ? Math.sqrt(x) : Number.MAX_VALUE,
distY: defined(y) ? Math.sqrt(y) : Number.MAX_VALUE,
distR: defined(r) ? Math.sqrt(r) : Number.MAX_VALUE
};
}
function _search(search, tree, depth, dimensions) {
var point = tree.point,
axis = series.kdAxisArray[depth % dimensions],
tdist,
sideA,
sideB,
ret = point,
nPoint1,
nPoint2;
point.dist = _distance(search, point);
// Pick side based on distance to splitting point
tdist = search[axis] - point[axis];
sideA = tdist < 0 ? 'left' : 'right';
// End of tree
if (tree[sideA]) {
nPoint1 =_search(search, tree[sideA], depth + 1, dimensions);
ret = (nPoint1.dist[kdComparer] < ret.dist[kdComparer] ? nPoint1 : point);
sideB = tdist < 0 ? 'right' : 'left';
if (tree[sideB]) {
// compare distance to current best to splitting point to decide wether to check side B or not
if (Math.sqrt(tdist*tdist) < ret.dist[kdComparer]) {
nPoint2 = _search(search, tree[sideB], depth + 1, dimensions);
ret = (nPoint2.dist[kdComparer] < ret.dist[kdComparer] ? nPoint2 : ret);
}
}
}
return ret;
}
if (!this.kdTree) {
this.buildKDTree();
}
if (this.kdTree) {
return _search(point,
this.kdTree, this.kdDimensions, this.kdDimensions);
} else {
return UNDEFINED;
}
}
}; // end Series prototype
/**
* The class for stack items
*/
function StackItem(axis, options, isNegative, x, stackOption) {
var inverted = axis.chart.inverted;
this.axis = axis;
// Tells if the stack is negative
this.isNegative = isNegative;
// Save the options to be able to style the label
this.options = options;
// Save the x value to be able to position the label later
this.x = x;
// Initialize total value
this.total = null;
// This will keep each points' extremes stored by series.index and point index
this.points = {};
// Save the stack option on the series configuration object, and whether to treat it as percent
this.stack = stackOption;
// The align options and text align varies on whether the stack is negative and
// if the chart is inverted or not.
// First test the user supplied value, then use the dynamic.
this.alignOptions = {
align: options.align || (inverted ? (isNegative ? 'left' : 'right') : 'center'),
verticalAlign: options.verticalAlign || (inverted ? 'middle' : (isNegative ? 'bottom' : 'top')),
y: pick(options.y, inverted ? 4 : (isNegative ? 14 : -6)),
x: pick(options.x, inverted ? (isNegative ? -6 : 6) : 0)
};
this.textAlign = options.textAlign || (inverted ? (isNegative ? 'right' : 'left') : 'center');
}
StackItem.prototype = {
destroy: function () {
destroyObjectProperties(this, this.axis);
},
/**
* Renders the stack total label and adds it to the stack label group.
*/
render: function (group) {
var options = this.options,
formatOption = options.format,
str = formatOption ?
format(formatOption, this) :
options.formatter.call(this); // format the text in the label
// Change the text to reflect the new total and set visibility to hidden in case the serie is hidden
if (this.label) {
this.label.attr({text: str, visibility: HIDDEN});
// Create new label
} else {
this.label =
this.axis.chart.renderer.text(str, null, null, options.useHTML) // dummy positions, actual position updated with setOffset method in columnseries
.css(options.style) // apply style
.attr({
align: this.textAlign, // fix the text-anchor
rotation: options.rotation, // rotation
visibility: HIDDEN // hidden until setOffset is called
})
.add(group); // add to the labels-group
}
},
/**
* Sets the offset that the stack has from the x value and repositions the label.
*/
setOffset: function (xOffset, xWidth) {
var stackItem = this,
axis = stackItem.axis,
chart = axis.chart,
inverted = chart.inverted,
neg = this.isNegative, // special treatment is needed for negative stacks
y = axis.translate(axis.usePercentage ? 100 : this.total, 0, 0, 0, 1), // stack value translated mapped to chart coordinates
yZero = axis.translate(0), // stack origin
h = mathAbs(y - yZero), // stack height
x = chart.xAxis[0].translate(this.x) + xOffset, // stack x position
plotHeight = chart.plotHeight,
stackBox = { // this is the box for the complete stack
x: inverted ? (neg ? y : y - h) : x,
y: inverted ? plotHeight - x - xWidth : (neg ? (plotHeight - y - h) : plotHeight - y),
width: inverted ? h : xWidth,
height: inverted ? xWidth : h
},
label = this.label,
alignAttr;
if (label) {
label.align(this.alignOptions, null, stackBox); // align the label to the box
// Set visibility (#678)
alignAttr = label.alignAttr;
label[this.options.crop === false || chart.isInsidePlot(alignAttr.x, alignAttr.y) ? 'show' : 'hide'](true);
}
}
};
// Stacking methods defined on the Axis prototype
/**
* Build the stacks from top down
*/
Axis.prototype.buildStacks = function () {
var series = this.series,
reversedStacks = pick(this.options.reversedStacks, true),
i = series.length;
if (!this.isXAxis) {
this.usePercentage = false;
while (i--) {
series[reversedStacks ? i : series.length - i - 1].setStackedPoints();
}
// Loop up again to compute percent stack
if (this.usePercentage) {
for (i = 0; i < series.length; i++) {
series[i].setPercentStacks();
}
}
}
};
Axis.prototype.renderStackTotals = function () {
var axis = this,
chart = axis.chart,
renderer = chart.renderer,
stacks = axis.stacks,
stackKey,
oneStack,
stackCategory,
stackTotalGroup = axis.stackTotalGroup;
// Create a separate group for the stack total labels
if (!stackTotalGroup) {
axis.stackTotalGroup = stackTotalGroup =
renderer.g('stack-labels')
.attr({
visibility: VISIBLE,
zIndex: 6
})
.add();
}
// plotLeft/Top will change when y axis gets wider so we need to translate the
// stackTotalGroup at every render call. See bug #506 and #516
stackTotalGroup.translate(chart.plotLeft, chart.plotTop);
// Render each stack total
for (stackKey in stacks) {
oneStack = stacks[stackKey];
for (stackCategory in oneStack) {
oneStack[stackCategory].render(stackTotalGroup);
}
}
};
// Stacking methods defnied for Series prototype
/**
* Adds series' points value to corresponding stack
*/
Series.prototype.setStackedPoints = function () {
if (!this.options.stacking || (this.visible !== true && this.chart.options.chart.ignoreHiddenSeries !== false)) {
return;
}
var series = this,
xData = series.processedXData,
yData = series.processedYData,
stackedYData = [],
yDataLength = yData.length,
seriesOptions = series.options,
threshold = seriesOptions.threshold,
stackOption = seriesOptions.stack,
stacking = seriesOptions.stacking,
stackKey = series.stackKey,
negKey = '-' + stackKey,
negStacks = series.negStacks,
yAxis = series.yAxis,
stacks = yAxis.stacks,
oldStacks = yAxis.oldStacks,
isNegative,
stack,
other,
key,
pointKey,
i,
x,
y;
// loop over the non-null y values and read them into a local array
for (i = 0; i < yDataLength; i++) {
x = xData[i];
y = yData[i];
pointKey = series.index + ',' + i;
// Read stacked values into a stack based on the x value,
// the sign of y and the stack key. Stacking is also handled for null values (#739)
isNegative = negStacks && y < threshold;
key = isNegative ? negKey : stackKey;
// Create empty object for this stack if it doesn't exist yet
if (!stacks[key]) {
stacks[key] = {};
}
// Initialize StackItem for this x
if (!stacks[key][x]) {
if (oldStacks[key] && oldStacks[key][x]) {
stacks[key][x] = oldStacks[key][x];
stacks[key][x].total = null;
} else {
stacks[key][x] = new StackItem(yAxis, yAxis.options.stackLabels, isNegative, x, stackOption);
}
}
// If the StackItem doesn't exist, create it first
stack = stacks[key][x];
stack.points[pointKey] = [stack.cum || 0];
// Add value to the stack total
if (stacking === 'percent') {
// Percent stacked column, totals are the same for the positive and negative stacks
other = isNegative ? stackKey : negKey;
if (negStacks && stacks[other] && stacks[other][x]) {
other = stacks[other][x];
stack.total = other.total = mathMax(other.total, stack.total) + mathAbs(y) || 0;
// Percent stacked areas
} else {
stack.total = correctFloat(stack.total + (mathAbs(y) || 0));
}
} else {
stack.total = correctFloat(stack.total + (y || 0));
}
stack.cum = (stack.cum || 0) + (y || 0);
stack.points[pointKey].push(stack.cum);
stackedYData[i] = stack.cum;
}
if (stacking === 'percent') {
yAxis.usePercentage = true;
}
this.stackedYData = stackedYData; // To be used in getExtremes
// Reset old stacks
yAxis.oldStacks = {};
};
/**
* Iterate over all stacks and compute the absolute values to percent
*/
Series.prototype.setPercentStacks = function () {
var series = this,
stackKey = series.stackKey,
stacks = series.yAxis.stacks,
processedXData = series.processedXData;
each([stackKey, '-' + stackKey], function (key) {
var i = processedXData.length,
x,
stack,
pointExtremes,
totalFactor;
while (i--) {
x = processedXData[i];
stack = stacks[key] && stacks[key][x];
pointExtremes = stack && stack.points[series.index + ',' + i];
if (pointExtremes) {
totalFactor = stack.total ? 100 / stack.total : 0;
pointExtremes[0] = correctFloat(pointExtremes[0] * totalFactor); // Y bottom value
pointExtremes[1] = correctFloat(pointExtremes[1] * totalFactor); // Y value
series.stackedYData[i] = pointExtremes[1];
}
}
});
};
// Extend the Chart prototype for dynamic methods
extend(Chart.prototype, {
/**
* Add a series dynamically after time
*
* @param {Object} options The config options
* @param {Boolean} redraw Whether to redraw the chart after adding. Defaults to true.
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*
* @return {Object} series The newly created series object
*/
addSeries: function (options, redraw, animation) {
var series,
chart = this;
if (options) {
redraw = pick(redraw, true); // defaults to true
fireEvent(chart, 'addSeries', { options: options }, function () {
series = chart.initSeries(options);
chart.isDirtyLegend = true; // the series array is out of sync with the display
chart.linkSeries();
if (redraw) {
chart.redraw(animation);
}
});
}
return series;
},
/**
* Add an axis to the chart
* @param {Object} options The axis option
* @param {Boolean} isX Whether it is an X axis or a value axis
*/
addAxis: function (options, isX, redraw, animation) {
var key = isX ? 'xAxis' : 'yAxis',
chartOptions = this.options,
axis;
/*jslint unused: false*/
axis = new Axis(this, merge(options, {
index: this[key].length,
isX: isX
}));
/*jslint unused: true*/
// Push the new axis options to the chart options
chartOptions[key] = splat(chartOptions[key] || {});
chartOptions[key].push(options);
if (pick(redraw, true)) {
this.redraw(animation);
}
},
/**
* Dim the chart and show a loading text or symbol
* @param {String} str An optional text to show in the loading label instead of the default one
*/
showLoading: function (str) {
var chart = this,
options = chart.options,
loadingDiv = chart.loadingDiv,
loadingOptions = options.loading,
setLoadingSize = function () {
if (loadingDiv) {
css(loadingDiv, {
left: chart.plotLeft + PX,
top: chart.plotTop + PX,
width: chart.plotWidth + PX,
height: chart.plotHeight + PX
});
}
};
// create the layer at the first call
if (!loadingDiv) {
chart.loadingDiv = loadingDiv = createElement(DIV, {
className: PREFIX + 'loading'
}, extend(loadingOptions.style, {
zIndex: 10,
display: NONE
}), chart.container);
chart.loadingSpan = createElement(
'span',
null,
loadingOptions.labelStyle,
loadingDiv
);
addEvent(chart, 'redraw', setLoadingSize); // #1080
}
// update text
chart.loadingSpan.innerHTML = str || options.lang.loading;
// show it
if (!chart.loadingShown) {
css(loadingDiv, {
opacity: 0,
display: ''
});
animate(loadingDiv, {
opacity: loadingOptions.style.opacity
}, {
duration: loadingOptions.showDuration || 0
});
chart.loadingShown = true;
}
setLoadingSize();
},
/**
* Hide the loading layer
*/
hideLoading: function () {
var options = this.options,
loadingDiv = this.loadingDiv;
if (loadingDiv) {
animate(loadingDiv, {
opacity: 0
}, {
duration: options.loading.hideDuration || 100,
complete: function () {
css(loadingDiv, { display: NONE });
}
});
}
this.loadingShown = false;
}
});
// extend the Point prototype for dynamic methods
extend(Point.prototype, {
/**
* Update the point with new options (typically x/y data) and optionally redraw the series.
*
* @param {Object} options Point options as defined in the series.data array
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*
*/
update: function (options, redraw, animation, runEvent) {
var point = this,
series = point.series,
graphic = point.graphic,
i,
chart = series.chart,
seriesOptions = series.options,
names = series.xAxis && series.xAxis.names;
redraw = pick(redraw, true);
function update() {
point.applyOptions(options);
// Update visuals
if (isObject(options) && !isArray(options)) {
// Defer the actual redraw until getAttribs has been called (#3260)
point.redraw = function () {
if (graphic) {
if (options && options.marker && options.marker.symbol) {
point.graphic = graphic.destroy();
} else {
graphic.attr(point.pointAttr[point.state || '']);
}
}
if (options && options.dataLabels && point.dataLabel) { // #2468
point.dataLabel = point.dataLabel.destroy();
}
point.redraw = null;
};
}
// record changes in the parallel arrays
i = point.index;
series.updateParallelArrays(point, i);
if (names && point.name) {
names[point.x] = point.name;
}
seriesOptions.data[i] = point.options;
// redraw
series.isDirty = series.isDirtyData = true;
if (!series.fixedBox && series.hasCartesianSeries) { // #1906, #2320
chart.isDirtyBox = true;
}
if (seriesOptions.legendType === 'point') { // #1831, #1885
chart.legend.destroyItem(point);
}
if (redraw) {
chart.redraw(animation);
}
}
// Fire the event with a default handler of doing the update
if (runEvent === false) { // When called from setData
update();
} else {
point.firePointEvent('update', { options: options }, update);
}
},
/**
* Remove a point and optionally redraw the series and if necessary the axes
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
remove: function (redraw, animation) {
this.series.removePoint(inArray(this, this.series.data), redraw, animation);
}
});
// Extend the series prototype for dynamic methods
extend(Series.prototype, {
/**
* Add a point dynamically after chart load time
* @param {Object} options Point options as given in series.data
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean} shift If shift is true, a point is shifted off the start
* of the series as one is appended to the end.
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
addPoint: function (options, redraw, shift, animation) {
var series = this,
seriesOptions = series.options,
data = series.data,
graph = series.graph,
area = series.area,
chart = series.chart,
names = series.xAxis && series.xAxis.names,
currentShift = (graph && graph.shift) || 0,
dataOptions = seriesOptions.data,
point,
isInTheMiddle,
xData = series.xData,
x,
i;
setAnimation(animation, chart);
// Make graph animate sideways
if (shift) {
each([graph, area, series.graphNeg, series.areaNeg], function (shape) {
if (shape) {
shape.shift = currentShift + 1;
}
});
}
if (area) {
area.isArea = true; // needed in animation, both with and without shift
}
// Optional redraw, defaults to true
redraw = pick(redraw, true);
// Get options and push the point to xData, yData and series.options. In series.generatePoints
// the Point instance will be created on demand and pushed to the series.data array.
point = { series: series };
series.pointClass.prototype.applyOptions.apply(point, [options]);
x = point.x;
// Get the insertion point
i = xData.length;
if (series.requireSorting && x < xData[i - 1]) {
isInTheMiddle = true;
while (i && xData[i - 1] > x) {
i--;
}
}
series.updateParallelArrays(point, 'splice', i, 0, 0); // insert undefined item
series.updateParallelArrays(point, i); // update it
if (names && point.name) {
names[x] = point.name;
}
dataOptions.splice(i, 0, options);
if (isInTheMiddle) {
series.data.splice(i, 0, null);
series.processData();
}
// Generate points to be added to the legend (#1329)
if (seriesOptions.legendType === 'point') {
series.generatePoints();
}
// Shift the first point off the parallel arrays
// todo: consider series.removePoint(i) method
if (shift) {
if (data[0] && data[0].remove) {
data[0].remove(false);
} else {
data.shift();
series.updateParallelArrays(point, 'shift');
dataOptions.shift();
}
}
// redraw
delete series.kdTree; // #3816 kdTree has to be rebuild.
series.isDirty = true;
series.isDirtyData = true;
if (redraw) {
series.getAttribs(); // #1937
chart.redraw();
}
},
/**
* Remove a point (rendered or not), by index
*/
removePoint: function (i, redraw, animation) {
var series = this,
data = series.data,
point = data[i],
points = series.points,
chart = series.chart,
remove = function () {
if (data.length === points.length) {
points.splice(i, 1);
}
data.splice(i, 1);
series.options.data.splice(i, 1);
series.updateParallelArrays(point || { series: series }, 'splice', i, 1);
if (point) {
point.destroy();
}
// redraw
delete series.kdTree; // #3816 kdTree has to be rebuild.
series.isDirty = true;
series.isDirtyData = true;
if (redraw) {
chart.redraw();
}
};
setAnimation(animation, chart);
redraw = pick(redraw, true);
// Fire the event with a default handler of removing the point
if (point) {
point.firePointEvent('remove', null, remove);
} else {
remove();
}
},
/**
* Remove a series and optionally redraw the chart
*
* @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
* @param {Boolean|Object} animation Whether to apply animation, and optionally animation
* configuration
*/
remove: function (redraw, animation) {
var series = this,
chart = series.chart;
redraw = pick(redraw, true);
if (!series.isRemoving) { /* prevent triggering native event in jQuery
(calling the remove function from the remove event) */
series.isRemoving = true;
// fire the event with a default handler of removing the point
fireEvent(series, 'remove', null, function () {
// destroy elements
series.destroy();
// redraw
chart.isDirtyLegend = chart.isDirtyBox = true;
chart.linkSeries();
if (redraw) {
chart.redraw(animation);
}
});
}
series.isRemoving = false;
},
/**
* Update the series with a new set of options
*/
update: function (newOptions, redraw) {
var series = this,
chart = this.chart,
// must use user options when changing type because this.options is merged
// in with type specific plotOptions
oldOptions = this.userOptions,
oldType = this.type,
proto = seriesTypes[oldType].prototype,
preserve = ['group', 'markerGroup', 'dataLabelsGroup'],
n;
// If we're changing type or zIndex, create new groups (#3380, #3404)
if ((newOptions.type && newOptions.type !== oldType) || newOptions.zIndex !== undefined) {
preserve.length = 0;
}
// Make sure groups are not destroyed (#3094)
each(preserve, function (prop) {
preserve[prop] = series[prop];
delete series[prop];
});
// Do the merge, with some forced options
newOptions = merge(oldOptions, {
animation: false,
index: this.index,
pointStart: this.xData[0] // when updating after addPoint
}, { data: this.options.data }, newOptions);
// Destroy the series and delete all properties. Reinsert all methods
// and properties from the new type prototype (#2270, #3719)
this.remove(false);
for (n in proto) {
this[n] = UNDEFINED;
}
extend(this, seriesTypes[newOptions.type || oldType].prototype);
// Re-register groups (#3094)
each(preserve, function (prop) {
series[prop] = preserve[prop];
});
this.init(chart, newOptions);
chart.linkSeries(); // Links are lost in this.remove (#3028)
if (pick(redraw, true)) {
chart.redraw(false);
}
}
});
// Extend the Axis.prototype for dynamic methods
extend(Axis.prototype, {
/**
* Update the axis with a new options structure
*/
update: function (newOptions, redraw) {
var chart = this.chart;
newOptions = chart.options[this.coll][this.options.index] = merge(this.userOptions, newOptions);
this.destroy(true);
this._addedPlotLB = UNDEFINED; // #1611, #2887
this.init(chart, extend(newOptions, { events: UNDEFINED }));
chart.isDirtyBox = true;
if (pick(redraw, true)) {
chart.redraw();
}
},
/**
* Remove the axis from the chart
*/
remove: function (redraw) {
var chart = this.chart,
key = this.coll, // xAxis or yAxis
axisSeries = this.series,
i = axisSeries.length;
// Remove associated series (#2687)
while (i--) {
if (axisSeries[i]) {
axisSeries[i].remove(false);
}
}
// Remove the axis
erase(chart.axes, this);
erase(chart[key], this);
chart.options[key].splice(this.options.index, 1);
each(chart[key], function (axis, i) { // Re-index, #1706
axis.options.index = i;
});
this.destroy();
chart.isDirtyBox = true;
if (pick(redraw, true)) {
chart.redraw();
}
},
/**
* Update the axis title by options
*/
setTitle: function (newTitleOptions, redraw) {
this.update({ title: newTitleOptions }, redraw);
},
/**
* Set new axis categories and optionally redraw
* @param {Array} categories
* @param {Boolean} redraw
*/
setCategories: function (categories, redraw) {
this.update({ categories: categories }, redraw);
}
});
/**
* LineSeries object
*/
var LineSeries = extendClass(Series);
seriesTypes.line = LineSeries;
/**
* Set the default options for area
*/
defaultPlotOptions.area = merge(defaultSeriesOptions, {
threshold: 0
// trackByArea: false,
// lineColor: null, // overrides color, but lets fillColor be unaltered
// fillOpacity: 0.75,
// fillColor: null
});
/**
* AreaSeries object
*/
var AreaSeries = extendClass(Series, {
type: 'area',
/**
* For stacks, don't split segments on null values. Instead, draw null values with
* no marker. Also insert dummy points for any X position that exists in other series
* in the stack.
*/
getSegments: function () {
var series = this,
segments = [],
segment = [],
keys = [],
xAxis = this.xAxis,
yAxis = this.yAxis,
stack = yAxis.stacks[this.stackKey],
pointMap = {},
plotX,
plotY,
points = this.points,
connectNulls = this.options.connectNulls,
i,
x;
if (this.options.stacking && !this.cropped) { // cropped causes artefacts in Stock, and perf issue
// Create a map where we can quickly look up the points by their X value.
for (i = 0; i < points.length; i++) {
pointMap[points[i].x] = points[i];
}
// Sort the keys (#1651)
for (x in stack) {
if (stack[x].total !== null) { // nulled after switching between grouping and not (#1651, #2336)
keys.push(+x);
}
}
keys.sort(function (a, b) {
return a - b;
});
each(keys, function (x) {
var y = 0,
stackPoint;
if (connectNulls && (!pointMap[x] || pointMap[x].y === null)) { // #1836
return;
// The point exists, push it to the segment
} else if (pointMap[x]) {
segment.push(pointMap[x]);
// There is no point for this X value in this series, so we
// insert a dummy point in order for the areas to be drawn
// correctly.
} else {
// Loop down the stack to find the series below this one that has
// a value (#1991)
for (i = series.index; i <= yAxis.series.length; i++) {
stackPoint = stack[x].points[i + ',' + x];
if (stackPoint) {
y = stackPoint[1];
break;
}
}
plotX = xAxis.translate(x);
plotY = yAxis.toPixels(y, true);
segment.push({
y: null,
plotX: plotX,
clientX: plotX,
plotY: plotY,
yBottom: plotY,
onMouseOver: noop
});
}
});
if (segment.length) {
segments.push(segment);
}
} else {
Series.prototype.getSegments.call(this);
segments = this.segments;
}
this.segments = segments;
},
/**
* Extend the base Series getSegmentPath method by adding the path for the area.
* This path is pushed to the series.areaPath property.
*/
getSegmentPath: function (segment) {
var segmentPath = Series.prototype.getSegmentPath.call(this, segment), // call base method
areaSegmentPath = [].concat(segmentPath), // work on a copy for the area path
i,
options = this.options,
segLength = segmentPath.length,
translatedThreshold = this.yAxis.getThreshold(options.threshold), // #2181
yBottom;
if (segLength === 3) { // for animation from 1 to two points
areaSegmentPath.push(L, segmentPath[1], segmentPath[2]);
}
if (options.stacking && !this.closedStacks) {
// Follow stack back. Todo: implement areaspline. A general solution could be to
// reverse the entire graphPath of the previous series, though may be hard with
// splines and with series with different extremes
for (i = segment.length - 1; i >= 0; i--) {
yBottom = pick(segment[i].yBottom, translatedThreshold);
// step line?
if (i < segment.length - 1 && options.step) {
areaSegmentPath.push(segment[i + 1].plotX, yBottom);
}
areaSegmentPath.push(segment[i].plotX, yBottom);
}
} else { // follow zero line back
this.closeSegment(areaSegmentPath, segment, translatedThreshold);
}
this.areaPath = this.areaPath.concat(areaSegmentPath);
return segmentPath;
},
/**
* Extendable method to close the segment path of an area. This is overridden in polar
* charts.
*/
closeSegment: function (path, segment, translatedThreshold) {
path.push(
L,
segment[segment.length - 1].plotX,
translatedThreshold,
L,
segment[0].plotX,
translatedThreshold
);
},
/**
* Draw the graph and the underlying area. This method calls the Series base
* function and adds the area. The areaPath is calculated in the getSegmentPath
* method called from Series.prototype.drawGraph.
*/
drawGraph: function () {
// Define or reset areaPath
this.areaPath = [];
// Call the base method
Series.prototype.drawGraph.apply(this);
// Define local variables
var series = this,
areaPath = this.areaPath,
options = this.options,
zones = this.zones,
props = [['area', this.color, options.fillColor]]; // area name, main color, fill color
each(zones, function (threshold, i) {
props.push(['colorArea' + i, threshold.color || series.color, threshold.fillColor || options.fillColor]);
});
each(props, function (prop) {
var areaKey = prop[0],
area = series[areaKey];
// Create or update the area
if (area) { // update
area.animate({ d: areaPath });
} else { // create
series[areaKey] = series.chart.renderer.path(areaPath)
.attr({
fill: pick(
prop[2],
Color(prop[1]).setOpacity(pick(options.fillOpacity, 0.75)).get()
),
zIndex: 0 // #1069
}).add(series.group);
}
});
},
drawLegendSymbol: LegendSymbolMixin.drawRectangle
});
seriesTypes.area = AreaSeries;
/**
* Set the default options for spline
*/
defaultPlotOptions.spline = merge(defaultSeriesOptions);
/**
* SplineSeries object
*/
var SplineSeries = extendClass(Series, {
type: 'spline',
/**
* Get the spline segment from a given point's previous neighbour to the given point
*/
getPointSpline: function (segment, point, i) {
var smoothing = 1.5, // 1 means control points midway between points, 2 means 1/3 from the point, 3 is 1/4 etc
denom = smoothing + 1,
plotX = point.plotX,
plotY = point.plotY,
lastPoint = segment[i - 1],
nextPoint = segment[i + 1],
leftContX,
leftContY,
rightContX,
rightContY,
ret;
// find control points
if (lastPoint && nextPoint) {
var lastX = lastPoint.plotX,
lastY = lastPoint.plotY,
nextX = nextPoint.plotX,
nextY = nextPoint.plotY,
correction;
leftContX = (smoothing * plotX + lastX) / denom;
leftContY = (smoothing * plotY + lastY) / denom;
rightContX = (smoothing * plotX + nextX) / denom;
rightContY = (smoothing * plotY + nextY) / denom;
// have the two control points make a straight line through main point
correction = ((rightContY - leftContY) * (rightContX - plotX)) /
(rightContX - leftContX) + plotY - rightContY;
leftContY += correction;
rightContY += correction;
// to prevent false extremes, check that control points are between
// neighbouring points' y values
if (leftContY > lastY && leftContY > plotY) {
leftContY = mathMax(lastY, plotY);
rightContY = 2 * plotY - leftContY; // mirror of left control point
} else if (leftContY < lastY && leftContY < plotY) {
leftContY = mathMin(lastY, plotY);
rightContY = 2 * plotY - leftContY;
}
if (rightContY > nextY && rightContY > plotY) {
rightContY = mathMax(nextY, plotY);
leftContY = 2 * plotY - rightContY;
} else if (rightContY < nextY && rightContY < plotY) {
rightContY = mathMin(nextY, plotY);
leftContY = 2 * plotY - rightContY;
}
// record for drawing in next point
point.rightContX = rightContX;
point.rightContY = rightContY;
}
// Visualize control points for debugging
/*
if (leftContX) {
this.chart.renderer.circle(leftContX + this.chart.plotLeft, leftContY + this.chart.plotTop, 2)
.attr({
stroke: 'red',
'stroke-width': 1,
fill: 'none'
})
.add();
this.chart.renderer.path(['M', leftContX + this.chart.plotLeft, leftContY + this.chart.plotTop,
'L', plotX + this.chart.plotLeft, plotY + this.chart.plotTop])
.attr({
stroke: 'red',
'stroke-width': 1
})
.add();
this.chart.renderer.circle(rightContX + this.chart.plotLeft, rightContY + this.chart.plotTop, 2)
.attr({
stroke: 'green',
'stroke-width': 1,
fill: 'none'
})
.add();
this.chart.renderer.path(['M', rightContX + this.chart.plotLeft, rightContY + this.chart.plotTop,
'L', plotX + this.chart.plotLeft, plotY + this.chart.plotTop])
.attr({
stroke: 'green',
'stroke-width': 1
})
.add();
}
*/
// moveTo or lineTo
if (!i) {
ret = [M, plotX, plotY];
} else { // curve from last point to this
ret = [
'C',
lastPoint.rightContX || lastPoint.plotX,
lastPoint.rightContY || lastPoint.plotY,
leftContX || plotX,
leftContY || plotY,
plotX,
plotY
];
lastPoint.rightContX = lastPoint.rightContY = null; // reset for updating series later
}
return ret;
}
});
seriesTypes.spline = SplineSeries;
/**
* Set the default options for areaspline
*/
defaultPlotOptions.areaspline = merge(defaultPlotOptions.area);
/**
* AreaSplineSeries object
*/
var areaProto = AreaSeries.prototype,
AreaSplineSeries = extendClass(SplineSeries, {
type: 'areaspline',
closedStacks: true, // instead of following the previous graph back, follow the threshold back
// Mix in methods from the area series
getSegmentPath: areaProto.getSegmentPath,
closeSegment: areaProto.closeSegment,
drawGraph: areaProto.drawGraph,
drawLegendSymbol: LegendSymbolMixin.drawRectangle
});
seriesTypes.areaspline = AreaSplineSeries;
/**
* Set the default options for column
*/
defaultPlotOptions.column = merge(defaultSeriesOptions, {
borderColor: '#FFFFFF',
//borderWidth: 1,
borderRadius: 0,
//colorByPoint: undefined,
groupPadding: 0.2,
//grouping: true,
marker: null, // point options are specified in the base options
pointPadding: 0.1,
//pointWidth: null,
minPointLength: 0,
cropThreshold: 50, // when there are more points, they will not animate out of the chart on xAxis.setExtremes
pointRange: null, // null means auto, meaning 1 in a categorized axis and least distance between points if not categories
states: {
hover: {
brightness: 0.1,
shadow: false,
halo: false
},
select: {
color: '#C0C0C0',
borderColor: '#000000',
shadow: false
}
},
dataLabels: {
align: null, // auto
verticalAlign: null, // auto
y: null
},
stickyTracking: false,
tooltip: {
distance: 6
},
threshold: 0
});
/**
* ColumnSeries object
*/
var ColumnSeries = extendClass(Series, {
type: 'column',
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
stroke: 'borderColor',
fill: 'color',
r: 'borderRadius'
},
cropShoulder: 0,
directTouch: true, // When tooltip is not shared, this series (and derivatives) requires direct touch/hover. KD-tree does not apply.
trackerGroups: ['group', 'dataLabelsGroup'],
negStacks: true, // use separate negative stacks, unlike area stacks where a negative
// point is substracted from previous (#1910)
/**
* Initialize the series
*/
init: function () {
Series.prototype.init.apply(this, arguments);
var series = this,
chart = series.chart;
// if the series is added dynamically, force redraw of other
// series affected by a new column
if (chart.hasRendered) {
each(chart.series, function (otherSeries) {
if (otherSeries.type === series.type) {
otherSeries.isDirty = true;
}
});
}
},
/**
* Return the width and x offset of the columns adjusted for grouping, groupPadding, pointPadding,
* pointWidth etc.
*/
getColumnMetrics: function () {
var series = this,
options = series.options,
xAxis = series.xAxis,
yAxis = series.yAxis,
reversedXAxis = xAxis.reversed,
stackKey,
stackGroups = {},
columnIndex,
columnCount = 0;
// Get the total number of column type series.
// This is called on every series. Consider moving this logic to a
// chart.orderStacks() function and call it on init, addSeries and removeSeries
if (options.grouping === false) {
columnCount = 1;
} else {
each(series.chart.series, function (otherSeries) {
var otherOptions = otherSeries.options,
otherYAxis = otherSeries.yAxis;
if (otherSeries.type === series.type && otherSeries.visible &&
yAxis.len === otherYAxis.len && yAxis.pos === otherYAxis.pos) { // #642, #2086
if (otherOptions.stacking) {
stackKey = otherSeries.stackKey;
if (stackGroups[stackKey] === UNDEFINED) {
stackGroups[stackKey] = columnCount++;
}
columnIndex = stackGroups[stackKey];
} else if (otherOptions.grouping !== false) { // #1162
columnIndex = columnCount++;
}
otherSeries.columnIndex = columnIndex;
}
});
}
var categoryWidth = mathMin(
mathAbs(xAxis.transA) * (xAxis.ordinalSlope || options.pointRange || xAxis.closestPointRange || xAxis.tickInterval || 1), // #2610
xAxis.len // #1535
),
groupPadding = categoryWidth * options.groupPadding,
groupWidth = categoryWidth - 2 * groupPadding,
pointOffsetWidth = groupWidth / columnCount,
optionPointWidth = options.pointWidth,
pointPadding = defined(optionPointWidth) ? (pointOffsetWidth - optionPointWidth) / 2 :
pointOffsetWidth * options.pointPadding,
pointWidth = pick(optionPointWidth, pointOffsetWidth - 2 * pointPadding), // exact point width, used in polar charts
colIndex = (reversedXAxis ?
columnCount - (series.columnIndex || 0) : // #1251
series.columnIndex) || 0,
pointXOffset = pointPadding + (groupPadding + colIndex *
pointOffsetWidth - (categoryWidth / 2)) *
(reversedXAxis ? -1 : 1);
// Save it for reading in linked series (Error bars particularly)
return (series.columnMetrics = {
width: pointWidth,
offset: pointXOffset
});
},
/**
* Translate each point to the plot area coordinate system and find shape positions
*/
translate: function () {
var series = this,
chart = series.chart,
options = series.options,
borderWidth = series.borderWidth = pick(
options.borderWidth,
series.closestPointRange * series.xAxis.transA < 2 ? 0 : 1 // #3635
),
yAxis = series.yAxis,
threshold = options.threshold,
translatedThreshold = series.translatedThreshold = yAxis.getThreshold(threshold),
minPointLength = pick(options.minPointLength, 5),
metrics = series.getColumnMetrics(),
pointWidth = metrics.width,
seriesBarW = series.barW = mathMax(pointWidth, 1 + 2 * borderWidth), // postprocessed for border width
pointXOffset = series.pointXOffset = metrics.offset,
xCrisp = -(borderWidth % 2 ? 0.5 : 0),
yCrisp = borderWidth % 2 ? 0.5 : 1;
if (chart.renderer.isVML && chart.inverted) {
yCrisp += 1;
}
// When the pointPadding is 0, we want the columns to be packed tightly, so we allow individual
// columns to have individual sizes. When pointPadding is greater, we strive for equal-width
// columns (#2694).
if (options.pointPadding) {
seriesBarW = mathCeil(seriesBarW);
}
Series.prototype.translate.apply(series);
// Record the new values
each(series.points, function (point) {
var yBottom = pick(point.yBottom, translatedThreshold),
plotY = mathMin(mathMax(-999 - yBottom, point.plotY), yAxis.len + 999 + yBottom), // Don't draw too far outside plot area (#1303, #2241)
barX = point.plotX + pointXOffset,
barW = seriesBarW,
barY = mathMin(plotY, yBottom),
right,
bottom,
fromTop,
barH = mathMax(plotY, yBottom) - barY;
// Handle options.minPointLength
if (mathAbs(barH) < minPointLength) {
if (minPointLength) {
barH = minPointLength;
barY =
mathRound(mathAbs(barY - translatedThreshold) > minPointLength ? // stacked
yBottom - minPointLength : // keep position
translatedThreshold - (yAxis.translate(point.y, 0, 1, 0, 1) <= translatedThreshold ? minPointLength : 0)); // use exact yAxis.translation (#1485)
}
}
// Cache for access in polar
point.barX = barX;
point.pointWidth = pointWidth;
// Fix the tooltip on center of grouped columns (#1216, #424, #3648)
point.tooltipPos = chart.inverted ?
[yAxis.len + yAxis.pos - chart.plotLeft - plotY, series.xAxis.len - barX - barW / 2] :
[barX + barW / 2, plotY + yAxis.pos - chart.plotTop];
// Round off to obtain crisp edges and avoid overlapping with neighbours (#2694)
right = mathRound(barX + barW) + xCrisp;
barX = mathRound(barX) + xCrisp;
barW = right - barX;
fromTop = mathAbs(barY) < 0.5;
bottom = mathMin(mathRound(barY + barH) + yCrisp, 9e4); // #3575
barY = mathRound(barY) + yCrisp;
barH = bottom - barY;
// Top edges are exceptions
if (fromTop) {
barY -= 1;
barH += 1;
}
// Register shape type and arguments to be used in drawPoints
point.shapeType = 'rect';
point.shapeArgs = {
x: barX,
y: barY,
width: barW,
height: barH
};
});
},
getSymbol: noop,
/**
* Use a solid rectangle like the area series types
*/
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
/**
* Columns have no graph
*/
drawGraph: noop,
/**
* Draw the columns. For bars, the series.group is rotated, so the same coordinates
* apply for columns and bars. This method is inherited by scatter series.
*
*/
drawPoints: function () {
var series = this,
chart = this.chart,
options = series.options,
renderer = chart.renderer,
animationLimit = options.animationLimit || 250,
shapeArgs,
pointAttr;
// draw the columns
each(series.points, function (point) {
var plotY = point.plotY,
graphic = point.graphic,
borderAttr;
if (plotY !== UNDEFINED && !isNaN(plotY) && point.y !== null) {
shapeArgs = point.shapeArgs;
borderAttr = defined(series.borderWidth) ? {
'stroke-width': series.borderWidth
} : {};
pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || series.pointAttr[NORMAL_STATE];
if (graphic) { // update
stop(graphic);
graphic.attr(borderAttr)[chart.pointCount < animationLimit ? 'animate' : 'attr'](merge(shapeArgs));
} else {
point.graphic = graphic = renderer[point.shapeType](shapeArgs)
.attr(borderAttr)
.attr(pointAttr)
.add(series.group)
.shadow(options.shadow, null, options.stacking && !options.borderRadius);
}
} else if (graphic) {
point.graphic = graphic.destroy(); // #1269
}
});
},
/**
* Animate the column heights one by one from zero
* @param {Boolean} init Whether to initialize the animation or run it
*/
animate: function (init) {
var series = this,
yAxis = this.yAxis,
options = series.options,
inverted = this.chart.inverted,
attr = {},
translatedThreshold;
if (hasSVG) { // VML is too slow anyway
if (init) {
attr.scaleY = 0.001;
translatedThreshold = mathMin(yAxis.pos + yAxis.len, mathMax(yAxis.pos, yAxis.toPixels(options.threshold)));
if (inverted) {
attr.translateX = translatedThreshold - yAxis.len;
} else {
attr.translateY = translatedThreshold;
}
series.group.attr(attr);
} else { // run the animation
attr.scaleY = 1;
attr[inverted ? 'translateX' : 'translateY'] = yAxis.pos;
series.group.animate(attr, series.options.animation);
// delete this function to allow it only once
series.animate = null;
}
}
},
/**
* Remove this series from the chart
*/
remove: function () {
var series = this,
chart = series.chart;
// column and bar series affects other series of the same type
// as they are either stacked or grouped
if (chart.hasRendered) {
each(chart.series, function (otherSeries) {
if (otherSeries.type === series.type) {
otherSeries.isDirty = true;
}
});
}
Series.prototype.remove.apply(series, arguments);
}
});
seriesTypes.column = ColumnSeries;
/**
* Set the default options for bar
*/
defaultPlotOptions.bar = merge(defaultPlotOptions.column);
/**
* The Bar series class
*/
var BarSeries = extendClass(ColumnSeries, {
type: 'bar',
inverted: true
});
seriesTypes.bar = BarSeries;
/**
* Set the default options for scatter
*/
defaultPlotOptions.scatter = merge(defaultSeriesOptions, {
lineWidth: 0,
marker: {
enabled: true // Overrides auto-enabling in line series (#3647)
},
tooltip: {
headerFormat: '<span style="color:{series.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/>'
}
});
/**
* The scatter series class
*/
var ScatterSeries = extendClass(Series, {
type: 'scatter',
sorted: false,
requireSorting: false,
noSharedTooltip: true,
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
takeOrdinalPosition: false, // #2342
kdDimensions: 2,
kdComparer: 'distR',
drawGraph: function () {
if (this.options.lineWidth) {
Series.prototype.drawGraph.call(this);
}
}
});
seriesTypes.scatter = ScatterSeries;
/**
* Set the default options for pie
*/
defaultPlotOptions.pie = merge(defaultSeriesOptions, {
borderColor: '#FFFFFF',
borderWidth: 1,
center: [null, null],
clip: false,
colorByPoint: true, // always true for pies
dataLabels: {
// align: null,
// connectorWidth: 1,
// connectorColor: point.color,
// connectorPadding: 5,
distance: 30,
enabled: true,
formatter: function () { // #2945
return this.point.name;
},
// softConnector: true,
x: 0
// y: 0
},
ignoreHiddenPoint: true,
//innerSize: 0,
legendType: 'point',
marker: null, // point options are specified in the base options
size: null,
showInLegend: false,
slicedOffset: 10,
states: {
hover: {
brightness: 0.1,
shadow: false
}
},
stickyTracking: false,
tooltip: {
followPointer: true
}
});
/**
* Extended point object for pies
*/
var PiePoint = extendClass(Point, {
/**
* Initiate the pie slice
*/
init: function () {
Point.prototype.init.apply(this, arguments);
var point = this,
toggleSlice;
extend(point, {
visible: point.visible !== false,
name: pick(point.name, 'Slice')
});
// add event listener for select
toggleSlice = function (e) {
point.slice(e.type === 'select');
};
addEvent(point, 'select', toggleSlice);
addEvent(point, 'unselect', toggleSlice);
return point;
},
/**
* Toggle the visibility of the pie slice
* @param {Boolean} vis Whether to show the slice or not. If undefined, the
* visibility is toggled
*/
setVisible: function (vis) {
var point = this,
series = point.series,
chart = series.chart;
// if called without an argument, toggle visibility
point.visible = point.options.visible = vis = vis === UNDEFINED ? !point.visible : vis;
series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data
// Show and hide associated elements
each(['graphic', 'dataLabel', 'connector', 'shadowGroup'], function (key) {
if (point[key]) {
point[key][vis ? 'show' : 'hide'](true);
}
});
if (point.legendItem) {
chart.legend.colorizeItem(point, vis);
}
// Handle ignore hidden slices
if (!series.isDirty && series.options.ignoreHiddenPoint) {
series.isDirty = true;
chart.redraw();
}
},
/**
* Set or toggle whether the slice is cut out from the pie
* @param {Boolean} sliced When undefined, the slice state is toggled
* @param {Boolean} redraw Whether to redraw the chart. True by default.
*/
slice: function (sliced, redraw, animation) {
var point = this,
series = point.series,
chart = series.chart,
translation;
setAnimation(animation, chart);
// redraw is true by default
redraw = pick(redraw, true);
// if called without an argument, toggle
point.sliced = point.options.sliced = sliced = defined(sliced) ? sliced : !point.sliced;
series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data
translation = sliced ? point.slicedTranslation : {
translateX: 0,
translateY: 0
};
point.graphic.animate(translation);
if (point.shadowGroup) {
point.shadowGroup.animate(translation);
}
},
haloPath: function (size) {
var shapeArgs = this.shapeArgs,
chart = this.series.chart;
return this.sliced || !this.visible ? [] : this.series.chart.renderer.symbols.arc(chart.plotLeft + shapeArgs.x, chart.plotTop + shapeArgs.y, shapeArgs.r + size, shapeArgs.r + size, {
innerR: this.shapeArgs.r,
start: shapeArgs.start,
end: shapeArgs.end
});
}
});
/**
* The Pie series class
*/
var PieSeries = {
type: 'pie',
isCartesian: false,
pointClass: PiePoint,
requireSorting: false,
noSharedTooltip: true,
trackerGroups: ['group', 'dataLabelsGroup'],
axisTypes: [],
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
stroke: 'borderColor',
'stroke-width': 'borderWidth',
fill: 'color'
},
/**
* Pies have one color each point
*/
getColor: noop,
/**
* Animate the pies in
*/
animate: function (init) {
var series = this,
points = series.points,
startAngleRad = series.startAngleRad;
if (!init) {
each(points, function (point) {
var graphic = point.graphic,
args = point.shapeArgs;
if (graphic) {
// start values
graphic.attr({
r: series.center[3] / 2, // animate from inner radius (#779)
start: startAngleRad,
end: startAngleRad
});
// animate
graphic.animate({
r: args.r,
start: args.start,
end: args.end
}, series.options.animation);
}
});
// delete this function to allow it only once
series.animate = null;
}
},
/**
* Extend the basic setData method by running processData and generatePoints immediately,
* in order to access the points from the legend.
*/
setData: function (data, redraw, animation, updatePoints) {
Series.prototype.setData.call(this, data, false, animation, updatePoints);
this.processData();
this.generatePoints();
if (pick(redraw, true)) {
this.chart.redraw(animation);
}
},
/**
* Extend the generatePoints method by adding total and percentage properties to each point
*/
generatePoints: function () {
var i,
total = 0,
points,
len,
point,
ignoreHiddenPoint = this.options.ignoreHiddenPoint;
Series.prototype.generatePoints.call(this);
// Populate local vars
points = this.points;
len = points.length;
// Get the total sum
for (i = 0; i < len; i++) {
point = points[i];
// Disallow negative values (#1530, #3623)
if (point.y < 0) {
point.y = null;
}
total += (ignoreHiddenPoint && !point.visible) ? 0 : point.y;
}
this.total = total;
// Set each point's properties
for (i = 0; i < len; i++) {
point = points[i];
point.percentage = total > 0 ? (point.y / total) * 100 : 0;
point.total = total;
}
},
/**
* Do translation for pie slices
*/
translate: function (positions) {
this.generatePoints();
var series = this,
cumulative = 0,
precision = 1000, // issue #172
options = series.options,
slicedOffset = options.slicedOffset,
connectorOffset = slicedOffset + options.borderWidth,
start,
end,
angle,
startAngle = options.startAngle || 0,
startAngleRad = series.startAngleRad = mathPI / 180 * (startAngle - 90),
endAngleRad = series.endAngleRad = mathPI / 180 * ((pick(options.endAngle, startAngle + 360)) - 90),
circ = endAngleRad - startAngleRad, //2 * mathPI,
points = series.points,
radiusX, // the x component of the radius vector for a given point
radiusY,
labelDistance = options.dataLabels.distance,
ignoreHiddenPoint = options.ignoreHiddenPoint,
i,
len = points.length,
point;
// Get positions - either an integer or a percentage string must be given.
// If positions are passed as a parameter, we're in a recursive loop for adjusting
// space for data labels.
if (!positions) {
series.center = positions = series.getCenter();
}
// utility for getting the x value from a given y, used for anticollision logic in data labels
series.getX = function (y, left) {
angle = math.asin(mathMin((y - positions[1]) / (positions[2] / 2 + labelDistance), 1));
return positions[0] +
(left ? -1 : 1) *
(mathCos(angle) * (positions[2] / 2 + labelDistance));
};
// Calculate the geometry for each point
for (i = 0; i < len; i++) {
point = points[i];
// set start and end angle
start = startAngleRad + (cumulative * circ);
if (!ignoreHiddenPoint || point.visible) {
cumulative += point.percentage / 100;
}
end = startAngleRad + (cumulative * circ);
// set the shape
point.shapeType = 'arc';
point.shapeArgs = {
x: positions[0],
y: positions[1],
r: positions[2] / 2,
innerR: positions[3] / 2,
start: mathRound(start * precision) / precision,
end: mathRound(end * precision) / precision
};
// The angle must stay within -90 and 270 (#2645)
angle = (end + start) / 2;
if (angle > 1.5 * mathPI) {
angle -= 2 * mathPI;
} else if (angle < -mathPI / 2) {
angle += 2 * mathPI;
}
// Center for the sliced out slice
point.slicedTranslation = {
translateX: mathRound(mathCos(angle) * slicedOffset),
translateY: mathRound(mathSin(angle) * slicedOffset)
};
// set the anchor point for tooltips
radiusX = mathCos(angle) * positions[2] / 2;
radiusY = mathSin(angle) * positions[2] / 2;
point.tooltipPos = [
positions[0] + radiusX * 0.7,
positions[1] + radiusY * 0.7
];
point.half = angle < -mathPI / 2 || angle > mathPI / 2 ? 1 : 0;
point.angle = angle;
// set the anchor point for data labels
connectorOffset = mathMin(connectorOffset, labelDistance / 2); // #1678
point.labelPos = [
positions[0] + radiusX + mathCos(angle) * labelDistance, // first break of connector
positions[1] + radiusY + mathSin(angle) * labelDistance, // a/a
positions[0] + radiusX + mathCos(angle) * connectorOffset, // second break, right outside pie
positions[1] + radiusY + mathSin(angle) * connectorOffset, // a/a
positions[0] + radiusX, // landing point for connector
positions[1] + radiusY, // a/a
labelDistance < 0 ? // alignment
'center' :
point.half ? 'right' : 'left', // alignment
angle // center angle
];
}
},
drawGraph: null,
/**
* Draw the data points
*/
drawPoints: function () {
var series = this,
chart = series.chart,
renderer = chart.renderer,
groupTranslation,
//center,
graphic,
//group,
shadow = series.options.shadow,
shadowGroup,
shapeArgs;
if (shadow && !series.shadowGroup) {
series.shadowGroup = renderer.g('shadow')
.add(series.group);
}
// draw the slices
each(series.points, function (point) {
graphic = point.graphic;
shapeArgs = point.shapeArgs;
shadowGroup = point.shadowGroup;
// put the shadow behind all points
if (shadow && !shadowGroup) {
shadowGroup = point.shadowGroup = renderer.g('shadow')
.add(series.shadowGroup);
}
// if the point is sliced, use special translation, else use plot area traslation
groupTranslation = point.sliced ? point.slicedTranslation : {
translateX: 0,
translateY: 0
};
//group.translate(groupTranslation[0], groupTranslation[1]);
if (shadowGroup) {
shadowGroup.attr(groupTranslation);
}
// draw the slice
if (graphic) {
graphic.animate(extend(shapeArgs, groupTranslation));
} else {
point.graphic = graphic = renderer[point.shapeType](shapeArgs)
.setRadialReference(series.center)
.attr(
point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE]
)
.attr({
'stroke-linejoin': 'round'
//zIndex: 1 // #2722 (reversed)
})
.attr(groupTranslation)
.add(series.group)
.shadow(shadow, shadowGroup);
}
// detect point specific visibility (#2430)
if (point.visible !== undefined) {
point.setVisible(point.visible);
}
});
},
searchPoint: noop,
/**
* Utility for sorting data labels
*/
sortByAngle: function (points, sign) {
points.sort(function (a, b) {
return a.angle !== undefined && (b.angle - a.angle) * sign;
});
},
/**
* Use a simple symbol from LegendSymbolMixin
*/
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
/**
* Use the getCenter method from drawLegendSymbol
*/
getCenter: CenteredSeriesMixin.getCenter,
/**
* Pies don't have point marker symbols
*/
getSymbol: noop
};
PieSeries = extendClass(Series, PieSeries);
seriesTypes.pie = PieSeries;
/**
* Draw the data labels
*/
Series.prototype.drawDataLabels = function () {
var series = this,
seriesOptions = series.options,
cursor = seriesOptions.cursor,
options = seriesOptions.dataLabels,
points = series.points,
pointOptions,
generalOptions,
hasRendered = series.hasRendered || 0,
str,
dataLabelsGroup,
renderer = series.chart.renderer;
if (options.enabled || series._hasPointLabels) {
// Process default alignment of data labels for columns
if (series.dlProcessOptions) {
series.dlProcessOptions(options);
}
// Create a separate group for the data labels to avoid rotation
dataLabelsGroup = series.plotGroup(
'dataLabelsGroup',
'data-labels',
options.defer ? HIDDEN : VISIBLE,
options.zIndex || 6
);
if (pick(options.defer, true)) {
dataLabelsGroup.attr({ opacity: +hasRendered }); // #3300
if (!hasRendered) {
addEvent(series, 'afterAnimate', function () {
if (series.visible) { // #3023, #3024
dataLabelsGroup.show();
}
dataLabelsGroup[seriesOptions.animation ? 'animate' : 'attr']({ opacity: 1 }, { duration: 200 });
});
}
}
// Make the labels for each point
generalOptions = options;
each(points, function (point) {
var enabled,
dataLabel = point.dataLabel,
labelConfig,
attr,
name,
rotation,
connector = point.connector,
isNew = true,
style,
moreStyle = {};
// Determine if each data label is enabled
pointOptions = point.dlOptions || (point.options && point.options.dataLabels); // dlOptions is used in treemaps
enabled = pick(pointOptions && pointOptions.enabled, generalOptions.enabled); // #2282
// If the point is outside the plot area, destroy it. #678, #820
if (dataLabel && !enabled) {
point.dataLabel = dataLabel.destroy();
// Individual labels are disabled if the are explicitly disabled
// in the point options, or if they fall outside the plot area.
} else if (enabled) {
// Create individual options structure that can be extended without
// affecting others
options = merge(generalOptions, pointOptions);
style = options.style;
rotation = options.rotation;
// Get the string
labelConfig = point.getLabelConfig();
str = options.format ?
format(options.format, labelConfig) :
options.formatter.call(labelConfig, options);
// Determine the color
style.color = pick(options.color, style.color, series.color, 'black');
// update existing label
if (dataLabel) {
if (defined(str)) {
dataLabel
.attr({
text: str
});
isNew = false;
} else { // #1437 - the label is shown conditionally
point.dataLabel = dataLabel = dataLabel.destroy();
if (connector) {
point.connector = connector.destroy();
}
}
// create new label
} else if (defined(str)) {
attr = {
//align: align,
fill: options.backgroundColor,
stroke: options.borderColor,
'stroke-width': options.borderWidth,
r: options.borderRadius || 0,
rotation: rotation,
padding: options.padding,
zIndex: 1
};
// Get automated contrast color
if (style.color === 'contrast') {
moreStyle.color = options.inside || options.distance < 0 || !!seriesOptions.stacking ?
renderer.getContrast(point.color || series.color) :
'#000000';
}
if (cursor) {
moreStyle.cursor = cursor;
}
// Remove unused attributes (#947)
for (name in attr) {
if (attr[name] === UNDEFINED) {
delete attr[name];
}
}
dataLabel = point.dataLabel = renderer[rotation ? 'text' : 'label']( // labels don't support rotation
str,
0,
-999,
null,
null,
null,
options.useHTML
)
.attr(attr)
.css(extend(style, moreStyle))
.add(dataLabelsGroup)
.shadow(options.shadow);
}
if (dataLabel) {
// Now the data label is created and placed at 0,0, so we need to align it
series.alignDataLabel(point, dataLabel, options, null, isNew);
}
}
});
}
};
/**
* Align each individual data label
*/
Series.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) {
var chart = this.chart,
inverted = chart.inverted,
plotX = pick(point.plotX, -999),
plotY = pick(point.plotY, -999),
bBox = dataLabel.getBBox(),
baseline = chart.renderer.fontMetrics(options.style.fontSize).b,
rotCorr, // rotation correction
// Math.round for rounding errors (#2683), alignTo to allow column labels (#2700)
visible = this.visible && (point.series.forceDL || chart.isInsidePlot(plotX, mathRound(plotY), inverted) ||
(alignTo && chart.isInsidePlot(plotX, inverted ? alignTo.x + 1 : alignTo.y + alignTo.height - 1, inverted))),
alignAttr; // the final position;
if (visible) {
// The alignment box is a singular point
alignTo = extend({
x: inverted ? chart.plotWidth - plotY : plotX,
y: mathRound(inverted ? chart.plotHeight - plotX : plotY),
width: 0,
height: 0
}, alignTo);
// Add the text size for alignment calculation
extend(options, {
width: bBox.width,
height: bBox.height
});
// Allow a hook for changing alignment in the last moment, then do the alignment
if (options.rotation) { // Fancy box alignment isn't supported for rotated text
rotCorr = chart.renderer.rotCorr(baseline, options.rotation); // #3723
dataLabel[isNew ? 'attr' : 'animate']({
x: alignTo.x + options.x + alignTo.width / 2 + rotCorr.x,
y: alignTo.y + options.y + alignTo.height / 2
})
.attr({ // #3003
align: options.align
});
} else {
dataLabel.align(options, null, alignTo);
alignAttr = dataLabel.alignAttr;
// Handle justify or crop
if (pick(options.overflow, 'justify') === 'justify') {
this.justifyDataLabel(dataLabel, options, alignAttr, bBox, alignTo, isNew);
} else if (pick(options.crop, true)) {
// Now check that the data label is within the plot area
visible = chart.isInsidePlot(alignAttr.x, alignAttr.y) && chart.isInsidePlot(alignAttr.x + bBox.width, alignAttr.y + bBox.height);
}
}
}
// Show or hide based on the final aligned position
if (!visible) {
dataLabel.attr({ y: -999 });
dataLabel.placed = false; // don't animate back in
}
};
/**
* If data labels fall partly outside the plot area, align them back in, in a way that
* doesn't hide the point.
*/
Series.prototype.justifyDataLabel = function (dataLabel, options, alignAttr, bBox, alignTo, isNew) {
var chart = this.chart,
align = options.align,
verticalAlign = options.verticalAlign,
off,
justified,
padding = dataLabel.box ? 0 : (dataLabel.padding || 0);
// Off left
off = alignAttr.x + padding;
if (off < 0) {
if (align === 'right') {
options.align = 'left';
} else {
options.x = -off;
}
justified = true;
}
// Off right
off = alignAttr.x + bBox.width - padding;
if (off > chart.plotWidth) {
if (align === 'left') {
options.align = 'right';
} else {
options.x = chart.plotWidth - off;
}
justified = true;
}
// Off top
off = alignAttr.y + padding;
if (off < 0) {
if (verticalAlign === 'bottom') {
options.verticalAlign = 'top';
} else {
options.y = -off;
}
justified = true;
}
// Off bottom
off = alignAttr.y + bBox.height - padding;
if (off > chart.plotHeight) {
if (verticalAlign === 'top') {
options.verticalAlign = 'bottom';
} else {
options.y = chart.plotHeight - off;
}
justified = true;
}
if (justified) {
dataLabel.placed = !isNew;
dataLabel.align(options, null, alignTo);
}
};
/**
* Override the base drawDataLabels method by pie specific functionality
*/
if (seriesTypes.pie) {
seriesTypes.pie.prototype.drawDataLabels = function () {
var series = this,
data = series.data,
point,
chart = series.chart,
options = series.options.dataLabels,
connectorPadding = pick(options.connectorPadding, 10),
connectorWidth = pick(options.connectorWidth, 1),
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
connector,
connectorPath,
softConnector = pick(options.softConnector, true),
distanceOption = options.distance,
seriesCenter = series.center,
radius = seriesCenter[2] / 2,
centerY = seriesCenter[1],
outside = distanceOption > 0,
dataLabel,
dataLabelWidth,
labelPos,
labelHeight,
halves = [// divide the points into right and left halves for anti collision
[], // right
[] // left
],
x,
y,
visibility,
rankArr,
i,
j,
overflow = [0, 0, 0, 0], // top, right, bottom, left
sort = function (a, b) {
return b.y - a.y;
};
// get out if not enabled
if (!series.visible || (!options.enabled && !series._hasPointLabels)) {
return;
}
// run parent method
Series.prototype.drawDataLabels.apply(series);
// arrange points for detection collision
each(data, function (point) {
if (point.dataLabel && point.visible) { // #407, #2510
halves[point.half].push(point);
}
});
/* Loop over the points in each half, starting from the top and bottom
* of the pie to detect overlapping labels.
*/
i = 2;
while (i--) {
var slots = [],
slotsLength,
usedSlots = [],
points = halves[i],
pos,
bottom,
length = points.length,
slotIndex;
if (!length) {
continue;
}
// Sort by angle
series.sortByAngle(points, i - 0.5);
// Assume equal label heights on either hemisphere (#2630)
j = labelHeight = 0;
while (!labelHeight && points[j]) { // #1569
labelHeight = points[j] && points[j].dataLabel && (points[j].dataLabel.getBBox().height || 21); // 21 is for #968
j++;
}
// Only do anti-collision when we are outside the pie and have connectors (#856)
if (distanceOption > 0) {
// Build the slots
bottom = mathMin(centerY + radius + distanceOption, chart.plotHeight);
for (pos = mathMax(0, centerY - radius - distanceOption); pos <= bottom; pos += labelHeight) {
slots.push(pos);
}
slotsLength = slots.length;
/* Visualize the slots
if (!series.slotElements) {
series.slotElements = [];
}
if (i === 1) {
series.slotElements.forEach(function (elem) {
elem.destroy();
});
series.slotElements.length = 0;
}
slots.forEach(function (pos, no) {
var slotX = series.getX(pos, i) + chart.plotLeft - (i ? 100 : 0),
slotY = pos + chart.plotTop;
if (!isNaN(slotX)) {
series.slotElements.push(chart.renderer.rect(slotX, slotY - 7, 100, labelHeight, 1)
.attr({
'stroke-width': 1,
stroke: 'silver',
fill: 'rgba(0,0,255,0.1)'
})
.add());
series.slotElements.push(chart.renderer.text('Slot '+ no, slotX, slotY + 4)
.attr({
fill: 'silver'
}).add());
}
});
// */
// if there are more values than available slots, remove lowest values
if (length > slotsLength) {
// create an array for sorting and ranking the points within each quarter
rankArr = [].concat(points);
rankArr.sort(sort);
j = length;
while (j--) {
rankArr[j].rank = j;
}
j = length;
while (j--) {
if (points[j].rank >= slotsLength) {
points.splice(j, 1);
}
}
length = points.length;
}
// The label goes to the nearest open slot, but not closer to the edge than
// the label's index.
for (j = 0; j < length; j++) {
point = points[j];
labelPos = point.labelPos;
var closest = 9999,
distance,
slotI;
// find the closest slot index
for (slotI = 0; slotI < slotsLength; slotI++) {
distance = mathAbs(slots[slotI] - labelPos[1]);
if (distance < closest) {
closest = distance;
slotIndex = slotI;
}
}
// if that slot index is closer to the edges of the slots, move it
// to the closest appropriate slot
if (slotIndex < j && slots[j] !== null) { // cluster at the top
slotIndex = j;
} else if (slotsLength < length - j + slotIndex && slots[j] !== null) { // cluster at the bottom
slotIndex = slotsLength - length + j;
while (slots[slotIndex] === null) { // make sure it is not taken
slotIndex++;
}
} else {
// Slot is taken, find next free slot below. In the next run, the next slice will find the
// slot above these, because it is the closest one
while (slots[slotIndex] === null) { // make sure it is not taken
slotIndex++;
}
}
usedSlots.push({ i: slotIndex, y: slots[slotIndex] });
slots[slotIndex] = null; // mark as taken
}
// sort them in order to fill in from the top
usedSlots.sort(sort);
}
// now the used slots are sorted, fill them up sequentially
for (j = 0; j < length; j++) {
var slot, naturalY;
point = points[j];
labelPos = point.labelPos;
dataLabel = point.dataLabel;
visibility = point.visible === false ? HIDDEN : VISIBLE;
naturalY = labelPos[1];
if (distanceOption > 0) {
slot = usedSlots.pop();
slotIndex = slot.i;
// if the slot next to currrent slot is free, the y value is allowed
// to fall back to the natural position
y = slot.y;
if ((naturalY > y && slots[slotIndex + 1] !== null) ||
(naturalY < y && slots[slotIndex - 1] !== null)) {
y = mathMin(mathMax(0, naturalY), chart.plotHeight);
}
} else {
y = naturalY;
}
// get the x - use the natural x position for first and last slot, to prevent the top
// and botton slice connectors from touching each other on either side
x = options.justify ?
seriesCenter[0] + (i ? -1 : 1) * (radius + distanceOption) :
series.getX(y === centerY - radius - distanceOption || y === centerY + radius + distanceOption ? naturalY : y, i);
// Record the placement and visibility
dataLabel._attr = {
visibility: visibility,
align: labelPos[6]
};
dataLabel._pos = {
x: x + options.x +
({ left: connectorPadding, right: -connectorPadding }[labelPos[6]] || 0),
y: y + options.y - 10 // 10 is for the baseline (label vs text)
};
dataLabel.connX = x;
dataLabel.connY = y;
// Detect overflowing data labels
if (this.options.size === null) {
dataLabelWidth = dataLabel.width;
// Overflow left
if (x - dataLabelWidth < connectorPadding) {
overflow[3] = mathMax(mathRound(dataLabelWidth - x + connectorPadding), overflow[3]);
// Overflow right
} else if (x + dataLabelWidth > plotWidth - connectorPadding) {
overflow[1] = mathMax(mathRound(x + dataLabelWidth - plotWidth + connectorPadding), overflow[1]);
}
// Overflow top
if (y - labelHeight / 2 < 0) {
overflow[0] = mathMax(mathRound(-y + labelHeight / 2), overflow[0]);
// Overflow left
} else if (y + labelHeight / 2 > plotHeight) {
overflow[2] = mathMax(mathRound(y + labelHeight / 2 - plotHeight), overflow[2]);
}
}
} // for each point
} // for each half
// Do not apply the final placement and draw the connectors until we have verified
// that labels are not spilling over.
if (arrayMax(overflow) === 0 || this.verifyDataLabelOverflow(overflow)) {
// Place the labels in the final position
this.placeDataLabels();
// Draw the connectors
if (outside && connectorWidth) {
each(this.points, function (point) {
connector = point.connector;
labelPos = point.labelPos;
dataLabel = point.dataLabel;
if (dataLabel && dataLabel._pos) {
visibility = dataLabel._attr.visibility;
x = dataLabel.connX;
y = dataLabel.connY;
connectorPath = softConnector ? [
M,
x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label
'C',
x, y, // first break, next to the label
2 * labelPos[2] - labelPos[4], 2 * labelPos[3] - labelPos[5],
labelPos[2], labelPos[3], // second break
L,
labelPos[4], labelPos[5] // base
] : [
M,
x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label
L,
labelPos[2], labelPos[3], // second break
L,
labelPos[4], labelPos[5] // base
];
if (connector) {
connector.animate({ d: connectorPath });
connector.attr('visibility', visibility);
} else {
point.connector = connector = series.chart.renderer.path(connectorPath).attr({
'stroke-width': connectorWidth,
stroke: options.connectorColor || point.color || '#606060',
visibility: visibility
//zIndex: 0 // #2722 (reversed)
})
.add(series.dataLabelsGroup);
}
} else if (connector) {
point.connector = connector.destroy();
}
});
}
}
};
/**
* Perform the final placement of the data labels after we have verified that they
* fall within the plot area.
*/
seriesTypes.pie.prototype.placeDataLabels = function () {
each(this.points, function (point) {
var dataLabel = point.dataLabel,
_pos;
if (dataLabel) {
_pos = dataLabel._pos;
if (_pos) {
dataLabel.attr(dataLabel._attr);
dataLabel[dataLabel.moved ? 'animate' : 'attr'](_pos);
dataLabel.moved = true;
} else if (dataLabel) {
dataLabel.attr({ y: -999 });
}
}
});
};
seriesTypes.pie.prototype.alignDataLabel = noop;
/**
* Verify whether the data labels are allowed to draw, or we should run more translation and data
* label positioning to keep them inside the plot area. Returns true when data labels are ready
* to draw.
*/
seriesTypes.pie.prototype.verifyDataLabelOverflow = function (overflow) {
var center = this.center,
options = this.options,
centerOption = options.center,
minSize = options.minSize || 80,
newSize = minSize,
ret;
// Handle horizontal size and center
if (centerOption[0] !== null) { // Fixed center
newSize = mathMax(center[2] - mathMax(overflow[1], overflow[3]), minSize);
} else { // Auto center
newSize = mathMax(
center[2] - overflow[1] - overflow[3], // horizontal overflow
minSize
);
center[0] += (overflow[3] - overflow[1]) / 2; // horizontal center
}
// Handle vertical size and center
if (centerOption[1] !== null) { // Fixed center
newSize = mathMax(mathMin(newSize, center[2] - mathMax(overflow[0], overflow[2])), minSize);
} else { // Auto center
newSize = mathMax(
mathMin(
newSize,
center[2] - overflow[0] - overflow[2] // vertical overflow
),
minSize
);
center[1] += (overflow[0] - overflow[2]) / 2; // vertical center
}
// If the size must be decreased, we need to run translate and drawDataLabels again
if (newSize < center[2]) {
center[2] = newSize;
this.translate(center);
each(this.points, function (point) {
if (point.dataLabel) {
point.dataLabel._pos = null; // reset
}
});
if (this.drawDataLabels) {
this.drawDataLabels();
}
// Else, return true to indicate that the pie and its labels is within the plot area
} else {
ret = true;
}
return ret;
};
}
if (seriesTypes.column) {
/**
* Override the basic data label alignment by adjusting for the position of the column
*/
seriesTypes.column.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) {
var inverted = this.chart.inverted,
series = point.series,
dlBox = point.dlBox || point.shapeArgs, // data label box for alignment
below = point.below || (point.plotY > pick(this.translatedThreshold, series.yAxis.len)),
inside = pick(options.inside, !!this.options.stacking); // draw it inside the box?
// Align to the column itself, or the top of it
if (dlBox) { // Area range uses this method but not alignTo
alignTo = merge(dlBox);
if (inverted) {
alignTo = {
x: series.yAxis.len - alignTo.y - alignTo.height,
y: series.xAxis.len - alignTo.x - alignTo.width,
width: alignTo.height,
height: alignTo.width
};
}
// Compute the alignment box
if (!inside) {
if (inverted) {
alignTo.x += below ? 0 : alignTo.width;
alignTo.width = 0;
} else {
alignTo.y += below ? alignTo.height : 0;
alignTo.height = 0;
}
}
}
// When alignment is undefined (typically columns and bars), display the individual
// point below or above the point depending on the threshold
options.align = pick(
options.align,
!inverted || inside ? 'center' : below ? 'right' : 'left'
);
options.verticalAlign = pick(
options.verticalAlign,
inverted || inside ? 'middle' : below ? 'top' : 'bottom'
);
// Call the parent method
Series.prototype.alignDataLabel.call(this, point, dataLabel, options, alignTo, isNew);
};
}
/**
* Highcharts JS v4.1.1 (2015-02-17)
* Highcharts module to hide overlapping data labels. This module is included by default in Highmaps.
*
* (c) 2010-2014 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/*global Highcharts, HighchartsAdapter */
(function (H) {
var Chart = H.Chart,
each = H.each,
addEvent = HighchartsAdapter.addEvent;
// Collect potensial overlapping data labels. Stack labels probably don't need to be
// considered because they are usually accompanied by data labels that lie inside the columns.
Chart.prototype.callbacks.push(function (chart) {
function collectAndHide() {
var labels = [];
each(chart.series, function (series) {
var dlOptions = series.options.dataLabels;
if ((dlOptions.enabled || series._hasPointLabels) && !dlOptions.allowOverlap) {
each(series.points, function (point) {
if (point.dataLabel) {
point.dataLabel.labelrank = point.labelrank;
labels.push(point.dataLabel);
}
});
}
});
chart.hideOverlappingLabels(labels);
}
// Do it now ...
collectAndHide();
// ... and after each chart redraw
addEvent(chart, 'redraw', collectAndHide);
});
/**
* Hide overlapping labels. Labels are moved and faded in and out on zoom to provide a smooth
* visual imression.
*/
Chart.prototype.hideOverlappingLabels = function (labels) {
var len = labels.length,
label,
i,
j,
label1,
label2,
intersectRect = function (pos1, pos2, size1, size2) {
return !(
pos2.x > pos1.x + size1.width ||
pos2.x + size2.width < pos1.x ||
pos2.y > pos1.y + size1.height ||
pos2.y + size2.height < pos1.y
);
};
// Mark with initial opacity
for (i = 0; i < len; i++) {
label = labels[i];
if (label) {
label.oldOpacity = label.opacity;
label.newOpacity = 1;
}
}
// Detect overlapping labels
for (i = 0; i < len; i++) {
label1 = labels[i];
for (j = i + 1; j < len; ++j) {
label2 = labels[j];
if (label1 && label2 && label1.placed && label2.placed && label1.newOpacity !== 0 && label2.newOpacity !== 0 &&
intersectRect(label1.alignAttr, label2.alignAttr, label1, label2)) {
(label1.labelrank < label2.labelrank ? label1 : label2).newOpacity = 0;
}
}
}
// Hide or show
for (i = 0; i < len; i++) {
label = labels[i];
if (label) {
if (label.oldOpacity !== label.newOpacity && label.placed) {
label.alignAttr.opacity = label.newOpacity;
label[label.isOld && label.newOpacity ? 'animate' : 'attr'](label.alignAttr);
}
label.isOld = true;
}
}
};
}(Highcharts));/**
* TrackerMixin for points and graphs
*/
var TrackerMixin = Highcharts.TrackerMixin = {
drawTrackerPoint: function () {
var series = this,
chart = series.chart,
pointer = chart.pointer,
cursor = series.options.cursor,
css = cursor && { cursor: cursor },
onMouseOver = function (e) {
var target = e.target,
point;
if (chart.hoverSeries !== series) {
series.onMouseOver();
}
while (target && !point) {
point = target.point;
target = target.parentNode;
}
if (point !== UNDEFINED && point !== chart.hoverPoint) { // undefined on graph in scatterchart
point.onMouseOver(e);
}
};
// Add reference to the point
each(series.points, function (point) {
if (point.graphic) {
point.graphic.element.point = point;
}
if (point.dataLabel) {
point.dataLabel.element.point = point;
}
});
// Add the event listeners, we need to do this only once
if (!series._hasTracking) {
each(series.trackerGroups, function (key) {
if (series[key]) { // we don't always have dataLabelsGroup
series[key]
.addClass(PREFIX + 'tracker')
.on('mouseover', onMouseOver)
.on('mouseout', function (e) { pointer.onTrackerMouseOut(e); })
.css(css);
if (hasTouch) {
series[key].on('touchstart', onMouseOver);
}
}
});
series._hasTracking = true;
}
},
/**
* Draw the tracker object that sits above all data labels and markers to
* track mouse events on the graph or points. For the line type charts
* the tracker uses the same graphPath, but with a greater stroke width
* for better control.
*/
drawTrackerGraph: function () {
var series = this,
options = series.options,
trackByArea = options.trackByArea,
trackerPath = [].concat(trackByArea ? series.areaPath : series.graphPath),
trackerPathLength = trackerPath.length,
chart = series.chart,
pointer = chart.pointer,
renderer = chart.renderer,
snap = chart.options.tooltip.snap,
tracker = series.tracker,
cursor = options.cursor,
css = cursor && { cursor: cursor },
singlePoints = series.singlePoints,
singlePoint,
i,
onMouseOver = function () {
if (chart.hoverSeries !== series) {
series.onMouseOver();
}
},
/*
* Empirical lowest possible opacities for TRACKER_FILL for an element to stay invisible but clickable
* IE6: 0.002
* IE7: 0.002
* IE8: 0.002
* IE9: 0.00000000001 (unlimited)
* IE10: 0.0001 (exporting only)
* FF: 0.00000000001 (unlimited)
* Chrome: 0.000001
* Safari: 0.000001
* Opera: 0.00000000001 (unlimited)
*/
TRACKER_FILL = 'rgba(192,192,192,' + (hasSVG ? 0.0001 : 0.002) + ')';
// Extend end points. A better way would be to use round linecaps,
// but those are not clickable in VML.
if (trackerPathLength && !trackByArea) {
i = trackerPathLength + 1;
while (i--) {
if (trackerPath[i] === M) { // extend left side
trackerPath.splice(i + 1, 0, trackerPath[i + 1] - snap, trackerPath[i + 2], L);
}
if ((i && trackerPath[i] === M) || i === trackerPathLength) { // extend right side
trackerPath.splice(i, 0, L, trackerPath[i - 2] + snap, trackerPath[i - 1]);
}
}
}
// handle single points
for (i = 0; i < singlePoints.length; i++) {
singlePoint = singlePoints[i];
trackerPath.push(M, singlePoint.plotX - snap, singlePoint.plotY,
L, singlePoint.plotX + snap, singlePoint.plotY);
}
// draw the tracker
if (tracker) {
tracker.attr({ d: trackerPath });
} else { // create
series.tracker = renderer.path(trackerPath)
.attr({
'stroke-linejoin': 'round', // #1225
visibility: series.visible ? VISIBLE : HIDDEN,
stroke: TRACKER_FILL,
fill: trackByArea ? TRACKER_FILL : NONE,
'stroke-width' : options.lineWidth + (trackByArea ? 0 : 2 * snap),
zIndex: 2
})
.add(series.group);
// The tracker is added to the series group, which is clipped, but is covered
// by the marker group. So the marker group also needs to capture events.
each([series.tracker, series.markerGroup], function (tracker) {
tracker.addClass(PREFIX + 'tracker')
.on('mouseover', onMouseOver)
.on('mouseout', function (e) { pointer.onTrackerMouseOut(e); })
.css(css);
if (hasTouch) {
tracker.on('touchstart', onMouseOver);
}
});
}
}
};
/* End TrackerMixin */
/**
* Add tracking event listener to the series group, so the point graphics
* themselves act as trackers
*/
if (seriesTypes.column) {
ColumnSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
}
if (seriesTypes.pie) {
seriesTypes.pie.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
}
if (seriesTypes.scatter) {
ScatterSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
}
/*
* Extend Legend for item events
*/
extend(Legend.prototype, {
setItemEvents: function (item, legendItem, useHTML, itemStyle, itemHiddenStyle) {
var legend = this;
// Set the events on the item group, or in case of useHTML, the item itself (#1249)
(useHTML ? legendItem : item.legendGroup).on('mouseover', function () {
item.setState(HOVER_STATE);
legendItem.css(legend.options.itemHoverStyle);
})
.on('mouseout', function () {
legendItem.css(item.visible ? itemStyle : itemHiddenStyle);
item.setState();
})
.on('click', function (event) {
var strLegendItemClick = 'legendItemClick',
fnLegendItemClick = function () {
item.setVisible();
};
// Pass over the click/touch event. #4.
event = {
browserEvent: event
};
// click the name or symbol
if (item.firePointEvent) { // point
item.firePointEvent(strLegendItemClick, event, fnLegendItemClick);
} else {
fireEvent(item, strLegendItemClick, event, fnLegendItemClick);
}
});
},
createCheckboxForItem: function (item) {
var legend = this;
item.checkbox = createElement('input', {
type: 'checkbox',
checked: item.selected,
defaultChecked: item.selected // required by IE7
}, legend.options.itemCheckboxStyle, legend.chart.container);
addEvent(item.checkbox, 'click', function (event) {
var target = event.target;
fireEvent(item.series || item, 'checkboxClick', { // #3712
checked: target.checked,
item: item
},
function () {
item.select();
}
);
});
}
});
/*
* Add pointer cursor to legend itemstyle in defaultOptions
*/
defaultOptions.legend.itemStyle.cursor = 'pointer';
/*
* Extend the Chart object with interaction
*/
extend(Chart.prototype, {
/**
* Display the zoom button
*/
showResetZoom: function () {
var chart = this,
lang = defaultOptions.lang,
btnOptions = chart.options.chart.resetZoomButton,
theme = btnOptions.theme,
states = theme.states,
alignTo = btnOptions.relativeTo === 'chart' ? null : 'plotBox';
this.resetZoomButton = chart.renderer.button(lang.resetZoom, null, null, function () { chart.zoomOut(); }, theme, states && states.hover)
.attr({
align: btnOptions.position.align,
title: lang.resetZoomTitle
})
.add()
.align(btnOptions.position, false, alignTo);
},
/**
* Zoom out to 1:1
*/
zoomOut: function () {
var chart = this;
fireEvent(chart, 'selection', { resetSelection: true }, function () {
chart.zoom();
});
},
/**
* Zoom into a given portion of the chart given by axis coordinates
* @param {Object} event
*/
zoom: function (event) {
var chart = this,
hasZoomed,
pointer = chart.pointer,
displayButton = false,
resetZoomButton;
// If zoom is called with no arguments, reset the axes
if (!event || event.resetSelection) {
each(chart.axes, function (axis) {
hasZoomed = axis.zoom();
});
} else { // else, zoom in on all axes
each(event.xAxis.concat(event.yAxis), function (axisData) {
var axis = axisData.axis,
isXAxis = axis.isXAxis;
// don't zoom more than minRange
if (pointer[isXAxis ? 'zoomX' : 'zoomY'] || pointer[isXAxis ? 'pinchX' : 'pinchY']) {
hasZoomed = axis.zoom(axisData.min, axisData.max);
if (axis.displayBtn) {
displayButton = true;
}
}
});
}
// Show or hide the Reset zoom button
resetZoomButton = chart.resetZoomButton;
if (displayButton && !resetZoomButton) {
chart.showResetZoom();
} else if (!displayButton && isObject(resetZoomButton)) {
chart.resetZoomButton = resetZoomButton.destroy();
}
// Redraw
if (hasZoomed) {
chart.redraw(
pick(chart.options.chart.animation, event && event.animation, chart.pointCount < 100) // animation
);
}
},
/**
* Pan the chart by dragging the mouse across the pane. This function is called
* on mouse move, and the distance to pan is computed from chartX compared to
* the first chartX position in the dragging operation.
*/
pan: function (e, panning) {
var chart = this,
hoverPoints = chart.hoverPoints,
doRedraw;
// remove active points for shared tooltip
if (hoverPoints) {
each(hoverPoints, function (point) {
point.setState();
});
}
each(panning === 'xy' ? [1, 0] : [1], function (isX) { // xy is used in maps
var mousePos = e[isX ? 'chartX' : 'chartY'],
axis = chart[isX ? 'xAxis' : 'yAxis'][0],
startPos = chart[isX ? 'mouseDownX' : 'mouseDownY'],
halfPointRange = (axis.pointRange || 0) / 2,
extremes = axis.getExtremes(),
newMin = axis.toValue(startPos - mousePos, true) + halfPointRange,
newMax = axis.toValue(startPos + chart[isX ? 'plotWidth' : 'plotHeight'] - mousePos, true) - halfPointRange,
goingLeft = startPos > mousePos; // #3613
if (axis.series.length &&
(goingLeft || newMin > mathMin(extremes.dataMin, extremes.min)) &&
(!goingLeft || newMax < mathMax(extremes.dataMax, extremes.max))) {
axis.setExtremes(newMin, newMax, false, false, { trigger: 'pan' });
doRedraw = true;
}
chart[isX ? 'mouseDownX' : 'mouseDownY'] = mousePos; // set new reference for next run
});
if (doRedraw) {
chart.redraw(false);
}
css(chart.container, { cursor: 'move' });
}
});
/*
* Extend the Point object with interaction
*/
extend(Point.prototype, {
/**
* Toggle the selection status of a point
* @param {Boolean} selected Whether to select or unselect the point.
* @param {Boolean} accumulate Whether to add to the previous selection. By default,
* this happens if the control key (Cmd on Mac) was pressed during clicking.
*/
select: function (selected, accumulate) {
var point = this,
series = point.series,
chart = series.chart;
selected = pick(selected, !point.selected);
// fire the event with the defalut handler
point.firePointEvent(selected ? 'select' : 'unselect', { accumulate: accumulate }, function () {
point.selected = point.options.selected = selected;
series.options.data[inArray(point, series.data)] = point.options;
point.setState(selected && SELECT_STATE);
// unselect all other points unless Ctrl or Cmd + click
if (!accumulate) {
each(chart.getSelectedPoints(), function (loopPoint) {
if (loopPoint.selected && loopPoint !== point) {
loopPoint.selected = loopPoint.options.selected = false;
series.options.data[inArray(loopPoint, series.data)] = loopPoint.options;
loopPoint.setState(NORMAL_STATE);
loopPoint.firePointEvent('unselect');
}
});
}
});
},
/**
* Runs on mouse over the point
*/
onMouseOver: function (e) {
var point = this,
series = point.series,
chart = series.chart,
tooltip = chart.tooltip,
hoverPoint = chart.hoverPoint;
// set normal state to previous series
if (hoverPoint && hoverPoint !== point) {
hoverPoint.onMouseOut();
}
// trigger the event
point.firePointEvent('mouseOver');
// update the tooltip
if (tooltip && (!tooltip.shared || series.noSharedTooltip)) {
tooltip.refresh(point, e);
}
// hover this
point.setState(HOVER_STATE);
chart.hoverPoint = point;
},
/**
* Runs on mouse out from the point
*/
onMouseOut: function () {
var chart = this.series.chart,
hoverPoints = chart.hoverPoints;
this.firePointEvent('mouseOut');
if (!hoverPoints || inArray(this, hoverPoints) === -1) { // #887, #2240
this.setState();
chart.hoverPoint = null;
}
},
/**
* Import events from the series' and point's options. Only do it on
* demand, to save processing time on hovering.
*/
importEvents: function () {
if (!this.hasImportedEvents) {
var point = this,
options = merge(point.series.options.point, point.options),
events = options.events,
eventType;
point.events = events;
for (eventType in events) {
addEvent(point, eventType, events[eventType]);
}
this.hasImportedEvents = true;
}
},
/**
* Set the point's state
* @param {String} state
*/
setState: function (state, move) {
var point = this,
plotX = point.plotX,
plotY = point.plotY,
series = point.series,
stateOptions = series.options.states,
markerOptions = defaultPlotOptions[series.type].marker && series.options.marker,
normalDisabled = markerOptions && !markerOptions.enabled,
markerStateOptions = markerOptions && markerOptions.states[state],
stateDisabled = markerStateOptions && markerStateOptions.enabled === false,
stateMarkerGraphic = series.stateMarkerGraphic,
pointMarker = point.marker || {},
chart = series.chart,
radius,
halo = series.halo,
haloOptions,
newSymbol,
pointAttr;
state = state || NORMAL_STATE; // empty string
pointAttr = point.pointAttr[state] || series.pointAttr[state];
if (
// already has this state
(state === point.state && !move) ||
// selected points don't respond to hover
(point.selected && state !== SELECT_STATE) ||
// series' state options is disabled
(stateOptions[state] && stateOptions[state].enabled === false) ||
// general point marker's state options is disabled
(state && (stateDisabled || (normalDisabled && markerStateOptions.enabled === false))) ||
// individual point marker's state options is disabled
(state && pointMarker.states && pointMarker.states[state] && pointMarker.states[state].enabled === false) // #1610
) {
return;
}
// apply hover styles to the existing point
if (point.graphic) {
radius = markerOptions && point.graphic.symbolName && pointAttr.r;
point.graphic.attr(merge(
pointAttr,
radius ? { // new symbol attributes (#507, #612)
x: plotX - radius,
y: plotY - radius,
width: 2 * radius,
height: 2 * radius
} : {}
));
// Zooming in from a range with no markers to a range with markers
if (stateMarkerGraphic) {
stateMarkerGraphic.hide();
}
} else {
// if a graphic is not applied to each point in the normal state, create a shared
// graphic for the hover state
if (state && markerStateOptions) {
radius = markerStateOptions.radius;
newSymbol = pointMarker.symbol || series.symbol;
// If the point has another symbol than the previous one, throw away the
// state marker graphic and force a new one (#1459)
if (stateMarkerGraphic && stateMarkerGraphic.currentSymbol !== newSymbol) {
stateMarkerGraphic = stateMarkerGraphic.destroy();
}
// Add a new state marker graphic
if (!stateMarkerGraphic) {
if (newSymbol) {
series.stateMarkerGraphic = stateMarkerGraphic = chart.renderer.symbol(
newSymbol,
plotX - radius,
plotY - radius,
2 * radius,
2 * radius
)
.attr(pointAttr)
.add(series.markerGroup);
stateMarkerGraphic.currentSymbol = newSymbol;
}
// Move the existing graphic
} else {
stateMarkerGraphic[move ? 'animate' : 'attr']({ // #1054
x: plotX - radius,
y: plotY - radius
});
}
}
if (stateMarkerGraphic) {
stateMarkerGraphic[state && chart.isInsidePlot(plotX, plotY, chart.inverted) ? 'show' : 'hide'](); // #2450
}
}
// Show me your halo
haloOptions = stateOptions[state] && stateOptions[state].halo;
if (haloOptions && haloOptions.size) {
if (!halo) {
series.halo = halo = chart.renderer.path()
.add(chart.seriesGroup);
}
halo.attr(extend({
fill: Color(point.color || series.color).setOpacity(haloOptions.opacity).get()
}, haloOptions.attributes))[move ? 'animate' : 'attr']({
d: point.haloPath(haloOptions.size)
});
} else if (halo) {
halo.attr({ d: [] });
}
point.state = state;
},
haloPath: function (size) {
var series = this.series,
chart = series.chart,
plotBox = series.getPlotBox(),
inverted = chart.inverted;
return chart.renderer.symbols.circle(
plotBox.translateX + (inverted ? series.yAxis.len - this.plotY : this.plotX) - size,
plotBox.translateY + (inverted ? series.xAxis.len - this.plotX : this.plotY) - size,
size * 2,
size * 2
);
}
});
/*
* Extend the Series object with interaction
*/
extend(Series.prototype, {
/**
* Series mouse over handler
*/
onMouseOver: function () {
var series = this,
chart = series.chart,
hoverSeries = chart.hoverSeries;
// set normal state to previous series
if (hoverSeries && hoverSeries !== series) {
hoverSeries.onMouseOut();
}
// trigger the event, but to save processing time,
// only if defined
if (series.options.events.mouseOver) {
fireEvent(series, 'mouseOver');
}
// hover this
series.setState(HOVER_STATE);
chart.hoverSeries = series;
},
/**
* Series mouse out handler
*/
onMouseOut: function () {
// trigger the event only if listeners exist
var series = this,
options = series.options,
chart = series.chart,
tooltip = chart.tooltip,
hoverPoint = chart.hoverPoint;
// trigger mouse out on the point, which must be in this series
if (hoverPoint) {
hoverPoint.onMouseOut();
}
// fire the mouse out event
if (series && options.events.mouseOut) {
fireEvent(series, 'mouseOut');
}
// hide the tooltip
if (tooltip && !options.stickyTracking && (!tooltip.shared || series.noSharedTooltip)) {
tooltip.hide();
}
// set normal state
series.setState();
chart.hoverSeries = null;
},
/**
* Set the state of the graph
*/
setState: function (state) {
var series = this,
options = series.options,
graph = series.graph,
graphNeg = series.graphNeg,
stateOptions = options.states,
lineWidth = options.lineWidth,
attribs;
state = state || NORMAL_STATE;
if (series.state !== state) {
series.state = state;
if (stateOptions[state] && stateOptions[state].enabled === false) {
return;
}
if (state) {
lineWidth = (stateOptions[state].lineWidth || lineWidth) + (stateOptions[state].lineWidthPlus || 0);
}
if (graph && !graph.dashstyle) { // hover is turned off for dashed lines in VML
attribs = {
'stroke-width': lineWidth
};
// use attr because animate will cause any other animation on the graph to stop
graph.attr(attribs);
if (graphNeg) {
graphNeg.attr(attribs);
}
}
}
},
/**
* Set the visibility of the graph
*
* @param vis {Boolean} True to show the series, false to hide. If UNDEFINED,
* the visibility is toggled.
*/
setVisible: function (vis, redraw) {
var series = this,
chart = series.chart,
legendItem = series.legendItem,
showOrHide,
ignoreHiddenSeries = chart.options.chart.ignoreHiddenSeries,
oldVisibility = series.visible;
// if called without an argument, toggle visibility
series.visible = vis = series.userOptions.visible = vis === UNDEFINED ? !oldVisibility : vis;
showOrHide = vis ? 'show' : 'hide';
// show or hide elements
each(['group', 'dataLabelsGroup', 'markerGroup', 'tracker'], function (key) {
if (series[key]) {
series[key][showOrHide]();
}
});
// hide tooltip (#1361)
if (chart.hoverSeries === series) {
series.onMouseOut();
}
if (legendItem) {
chart.legend.colorizeItem(series, vis);
}
// rescale or adapt to resized chart
series.isDirty = true;
// in a stack, all other series are affected
if (series.options.stacking) {
each(chart.series, function (otherSeries) {
if (otherSeries.options.stacking && otherSeries.visible) {
otherSeries.isDirty = true;
}
});
}
// show or hide linked series
each(series.linkedSeries, function (otherSeries) {
otherSeries.setVisible(vis, false);
});
if (ignoreHiddenSeries) {
chart.isDirtyBox = true;
}
if (redraw !== false) {
chart.redraw();
}
fireEvent(series, showOrHide);
},
/**
* Show the graph
*/
show: function () {
this.setVisible(true);
},
/**
* Hide the graph
*/
hide: function () {
this.setVisible(false);
},
/**
* Set the selected state of the graph
*
* @param selected {Boolean} True to select the series, false to unselect. If
* UNDEFINED, the selection state is toggled.
*/
select: function (selected) {
var series = this;
// if called without an argument, toggle
series.selected = selected = (selected === UNDEFINED) ? !series.selected : selected;
if (series.checkbox) {
series.checkbox.checked = selected;
}
fireEvent(series, selected ? 'select' : 'unselect');
},
drawTracker: TrackerMixin.drawTrackerGraph
});
// global variables
extend(Highcharts, {
// Constructors
Color: Color,
Point: Point,
Tick: Tick,
Renderer: Renderer,
SVGElement: SVGElement,
SVGRenderer: SVGRenderer,
// Various
arrayMin: arrayMin,
arrayMax: arrayMax,
charts: charts,
dateFormat: dateFormat,
error: error,
format: format,
pathAnim: pathAnim,
getOptions: getOptions,
hasBidiBug: hasBidiBug,
isTouchDevice: isTouchDevice,
setOptions: setOptions,
addEvent: addEvent,
removeEvent: removeEvent,
createElement: createElement,
discardElement: discardElement,
css: css,
each: each,
map: map,
merge: merge,
splat: splat,
extendClass: extendClass,
pInt: pInt,
svg: hasSVG,
canvas: useCanVG,
vml: !hasSVG && !useCanVG,
product: PRODUCT,
version: VERSION
});
}());
|
src/components/Checkbox.js | angeloocana/angeloocana | import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { FormattedMessage } from 'react-intl';
const Label = styled.label`
cursor: 'pointer';
padding-top: ${({ theme }) => theme.scale(-1)};
padding-bottom: ${({ theme }) => theme.scale(0)};
padding-left: ${({ theme }) => theme.scale(-1)};
padding-right: ${({ theme }) => theme.scale(0)};
margin-top: 0;
margin-bottom: ${({ theme }) => theme.scale(0)};
margin-left: 0;
margin-right: ${({ theme }) => theme.scale(-6)};
display: inline-block;
border-radius: 0.2rem;
transition: 0.2s;
font-size: ${({ theme }) => theme.scale(-1)};
${(props) => props.checked
? `
color: ${props.theme.colors.black};
background-color: ${props.theme.colors.white};
font-size: ${props.theme.scale(0)};
`
: ``}
&:hover {
color: ${({ theme }) => theme.colors.black};
background-color: ${({ theme }) => theme.colors.white};
font-size: ${({ theme }) => theme.scale(0)};
}
`;
const Input = styled.input`
cursor: 'pointer';
padding: 0;
margin: 0 0.2rem 0 0;
appearance: none;
`;
class Checkbox extends React.PureComponent {
static propTypes = {
label: PropTypes.string,
value: PropTypes.any,
check: PropTypes.func.isRequired,
checked: PropTypes.bool.isRequired
}
onChange = (e) => {
this.props.check(this.props.value);
}
render() {
return (
<FormattedMessage
id={this.props.label}
defaultMessage={this.props.label}
>
{(txt) => (
<Label checked={this.props.checked}>
<Input
type="checkbox"
onChange={this.onChange}
onClick={this.onClick}
checked={this.props.checked}
/>
{txt}
</Label>
)}
</FormattedMessage>
);
}
}
export default Checkbox;
|
src/svg-icons/hardware/keyboard-tab.js | manchesergit/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let HardwareKeyboardTab = (props) => (
<SvgIcon {...props}>
<path d="M11.59 7.41L15.17 11H1v2h14.17l-3.59 3.59L13 18l6-6-6-6-1.41 1.41zM20 6v12h2V6h-2z"/>
</SvgIcon>
);
HardwareKeyboardTab = pure(HardwareKeyboardTab);
HardwareKeyboardTab.displayName = 'HardwareKeyboardTab';
HardwareKeyboardTab.muiName = 'SvgIcon';
export default HardwareKeyboardTab;
|
src/project/FileSyncManager.js | StephanieMak/brackets | /*
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*global define, $ */
/**
* FileSyncManager is a set of utilities to help track external modifications to the files and folders
* in the currently open project.
*
* Currently, we detect external changes purely by checking file timestamps against the last-sync
* timestamp recorded on Document. Brackets triggers this check whenever an external change was detected
* by our native file watchers, and on window focus. We recheck all open Documents, but with file caching
* the timestamp check is a fast no-op for everything other than files where a watcher change was just
* notified. If watchers/caching are disabled, we'll essentially check only on window focus, and we'll hit
* the disk to check every open Document's timestamp every time.
*
* FUTURE: Whenever we have a 'project file tree model,' we should manipulate that instead of notifying
* DocumentManager directly. DocumentManager, the tree UI, etc. then all listen to that model for changes.
*/
define(function (require, exports, module) {
"use strict";
// Load dependent modules
var ProjectManager = require("project/ProjectManager"),
DocumentManager = require("document/DocumentManager"),
MainViewManager = require("view/MainViewManager"),
Async = require("utils/Async"),
Dialogs = require("widgets/Dialogs"),
DefaultDialogs = require("widgets/DefaultDialogs"),
Strings = require("strings"),
StringUtils = require("utils/StringUtils"),
FileUtils = require("file/FileUtils"),
FileSystemError = require("filesystem/FileSystemError");
/**
* Guard to spot re-entrancy while syncOpenDocuments() is still in progress
* @type {boolean}
*/
var _alreadyChecking = false;
/**
* If true, we should bail from the syncOpenDocuments() process and then re-run it. See
* comments in syncOpenDocuments() for how this works.
* @type {boolean}
*/
var _restartPending = false;
/**
* @type {Array.<Document>}
*/
var toReload;
/**
* @type {Array.<Document>}
*/
var toClose;
/**
* @type {Array.<{doc: Document, fileTime: number}>}
*/
var editConflicts;
/**
* @type {Array.<{doc: Document, fileTime: number}>}
*/
var deleteConflicts;
/**
* Scans all the given Documents for changes on disk, and sorts them into four buckets,
* populating the corresponding arrays:
* toReload - changed on disk; unchanged within Brackets
* toClose - deleted on disk; unchanged within Brackets
* editConflicts - changed on disk; also dirty in Brackets
* deleteConflicts - deleted on disk; also dirty in Brackets
*
* @param {!Array.<Document>} docs
* @return {$.Promise} Resolved when all scanning done, or rejected immediately if there's any
* error while reading file timestamps. Errors are logged but no UI is shown.
*/
function findExternalChanges(docs) {
toReload = [];
toClose = [];
editConflicts = [];
deleteConflicts = [];
function checkDoc(doc) {
var result = new $.Deferred();
// Check file timestamp / existence
if (doc.isUntitled()) {
result.resolve();
} else {
doc.file.stat(function (err, stat) {
if (!err) {
// Does file's timestamp differ from last sync time on the Document?
var fileTime = stat.mtime.getTime();
if (fileTime !== doc.diskTimestamp.getTime()) {
// If the user has chosen to keep changes that conflict with the
// current state of the file on disk, then do nothing. This means
// that even if the user later undoes back to clean, we won't
// automatically reload the file on window reactivation. We could
// make it do that, but it seems better to be consistent with the
// deletion case below, where it seems clear that you don't want
// to auto-delete the file on window reactivation just because you
// undid back to clean.
if (doc.keepChangesTime !== fileTime) {
if (doc.isDirty) {
editConflicts.push({doc: doc, fileTime: fileTime});
} else {
toReload.push(doc);
}
}
}
result.resolve();
} else {
// File has been deleted externally
if (err === FileSystemError.NOT_FOUND) {
// If the user has chosen to keep changes previously, and the file
// has been deleted, then do nothing. Like the case above, this
// means that even if the user later undoes back to clean, we won't
// then automatically delete the file on window reactivation.
// (We use -1 as the "mod time" to indicate that the file didn't
// exist, since there's no actual modification time to keep track of
// and -1 isn't a valid mod time for a real file.)
if (doc.keepChangesTime !== -1) {
if (doc.isDirty) {
deleteConflicts.push({doc: doc, fileTime: -1});
} else {
toClose.push(doc);
}
}
result.resolve();
} else {
// Some other error fetching metadata: treat as a real error
console.log("Error checking modification status of " + doc.file.fullPath, err);
result.reject();
}
}
});
}
return result.promise();
}
// Check all docs in parallel
// (fail fast b/c we won't continue syncing if there was any error fetching timestamps)
return Async.doInParallel(docs, checkDoc, true);
}
/**
* Scans all the files in the working set that do not have Documents (and thus were not scanned
* by findExternalChanges()). If any were deleted on disk, removes them from the working set.
*/
function syncUnopenWorkingSet() {
// We only care about working set entries that have never been open (have no Document).
var unopenWorkingSetFiles = MainViewManager.getWorkingSet(MainViewManager.ALL_PANES).filter(function (wsFile) {
return !DocumentManager.getOpenDocumentForPath(wsFile.fullPath);
});
function checkWorkingSetFile(file) {
var result = new $.Deferred();
file.stat(function (err, stat) {
if (!err) {
// File still exists
result.resolve();
} else {
// File has been deleted externally
if (err === FileSystemError.NOT_FOUND) {
DocumentManager.notifyFileDeleted(file);
result.resolve();
} else {
// Some other error fetching metadata: treat as a real error
console.log("Error checking for deletion of " + file.fullPath, err);
result.reject();
}
}
});
return result.promise();
}
// Check all these files in parallel
return Async.doInParallel(unopenWorkingSetFiles, checkWorkingSetFile, false);
}
/**
* Reloads the Document's contents from disk, discarding any unsaved changes in the editor.
*
* @param {!Document} doc
* @return {$.Promise} Resolved after editor has been refreshed; rejected if unable to load the
* file's new content. Errors are logged but no UI is shown.
*/
function reloadDoc(doc) {
var promise = FileUtils.readAsText(doc.file);
promise.done(function (text, readTimestamp) {
doc.refreshText(text, readTimestamp);
});
promise.fail(function (error) {
console.log("Error reloading contents of " + doc.file.fullPath, error);
});
return promise;
}
/**
* Reloads all the documents in "toReload" silently (no prompts). The operations are all run
* in parallel.
* @return {$.Promise} Resolved/rejected after all reloads done; will be rejected if any one
* file's reload failed. Errors are logged (by reloadDoc()) but no UI is shown.
*/
function reloadChangedDocs() {
// Reload each doc in turn, and once all are (async) done, signal that we're done
return Async.doInParallel(toReload, reloadDoc, false);
}
/**
* @param {FileError} error
* @param {!Document} doc
* @return {Dialog}
*/
function showReloadError(error, doc) {
return Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_ERROR,
Strings.ERROR_RELOADING_FILE_TITLE,
StringUtils.format(
Strings.ERROR_RELOADING_FILE,
StringUtils.breakableUrl(doc.file.fullPath),
FileUtils.getFileErrorString(error)
)
);
}
/**
* Closes all the documents in "toClose" silently (no prompts). Completes synchronously.
*/
function closeDeletedDocs() {
toClose.forEach(function (doc) {
DocumentManager.notifyFileDeleted(doc.file);
});
}
/**
* Walks through all the documents in "editConflicts" & "deleteConflicts" and prompts the user
* about each one. Processing is sequential: if the user chooses to reload a document, the next
* prompt is not shown until after the reload has completed.
*
* @param {string} title Title of the dialog.
* @return {$.Promise} Resolved/rejected after all documents have been prompted and (if
* applicable) reloaded (and any resulting error UI has been dismissed). Rejected if any
* one reload failed.
*/
function presentConflicts(title) {
var allConflicts = editConflicts.concat(deleteConflicts);
function presentConflict(docInfo, i) {
var result = new $.Deferred(),
promise = result.promise(),
doc = docInfo.doc,
fileTime = docInfo.fileTime;
// If window has been re-focused, skip all remaining conflicts so the sync can bail & restart
if (_restartPending) {
result.resolve();
return promise;
}
var toClose;
var dialogId;
var message;
var buttons;
// Prompt UI varies depending on whether the file on disk was modified vs. deleted
if (i < editConflicts.length) {
toClose = false;
dialogId = DefaultDialogs.DIALOG_ID_EXT_CHANGED;
message = StringUtils.format(
Strings.EXT_MODIFIED_MESSAGE,
StringUtils.breakableUrl(
ProjectManager.makeProjectRelativeIfPossible(doc.file.fullPath)
)
);
buttons = [
{
className: Dialogs.DIALOG_BTN_CLASS_LEFT,
id: Dialogs.DIALOG_BTN_DONTSAVE,
text: Strings.RELOAD_FROM_DISK
},
{
className: Dialogs.DIALOG_BTN_CLASS_PRIMARY,
id: Dialogs.DIALOG_BTN_CANCEL,
text: Strings.KEEP_CHANGES_IN_EDITOR
}
];
} else {
toClose = true;
dialogId = DefaultDialogs.DIALOG_ID_EXT_DELETED;
message = StringUtils.format(
Strings.EXT_DELETED_MESSAGE,
StringUtils.breakableUrl(
ProjectManager.makeProjectRelativeIfPossible(doc.file.fullPath)
)
);
buttons = [
{
className: Dialogs.DIALOG_BTN_CLASS_LEFT,
id: Dialogs.DIALOG_BTN_DONTSAVE,
text: Strings.CLOSE_DONT_SAVE
},
{
className: Dialogs.DIALOG_BTN_CLASS_PRIMARY,
id: Dialogs.DIALOG_BTN_CANCEL,
text: Strings.KEEP_CHANGES_IN_EDITOR
}
];
}
Dialogs.showModalDialog(dialogId, title, message, buttons)
.done(function (id) {
if (id === Dialogs.DIALOG_BTN_DONTSAVE) {
if (toClose) {
// Discard - close all editors
DocumentManager.notifyFileDeleted(doc.file);
result.resolve();
} else {
// Discard - load changes from disk
reloadDoc(doc)
.done(function () {
result.resolve();
})
.fail(function (error) {
// Unable to load changed version from disk - show error UI
showReloadError(error, doc)
.done(function () {
// After user dismisses, move on to next conflict prompt
result.reject();
});
});
}
} else {
// Cancel - if user doesn't manually save or close, remember that they
// chose to keep the changes in the editor and don't prompt again unless the
// file changes again
// OR programmatically canceled due to _resetPending - we'll skip all
// remaining files in the conflicts list (see above)
// If this wasn't programmatically cancelled, remember that the user
// has accepted conflicting changes as of this file version.
if (!_restartPending) {
doc.keepChangesTime = fileTime;
}
result.resolve();
}
});
return promise;
}
// Begin walking through the conflicts, one at a time
return Async.doSequentially(allConflicts, presentConflict, false);
}
/**
* Check to see whether any open files have been modified by an external app since the last time
* Brackets synced up with the copy on disk (either by loading or saving the file). For clean
* files, we silently upate the editor automatically. For files with unsaved changes, we prompt
* the user.
*
* @param {string} title Title to use for document. Default is "External Changes".
*/
function syncOpenDocuments(title) {
title = title || Strings.EXT_MODIFIED_TITLE;
// We can become "re-entrant" if the user leaves & then returns to Brackets before we're
// done -- easy if a prompt dialog is left open. Since the user may have left Brackets to
// revert some of the disk changes, etc. we want to cancel the current sync and immediately
// begin a new one. We let the orig sync run until the user-visible dialog phase, then
// bail; if we're already there we programmatically close the dialog to bail right away.
if (_alreadyChecking) {
_restartPending = true;
// Close dialog if it was open. This will 'unblock' presentConflict(), which bails back
// to us immediately upon seeing _restartPending. We then restart the sync - see below
Dialogs.cancelModalDialogIfOpen(DefaultDialogs.DIALOG_ID_EXT_CHANGED);
Dialogs.cancelModalDialogIfOpen(DefaultDialogs.DIALOG_ID_EXT_DELETED);
return;
}
_alreadyChecking = true;
// Syncing proceeds in four phases:
// 1) Check all open files for external modifications
// 2) Check any other working set entries (that are not open) for deletion, and remove
// from working set if deleted
// 3) Refresh all Documents that are clean (if file changed on disk)
// 4) Close all Documents that are clean (if file deleted on disk)
// 5) Prompt about any Documents that are dirty (if file changed/deleted on disk)
// Each phase fully completes (asynchronously) before the next one begins.
// 1) Check for external modifications
var allDocs = DocumentManager.getAllOpenDocuments();
findExternalChanges(allDocs)
.done(function () {
// 2) Check un-open working set entries for deletion (& "close" if needed)
syncUnopenWorkingSet()
.always(function () {
// If we were unable to check any un-open files for deletion, silently ignore
// (after logging to console). This doesn't have any bearing on syncing truly
// open Documents (which we've already successfully checked).
// 3) Reload clean docs as needed
reloadChangedDocs()
.always(function () {
// 4) Close clean docs as needed
// This phase completes synchronously
closeDeletedDocs();
// 5) Prompt for dirty editors (conflicts)
presentConflicts(title)
.always(function () {
if (_restartPending) {
// Restart the sync if needed
_restartPending = false;
_alreadyChecking = false;
syncOpenDocuments();
} else {
// We're really done!
_alreadyChecking = false;
// If we showed a dialog, restore focus to editor
if (editConflicts.length > 0 || deleteConflicts.length > 0) {
MainViewManager.focusActivePane();
}
// (Any errors that ocurred during presentConflicts() have already
// shown UI & been dismissed, so there's no fail() handler here)
}
});
});
// Note: if any auto-reloads failed, we silently ignore (after logging to console)
// and we still continue onto phase 4 and try to process those files anyway.
// (We'll retry the auto-reloads next time window is activated... and evenually
// we'll also be double checking before each Save).
});
}).fail(function () {
// Unable to fetch timestamps for some reason - silently ignore (after logging to console)
// (We'll retry next time window is activated... and evenually we'll also be double
// checking before each Save).
// We can't go on without knowing which files are dirty, so bail now
_alreadyChecking = false;
});
}
// Define public API
exports.syncOpenDocuments = syncOpenDocuments;
});
|
client/src/App.js | hankolsen/graphql-tutorial | import React, { Component } from 'react';
import './App.css';
import ChannelsListWithData from './components/ChannelsListWithData';
import ApolloClient from 'apollo-client';
import { ApolloProvider, createNetworkInterface } from 'react-apollo';
const networkInterface = createNetworkInterface({
uri: 'http://localhost:4000/graphql',
});
networkInterface.use([{
applyMiddleware(req, next) {
setTimeout(next, 500);
}
}]);
const client = new ApolloClient({
networkInterface
});
class App extends Component {
render() {
return (
<ApolloProvider client={client}>
<div className="App">
<div className="navbar">React + GraphQL Tutorial</div>
<ChannelsListWithData />
</div>
</ApolloProvider>
);
}
}
export default App;
|
node_modules/react-flexbox-grid/spec/root.js | SerendpityZOEY/Solr-Search-React-UI | /* global VERSION */
require('./stylesheets/base');
import box from './stylesheets/modules/box';
import React from 'react';
import {Grid, Row, Col} from '../src/index';
const Root = () => (
<div>
<h1>React Flexbox Grid <small>Spec {VERSION}</small></h1>
<Grid>
<Row>
<Col xs={12} sm={3} md={2} lg={1}>
<div className={box.row} />
</Col>
<Col xs={6} sm={6} md={8} lg={10}>
<div className={box.row} />
</Col>
<Col xs={6} sm={3} md={2} lg={1}>
<div className={box.row} />
</Col>
</Row>
</Grid>
</div>
);
export default Root;
|
app/js/pages/Page1.js | catxuxiang/amt-starter-kit | import React from 'react';
import {
Container,
Group,
} from 'amazeui-touch';
const Page1 = React.createClass({
getInitialState: function() {
return {
result: null,
};
},
componentDidMount: function() {
let nocache = require('superagent-no-cache');
let request = require('superagent');
request
.get("http://192.168.0.105:6699/mysql")
.use(nocache)
.withCredentials()
.end(function(err, res){
if (err != null) {
alert(err);
} else {
if (this.isMounted()) {
this.setState({
result: JSON.parse(res.text)
});
}
}
}.bind(this));
},
render() {
if (this.state.result == null) {
return (
<Container {...this.props}>
<Group>
</Group>
</Container>
);
} else {
var repos = this.state.result;
var repoList = repos.map(function (repo) {
return (
<div>
<h2>{ repo.id }</h2>
<p>{ repo.comment }</p>
</div>
);
});
return (
<Container {...this.props}>
<Group>
{repoList}
</Group>
</Container>
);
}
},
});
export default Page1;
|
app/javascript/mastodon/features/ui/components/bundle_column_error.js | Chronister/mastodon | import React from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import Column from './column';
import ColumnHeader from './column_header';
import ColumnBackButtonSlim from '../../../components/column_back_button_slim';
import IconButton from '../../../components/icon_button';
const messages = defineMessages({
title: { id: 'bundle_column_error.title', defaultMessage: 'Network error' },
body: { id: 'bundle_column_error.body', defaultMessage: 'Something went wrong while loading this component.' },
retry: { id: 'bundle_column_error.retry', defaultMessage: 'Try again' },
});
class BundleColumnError extends React.PureComponent {
static propTypes = {
onRetry: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
}
handleRetry = () => {
this.props.onRetry();
}
render () {
const { intl: { formatMessage } } = this.props;
return (
<Column>
<ColumnHeader icon='exclamation-circle' type={formatMessage(messages.title)} />
<ColumnBackButtonSlim />
<div className='error-column'>
<IconButton title={formatMessage(messages.retry)} icon='refresh' onClick={this.handleRetry} size={64} />
{formatMessage(messages.body)}
</div>
</Column>
);
}
}
export default injectIntl(BundleColumnError);
|
ajax/libs/maple.js/1.2.0/maple.js | BenjaminVanRyseghem/cdnjs | (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
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; }; })();
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'); } }
var _modelsModuleJs = require('./models/Module.js');
var _modelsModuleJs2 = _interopRequireDefault(_modelsModuleJs);
var _modelsComponentJs = require('./models/Component.js');
var _modelsComponentJs2 = _interopRequireDefault(_modelsComponentJs);
var _helpersSelectorsJs = require('./helpers/Selectors.js');
var _helpersSelectorsJs2 = _interopRequireDefault(_helpersSelectorsJs);
var _helpersUtilityJs = require('./helpers/Utility.js');
var _helpersUtilityJs2 = _interopRequireDefault(_helpersUtilityJs);
var _helpersEventsJs = require('./helpers/Events.js');
var _helpersEventsJs2 = _interopRequireDefault(_helpersEventsJs);
(function main($window, $document) {
'use strict';
if (typeof System !== 'undefined') {
System.transpiler = 'babel';
System.babelOptions = { blacklist: [] };
}
/**
* @constant HAS_INITIATED
* @type {Boolean}
*/
var HAS_INITIATED = false;
/**
* @method isReady
* @param {String} state
* @return {Boolean}
*/
function isReady(state) {
var readyStates = ['interactive', 'complete'];
return !HAS_INITIATED && ~readyStates.indexOf(state);
}
/**
* @module Maple
* @link https://github.com/Wildhoney/Maple.js
* @author Adam Timberlake
*/
var Maple = (function () {
/**
* @constructor
* @return {void}
*/
function Maple() {
_classCallCheck(this, Maple);
HAS_INITIATED = true;
this.findLinks();
this.findTemplates();
// Configure the event delegation mappings.
_helpersEventsJs2['default'].setupDelegation();
}
_createClass(Maple, [{
key: 'findLinks',
/**
* Responsible for finding all of the external link elements, as well as the inline template elements
* that can be handcrafted, or baked into the HTML document when compiling a project.
*
* @method findLinks
* @return {void}
*/
value: function findLinks() {
_helpersSelectorsJs2['default'].getLinks($document).forEach(function (linkElement) {
if (linkElement['import']) {
return void new _modelsModuleJs2['default'](linkElement);
}
linkElement.addEventListener('load', function () {
return new _modelsModuleJs2['default'](linkElement);
});
});
}
}, {
key: 'findTemplates',
/**
* Responsible for finding all of the template HTML elements that contain the `ref` attribute which
* is the component's original path before Mapleify.
*
* @method findTemplates
* @return {void}
*/
value: function findTemplates() {
_helpersSelectorsJs2['default'].getTemplates($document).forEach(function (templateElement) {
var scriptElements = _helpersSelectorsJs2['default'].getAllScripts(templateElement.content);
var ref = templateElement.getAttribute('ref');
var path = _helpersUtilityJs2['default'].resolver(ref, null).production;
scriptElements.forEach(function (scriptElement) {
if (path.isLocalPath(scriptElement.getAttribute('src'))) {
new _modelsComponentJs2['default'](path, templateElement, scriptElement);
}
});
});
}
}]);
return Maple;
})();
// Support for the "async" attribute on the Maple script element.
if (isReady($document.readyState)) {
new Maple();
}
// No documents, no person.
$document.addEventListener('DOMContentLoaded', function () {
return new Maple();
});
})(window, document);
},{"./helpers/Events.js":3,"./helpers/Selectors.js":5,"./helpers/Utility.js":6,"./models/Component.js":7,"./models/Module.js":9}],2:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = (function main($window) {
"use strict";
/**
* @property cache
* @type {Object}
*/
var cache = {};
return {
/**
* Responsible for delegating to the native `fetch` function (polyfill provided), but will cache the
* initial promise in order for other invocations to the same URL to yield the same promise.
*
* @method fetch
* @param url {String}
* @return {Promise}
*/
fetch: function fetch(url) {
if (cache[url]) {
return cache[url];
}
cache[url] = new Promise(function (resolve) {
cache[url] = $window.fetch(url).then(function (response) {
return response.text();
}).then(function (body) {
resolve(body);
});
});
return cache[url];
}
};
})(window);
module.exports = exports["default"];
},{}],3:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _UtilityJs = require("./Utility.js");
var _UtilityJs2 = _interopRequireDefault(_UtilityJs);
/**
* @method overrideStopPropagation
* @see: http://bit.ly/1dPpxHl
* @return {void}
*/
(function overrideStopPropagation() {
"use strict";
var overriddenStop = Event.prototype.stopPropagation;
Event.prototype.stopPropagation = function stopPropagation() {
this.isPropagationStopped = true;
overriddenStop.apply(this, arguments);
};
})();
exports["default"] = (function main($document) {
"use strict";
/**
* @property components
* @type {Array}
*/
var components = [];
/**
* @property eventNames
* @type {Array|null}
*/
var eventNames = null;
return {
/**
* Recursively discover a component via its React ID that is set as a data attribute
* on each React element.
*
* @method findById
* @param id {String}
* @return {Object}
*/
findById: function findById(id) {
var model = undefined;
/**
* @method find
* @param {Object} renderedComponent
* @param {Object} currentComponent
* @return {void}
*/
function find(renderedComponent, currentComponent) {
if (renderedComponent._rootNodeID === id) {
/**
* @method bindModel
* @return {void}
*/
(function bindModel() {
model = {
properties: this._currentElement.props,
component: currentComponent
};
}).bind(renderedComponent)();
return;
}
if (renderedComponent._renderedComponent) {
(function () {
var children = renderedComponent._renderedComponent._renderedChildren;
if (children) {
Object.keys(children).forEach(function (index) {
find(children[index], currentComponent);
});
}
})();
}
}
components.forEach(function (component) {
find(component._reactInternalInstance._renderedComponent, component);
});
return model;
},
/**
* @method transformKeys
* @param {Object} map
* @param {String} [transformer='toLowerCase']
* @return {Object}
*/
transformKeys: function transformKeys(map) {
var transformer = arguments[1] === undefined ? "toLowerCase" : arguments[1];
var transformedMap = {};
Object.keys(map).forEach(function forEach(key) {
transformedMap[key[transformer]()] = map[key];
});
return transformedMap;
},
/**
* @method registerComponent
* @param {Object} component
* @return {void}
*/
registerComponent: function registerComponent(component) {
components.push(component);
},
/**
* @method setupDelegation
* @return {void}
*/
setupDelegation: function setupDelegation() {
var _this = this;
/**
* Determines all of the event types supported by the current browser. Will cache the results
* of this discovery for performance benefits.
*
* @property events
* @type {Array}
*/
var events = eventNames || (function () {
var aElement = $document.createElement("a"),
matcher = /^on/i,
eventNames = [];
for (var key in aElement) {
if (key.match(matcher)) {
eventNames.push(key.replace(matcher, ""));
}
}
return eventNames;
})();
events.forEach(function (eventType) {
$document.addEventListener(eventType, function (event) {
var eventName = "on" + event.type,
eventList = [];
_UtilityJs2["default"].toArray(event.path).forEach(function (item) {
if (event.isPropagationStopped) {
// Method `stopPropagation` was invoked on the current event, which prevents
// us from propagating any further.
return;
}
if (!item.getAttribute || !item.hasAttribute(_UtilityJs2["default"].ATTRIBUTE_REACTID)) {
// Current element is not a valid React element because it doesn't have a
// React ID data attribute.
return;
}
// Attempt to field the component by the associated React ID.
var model = _this.findById(item.getAttribute(_UtilityJs2["default"].ATTRIBUTE_REACTID));
if (model && model.properties) {
// Transform the current React events into lower case keys, so that we can pair them
// up with the event types.
var transformed = _this.transformKeys(model.properties);
if (eventName in transformed) {
// We defer the invocation of the event method, because otherwise React.js
// will re-render, and the React IDs will then be "out of sync" for this event.
eventList.push(transformed[eventName].bind(model.component, event));
}
}
});
// Invoke each found event for the event type.
eventList.forEach(function (eventInvocation) {
return eventInvocation();
});
});
});
}
};
})(window.document);
module.exports = exports["default"];
},{"./Utility.js":6}],4:[function(require,module,exports){
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = (function main($console) {
'use strict';
return {
/**
* @method warn
* @param {String} message
* @return {void}
*/
warn: function warn(message) {
$console.log('Maple.js: %c' + message + '.', 'color: #5F9EA0');
},
/**
* @method info
* @param {String} message
* @return {void}
*/
info: function info(message) {
$console.log('Maple.js: %c' + message + '.', 'color: blue');
},
/**
* @method error
* @param {String} message
* @return {void}
*/
error: function error(message) {
$console.error('%c Maple.js: %c' + message + '.', 'color: black', 'color: #CD6090');
}
};
})(window.console);
module.exports = exports['default'];
},{}],5:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _UtilityJs = require("./Utility.js");
var _UtilityJs2 = _interopRequireDefault(_UtilityJs);
/**
* @method queryAll
* @param {String} expression
* @return {Array}
*/
var queryAll = function queryAll(expression) {
"use strict";
return _UtilityJs2["default"].toArray(this.querySelectorAll(expression));
};
exports["default"] = (function main() {
"use strict";
return {
/**
* @method getExternalStyles
* @param {HTMLElement|HTMLDocument} element
* @return {Array}
*/
getExternalStyles: function getExternalStyles(element) {
return queryAll.call(element, "link[type=\"text/css\"]");
},
/**
* @method getInlineStyles
* @param {HTMLElement|HTMLDocument} element
* @return {Array}
*/
getInlineStyles: function getInlineStyles(element) {
return queryAll.call(element, "style[type=\"text/css\"]");
},
/**
* @mmethod getLinks
* @param {HTMLElement|HTMLDocument} element
* @return {Array}
*/
getLinks: function getLinks(element) {
return queryAll.call(element, "link[rel=\"import\"]:not([data-ignore])");
},
/**
* @mmethod getTemplates
* @param {HTMLElement|HTMLDocument} element
* @return {Array}
*/
getTemplates: function getTemplates(element) {
return queryAll.call(element, "template[ref]");
},
/**
* @mmethod getScripts
* @param {HTMLElement|HTMLDocument} element
* @return {Array}
*/
getScripts: function getScripts(element) {
return queryAll.call(element, "script[type=\"text/javascript\"]");
},
/**
* @method getAllScripts
* @param {HTMLElement|HTMLDocument} element
* @return {Array}
*/
getAllScripts: function getAllScripts(element) {
var jsxFiles = queryAll.call(element, "script[type=\"text/jsx\"]");
return [].concat(_UtilityJs2["default"].toArray(this.getScripts(element)), _UtilityJs2["default"].toArray(jsxFiles));
}
};
})();
module.exports = exports["default"];
},{"./Utility.js":6}],6:[function(require,module,exports){
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = (function main($document) {
'use strict';
/**
* @constant WAIT_TIMEOUT
* @type {Number}
*/
var WAIT_TIMEOUT = 30000;
return {
/**
* @constant ATTRIBUTE_REACTID
* @type {String}
*/
ATTRIBUTE_REACTID: 'data-reactid',
/**
* @method resolver
* @param {String} url
* @param {HTMLDocument|null} ownerDocument
* @return {Object}
*/
resolver: function resolver(url, ownerDocument) {
var componentPath = this.getPath(url),
getPath = this.getPath.bind(this),
getName = this.getName.bind(this);
/**
* @method resolvePath
* @param {String} path
* @param {HTMLDocument} overrideDocument
* @return {String}
*/
function resolvePath(path) {
var overrideDocument = arguments[1] === undefined ? $document : arguments[1];
var a = overrideDocument.createElement('a');
a.href = path;
return a.href;
}
return {
/**
* @property production
* @type {Object}
*/
production: {
/**
* @method getPath
* @param {String} path
* @return {String}
*/
getPath: function getPath(path) {
if (this.isLocalPath(path)) {
return '' + this.getAbsolutePath() + '/' + getName(path);
}
return resolvePath(path, $document);
},
/**
* @method getSrc
* @return {String}
*/
getSrc: function getSrc(src) {
return getName(src);
},
/**
* @method getAbsolutePath
* @return {String}
*/
getAbsolutePath: function getAbsolutePath() {
return resolvePath(url);
},
/**
* @method getRelativePath
* @return {String}
*/
getRelativePath: function getRelativePath() {
return url;
},
/**
* @method isLocalPath
* @param {String} path
* @return {Boolean}
*/
isLocalPath: function isLocalPath(path) {
return !! ~path.indexOf(url);
}
},
/**
* @property development
* @type {Object}
*/
development: {
/**
* @method getPath
* @param {String} path
* @return {String}
*/
getPath: function getPath(path) {
if (this.isLocalPath(path)) {
return '' + this.getAbsolutePath() + '/' + path;
}
return resolvePath(path, $document);
},
/**
* @method getSrc
* @return {String}
*/
getSrc: function getSrc(src) {
return src;
},
/**
* @method getAbsolutePath
* @return {String}
*/
getAbsolutePath: function getAbsolutePath() {
return resolvePath(componentPath);
},
/**
* @method getRelativePath
* @return {String}
*/
getRelativePath: function getRelativePath() {
return componentPath;
},
/**
* @method isLocalPath
* @param path {String}
* @return {Boolean}
*/
isLocalPath: function isLocalPath(path) {
path = getPath(resolvePath(path, ownerDocument));
return !! ~resolvePath(componentPath).indexOf(path);
}
}
};
},
/**
* @method toArray
* @param {*} arrayLike
* @return {Array}
*/
toArray: function toArray(arrayLike) {
return Array.from ? Array.from(arrayLike) : Array.prototype.slice.apply(arrayLike);
},
/**
* @method flattenArray
* @param {Array} arr
* @param {Array} [givenArr=[]]
*/
flattenArray: function flattenArray(arr) {
var _this = this;
var givenArr = arguments[1] === undefined ? [] : arguments[1];
/* jshint ignore:start */
arr.forEach(function (item) {
Array.isArray(item) && _this.flattenArray(item, givenArr);
!Array.isArray(item) && givenArr.push(item);
});
/* jshint ignore:end */
return givenArr;
},
/**
* @method timeoutPromise
* @param {Function} reject
* @param {String} errorMessage
* @param {Number} [timeout=WAIT_TIMEOUT]
* @return {void}
*/
timeoutPromise: function timeoutPromise(reject) {
var errorMessage = arguments[1] === undefined ? 'Timeout' : arguments[1];
var timeout = arguments[2] === undefined ? WAIT_TIMEOUT : arguments[2];
setTimeout(function () {
return reject(new Error(errorMessage));
}, timeout);
},
/**
* @method toSnakeCase
* @param {String} camelCase
* @param {String} [joiner='-']
* @return {String}
*/
toSnakeCase: function toSnakeCase(camelCase) {
var joiner = arguments[1] === undefined ? '-' : arguments[1];
return camelCase.split(/([A-Z][a-z]{0,})/g).filter(function (parts) {
return parts;
}).join(joiner).toLowerCase();
},
/**
* @method getName
* @param {String} importPath
* @return {String}
*/
getName: function getName(importPath) {
return importPath.split('/').slice(-1);
},
/**
* @method getPath
* @param {String} importPath
* @return {String}
*/
getPath: function getPath(importPath) {
return importPath.split('/').slice(0, -1).join('/');
},
/**
* @method removeExtension
* @param {String} filePath
* @return {String}
*/
removeExtension: function removeExtension(filePath) {
return filePath.split('.').slice(0, -1).join('.');
}
};
})(window.document);
module.exports = exports['default'];
},{}],7:[function(require,module,exports){
'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 _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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 _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) subClass.__proto__ = superClass; }
var _ElementJs = require('./Element.js');
var _ElementJs2 = _interopRequireDefault(_ElementJs);
var _helpersUtilityJs = require('./../helpers/Utility.js');
var _helpersUtilityJs2 = _interopRequireDefault(_helpersUtilityJs);
var _helpersLoggerJs = require('./../helpers/Logger.js');
var _helpersLoggerJs2 = _interopRequireDefault(_helpersLoggerJs);
var _StateManagerJs = require('./StateManager.js');
/**
* @module Maple
* @submodule Component
* @extends StateManager
* @author Adam Timberlake
* @link https://github.com/Wildhoney/Maple.js
*/
var Component = (function (_StateManager) {
/**
* Responsible for loading any prerequisites before the component is delegated to each `CustomElement`
* object for creating a custom element, and lastly rendering the React component to the designated HTML element.
*
* @constructor
* @param {String} path
* @param {HTMLTemplateElement} templateElement
* @param {HTMLScriptElement} scriptElement
* @return {Module}
*/
function Component(path, templateElement, scriptElement) {
var _this = this;
_classCallCheck(this, Component);
_get(Object.getPrototypeOf(Component.prototype), 'constructor', this).call(this);
this.path = path;
this.elements = { script: scriptElement, template: templateElement };
var src = scriptElement.getAttribute('src');
this.setState(_StateManagerJs.State.RESOLVING);
// Configure the URL of the component for ES6 `System.import`, which is also polyfilled in case the
// current browser does not provide support for dynamic module loading.
var url = '' + this.path.getRelativePath() + '/' + _helpersUtilityJs2['default'].removeExtension(src);
if (src.split('.').pop().toLowerCase() === 'jsx') {
return void _helpersLoggerJs2['default'].error('Use JS extension instead of JSX – JSX compilation will work as expected');
}
System['import']('' + url).then(function (imports) {
if (!imports['default']) {
// Components that do not have a default export (i.e: export default class...) will be ignored.
return;
}
// Load all third-party scripts that are a prerequisite of resolving the custom element.
Promise.all(_this.loadThirdPartyScripts()).then(function () {
new _ElementJs2['default'](path, templateElement, scriptElement, imports['default']);
_this.setState(_StateManagerJs.State.RESOLVED);
});
});
}
_inherits(Component, _StateManager);
_createClass(Component, [{
key: 'loadThirdPartyScripts',
/**
* Discover all of the third party JavaScript dependencies that are required to have been loaded before
* attempting to render the custom element.
*
* @method loadThirdPartyScripts
* @return {Promise[]}
*/
value: function loadThirdPartyScripts() {
var _this2 = this;
var scriptElements = _helpersUtilityJs2['default'].toArray(this.elements.template.content.querySelectorAll('script[type="text/javascript"]')),
thirdPartyScripts = scriptElements.filter(function (scriptElement) {
return !_this2.path.isLocalPath(scriptElement.getAttribute('src'));
});
return thirdPartyScripts.map(function (scriptElement) {
var src = scriptElement.getAttribute('src');
scriptElement = document.createElement('script');
scriptElement.setAttribute('type', 'text/javascript');
scriptElement.setAttribute('src', src);
return new Promise(function (resolve) {
scriptElement.addEventListener('load', function () {
return resolve();
});
document.head.appendChild(scriptElement);
});
});
}
}]);
return Component;
})(_StateManagerJs.StateManager);
exports['default'] = Component;
module.exports = exports['default'];
},{"./../helpers/Logger.js":4,"./../helpers/Utility.js":6,"./Element.js":8,"./StateManager.js":10}],8:[function(require,module,exports){
'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 _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { var object = _x2, property = _x3, receiver = _x4; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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 _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) subClass.__proto__ = superClass; }
var _helpersEventsJs = require('./../helpers/Events.js');
var _helpersEventsJs2 = _interopRequireDefault(_helpersEventsJs);
var _helpersUtilityJs = require('./../helpers/Utility.js');
var _helpersUtilityJs2 = _interopRequireDefault(_helpersUtilityJs);
var _helpersCacheFactoryJs = require('./../helpers/CacheFactory.js');
var _helpersCacheFactoryJs2 = _interopRequireDefault(_helpersCacheFactoryJs);
var _helpersSelectorsJs = require('./../helpers/Selectors.js');
var _helpersSelectorsJs2 = _interopRequireDefault(_helpersSelectorsJs);
var _StateManagerJs = require('./StateManager.js');
/**
* @module Maple
* @submodule CustomElement
* @extends StateManager
* @author Adam Timberlake
* @link https://github.com/Wildhoney/Maple.js
*/
var CustomElement = (function (_StateManager) {
/**
* @constructor
* @param {String} path
* @param {HTMLScriptElement} scriptElement
* @param {HTMLTemplateElement} templateElement
* @param {String} importScript
* @return {Element}
*/
function CustomElement(path, templateElement, scriptElement, importScript) {
_classCallCheck(this, CustomElement);
_get(Object.getPrototypeOf(CustomElement.prototype), 'constructor', this).call(this);
this.path = path;
this.elements = { script: scriptElement, template: templateElement };
this.script = importScript;
document.registerElement(this.getElementName(), {
prototype: this.getElementPrototype()
});
}
_inherits(CustomElement, _StateManager);
_createClass(CustomElement, [{
key: 'loadStyles',
/**
* Responsible for loading associated styles into either the shadow DOM, if the path is determined to be local
* to the component, or globally if not.
*
* @method loadStyles
* @param {ShadowRoot} shadowBoundary
* @return {Promise[]}
*/
value: function loadStyles(shadowBoundary) {
var _this = this;
/**
* @method createStyle
* @param {String} body
* @param {ShadowRoot|HTMLDocument} element
* @return {void}
*/
function createStyle(body) {
var element = arguments[1] === undefined ? shadowBoundary : arguments[1];
var styleElement = document.createElement('style');
styleElement.setAttribute('type', 'text/css');
styleElement.innerHTML = body;
element.appendChild(styleElement);
}
this.setState(_StateManagerJs.State.RESOLVING);
var content = this.elements.template.content;
var linkElements = _helpersSelectorsJs2['default'].getExternalStyles(content);
var styleElements = _helpersSelectorsJs2['default'].getInlineStyles(content);
var promises = [].concat(linkElements, styleElements).map(function (element) {
return new Promise(function (resolve) {
if (element.nodeName.toLowerCase() === 'style') {
createStyle(element.innerHTML, shadowBoundary);
resolve();
return;
}
_helpersCacheFactoryJs2['default'].fetch(_this.path.getPath(element.getAttribute('href'))).then(function (body) {
createStyle(body, shadowBoundary);
resolve();
});
});
});
Promise.all(promises).then(function () {
return _this.setState(_StateManagerJs.State.RESOLVED);
});
return promises;
}
}, {
key: 'getElementName',
/**
* Extract the element name from converting the Function to a String via the `toString` method. It's worth
* noting that this is probably the weakest part of the Maple system because it relies on a regular expression
* to determine the name of the resulting custom HTML element.
*
* @method getElementName
* @return {String}
*/
value: function getElementName() {
return _helpersUtilityJs2['default'].toSnakeCase(this.script.toString().match(/(?:function|class)\s*([a-z]+)/i)[1]);
}
}, {
key: 'getElementPrototype',
/**
* Yields the prototype for the custom HTML element that will be registered for our custom React component.
* It listens for when the custom element has been inserted into the DOM, and then sets up the styles, applies
* default React properties, etc...
*
* @method getElementPrototype
* @return {Object}
*/
value: function getElementPrototype() {
var loadStyles = this.loadStyles.bind(this),
script = this.script,
path = this.path;
return Object.create(HTMLElement.prototype, {
/**
* @property attachedCallback
* @type {Object}
*/
attachedCallback: {
/**
* @method value
* @return {void}
*/
value: function value() {
/**
* @method applyDefaultProps
* @param {Object} attributes
* @return {void}
*/
function applyDefaultProps(attributes) {
for (var index = 0; index < attributes.length; index++) {
var attribute = attributes.item(index);
var replacer = /^data-/i;
if (attribute.value) {
if (attribute.name === _helpersUtilityJs2['default'].ATTRIBUTE_REACTID) {
continue;
}
var _name = attribute.name.replace(replacer, '');
script.defaultProps[_name] = attribute.value;
}
}
}
// Apply properties to the custom element.
script.defaultProps = { path: path, element: this.cloneNode(true) };
applyDefaultProps.call(this, this.attributes);
this.innerHTML = '';
// Configure the React.js component, importing it under the shadow boundary.
var renderedElement = React.createElement(script),
contentElement = document.createElement('content'),
shadowRoot = this.createShadowRoot();
shadowRoot.appendChild(contentElement);
var component = React.render(renderedElement, contentElement);
// Configure the event delegation for the component.
_helpersEventsJs2['default'].registerComponent(component);
/**
* Import external CSS documents and resolve element.
*
* @method resolveElement
* @return {void}
*/
function resolveElement() {
var _this2 = this;
Promise.all(loadStyles(shadowRoot)).then(function () {
_this2.removeAttribute('unresolved');
_this2.setAttribute('resolved', '');
});
}
resolveElement.apply(this);
}
}
});
}
}]);
return CustomElement;
})(_StateManagerJs.StateManager);
exports['default'] = CustomElement;
module.exports = exports['default'];
},{"./../helpers/CacheFactory.js":2,"./../helpers/Events.js":3,"./../helpers/Selectors.js":5,"./../helpers/Utility.js":6,"./StateManager.js":10}],9:[function(require,module,exports){
'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 _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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 _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) subClass.__proto__ = superClass; }
var _ComponentJs = require('./Component.js');
var _ComponentJs2 = _interopRequireDefault(_ComponentJs);
var _helpersUtilityJs = require('./../helpers/Utility.js');
var _helpersUtilityJs2 = _interopRequireDefault(_helpersUtilityJs);
var _helpersLoggerJs = require('./../helpers/Logger.js');
var _helpersLoggerJs2 = _interopRequireDefault(_helpersLoggerJs);
var _helpersSelectorsJs = require('./../helpers/Selectors.js');
var _helpersSelectorsJs2 = _interopRequireDefault(_helpersSelectorsJs);
var _StateManagerJs = require('./StateManager.js');
var Module = (function (_StateManager) {
/**
* @constructor
* @param {HTMLLinkElement} linkElement
* @return {Component}
*/
function Module(linkElement) {
var _this = this;
_classCallCheck(this, Module);
_get(Object.getPrototypeOf(Module.prototype), 'constructor', this).call(this);
this.path = _helpersUtilityJs2['default'].resolver(linkElement.getAttribute('href'), linkElement['import']).development;
this.state = _StateManagerJs.State.UNRESOLVED;
this.elements = { link: linkElement };
this.components = [];
this.loadModule(linkElement).then(function () {
// Use only the first template, because otherwise Mapleify will have a difficult job attempting
// to resolve the paths when there's a mismatch between template elements and link elements.
// PREVIOUS: this.getTemplates().forEach((templateElement) => {
var templateElements = _this.getTemplates();
if (templateElements.length > 1) {
_helpersLoggerJs2['default'].error('Component "' + linkElement.getAttribute('href') + '" is attempting to register two components');
return;
}
[_this.getTemplates()[0]].forEach(function (templateElement) {
var scriptElements = _helpersSelectorsJs2['default'].getAllScripts(templateElement.content);
scriptElements.map(function (scriptElement) {
var src = scriptElement.getAttribute('src');
if (!_this.path.isLocalPath(src)) {
return;
}
var component = new _ComponentJs2['default'](_this.path, templateElement, scriptElement);
_this.components.push(component);
});
});
_this.setState(_StateManagerJs.State.RESOLVED);
});
}
_inherits(Module, _StateManager);
_createClass(Module, [{
key: 'setState',
/**
* @method setState
* @param {Number} state
* @return {void}
*/
value: function setState(state) {
this.state = state;
}
}, {
key: 'loadModule',
/**
* @method loadModule
* @param {HTMLTemplateElement} templateElement
* @return {Promise}
*/
value: function loadModule(templateElement) {
this.setState(_StateManagerJs.State.RESOLVING);
return new Promise(function (resolve) {
if (templateElement.hasAttribute('ref')) {
return void resolve(templateElement);
}
if (templateElement['import']) {
return void resolve(templateElement);
}
templateElement.addEventListener('load', function () {
resolve(templateElement);
});
});
}
}, {
key: 'getTemplates',
/**
* @method getTemplates
* @return {Array}
*/
value: function getTemplates() {
var ownerDocument = this.elements.link['import'];
return _helpersUtilityJs2['default'].toArray(ownerDocument.querySelectorAll('template'));
}
}]);
return Module;
})(_StateManagerJs.StateManager);
exports['default'] = Module;
module.exports = exports['default'];
},{"./../helpers/Logger.js":4,"./../helpers/Selectors.js":5,"./../helpers/Utility.js":6,"./Component.js":7,"./StateManager.js":10}],10:[function(require,module,exports){
"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; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**
* @constant State
* @type {{UNRESOLVED: number, RESOLVING: number, RESOLVED: number}}
*/
var State = { UNRESOLVED: 0, RESOLVING: 1, RESOLVED: 2 };
exports.State = State;
/**
* @module Maple
* @submodule StateManager
* @author Adam Timberlake
* @link https://github.com/Wildhoney/Maple.js
*/
var StateManager = (function () {
/**
* @constructor
* @return {Abstract}
*/
function StateManager() {
_classCallCheck(this, StateManager);
this.state = State.UNRESOLVED;
}
_createClass(StateManager, [{
key: "setState",
/**
* @method setState
* @param {Number} state
* @return {void}
*/
value: function setState(state) {
this.state = state;
}
}]);
return StateManager;
})();
exports.StateManager = StateManager;
},{}]},{},[1])
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCIvVXNlcnMvYXRpbWJlcmxha2UvV2Vicm9vdC9NYXBsZS5qcy9zcmMvTWFwbGUuanMiLCIvVXNlcnMvYXRpbWJlcmxha2UvV2Vicm9vdC9NYXBsZS5qcy9zcmMvaGVscGVycy9DYWNoZUZhY3RvcnkuanMiLCIvVXNlcnMvYXRpbWJlcmxha2UvV2Vicm9vdC9NYXBsZS5qcy9zcmMvaGVscGVycy9FdmVudHMuanMiLCIvVXNlcnMvYXRpbWJlcmxha2UvV2Vicm9vdC9NYXBsZS5qcy9zcmMvaGVscGVycy9Mb2dnZXIuanMiLCIvVXNlcnMvYXRpbWJlcmxha2UvV2Vicm9vdC9NYXBsZS5qcy9zcmMvaGVscGVycy9TZWxlY3RvcnMuanMiLCIvVXNlcnMvYXRpbWJlcmxha2UvV2Vicm9vdC9NYXBsZS5qcy9zcmMvaGVscGVycy9VdGlsaXR5LmpzIiwiL1VzZXJzL2F0aW1iZXJsYWtlL1dlYnJvb3QvTWFwbGUuanMvc3JjL21vZGVscy9Db21wb25lbnQuanMiLCIvVXNlcnMvYXRpbWJlcmxha2UvV2Vicm9vdC9NYXBsZS5qcy9zcmMvbW9kZWxzL0VsZW1lbnQuanMiLCIvVXNlcnMvYXRpbWJlcmxha2UvV2Vicm9vdC9NYXBsZS5qcy9zcmMvbW9kZWxzL01vZHVsZS5qcyIsIi9Vc2Vycy9hdGltYmVybGFrZS9XZWJyb290L01hcGxlLmpzL3NyYy9tb2RlbHMvU3RhdGVNYW5hZ2VyLmpzIl0sIm5hb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1Y3RvcigpIHtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgSEFTX0lOSVRJQVRFRCA9IHRydWU7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIHRoaXMuZmluZExpbmtzKCk7XG4gICAgICAgICAgICB0aGlzLmZpbmRUZW1wbGF0ZXMoKTtcblxuICAgICAgICAgICAgLy8gQ29uZmlndXJlIHRoZSBldmVudCBkZWxlZ2F0aW9uIG1hcHBpbmdzLlxuICAgICAgICAgICAgZXZlbnRzLnNldHVwRGVsZWdhdGlvbigpO1xuICAgICAgICAgICAgXG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogUmVzcG9uc2libGUgZm9yIGZpbmRpbmcgYWxsIG9mIHRoZSBleHRlcm5hbCBsaW5rIGVsZW1lbnRzLCBhcyB3ZWxsIGFzIHRoZSBpbmxpbmUgdGVtcGxhdGUgZWxlbWVudHNcbiAgICAgICAgICogdGhhdCBjYW4gYmUgaGFuZGNyYWZ0ZWQsIG9yIGJha2VkIGludG8gdGhlIEhUTUwgZG9jdW1lbnQgd2hlbiBjb21waWxpbmcgYSBwcm9qZWN0LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAbWV0aG9kIGZpbmRMaW5rc1xuICAgICAgICAgKiBAcmV0dXJuIHt2b2lkfVxuICAgICAgICAgKi9cbiAgICAgICAgZmluZExpbmtzKCkge1xuXG4gICAgICAgICAgICBzZWxlY3RvcnMuZ2V0TGlua3MoJGRvY3VtZW50KS5mb3JFYWNoKChsaW5rRWxlbWVudCkgPT4ge1xuXG4gICAgICAgICAgICAgICAgaWYgKGxpbmtFbGVtZW50LmltcG9ydCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdm9pZCBuZXcgTW9kdWxlKGxpbmtFbGVtZW50KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsaW5rRWxlbWVudC5hZGRFdmVudExpc3RlbmVyKCdsb2FkJywgKCkgPT4gbmV3IE1vZHVsZShsaW5rRWxlbWVudCkpO1xuXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICB9XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIFJlc3BvbnNpYmxlIGZvciBmaW5kaW5nIGFsbCBvZiB0aGUgdGVtcGxhdGUgSFRNTCBlbGVtZW50cyB0aGF0IGNvbnRhaW4gdGhlIGByZWZgIGF0dHJpYnV0ZSB3aGljaFxuICAgICAgICAgKiBpcyB0aGUgY29tcG9uZW50J3Mgb3JpZ2luYWwgcGF0aCBiZWZvcmUgTWFwbGVpZnkuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBtZXRob2QgZmluZFRlbXBsYXRlc1xuICAgICAgICAgKiBAcmV0dXJuIHt2b2lkfVxuICAgICAgICAgKi9cbiAgICAgICAgZmluZFRlbXBsYXRlcygpIHtcblxuICAgICAgICAgICAgc2VsZWN0b3JzLmdldFRlbXBsYXRlcygkZG9jdW1lbnQpLmZvckVhY2goKHRlbXBsYXRlRWxlbWVudCkgPT4ge1xuXG4gICAgICAgICAgICAgICAgbGV0IHNjcmlwdEVsZW1lbnRzID0gc2VsZWN0b3JzLmdldEFsbFNjcmlwdHModGVtcGxhdGVFbGVtZW50LmNvbnRlbnQpO1xuICAgICAgICAgICAgICAgIGxldCByZWYgICAgICAgICAgICA9IHRlbXBsYXRlRWxlbWVudC5nZXRBdHRyaWJ1dGUoJ3JlZicpO1xuICAgICAgICAgICAgICAgIGxldCBwYXRoICAgICAgICAgICA9IHV0aWxpdHkucmVzb2x2ZXIocmVmLCBudWxsKS5wcm9kdWN0aW9uO1xuXG4gICAgICAgICAgICAgICAgc2NyaXB0RWxlbWVudHMuZm9yRWFjaCgoc2NyaXB0RWxlbWVudCkgPT4ge1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChwYXRoLmlzTG9jYWxQYXRoKHNjcmlwdEVsZW1lbnQuZ2V0QXR0cmlidXRlKCdzcmMnKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBD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50XG4gICAgICAgICAgICAgKiBAcmV0dXJuIHt2b2lkfVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBmdW5jdGlvbiBmaW5kKHJlbmRlcmVkQ29tcG9uZW50LCBjdXJyZW50Q29tcG9uZW50KSB7XG5cbiAgICAgICAgICAgICAgICBpZiAocmVuZGVyZWRDb21wb25lbnQuX3Jvb3ROb2RlSUQgPT09IGlkKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAqIEBtZXRob2QgYmluZE1vZGVsXG4gICAgICAgICAgICAgICAgICAgICAqIEByZXR1cm4ge3ZvaWR9XG4gICAgICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICAoZnVuY3Rpb24gYmluZE1vZGVsKCkge1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBtb2RlbCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzOiB0aGlzLl9jdXJyZW50RWxlbWVudC5wcm9wcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQ6IGN1cnJlbnRDb21wb25lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAgICAgfS5iaW5kKHJlbmRlcmVkQ29tcG9uZW50KSkoKTtcblxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG5cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAocmVuZGVyZWRDb21wb25lbnQuX3JlbmRlcmVkQ29tcG9uZW50KSB7XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IGNoaWxkcmVuID0gcmVuZGVyZWRDb21wb25lbnQuX3JlbmRlcmVkQ29tcG9uZW50Ll9yZW5kZXJlZENoaWxkcmVuO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChjaGlsZHJlbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmtleXMoY2hpbGRyZW4pLmZvckVhY2goKGluZGV4KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluZChjaGlsZHJlbltpbmRleF0sIGN1cnJlbnRDb21wb25lbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb21wb25lbnRzLmZvckVhY2goKGNvbXBvbmVudCkgPT4ge1xuICAgICAgICAgICAgICAgIGZpbmQoY29tcG9uZW50Ll9yZWFjdEludGVybmFsSW5zdGFuY2UuX3JlbmRlcmVkQ29tcG9uZW50LCBjb21wb25lbnQpO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiBtb2RlbDtcblxuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWV0aG9kIHRyYW5zZm9ybUtleXNcbiAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IG1hcFxuICAgICAgICAgKiBAcGFyYW0ge1N0cmluZ30gW3RyYW5zZm9ybWVyPSd0b0xvd2VyQ2FzZSddXG4gICAgICAgICAqIEByZXR1cm4ge09iamVjdH1cbiAgICAgICAgICovXG4gICAgICAgIHRyYW5zZm9ybUtleXMobWFwLCB0cmFuc2Zvcm1lciA9ICd0b0xvd2VyQ2FzZScpIHtcblxuICAgICAgICAgICAgbGV0IHRyYW5zZm9ybWVkTWFwID0ge307XG5cbiAgICAgICAgICAgIE9iamVjdC5rZXlzKG1hcCkuZm9yRWFjaChmdW5jdGlvbiBmb3JFYWNoKGtleSkge1xuICAgICAgICAgICAgICAgIHRyYW5zZm9ybWVkTWFwW2tleVt0cmFuc2Zvcm1lcl0oKV0gPSBtYXBba2V5XTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gdHJhbnNmb3JtZWRNYXA7XG5cbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQG1ldGhvZCByZWdpc3RlckNvbXBvbmVudFxuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gY29tcG9uZW50XG4gICAgICAgICAqIEByZXR1cm4ge3ZvaWR9XG4gICAgICAgICAqL1xuICAgICAgICByZWdpc3RlckNvbXBvbmVudChjb21wb25lbnQpIHtcbiAgICAgICAgICAgIGNvbXBvbmVudHMucHVzaChjb21wb25lbnQpO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWV0aG9kIHNldHVwRGVsZWdhdGlvblxuICAgICAgICAgKiBAcmV0dXJuIHt2b2lkfVxuICAgICAgICAgKi9cbiAgICAgICAgc2V0dXBEZWxlZ2F0aW9uKCkge1xuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIERldGVybWluZXMgYWxsIG9mIHRoZSBldmVudCB0eXBlcyBzdXBwb3J0ZWQgYnkgdGhlIGN1cnJlbnQgYnJvd3Nlci4gV2lsbCBjYWNoZSB0aGUgcmVzdWx0c1xuICAgICAgICAgICAgICogb2YgdGhpcyBkaXNjb3ZlcnkgZm9yIHBlcmZvcm1hbmNlIGJlbmVmaXRzLlxuICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAqIEBwcm9wZXJ0eSBldmVudHNcbiAgICAgICAgICAgICAqIEB0eXBlIHtBcnJheX1cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgbGV0IGV2ZW50cyA9IGV2ZW50TmFtZXMgfHwgKCgpID0+IHtcblxuICAgICAgICAgICAgICAgIGxldCBhRWxlbWVudCAgID0gJGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2EnKSxcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2hlciAgICA9IC9eb24vaSxcbiAgICAgICAgICAgICAgICAgICAgZXZlbnROYW1lcyA9IFtdO1xuXG4gICAgICAgICAgICAgICAgZm9yKHZhciBrZXkgaW4gYUVsZW1lbnQpIHtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoa2V5Lm1hdGNoKG1hdGNoZXIpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudE5hbWVzLnB1c2goa2V5LnJlcGxhY2UobWF0Y2hlciwgJycpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIGV2ZW50TmFtZXM7XG5cbiAgICAgICAgICAgIH0pKCk7XG5cbiAgICAgICAgICAgIGV2ZW50cy5mb3JFYWNoKChldmVudFR5cGUpID0+IHtcblxuICAgICAgICAgICAgICAgICRkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKGV2ZW50VHlwZSwgKGV2ZW50KSA9PiB7XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IGV2ZW50TmFtZSA9IGBvbiR7ZXZlbnQudHlwZX1gLFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRMaXN0ID0gW107XG5cbiAgICAgICAgICAgICAgICAgICAgdXRpbGl0eS50b0FycmF5KGV2ZW50LnBhdGgpLmZvckVhY2goKGl0ZW0pID0+IHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV2ZW50LmlzUHJvcGFnYXRpb25TdG9wcGVkKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBNZXRob2QgYHN0b3BQcm9wYWdhdGlvbmAgd2FzIGludm9rZWQgb24gdGhlIGN1cnJlbnQgZXZlbnQsIHdoaWNoIHByZXZlbnRzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXMgZnJvbSBwcm9wYWdhdGluZyBhbnkgZnVydGhlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpdGVtLmdldEF0dHJpYnV0ZSB8fCAhaXRlbS5oYXNBdHRyaWJ1dGUodXRpbGl0eS5BVFRSSUJVVEVfUkVBQ1RJRCkpIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEN1cnJlbnQgZWxlbWVudCBpcyBub3QgYSB2YWxpZCBSZWFjdCBlbGVtZW50IGJlY2F1c2UgaXQgZG9lc24ndCBoYXZlIGFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBSZWFjdCBJRCBkYXRhIGF0dHJpYnV0ZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gQXR0ZW1wdCB0byBmaWVsZCB0aGUgY29tcG9uZW50IGJ5IHRoZSBhc3NvY2lhdGVkIFJlYWN0IElELlxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1vZGVsID0gdGhpcy5maW5kQnlJZChpdGVtLmdldEF0dHJpYnV0ZSh1dGlsaXR5LkFUVFJJQlVURV9SRUFDVElEKSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtb2RlbCAmJiBtb2RlbC5wcm9wZXJ0aWVzKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUcmFuc2Zvcm0gdGhlIGN1cnJlbnQgUmVhY3QgZXZlbnRzIGludG8gbG93ZXIgY2FzZSBrZXlzLCBzbyB0aGF0IHdlIGNhbiBwYWlyIHRoZW1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1cCB3aXRoIHRoZSBldmVudCB0eXBlcy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdHJhbnNmb3JtZWQgPSB0aGlzLnRyYW5zZm9ybUtleXMobW9kZWwucHJvcGVydGllcyk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXZlbnROYW1lIGluIHRyYW5zZm9ybWVkKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgZGVmZXIgdGhlIGludm9jYXRpb24gb2YgdGhlIGV2ZW50IG1ldGhvZCwgYmVjYXVzZSBvdGhlcndpc2UgUmVhY3QuanNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2lsbCByZS1yZW5kZXIsIGFuZCB0aGUgUmVhY3QgSURzIHdpbGwgdGhlbiBiZSBcIm91dCBvZiBzeW5jXCIgZm9yIHRoaXMgZXZlbnQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50TGlzdC5wdXNoKHRyYW5zZm9ybWVkW2V2ZW50TmFtZV0uYmluZChtb2RlbC5jb21wb25lbnQsIGV2ZW50KSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBJbnZva2UgZWFjaCBmb3VuZCBldmVudCBmb3IgdGhlIGV2ZW50IHR5cGUuXG4gICAgICAgICAgICAgICAgICAgIGV2ZW50TGlzdC5mb3JFYWNoKChldmVudEludm9jYXRpb24pID0+IGV2ZW50SW52b2NhdGlvbigpKTtcblxuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICB9XG5cbiAgICB9O1xuXG59KSh3aW5kb3cuZG9jdW1lbnQpOyIsImV4cG9ydCBkZWZhdWx0IChmdW5jdGlvbiBtYWluKCRjb25zb2xlKSB7XG5cbiAgICBcInVzZSBzdHJpY3RcIjtcblxuICAgIHJldHVybiB7XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZXRob2Qgd2FyblxuICAgICAgICAgKiBAcGFyYW0ge1N0cmluZ30gbWVzc2FnZVxuICAgICAgICAgKiBAcmV0dXJuIHt2b2lkfVxuICAgICAgICAgKi9cbiAgICAgICAgd2FybihtZXNzYWdlKSB7XG4gICAgICAgICAgICAkY29uc29sZS5sb2coYE1hcGxlLmp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N0aW9uIG1haW4oKSB7XG5cbiAgICBcInVzZSBzdHJpY3RcIjtcblxuICAgIHJldHVybiB7XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZXRob2QgZ2V0RXh0ZXJuYWxTdHlsZXNcbiAgICAgICAgICogQHBhcmFtIHtIVE1MRWxlbWVudHxIVE1MRG9jdW1lbnR9IGVsZW1lbnRcbiAgICAgICAgICogQHJldHVybiB7QXJyYXl9XG4gICAgICAgICAqL1xuICAgICAgICBnZXRFeHRlcm5hbFN0eWxlcyhlbGVtZW50KSB7XG4gICAgICAgICAgICByZXR1cm4gcXVlcnlBbGwuY2FsbChlbGVtZW50LCAnbGlua1t0eXBlPVwidGV4dC9jc3NcIl0nKTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQG1ldGhvZCBnZXRJbmxpbmVTdHlsZXNcbiAgICAgICAgICogQHBhcmFtIHtIVE1MRWxlbWVudHxIVE1MRG9jdW1lbnR9IGVsZW1lbnRcbiAgICAgICAgICogQHJldHVybiB7QXJyYXl9XG4gICAgICAgICAqL1xuICAgICAgICBnZXRJbmxpbmVTdHlsZXMoZWxlbWVudCkge1xuICAgICAgICAgICAgcmV0dXJuIHF1ZXJ5QWxsLmNhbGwoZWxlbWVudCwgJ3N0eWxlW3R5cGU9XCJ0ZXh0L2Nzc1wiXScpO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbW1ldGhvZCBnZXRMaW5rc1xuICAgICAgICAgKiBAcGFyYW0ge0hUTUxFbGVtZW50fEhUTUxEb2N1bWVudH0gZWxlbWVudFxuICAgICAgICAgKiBAcmV0dXJuIHtBcnJheX1cbiAgICAgICAgICovXG4gICAgICAgIGdldExpbmtzKGVsZW1lbnQpIHtcbiAgICAgICAgICAgIHJldHVybiBxdWVyeUFsbC5jYWxsKGVsZW1lbnQsICdsaW5rW3JlbD1cImltcG9ydFwiXTpub3QoW2RhdGEtaWdub3JlXSknKTtcbiA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yhlbGVtZW50KSksIHV0aWxpdHkudG9BcnJheShqc3hGaWxlcykpO1xuICAgICAgICB9XG5cbiAgICB9O1xuXG59KSgpOyIsImV4cG9ydCBkZWZhdWx0IChmdW5jdGlvbiBtYWluKCRkb2N1bWVudCkge1xuXG4gICAgXCJ1c2Ugc3RyaWN0XCI7XG5cbiAgICAvKipcbiAgICAgKiBAY29uc3RhbnQgV0FJVF9USU1FT1VUXG4gICAgICogQHR5cGUge051bWJlcn1cbiAgICAgKi9cbiAgICBjb25zdCBXQUlUX1RJTUVPVVQgPSAzMDAwMDtcblxuICAgIHJldHVybiB7XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBjb25zdGFudCBBVFRSSUJVVEVfUkVBQ1RJRFxuICAgICAgICAgKiBAdHlwZSB7U3RyaW5nfVxuICAgICAgICAgKi9cbiAgICAgICAgQVRUUklCVVRFX1JFQUNUSUQ6ICdkYXRhLXJlYWN0aWQnLFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWV0aG9kIHJlc29sdmVyXG4gICAgICAgICAqIEBwYXJhbSB7U3RyaW5nfSB1cmxcbiAgICAgICAgICogQHBhcmFtIHtIVE1MRG9jdW1lbnR8bnVsbH0gb3duZXJEb2N1bWVudFxuICAgICAgICAgKiBAcmV0dXJuIHtPYmplY3R9XG4gICAgICAgICAqL1xuICAgICAgICByZXNvbHZlcih1cmwsIG93bmVyRG9jdW1lbnQpIHtcblxuICAgICAgICAgICAgbGV0IGNvbXBvbmVudFBhdGggPSB0aGlzLmdldFBhdGgodXJsKSxcbiAgICAgICAgICAgICAgICBnZXRQYXRoICAgICAgID0gdGhpcy5nZXRQYXRoLmJpbmQodGhpcyksXG4gICAgICAgICAgICAgICAgZ2V0TmFtZSAgICAgICA9IHRoaXMuZ2V0TmFtZS5iaW5kKHRoaXMpO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWV0aG9kIHJlc29sdmVQYXRoXG4gICAgICAgICAgICAgKiBAcGFyYW0ge1N0cmluZ30gcGF0aFxuICAgICAgICAgICAgICogQHBhcmFtIHtIVE1MRG9jdW1lbnR9IG92ZXJyaWRlRG9jdW1lbnRcbiAgICAgICAgICAgICAqIEByZXR1cm4ge1N0cmluZ31cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgZnVuY3Rpb24gcmVzb2x2ZVBhdGgocGF0aCwgb3ZlcnJpZGVEb2N1bWVudCA9ICRkb2N1bWVudCkge1xuICAgICAgICAgICAgICAgIGxldCBhICA9IG92ZXJyaWRlRG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYScpO1xuICAgICAgICAgICAgICAgIGEuaHJlZiA9IHBhdGg7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGEuaHJlZjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHtcblxuICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgICAqIEBwcm9wZXJ0eSBwcm9kdWN0aW9uXG4gICAgICAgICAgICAgICAgICogQHR5cGUge09iamVjdH1cbiAgICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgICBwcm9kdWN0aW9uOiB7XG5cbiAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAqIEBtZXRob2QgZ2V0UGF0aFxuICAgICAgICAgICAgICAgICAgICAgKiBAcGFyYW0ge1N0cmluZ30gcGF0aFxuICAgICAgICAgICAgICAgICAgICAgKiBAcmV0dXJuIHtTdHJpbmd9XG4gICAgICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICBnZXRQYXRoKHBhdGgpIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuaXNMb2NhbFBhdGgocGF0aCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCR7dGhpcy5nZXRBYnNvbHV0ZVBhdGgoKX0vJHtnZXROYW1lKHBhdGgpfWA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXNvbHZlUGF0aChwYXRoLCAkZG9jdW1lbnQpO1xuXG4gICAgICAgICAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAqIEBtZXRob2QgZ2V0U3JjXG4gICAgICAgICAgICAgICAgICAgICAqIEByZXR1cm4ge1N0cmluZ31cbiAgICAgICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgICAgIGdldFNyYyhzcmMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXROYW1lKHNyYyk7XG4gICAgICAgICAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAqIEBtZXRob2QgZ2V0QWJzb2x1dGVQYXRoXG4gICAgICAgICAgICAgICAgICAgICAqIEByZXR1cm4ge1N0cmluZ31cbiAgICAgICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgICAgIGdldEFic29sdXRlUGF0aCgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXNvbHZlUGF0aCh1cmwpO1xuICAgICAgICAgICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgICAgICAgKiBAbWV0aG9kIGdldFJlbGF0aXZlUGF0aFxuICAgICAgICAgICAgICAgICAgICAgKiBAcmV0dXJuIHtTdHJpbmd9XG4gICAgICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICBnZXRSZWxhdGl2ZVBhdGgoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xuICAgICAgICAgICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgICAgICAgKiBAbWV0aG9kIGlzTG9jYWxQYXRoXG4gICAgICAgICAgICAgICAgICAgICAqIEBwYXJhbSB7U3RyaW5nfSBwYXRoXG4gICAgICAgICAgICAgICAgICAgICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAgICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICBpc0xvY2FsUGF0aChwYXRoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gISF+cGF0aC5pbmRleE9mKHVybCk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICAgKiBAcHJvcGVydHkgZGV2ZWxvcG1lbnRcbiAgICAgICAgICAgICAgICAgKiBAdHlwZSB7T2JqZWN0fVxuICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgIGRldmVsb3BtZW50OiB7XG5cbiAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAqIEBtZXRob2QgZ2V0UGF0aFxuICAgICAgICAgICAgICAgICAgICAgKiBAcGFyYW0ge1N0cmluZ30gcGF0aFxuICAgICAgICAgICAgICAgICAgICAgKiBAcmV0dXJuIHtTdHJpbmd9XG4gICAgICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICBnZXRQYXRoKHBhdGgpIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuaXNMb2NhbFBhdGgocGF0aCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCR7dGhpcy5nZXRBYnNvbHV0ZVBhdGgoKX0vJHtwYXRofWA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXNvbHZlUGF0aChwYXRoLCAkZG9jdW1lbnQpO1xuXG4gICAgICAgICAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAqIEBtZXRob2QgZ2V0U3JjXG4gICAgICAgICAgICAgICAgICAgICAqIEByZXR1cm4ge1N0cmluZ31cbiAgICAgICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgICAgIGdldFNyYyhzcmMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcmM7XG4gICAgICAgICAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAqIEBtZXRob2QgZ2V0QWJzb2x1dGVQYXRoXG4gICAgICAgICAgICAgICAgICAgICAqIEByZXR1cm4ge1N0cmluZ31cbiAgICAgICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgICAgIGdldEFic29sdXRlUGF0aCgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXNvbHZlUGF0aChjb21wb25lbnRQYXRoKTtcbiAgICAgICAgICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICAgICAgICogQG1ldGhvZCBnZXRSZWxhdGl2ZVBhdGhcbiAgICAgICAgICAgICAgICAgICAgICogQHJldHVybiB7U3RyaW5nfVxuICAgICAgICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgICAgICAgZ2V0UmVsYXRpdmVQYXRoKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBvbmVudFBhdGg7XG4gICAgICAgICAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICAgICAqIEBtZXRob2QgaXNMb2NhbFBhdGhcbiAgICAgICAgICAgICAgICAgICAgICogQHBhcmFtIHBhdGgge1N0cmluZ31cbiAgICAgICAgICAgICAgICAgICAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICAgICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgICAgIGlzTG9jYWxQYXRoKHBhdGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGggPSBnZXRQYXRoKHJlc29sdmVQYXRoKHBhdGgsIG93bmVyRG9jdW1lbnQpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAhIX5yZXNvbHZlUGF0aChjb21wb25lbnRQYXRoKS5pbmRleE9mKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIH1cblxuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWV0aG9kIHRvQXJyYXlcbiAgICAgICAgICogQHBhcmFtIHsqfSBhcnJheUxpa2VcbiAgICAgICAgICogQHJldHVybiB7QXJyYXl9XG4gICAgICAgICAqL1xuICAgICAgICB0b0FycmF5KGFycmF5TGlrZSkge1xuICAgICAgICAgICAgcmV0dXJuIEFycmF5LmZyb20gPyBBcnJheS5mcm9tKGFycmF5TGlrZSkgOiBBcnJheS5wcm90b3R5cGUuc2xpY2UuYXBwbHkoYXJyYXlMaWtlKTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQG1ldGhvZCBmbGF0dGVuQXJyYXlcbiAgICAgICAgICogQHBhcmFtIHtBcnJheX0gYXJyXG4gICAgICAgICAqIEBwYXJhbSB7QXJyYXl9IFtnaXZlbkFycj1bXV1cbiAgICAgICAgICovXG4gICAgICAgIGZsYXR0ZW5BcnJheShhcnIsIGdpdmVuQXJyID0gW10pIHtcblxuICAgICAgICAgICAgLyoganNoaW50IGlnbm9yZTpzdGFydCAqL1xuXG4gICAgICAgICAgICBhcnIuZm9yRWFjaCgoaXRlbSkgPT4ge1xuICAgICAgICAgICAgICAgIChBcnJheS5pc0FycmF5KGl0ZW0pKSAmJiAodGhpcy5mbGF0dGVuQXJyYXkoaXRlbSwgZ2l2ZW5BcnIpKTtcbiAgICAgICAgICAgICAgICAoIUFycmF5LmlzQXJyY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cmVkIGZvciBvdXIgY3VzdG9tIFJlYWN0IGNvbXBvbmVudC5cbiAgICAgKiBJdCBsaXN0ZW5zIGZvciB3aGVuIHRoZSBjdXN0b20gZWxlbWVudCBoYXMgYmVlbiBpbnNlcnRlZCBpbnRvIHRoZSBET00sIGFuZCB0aGVuIHNldHMgdXAgdGhlIHN0eWxlcywgYXBwbGllc1xuICAgICAqIGRlZmF1bHQgUmVhY3QgcHJvcGVydGllcywgZXRjLi4uXG4gICAgICpcbiAgICAgKiBAbWV0aG9kIGdldEVsZW1lbnRQcm90b3R5cGVcbiAgICAgKiBAcmV0dXJuIHtPYmplY3R9XG4gICAgICovXG4gICAgZ2V0RWxlbWVudFByb3RvdHlwZSgpIHtcblxuICAgICAgICBsZXQgbG9hZFN0eWxlcyA9IHRoaXMubG9hZFN0eWxlcy5iaW5kKHRoaXMpLFxuICAgICAgICAgICAgc2NyaXB0ICAgID0gdGhpcy5zY3JpcHQsXG4gICAgICAgICAgICBwYXRoICAgICAgPSB0aGlzLnBhdGg7XG5cbiAgICAgICAgcmV0dXJuIE9iamVjdC5jcmVhdGUoSFRNTEVsZW1lbnQucHJvdG90eXBlLCB7XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQHByb3BlcnR5IGF0dGFjaGVkQ2FsbGJhY2tcbiAgICAgICAgICAgICAqIEB0eXBlIHtPYmplY3R9XG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGF0dGFjaGVkQ2FsbGJhY2s6IHtcblxuICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgICAqIEBtZXRob2QgdmFsdWVcbiAgICAgICAgICAgICAgICAgKiBAcmV0dXJuIHt2b2lkfVxuICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgIHZhbHVlOiBmdW5jdGlvbiB2YWx1ZSgpIHtcblxuICAgICAgICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICAgICAgICogQG1ldGhvZCBhcHBseURlZmF1bHRQcm9wc1xuICAgICAgICAgICAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gYXR0cmlidXRlc1xuICAgICAgICAgICAgICAgICAgICAgKiBAcmV0dXJuIHt2b2lkfVxuICAgICAgICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gYXBwbHlEZWZhdWx0UHJvcHMoYXR0cmlidXRlcykge1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpbmRleCA9IDA7IGluZGV4IDwgYXR0cmlidXRlcy5sZW5ndGg7IGluZGV4KyspIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdHRyaWJ1dGUgPSBhdHRyaWJ1dGVzLml0ZW0oaW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXBsYWNlciAgPSAvXmRhdGEtL2k7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0cmlidXRlLnZhbHVlKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF0dHJpYnV0ZS5uYW1lID09PSB1dGlsaXR5LkFUVFJJQlVURV9SRUFDVElEKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuYW1lID0gYXR0cmlidXRlLm5hbWUucmVwbGFjZShyZXBsYWNlciwgJycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY3JpcHQuZGVmYXVsdFByb3BzW25hbWVdID0gYXR0cmlidXRlLnZhbHVlO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIEFwcGx5IHByb3BlcnRpZXMgdG8gdGhlIGN1c3RvbSBlbGVtZW50LlxuICAgICAgICAgICAgICAgICAgICBzY3JpcHQuZGVmYXVsdFByb3BzID0geyBwYXRoOiBwYXRoLCBlbGVtZW50OiB0aGlzLmNsb25lTm9kZSh0cnVlKSB9O1xuICAgICAgICAgICAgICAgICAgICBhcHBseURlZmF1bHRQcm9wcy5jYWxsKHRoaXMsIHRoaXMuYXR0cmlidXRlcyk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW5uZXJIVE1MICAgICAgPSAnJztcblxuICAgICAgICAgICAgICAgICAgICAvLyBDb25maWd1cmUgdGhlIFJlYWN0LmpzIGNvbXBvbmVudCwgaW1wb3J0aW5nIGl0IHVuZGVyIHRoZSBzaGFkb3cgYm91bmRhcnkuXG4gICAgICAgICAgICAgICAgICAgIGxldCByZW5kZXJlZEVsZW1lbnQgPSBSZWFjdC5jcmVhdGVFbGVtZW50KHNjcmlwdCksXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50RWxlbWVudCAgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdjb250ZW50JyksXG4gICAgICAgICAgICAgICAgICAgICAgICBzaGFkb3dSb290ICAgICAgPSB0aGlzLmNyZWF0ZVNoYWRvd1Jvb3QoKTtcblxuICAgICAgICAgICAgICAgICAgICBzaGFkb3dSb290LmFwcGVuZENoaWxkKGNvbnRlbnRFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbXBvbmVudCA9IFJlYWN0LnJlbmRlcihyZW5kZXJlZEVsZW1lbnQsIGNvbnRlbnRFbGVtZW50KTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBDb25maWd1cmUgdGhlIGV2ZW50IGRlbGVnYXRpb24gZm9yIHRoZSBjb21wb25lbnQuXG4gICAgICAgICAgICAgICAgICAgIGV2ZW50cy5yZWdpc3RlckNvbXBvbmVudChjb21wb25lbnQpO1xuXG4gICAgICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgICAgICAgKiBJbXBvcnQgZXh0ZXJuYWwgQ1NTIGRvY3VtZW50cyBhbmQgcmVzb2x2ZSBlbGVtZW50LlxuICAgICAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAgICAgKiBAbWV0aG9kIHJlc29sdmVFbGVtZW50XG4gICAgICAgICAgICAgICAgICAgICAqIEByZXR1cm4ge3ZvaWR9XG4gICAgICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiByZXNvbHZlRWxlbWVudCgpIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgUHJvbWlzZS5hbGwobG9hZFN0eWxlcyhzaGFkb3dSb290KSkudGhlbigoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZW1vdmVBdHRyaWJ1dGUoJ3VucmVzb2x2ZWQnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEF0dHJpYnV0ZSgncmVzb2x2ZWQnLCAnJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZUVsZW1lbnQuYXBwbHkodGhpcyk7XG5cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIH1cblxuICAgICAgICB9KTtcblxuICAgIH1cblxufSIsImltcG9ydCBDb21wb25lbnQgZnJvbSAnLi9Db21wb25lbnQuanMnO1xuaW1wb3J0IHV0aWxpdHkgICBmcm9tICcuLy4uL2hlbHBlcnMvVXRpbGl0eS5qcyc7XG5pbXBvcnQgbG9nZ2VyICAgIGZyb20gJy4vLi4vaGVscGVycy9Mb2dnZXIuanMnO1xuaW1wb3J0IHNlbGVjdG9ycyBmcm9tICcuLy4uL2hlbHBlcnMvU2VsZWN0b3JzLmpzJztcbmltcG9ydCB7U3RhdGVNYW5hZ2VyLCBTdGF0ZX0gZnJv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RlRWxlbWVudCkgPT4ge1xuXG4gICAgICAgICAgICBsZXQgdGVtcGxhdGVFbGVtZW50cyA9IHRoaXMuZ2V0VGVtcGxhdGVzKCk7XG5cbiAgICAgICAgICAgIGlmICh0ZW1wbGF0ZUVsZW1lbnRzLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICAgICAgICBsb2dnZXIuZXJyb3IoYENvbXBvbmVudCBcIiR7bGlua0VsZW1lbnQuZ2V0QXR0cmlidXRlKCdocmVmJyl9XCIgaXMgYXR0ZW1wdGluZyB0byByZWdpc3RlciB0d28gY29tcG9uZW50c2ApO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgW3RoaXMuZ2V0VGVtcGxhdGVzKClbMF1dLmZvckVhY2goKHRlbXBsYXRlRWxlbWVudCkgPT4ge1xuXG4gICAgICAgICAgICAgICAgbGV0IHNjcmlwdEVsZW1lbnRzID0gc2VsZWN0b3JzLmdldEFsbFNjcmlwdHModGVtcGxhdGVFbGVtZW50LmNvbnRlbnQpO1xuXG4gICAgICAgICAgICAgICAgc2NyaXB0RWxlbWVudHMubWFwKChzY3JpcHRFbGVtZW50KSA9PiB7XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IHNyYyA9IHNjcmlwdEVsZW1lbnQuZ2V0QXR0cmlidXRlKCdzcmMnKTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMucGF0aC5pc0xvY2FsUGF0aChzcmMpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBsZXQgY29tcG9uZW50ID0gbmV3IENvbXBvbmVudCh0aGlzLnBhdGgsIHRlbXBsYXRlRWxlbWVudCwgc2NyaXB0RWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY29tcG9uZW50cy5wdXNoKGNvbXBvbmVudCk7XG5cbiAgICAgICAgICA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IHtOdW1iZXJ9IHN0YXRlXG4gICAgICogQHJldHVybiB7dm9pZH1cbiAgICAgKi9cbiAgICBzZXRTdGF0ZShzdGF0ZSkge1xuICAgICAgICB0aGlzLnN0YXRlID0gc3RhdGU7XG4gICAgfVxuXG59Il19
|
src/components/CompilationErrorContainer/CompilationErrorContainer.react.js | OpusCapitaBES/js-react-showroom-client | import React, { Component } from 'react';
import './CompilationErrorContainer.less';
/* TO-DO It will be reimplemented in more reactive way when scope component will be removed */
export default
class CompilationErrorContainer extends Component {
constructor(props) {
super(props);
this.state = { error: window._showroom.codeCompilationError };
}
componentWillMount() {
window._showroom = { codeCompilationError: null };
}
componentWillReceiveProps() {
setTimeout(() => {
this.setState({ error: window._showroom.codeCompilationError });
}, 300);
}
render() {
let { error } = this.state;
if (!error) {
return null;
}
return (
<div className="compilation-error-container">
<pre className="compilation-error-container__message">
<code>
{error}
</code>
</pre>
</div>
);
}
}
CompilationErrorContainer.propTypes = {
};
CompilationErrorContainer.defaultProps = {
};
|
src/components/NavigatorMain.js | daskalov/vwm | import React, { Component } from 'react';
import { Navigator } from 'react-native';
import VWM from '../containers/VWM';
import Assessments from './Assessments';
class NavigatorMain extends Component {
navigatorRenderScene(route, navigator) {
const component = {
'VWM':
<VWM route={route} navigator={navigator} />,
'Assessments':
<Assessments route={route} navigator={navigator} />,
}[route.name];
return component;
}
render() {
const initialRoute = {
name: 'VWM'
};
return (
<Navigator
initialRoute={initialRoute}
renderScene={this.navigatorRenderScene.bind(this)}
/>
);
}
}
export default NavigatorMain;
|
src/templates/index-template.js | bodguy/bodguy.github.io | // @flow strict
import React from 'react';
import { graphql } from 'gatsby';
import Layout from '../components/Layout';
import Sidebar from '../components/Sidebar';
import Feed from '../components/Feed';
import Page from '../components/Page';
import Pagination from '../components/Pagination';
import { useSiteMetadata } from '../hooks';
import type { PageContext, AllMarkdownRemark } from '../types';
type Props = {
data: AllMarkdownRemark,
pageContext: PageContext
};
const IndexTemplate = ({ data, pageContext }: Props) => {
const { title: siteTitle, subtitle: siteSubtitle } = useSiteMetadata();
const {
currentPage,
hasNextPage,
hasPrevPage,
prevPagePath,
nextPagePath
} = pageContext;
const { edges } = data.allMarkdownRemark;
const pageTitle = currentPage > 0 ? `Posts - Page ${currentPage} - ${siteTitle}` : siteTitle;
return (
<Layout title={pageTitle} description={siteSubtitle}>
<Sidebar isIndex />
<Page>
<Feed edges={edges} />
<Pagination
prevPagePath={prevPagePath}
nextPagePath={nextPagePath}
hasPrevPage={hasPrevPage}
hasNextPage={hasNextPage}
/>
</Page>
</Layout>
);
};
export const query = graphql`
query IndexTemplate($postsLimit: Int!, $postsOffset: Int!) {
allMarkdownRemark(
limit: $postsLimit,
skip: $postsOffset,
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } },
sort: { order: DESC, fields: [frontmatter___date] }
){
edges {
node {
fields {
slug
categorySlug
}
frontmatter {
title
date
category
description
}
}
}
}
}
`;
export default IndexTemplate;
|
examples/realtime-redux/components/stock-event-list/index.js | vgno/roc-web-react | import React from 'react';
import styles from './style.scss';
import StockEventView from '../stock-event';
export default class StockEventListView extends React.Component {
static propTypes = {
numToDisplay: React.PropTypes.number,
events: React.PropTypes.array.isRequired
};
static defaultProps = {
numToDisplay: 7,
events: []
};
render() {
const events = this.props.events.map((event) => {
return (
<StockEventView
key={event.key}
name={event.TICKER}
current={event.LAST}
diff={event.CHANGE}
/>
);
});
return (
<div className={styles.list}>
{ events }
</div>
);
}
}
|
src/isomorphic/modern/class/ReactComponent.js | cmfcmf/react | /**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ReactComponent
*/
'use strict';
var ReactNoopUpdateQueue = require('ReactNoopUpdateQueue');
var emptyObject = require('emptyObject');
var invariant = require('invariant');
var warning = require('warning');
/**
* Base class helpers for the updating state of a component.
*/
function ReactComponent(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
// We initialize the default updater but the real one gets injected by the
// renderer.
this.updater = updater || ReactNoopUpdateQueue;
}
/**
* Sets a subset of the state. Always use this to mutate
* state. You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* There is no guarantee that calls to `setState` will run synchronously,
* as they may eventually be batched together. You can provide an optional
* callback that will be executed when the call to setState is actually
* completed.
*
* When a function is provided to setState, it will be called at some point in
* the future (not synchronously). It will be called with the up to date
* component arguments (state, props, context). These values can be different
* from this.* because your function may be called after receiveProps but before
* shouldComponentUpdate, and this new state, props, and context will not yet be
* assigned to this.
*
* @param {object|function} partialState Next partial state or function to
* produce next partial state to be merged with current state.
* @param {?function} callback Called after state is updated.
* @final
* @protected
*/
ReactComponent.prototype.setState = function(partialState, callback) {
invariant(
typeof partialState === 'object' ||
typeof partialState === 'function' ||
partialState == null,
'setState(...): takes an object of state variables to update or a ' +
'function which returns an object of state variables.'
);
if (__DEV__) {
warning(
partialState != null,
'setState(...): You passed an undefined or null state object; ' +
'instead, use forceUpdate().'
);
}
this.updater.enqueueSetState(this, partialState);
if (callback) {
this.updater.enqueueCallback(this, callback);
}
};
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {?function} callback Called after update is complete.
* @final
* @protected
*/
ReactComponent.prototype.forceUpdate = function(callback) {
this.updater.enqueueForceUpdate(this);
if (callback) {
this.updater.enqueueCallback(this, callback);
}
};
/**
* Deprecated APIs. These APIs used to exist on classic React classes but since
* we would like to deprecate them, we're not going to move them over to this
* modern base class. Instead, we define a getter that warns if it's accessed.
*/
if (__DEV__) {
var deprecatedAPIs = {
getDOMNode: [
'getDOMNode',
'Use React.findDOMNode(component) instead.',
],
isMounted: [
'isMounted',
'Instead, make sure to clean up subscriptions and pending requests in ' +
'componentWillUnmount to prevent memory leaks.',
],
replaceProps: [
'replaceProps',
'Instead, call React.render again at the top level.',
],
replaceState: [
'replaceState',
'Refactor your code to use setState instead (see ' +
'https://github.com/facebook/react/issues/3236).',
],
setProps: [
'setProps',
'Instead, call React.render again at the top level.',
],
};
var defineDeprecationWarning = function(methodName, info) {
try {
Object.defineProperty(ReactComponent.prototype, methodName, {
get: function() {
warning(
false,
'%s(...) is deprecated in plain JavaScript React classes. %s',
info[0],
info[1]
);
return undefined;
},
});
} catch (x) {
// IE will fail on defineProperty (es5-shim/sham too)
}
};
for (var fnName in deprecatedAPIs) {
if (deprecatedAPIs.hasOwnProperty(fnName)) {
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
}
}
}
module.exports = ReactComponent;
|
ajax/libs/handsontable/0.22.0/handsontable.full.js | x112358/cdnjs | /*!
(The MIT License)
Copyright (c) 2012-2014 Marcin Warpechowski
Copyright (c) 2015 Handsoncode sp. z o.o. <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Handsontable = f()}})(function(){var define,module,exports;return (function init(modules, cache, entry) {
(function outer (modules, cache, entry) {
// Save the require from previous bundle to this closure if any
var previousRequire = typeof require == "function" && require;
var globalNS = JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}') || {};
function newRequire(name, jumped){
if(!cache[name]) {
if(!modules[name]) {
// if we cannot find the the module within our internal map or
// cache jump to the current global require ie. the last bundle
// that was added to the page.
var currentRequire = typeof require == "function" && require;
if (!jumped && currentRequire) return currentRequire(name, true);
// If there are other bundles on this page the require from the
// previous one is saved to 'previousRequire'. Repeat this as
// many times as there are bundles until the module is found or
// we exhaust the require chain.
if (previousRequire) return previousRequire(name, true);
// Try find module from global scope
if (globalNS[name] && typeof window[globalNS[name]] !== 'undefined') {
return window[globalNS[name]];
}
var err = new Error('Cannot find module \'' + name + '\'');
err.code = 'MODULE_NOT_FOUND';
throw err;
}
var m = cache[name] = {exports:{}};
modules[name][0].call(m.exports, function(x){
var id = modules[name][1][x];
return newRequire(id ? id : x);
},m,m.exports,outer,modules,cache,entry);
}
return cache[name].exports;
}
for(var i=0;i<entry.length;i++) newRequire(entry[i]);
// Override the current require with this new one
return newRequire;
})(modules, cache, entry);
return function() {
return Handsontable;
};
})
({1:[function(require,module,exports){
"use strict";
if (window.jQuery) {
(function(window, $, Handsontable) {
$.fn.handsontable = function(action) {
var i,
ilen,
args,
output,
userSettings,
$this = this.first(),
instance = $this.data('handsontable');
if (typeof action !== 'string') {
userSettings = action || {};
if (instance) {
instance.updateSettings(userSettings);
} else {
instance = new Handsontable.Core($this[0], userSettings);
$this.data('handsontable', instance);
instance.init();
}
return $this;
} else {
args = [];
if (arguments.length > 1) {
for (i = 1, ilen = arguments.length; i < ilen; i++) {
args.push(arguments[i]);
}
}
if (instance) {
if (typeof instance[action] !== 'undefined') {
output = instance[action].apply(instance, args);
if (action === 'destroy') {
$this.removeData();
}
} else {
throw new Error('Handsontable do not provide action: ' + action);
}
}
return output;
}
};
})(window, jQuery, Handsontable);
}
//#
},{}],2:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableBorder: {get: function() {
return WalkontableBorder;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__,
$___46__46__47__46__46__47__46__46__47_eventManager__,
$__cell_47_coords__,
$__overlay_47__95_base_46_js__;
var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
getComputedStyle = $__0.getComputedStyle,
getTrimmingContainer = $__0.getTrimmingContainer,
innerWidth = $__0.innerWidth,
innerHeight = $__0.innerHeight,
offset = $__0.offset,
outerHeight = $__0.outerHeight,
outerWidth = $__0.outerWidth;
var stopImmediatePropagation = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation;
var EventManager = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).EventManager;
var WalkontableCellCoords = ($__cell_47_coords__ = require("cell/coords"), $__cell_47_coords__ && $__cell_47_coords__.__esModule && $__cell_47_coords__ || {default: $__cell_47_coords__}).WalkontableCellCoords;
var WalkontableOverlay = ($__overlay_47__95_base_46_js__ = require("overlay/_base.js"), $__overlay_47__95_base_46_js__ && $__overlay_47__95_base_46_js__.__esModule && $__overlay_47__95_base_46_js__ || {default: $__overlay_47__95_base_46_js__}).WalkontableOverlay;
var WalkontableBorder = function WalkontableBorder(wotInstance, settings) {
if (!settings) {
return;
}
this.eventManager = new EventManager(wotInstance);
this.instance = wotInstance;
this.wot = wotInstance;
this.settings = settings;
this.mouseDown = false;
this.main = null;
this.top = null;
this.left = null;
this.bottom = null;
this.right = null;
this.topStyle = null;
this.leftStyle = null;
this.bottomStyle = null;
this.rightStyle = null;
this.cornerDefaultStyle = {
width: '5px',
height: '5px',
borderWidth: '2px',
borderStyle: 'solid',
borderColor: '#FFF'
};
this.corner = null;
this.cornerStyle = null;
this.createBorders(settings);
this.registerListeners();
};
($traceurRuntime.createClass)(WalkontableBorder, {
registerListeners: function() {
var $__5 = this;
this.eventManager.addEventListener(document.body, 'mousedown', (function() {
return $__5.onMouseDown();
}));
this.eventManager.addEventListener(document.body, 'mouseup', (function() {
return $__5.onMouseUp();
}));
var $__7 = this,
$__8 = function(c, len) {
$__7.eventManager.addEventListener($__7.main.childNodes[c], 'mouseenter', (function(event) {
return $__5.onMouseEnter(event, $__5.main.childNodes[c]);
}));
};
for (var c = 0,
len = this.main.childNodes.length; c < len; c++) {
$__8(c, len);
}
},
onMouseDown: function() {
this.mouseDown = true;
},
onMouseUp: function() {
this.mouseDown = false;
},
onMouseEnter: function(event, parentElement) {
if (!this.mouseDown || !this.wot.getSetting('hideBorderOnMouseDownOver')) {
return;
}
event.preventDefault();
stopImmediatePropagation(event);
var _this = this;
var bounds = parentElement.getBoundingClientRect();
parentElement.style.display = 'none';
function isOutside(event) {
if (event.clientY < Math.floor(bounds.top)) {
return true;
}
if (event.clientY > Math.ceil(bounds.top + bounds.height)) {
return true;
}
if (event.clientX < Math.floor(bounds.left)) {
return true;
}
if (event.clientX > Math.ceil(bounds.left + bounds.width)) {
return true;
}
}
function handler(event) {
if (isOutside(event)) {
_this.eventManager.removeEventListener(document.body, 'mousemove', handler);
parentElement.style.display = 'block';
}
}
this.eventManager.addEventListener(document.body, 'mousemove', handler);
},
createBorders: function(settings) {
this.main = document.createElement('div');
var borderDivs = ['top', 'left', 'bottom', 'right', 'corner'];
var style = this.main.style;
style.position = 'absolute';
style.top = 0;
style.left = 0;
for (var i = 0; i < 5; i++) {
var position = borderDivs[i];
var div = document.createElement('div');
div.className = 'wtBorder ' + (this.settings.className || '');
if (this.settings[position] && this.settings[position].hide) {
div.className += ' hidden';
}
style = div.style;
style.backgroundColor = (this.settings[position] && this.settings[position].color) ? this.settings[position].color : settings.border.color;
style.height = (this.settings[position] && this.settings[position].width) ? this.settings[position].width + 'px' : settings.border.width + 'px';
style.width = (this.settings[position] && this.settings[position].width) ? this.settings[position].width + 'px' : settings.border.width + 'px';
this.main.appendChild(div);
}
this.top = this.main.childNodes[0];
this.left = this.main.childNodes[1];
this.bottom = this.main.childNodes[2];
this.right = this.main.childNodes[3];
this.topStyle = this.top.style;
this.leftStyle = this.left.style;
this.bottomStyle = this.bottom.style;
this.rightStyle = this.right.style;
this.corner = this.main.childNodes[4];
this.corner.className += ' corner';
this.cornerStyle = this.corner.style;
this.cornerStyle.width = this.cornerDefaultStyle.width;
this.cornerStyle.height = this.cornerDefaultStyle.height;
this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');
if (Handsontable.mobileBrowser) {
this.createMultipleSelectorHandles();
}
this.disappear();
if (!this.wot.wtTable.bordersHolder) {
this.wot.wtTable.bordersHolder = document.createElement('div');
this.wot.wtTable.bordersHolder.className = 'htBorders';
this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder);
}
this.wot.wtTable.bordersHolder.insertBefore(this.main, this.wot.wtTable.bordersHolder.firstChild);
},
createMultipleSelectorHandles: function() {
this.selectionHandles = {
topLeft: document.createElement('DIV'),
topLeftHitArea: document.createElement('DIV'),
bottomRight: document.createElement('DIV'),
bottomRightHitArea: document.createElement('DIV')
};
var width = 10;
var hitAreaWidth = 40;
this.selectionHandles.topLeft.className = 'topLeftSelectionHandle';
this.selectionHandles.topLeftHitArea.className = 'topLeftSelectionHandle-HitArea';
this.selectionHandles.bottomRight.className = 'bottomRightSelectionHandle';
this.selectionHandles.bottomRightHitArea.className = 'bottomRightSelectionHandle-HitArea';
this.selectionHandles.styles = {
topLeft: this.selectionHandles.topLeft.style,
topLeftHitArea: this.selectionHandles.topLeftHitArea.style,
bottomRight: this.selectionHandles.bottomRight.style,
bottomRightHitArea: this.selectionHandles.bottomRightHitArea.style
};
var hitAreaStyle = {
position: 'absolute',
height: hitAreaWidth + 'px',
width: hitAreaWidth + 'px',
'border-radius': parseInt(hitAreaWidth / 1.5, 10) + 'px'
};
for (var prop in hitAreaStyle) {
if (hitAreaStyle.hasOwnProperty(prop)) {
this.selectionHandles.styles.bottomRightHitArea[prop] = hitAreaStyle[prop];
this.selectionHandles.styles.topLeftHitArea[prop] = hitAreaStyle[prop];
}
}
var handleStyle = {
position: 'absolute',
height: width + 'px',
width: width + 'px',
'border-radius': parseInt(width / 1.5, 10) + 'px',
background: '#F5F5FF',
border: '1px solid #4285c8'
};
for (var prop$__9 in handleStyle) {
if (handleStyle.hasOwnProperty(prop$__9)) {
this.selectionHandles.styles.bottomRight[prop$__9] = handleStyle[prop$__9];
this.selectionHandles.styles.topLeft[prop$__9] = handleStyle[prop$__9];
}
}
this.main.appendChild(this.selectionHandles.topLeft);
this.main.appendChild(this.selectionHandles.bottomRight);
this.main.appendChild(this.selectionHandles.topLeftHitArea);
this.main.appendChild(this.selectionHandles.bottomRightHitArea);
},
isPartRange: function(row, col) {
if (this.wot.selections.area.cellRange) {
if (row != this.wot.selections.area.cellRange.to.row || col != this.wot.selections.area.cellRange.to.col) {
return true;
}
}
return false;
},
updateMultipleSelectionHandlesPosition: function(row, col, top, left, width, height) {
var handleWidth = parseInt(this.selectionHandles.styles.topLeft.width, 10);
var hitAreaWidth = parseInt(this.selectionHandles.styles.topLeftHitArea.width, 10);
this.selectionHandles.styles.topLeft.top = parseInt(top - handleWidth, 10) + 'px';
this.selectionHandles.styles.topLeft.left = parseInt(left - handleWidth, 10) + 'px';
this.selectionHandles.styles.topLeftHitArea.top = parseInt(top - (hitAreaWidth / 4) * 3, 10) + 'px';
this.selectionHandles.styles.topLeftHitArea.left = parseInt(left - (hitAreaWidth / 4) * 3, 10) + 'px';
this.selectionHandles.styles.bottomRight.top = parseInt(top + height, 10) + 'px';
this.selectionHandles.styles.bottomRight.left = parseInt(left + width, 10) + 'px';
this.selectionHandles.styles.bottomRightHitArea.top = parseInt(top + height - hitAreaWidth / 4, 10) + 'px';
this.selectionHandles.styles.bottomRightHitArea.left = parseInt(left + width - hitAreaWidth / 4, 10) + 'px';
if (this.settings.border.multipleSelectionHandlesVisible && this.settings.border.multipleSelectionHandlesVisible()) {
this.selectionHandles.styles.topLeft.display = 'block';
this.selectionHandles.styles.topLeftHitArea.display = 'block';
if (this.isPartRange(row, col)) {
this.selectionHandles.styles.bottomRight.display = 'none';
this.selectionHandles.styles.bottomRightHitArea.display = 'none';
} else {
this.selectionHandles.styles.bottomRight.display = 'block';
this.selectionHandles.styles.bottomRightHitArea.display = 'block';
}
} else {
this.selectionHandles.styles.topLeft.display = 'none';
this.selectionHandles.styles.bottomRight.display = 'none';
this.selectionHandles.styles.topLeftHitArea.display = 'none';
this.selectionHandles.styles.bottomRightHitArea.display = 'none';
}
if (row == this.wot.wtSettings.getSetting('fixedRowsTop') || col == this.wot.wtSettings.getSetting('fixedColumnsLeft')) {
this.selectionHandles.styles.topLeft.zIndex = '9999';
this.selectionHandles.styles.topLeftHitArea.zIndex = '9999';
} else {
this.selectionHandles.styles.topLeft.zIndex = '';
this.selectionHandles.styles.topLeftHitArea.zIndex = '';
}
},
appear: function(corners) {
if (this.disabled) {
return;
}
var isMultiple,
fromTD,
toTD,
fromOffset,
toOffset,
containerOffset,
top,
minTop,
left,
minLeft,
height,
width,
fromRow,
fromColumn,
toRow,
toColumn,
trimmingContainer,
cornerOverlappingContainer,
ilen;
ilen = this.wot.wtTable.getRenderedRowsCount();
for (var i = 0; i < ilen; i++) {
var s = this.wot.wtTable.rowFilter.renderedToSource(i);
if (s >= corners[0] && s <= corners[2]) {
fromRow = s;
break;
}
}
for (var i$__10 = ilen - 1; i$__10 >= 0; i$__10--) {
var s$__11 = this.wot.wtTable.rowFilter.renderedToSource(i$__10);
if (s$__11 >= corners[0] && s$__11 <= corners[2]) {
toRow = s$__11;
break;
}
}
ilen = this.wot.wtTable.getRenderedColumnsCount();
for (var i$__12 = 0; i$__12 < ilen; i$__12++) {
var s$__13 = this.wot.wtTable.columnFilter.renderedToSource(i$__12);
if (s$__13 >= corners[1] && s$__13 <= corners[3]) {
fromColumn = s$__13;
break;
}
}
for (var i$__14 = ilen - 1; i$__14 >= 0; i$__14--) {
var s$__15 = this.wot.wtTable.columnFilter.renderedToSource(i$__14);
if (s$__15 >= corners[1] && s$__15 <= corners[3]) {
toColumn = s$__15;
break;
}
}
if (fromRow === void 0 || fromColumn === void 0) {
this.disappear();
return;
}
isMultiple = (fromRow !== toRow || fromColumn !== toColumn);
fromTD = this.wot.wtTable.getCell(new WalkontableCellCoords(fromRow, fromColumn));
toTD = isMultiple ? this.wot.wtTable.getCell(new WalkontableCellCoords(toRow, toColumn)) : fromTD;
fromOffset = offset(fromTD);
toOffset = isMultiple ? offset(toTD) : fromOffset;
containerOffset = offset(this.wot.wtTable.TABLE);
minTop = fromOffset.top;
height = toOffset.top + outerHeight(toTD) - minTop;
minLeft = fromOffset.left;
width = toOffset.left + outerWidth(toTD) - minLeft;
top = minTop - containerOffset.top - 1;
left = minLeft - containerOffset.left - 1;
var style = getComputedStyle(fromTD);
if (parseInt(style.borderTopWidth, 10) > 0) {
top += 1;
height = height > 0 ? height - 1 : 0;
}
if (parseInt(style.borderLeftWidth, 10) > 0) {
left += 1;
width = width > 0 ? width - 1 : 0;
}
this.topStyle.top = top + 'px';
this.topStyle.left = left + 'px';
this.topStyle.width = width + 'px';
this.topStyle.display = 'block';
this.leftStyle.top = top + 'px';
this.leftStyle.left = left + 'px';
this.leftStyle.height = height + 'px';
this.leftStyle.display = 'block';
var delta = Math.floor(this.settings.border.width / 2);
this.bottomStyle.top = top + height - delta + 'px';
this.bottomStyle.left = left + 'px';
this.bottomStyle.width = width + 'px';
this.bottomStyle.display = 'block';
this.rightStyle.top = top + 'px';
this.rightStyle.left = left + width - delta + 'px';
this.rightStyle.height = height + 1 + 'px';
this.rightStyle.display = 'block';
if (Handsontable.mobileBrowser || (!this.hasSetting(this.settings.border.cornerVisible) || this.isPartRange(toRow, toColumn))) {
this.cornerStyle.display = 'none';
} else {
this.cornerStyle.top = top + height - 4 + 'px';
this.cornerStyle.left = left + width - 4 + 'px';
this.cornerStyle.borderRightWidth = this.cornerDefaultStyle.borderWidth;
this.cornerStyle.width = this.cornerDefaultStyle.width;
this.cornerStyle.display = 'block';
trimmingContainer = getTrimmingContainer(this.wot.wtTable.TABLE);
if (toColumn === this.wot.getSetting('totalColumns') - 1) {
cornerOverlappingContainer = toTD.offsetLeft + outerWidth(toTD) >= innerWidth(trimmingContainer);
if (cornerOverlappingContainer) {
this.cornerStyle.left = Math.floor(left + width - 3 - parseInt(this.cornerDefaultStyle.width) / 2) + 'px';
this.cornerStyle.borderRightWidth = 0;
}
}
if (toRow === this.wot.getSetting('totalRows') - 1) {
cornerOverlappingContainer = toTD.offsetTop + outerHeight(toTD) >= innerHeight(trimmingContainer);
if (cornerOverlappingContainer) {
this.cornerStyle.top = Math.floor(top + height - 3 - parseInt(this.cornerDefaultStyle.height) / 2) + 'px';
this.cornerStyle.borderBottomWidth = 0;
}
}
}
if (Handsontable.mobileBrowser) {
this.updateMultipleSelectionHandlesPosition(fromRow, fromColumn, top, left, width, height);
}
},
disappear: function() {
this.topStyle.display = 'none';
this.leftStyle.display = 'none';
this.bottomStyle.display = 'none';
this.rightStyle.display = 'none';
this.cornerStyle.display = 'none';
if (Handsontable.mobileBrowser) {
this.selectionHandles.styles.topLeft.display = 'none';
this.selectionHandles.styles.bottomRight.display = 'none';
}
},
hasSetting: function(setting) {
if (typeof setting === 'function') {
return setting();
}
return !!setting;
}
}, {});
;
window.WalkontableBorder = WalkontableBorder;
//#
},{"cell/coords":5,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableViewportColumnsCalculator: {get: function() {
return WalkontableViewportColumnsCalculator;
}},
__esModule: {value: true}
});
var privatePool = new WeakMap();
var WalkontableViewportColumnsCalculator = function WalkontableViewportColumnsCalculator(viewportWidth, scrollOffset, totalColumns, columnWidthFn, overrideFn, onlyFullyVisible, stretchH) {
var stretchingColumnWidthFn = arguments[7] !== (void 0) ? arguments[7] : (function(width) {
return width;
});
privatePool.set(this, {
viewportWidth: viewportWidth,
scrollOffset: scrollOffset,
totalColumns: totalColumns,
columnWidthFn: columnWidthFn,
overrideFn: overrideFn,
onlyFullyVisible: onlyFullyVisible,
stretchingColumnWidthFn: stretchingColumnWidthFn
});
this.count = 0;
this.startColumn = null;
this.endColumn = null;
this.startPosition = null;
this.stretchAllRatio = 0;
this.stretchLastWidth = 0;
this.stretch = stretchH;
this.totalTargetWidth = 0;
this.needVerifyLastColumnWidth = true;
this.stretchAllColumnsWidth = [];
this.calculate();
};
var $WalkontableViewportColumnsCalculator = WalkontableViewportColumnsCalculator;
($traceurRuntime.createClass)(WalkontableViewportColumnsCalculator, {
calculate: function() {
var sum = 0;
var needReverse = true;
var startPositions = [];
var columnWidth;
var priv = privatePool.get(this);
var onlyFullyVisible = priv.onlyFullyVisible;
var overrideFn = priv.overrideFn;
var scrollOffset = priv.scrollOffset;
var totalColumns = priv.totalColumns;
var viewportWidth = priv.viewportWidth;
for (var i = 0; i < totalColumns; i++) {
columnWidth = this._getColumnWidth(i);
if (sum <= scrollOffset && !onlyFullyVisible) {
this.startColumn = i;
}
if (sum >= scrollOffset && sum + columnWidth <= scrollOffset + viewportWidth) {
if (this.startColumn == null) {
this.startColumn = i;
}
this.endColumn = i;
}
startPositions.push(sum);
sum += columnWidth;
if (!onlyFullyVisible) {
this.endColumn = i;
}
if (sum >= scrollOffset + viewportWidth) {
needReverse = false;
break;
}
}
if (this.endColumn === totalColumns - 1 && needReverse) {
this.startColumn = this.endColumn;
while (this.startColumn > 0) {
var viewportSum = startPositions[this.endColumn] + columnWidth - startPositions[this.startColumn - 1];
if (viewportSum <= viewportWidth || !onlyFullyVisible) {
this.startColumn--;
}
if (viewportSum > viewportWidth) {
break;
}
}
}
if (this.startColumn !== null && overrideFn) {
overrideFn(this);
}
this.startPosition = startPositions[this.startColumn];
if (this.startPosition == void 0) {
this.startPosition = null;
}
if (this.startColumn !== null) {
this.count = this.endColumn - this.startColumn + 1;
}
},
refreshStretching: function(totalWidth) {
if (this.stretch === 'none') {
return;
}
this.totalTargetWidth = totalWidth;
var priv = privatePool.get(this);
var totalColumns = priv.totalColumns;
var sumAll = 0;
for (var i = 0; i < totalColumns; i++) {
var columnWidth = this._getColumnWidth(i);
var permanentColumnWidth = priv.stretchingColumnWidthFn(void 0, i);
if (typeof permanentColumnWidth === 'number') {
totalWidth -= permanentColumnWidth;
} else {
sumAll += columnWidth;
}
}
var remainingSize = totalWidth - sumAll;
if (this.stretch === 'all' && remainingSize > 0) {
this.stretchAllRatio = totalWidth / sumAll;
this.stretchAllColumnsWidth = [];
this.needVerifyLastColumnWidth = true;
} else if (this.stretch === 'last' && totalWidth !== Infinity) {
var columnWidth$__1 = this._getColumnWidth(totalColumns - 1);
var lastColumnWidth = remainingSize + columnWidth$__1;
this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth$__1;
}
},
getStretchedColumnWidth: function(column, baseWidth) {
var result = null;
if (this.stretch === 'all' && this.stretchAllRatio !== 0) {
result = this._getStretchedAllColumnWidth(column, baseWidth);
} else if (this.stretch === 'last' && this.stretchLastWidth !== 0) {
result = this._getStretchedLastColumnWidth(column);
}
return result;
},
_getStretchedAllColumnWidth: function(column, baseWidth) {
var sumRatioWidth = 0;
var priv = privatePool.get(this);
var totalColumns = priv.totalColumns;
if (!this.stretchAllColumnsWidth[column]) {
var stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);
var newStretchedWidth = priv.stretchingColumnWidthFn(stretchedWidth, column);
if (newStretchedWidth === void 0) {
this.stretchAllColumnsWidth[column] = stretchedWidth;
} else {
this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;
}
}
if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) {
this.needVerifyLastColumnWidth = false;
for (var i = 0; i < this.stretchAllColumnsWidth.length; i++) {
sumRatioWidth += this.stretchAllColumnsWidth[i];
}
if (sumRatioWidth !== this.totalTargetWidth) {
this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += this.totalTargetWidth - sumRatioWidth;
}
}
return this.stretchAllColumnsWidth[column];
},
_getStretchedLastColumnWidth: function(column) {
var priv = privatePool.get(this);
var totalColumns = priv.totalColumns;
if (column === totalColumns - 1) {
return this.stretchLastWidth;
}
return null;
},
_getColumnWidth: function(column) {
var width = privatePool.get(this).columnWidthFn(column);
if (width === void 0) {
width = $WalkontableViewportColumnsCalculator.DEFAULT_WIDTH;
}
return width;
}
}, {get DEFAULT_WIDTH() {
return 50;
}});
;
window.WalkontableViewportColumnsCalculator = WalkontableViewportColumnsCalculator;
//#
},{}],4:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableViewportRowsCalculator: {get: function() {
return WalkontableViewportRowsCalculator;
}},
__esModule: {value: true}
});
var privatePool = new WeakMap();
var WalkontableViewportRowsCalculator = function WalkontableViewportRowsCalculator(viewportHeight, scrollOffset, totalRows, rowHeightFn, overrideFn, onlyFullyVisible, horizontalScrollbarHeight) {
privatePool.set(this, {
viewportHeight: viewportHeight,
scrollOffset: scrollOffset,
totalRows: totalRows,
rowHeightFn: rowHeightFn,
overrideFn: overrideFn,
onlyFullyVisible: onlyFullyVisible,
horizontalScrollbarHeight: horizontalScrollbarHeight
});
this.count = 0;
this.startRow = null;
this.endRow = null;
this.startPosition = null;
this.calculate();
};
var $WalkontableViewportRowsCalculator = WalkontableViewportRowsCalculator;
($traceurRuntime.createClass)(WalkontableViewportRowsCalculator, {calculate: function() {
var sum = 0;
var needReverse = true;
var startPositions = [];
var priv = privatePool.get(this);
var onlyFullyVisible = priv.onlyFullyVisible;
var overrideFn = priv.overrideFn;
var rowHeightFn = priv.rowHeightFn;
var scrollOffset = priv.scrollOffset;
var totalRows = priv.totalRows;
var viewportHeight = priv.viewportHeight;
var horizontalScrollbarHeight = priv.horizontalScrollbarHeight || 0;
for (var i = 0; i < totalRows; i++) {
var rowHeight = rowHeightFn(i);
if (rowHeight === undefined) {
rowHeight = $WalkontableViewportRowsCalculator.DEFAULT_HEIGHT;
}
if (sum <= scrollOffset && !onlyFullyVisible) {
this.startRow = i;
}
if (sum >= scrollOffset && sum + rowHeight <= scrollOffset + viewportHeight - horizontalScrollbarHeight) {
if (this.startRow === null) {
this.startRow = i;
}
this.endRow = i;
}
startPositions.push(sum);
sum += rowHeight;
if (!onlyFullyVisible) {
this.endRow = i;
}
if (sum >= scrollOffset + viewportHeight - horizontalScrollbarHeight) {
needReverse = false;
break;
}
}
if (this.endRow === totalRows - 1 && needReverse) {
this.startRow = this.endRow;
while (this.startRow > 0) {
var viewportSum = startPositions[this.endRow] + rowHeight - startPositions[this.startRow - 1];
if (viewportSum <= viewportHeight - horizontalScrollbarHeight || !onlyFullyVisible) {
this.startRow--;
}
if (viewportSum >= viewportHeight - horizontalScrollbarHeight) {
break;
}
}
}
if (this.startRow !== null && overrideFn) {
overrideFn(this);
}
this.startPosition = startPositions[this.startRow];
if (this.startPosition == void 0) {
this.startPosition = null;
}
if (this.startRow !== null) {
this.count = this.endRow - this.startRow + 1;
}
}}, {get DEFAULT_HEIGHT() {
return 23;
}});
;
window.WalkontableViewportRowsCalculator = WalkontableViewportRowsCalculator;
//#
},{}],5:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableCellCoords: {get: function() {
return WalkontableCellCoords;
}},
__esModule: {value: true}
});
var WalkontableCellCoords = function WalkontableCellCoords(row, col) {
if (typeof row !== 'undefined' && typeof col !== 'undefined') {
this.row = row;
this.col = col;
} else {
this.row = null;
this.col = null;
}
};
($traceurRuntime.createClass)(WalkontableCellCoords, {
isValid: function(wotInstance) {
if (this.row < 0 || this.col < 0) {
return false;
}
if (this.row >= wotInstance.getSetting('totalRows') || this.col >= wotInstance.getSetting('totalColumns')) {
return false;
}
return true;
},
isEqual: function(cellCoords) {
if (cellCoords === this) {
return true;
}
return this.row === cellCoords.row && this.col === cellCoords.col;
},
isSouthEastOf: function(testedCoords) {
return this.row >= testedCoords.row && this.col >= testedCoords.col;
},
isNorthWestOf: function(testedCoords) {
return this.row <= testedCoords.row && this.col <= testedCoords.col;
},
isSouthWestOf: function(testedCoords) {
return this.row >= testedCoords.row && this.col <= testedCoords.col;
},
isNorthEastOf: function(testedCoords) {
return this.row <= testedCoords.row && this.col >= testedCoords.col;
}
}, {});
;
window.WalkontableCellCoords = WalkontableCellCoords;
//#
},{}],6:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableCellRange: {get: function() {
return WalkontableCellRange;
}},
__esModule: {value: true}
});
var $___46__46__47_cell_47_coords__;
var WalkontableCellCoords = ($___46__46__47_cell_47_coords__ = require("cell/coords"), $___46__46__47_cell_47_coords__ && $___46__46__47_cell_47_coords__.__esModule && $___46__46__47_cell_47_coords__ || {default: $___46__46__47_cell_47_coords__}).WalkontableCellCoords;
var WalkontableCellRange = function WalkontableCellRange(highlight, from, to) {
this.highlight = highlight;
this.from = from;
this.to = to;
};
var $WalkontableCellRange = WalkontableCellRange;
($traceurRuntime.createClass)(WalkontableCellRange, {
isValid: function(wotInstance) {
return this.from.isValid(wotInstance) && this.to.isValid(wotInstance);
},
isSingle: function() {
return this.from.row === this.to.row && this.from.col === this.to.col;
},
getHeight: function() {
return Math.max(this.from.row, this.to.row) - Math.min(this.from.row, this.to.row) + 1;
},
getWidth: function() {
return Math.max(this.from.col, this.to.col) - Math.min(this.from.col, this.to.col) + 1;
},
includes: function(cellCoords) {
var topLeft = this.getTopLeftCorner();
var bottomRight = this.getBottomRightCorner();
if (cellCoords.row < 0) {
cellCoords.row = 0;
}
if (cellCoords.col < 0) {
cellCoords.col = 0;
}
return topLeft.row <= cellCoords.row && bottomRight.row >= cellCoords.row && topLeft.col <= cellCoords.col && bottomRight.col >= cellCoords.col;
},
includesRange: function(testedRange) {
return this.includes(testedRange.getTopLeftCorner()) && this.includes(testedRange.getBottomRightCorner());
},
isEqual: function(testedRange) {
return (Math.min(this.from.row, this.to.row) == Math.min(testedRange.from.row, testedRange.to.row)) && (Math.max(this.from.row, this.to.row) == Math.max(testedRange.from.row, testedRange.to.row)) && (Math.min(this.from.col, this.to.col) == Math.min(testedRange.from.col, testedRange.to.col)) && (Math.max(this.from.col, this.to.col) == Math.max(testedRange.from.col, testedRange.to.col));
},
overlaps: function(testedRange) {
return testedRange.isSouthEastOf(this.getTopLeftCorner()) && testedRange.isNorthWestOf(this.getBottomRightCorner());
},
isSouthEastOf: function(testedCoords) {
return this.getTopLeftCorner().isSouthEastOf(testedCoords) || this.getBottomRightCorner().isSouthEastOf(testedCoords);
},
isNorthWestOf: function(testedCoords) {
return this.getTopLeftCorner().isNorthWestOf(testedCoords) || this.getBottomRightCorner().isNorthWestOf(testedCoords);
},
expand: function(cellCoords) {
var topLeft = this.getTopLeftCorner();
var bottomRight = this.getBottomRightCorner();
if (cellCoords.row < topLeft.row || cellCoords.col < topLeft.col || cellCoords.row > bottomRight.row || cellCoords.col > bottomRight.col) {
this.from = new WalkontableCellCoords(Math.min(topLeft.row, cellCoords.row), Math.min(topLeft.col, cellCoords.col));
this.to = new WalkontableCellCoords(Math.max(bottomRight.row, cellCoords.row), Math.max(bottomRight.col, cellCoords.col));
return true;
}
return false;
},
expandByRange: function(expandingRange) {
if (this.includesRange(expandingRange) || !this.overlaps(expandingRange)) {
return false;
}
var topLeft = this.getTopLeftCorner();
var bottomRight = this.getBottomRightCorner();
var topRight = this.getTopRightCorner();
var bottomLeft = this.getBottomLeftCorner();
var expandingTopLeft = expandingRange.getTopLeftCorner();
var expandingBottomRight = expandingRange.getBottomRightCorner();
var resultTopRow = Math.min(topLeft.row, expandingTopLeft.row);
var resultTopCol = Math.min(topLeft.col, expandingTopLeft.col);
var resultBottomRow = Math.max(bottomRight.row, expandingBottomRight.row);
var resultBottomCol = Math.max(bottomRight.col, expandingBottomRight.col);
var finalFrom = new WalkontableCellCoords(resultTopRow, resultTopCol),
finalTo = new WalkontableCellCoords(resultBottomRow, resultBottomCol);
var isCorner = new $WalkontableCellRange(finalFrom, finalFrom, finalTo).isCorner(this.from, expandingRange),
onlyMerge = expandingRange.isEqual(new $WalkontableCellRange(finalFrom, finalFrom, finalTo));
if (isCorner && !onlyMerge) {
if (this.from.col > finalFrom.col) {
finalFrom.col = resultBottomCol;
finalTo.col = resultTopCol;
}
if (this.from.row > finalFrom.row) {
finalFrom.row = resultBottomRow;
finalTo.row = resultTopRow;
}
}
this.from = finalFrom;
this.to = finalTo;
return true;
},
getDirection: function() {
if (this.from.isNorthWestOf(this.to)) {
return 'NW-SE';
} else if (this.from.isNorthEastOf(this.to)) {
return 'NE-SW';
} else if (this.from.isSouthEastOf(this.to)) {
return 'SE-NW';
} else if (this.from.isSouthWestOf(this.to)) {
return 'SW-NE';
}
},
setDirection: function(direction) {
switch (direction) {
case 'NW-SE':
this.from = this.getTopLeftCorner();
this.to = this.getBottomRightCorner();
break;
case 'NE-SW':
this.from = this.getTopRightCorner();
this.to = this.getBottomLeftCorner();
break;
case 'SE-NW':
this.from = this.getBottomRightCorner();
this.to = this.getTopLeftCorner();
break;
case 'SW-NE':
this.from = this.getBottomLeftCorner();
this.to = this.getTopRightCorner();
break;
}
},
getTopLeftCorner: function() {
return new WalkontableCellCoords(Math.min(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));
},
getBottomRightCorner: function() {
return new WalkontableCellCoords(Math.max(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));
},
getTopRightCorner: function() {
return new WalkontableCellCoords(Math.min(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));
},
getBottomLeftCorner: function() {
return new WalkontableCellCoords(Math.max(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));
},
isCorner: function(coords, expandedRange) {
if (expandedRange) {
if (expandedRange.includes(coords)) {
if (this.getTopLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.from.col)) || this.getTopRightCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.to.col)) || this.getBottomLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.from.col)) || this.getBottomRightCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.to.col))) {
return true;
}
}
}
return coords.isEqual(this.getTopLeftCorner()) || coords.isEqual(this.getTopRightCorner()) || coords.isEqual(this.getBottomLeftCorner()) || coords.isEqual(this.getBottomRightCorner());
},
getOppositeCorner: function(coords, expandedRange) {
if (!(coords instanceof WalkontableCellCoords)) {
return false;
}
if (expandedRange) {
if (expandedRange.includes(coords)) {
if (this.getTopLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.from.col))) {
return this.getBottomRightCorner();
}
if (this.getTopRightCorner().isEqual(new WalkontableCellCoords(expandedRange.from.row, expandedRange.to.col))) {
return this.getBottomLeftCorner();
}
if (this.getBottomLeftCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.from.col))) {
return this.getTopRightCorner();
}
if (this.getBottomRightCorner().isEqual(new WalkontableCellCoords(expandedRange.to.row, expandedRange.to.col))) {
return this.getTopLeftCorner();
}
}
}
if (coords.isEqual(this.getBottomRightCorner())) {
return this.getTopLeftCorner();
} else if (coords.isEqual(this.getTopLeftCorner())) {
return this.getBottomRightCorner();
} else if (coords.isEqual(this.getTopRightCorner())) {
return this.getBottomLeftCorner();
} else if (coords.isEqual(this.getBottomLeftCorner())) {
return this.getTopRightCorner();
}
},
getBordersSharedWith: function(range) {
if (!this.includesRange(range)) {
return [];
}
var thisBorders = {
top: Math.min(this.from.row, this.to.row),
bottom: Math.max(this.from.row, this.to.row),
left: Math.min(this.from.col, this.to.col),
right: Math.max(this.from.col, this.to.col)
};
var rangeBorders = {
top: Math.min(range.from.row, range.to.row),
bottom: Math.max(range.from.row, range.to.row),
left: Math.min(range.from.col, range.to.col),
right: Math.max(range.from.col, range.to.col)
};
var result = [];
if (thisBorders.top == rangeBorders.top) {
result.push('top');
}
if (thisBorders.right == rangeBorders.right) {
result.push('right');
}
if (thisBorders.bottom == rangeBorders.bottom) {
result.push('bottom');
}
if (thisBorders.left == rangeBorders.left) {
result.push('left');
}
return result;
},
getInner: function() {
var topLeft = this.getTopLeftCorner();
var bottomRight = this.getBottomRightCorner();
var out = [];
for (var r = topLeft.row; r <= bottomRight.row; r++) {
for (var c = topLeft.col; c <= bottomRight.col; c++) {
if (!(this.from.row === r && this.from.col === c) && !(this.to.row === r && this.to.col === c)) {
out.push(new WalkontableCellCoords(r, c));
}
}
}
return out;
},
getAll: function() {
var topLeft = this.getTopLeftCorner();
var bottomRight = this.getBottomRightCorner();
var out = [];
for (var r = topLeft.row; r <= bottomRight.row; r++) {
for (var c = topLeft.col; c <= bottomRight.col; c++) {
if (topLeft.row === r && topLeft.col === c) {
out.push(topLeft);
} else if (bottomRight.row === r && bottomRight.col === c) {
out.push(bottomRight);
} else {
out.push(new WalkontableCellCoords(r, c));
}
}
}
return out;
},
forAll: function(callback) {
var topLeft = this.getTopLeftCorner();
var bottomRight = this.getBottomRightCorner();
for (var r = topLeft.row; r <= bottomRight.row; r++) {
for (var c = topLeft.col; c <= bottomRight.col; c++) {
var breakIteration = callback(r, c);
if (breakIteration === false) {
return;
}
}
}
}
}, {});
;
window.WalkontableCellRange = WalkontableCellRange;
//#
},{"cell/coords":5}],7:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
Walkontable: {get: function() {
return Walkontable;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47__46__46__47_helpers_47_object__,
$___46__46__47__46__46__47__46__46__47_helpers_47_string__,
$__event__,
$__overlays__,
$__scroll__,
$__settings__,
$__table__,
$__viewport__,
$__overlay_47__95_base_46_js__,
$__overlay_47_top_46_js__,
$__overlay_47_left_46_js__,
$__overlay_47_debug_46_js__,
$__overlay_47_topLeftCorner_46_js__;
var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
fastInnerText = $__0.fastInnerText,
isVisible = $__0.isVisible,
removeClass = $__0.removeClass;
var objectEach = ($___46__46__47__46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_object__}).objectEach;
var $__2 = ($___46__46__47__46__46__47__46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47__46__46__47__46__46__47_helpers_47_string__ && $___46__46__47__46__46__47__46__46__47_helpers_47_string__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_string__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_string__}),
toUpperCaseFirst = $__2.toUpperCaseFirst,
randomString = $__2.randomString;
var WalkontableEvent = ($__event__ = require("event"), $__event__ && $__event__.__esModule && $__event__ || {default: $__event__}).WalkontableEvent;
var WalkontableOverlays = ($__overlays__ = require("overlays"), $__overlays__ && $__overlays__.__esModule && $__overlays__ || {default: $__overlays__}).WalkontableOverlays;
var WalkontableScroll = ($__scroll__ = require("scroll"), $__scroll__ && $__scroll__.__esModule && $__scroll__ || {default: $__scroll__}).WalkontableScroll;
var WalkontableSettings = ($__settings__ = require("settings"), $__settings__ && $__settings__.__esModule && $__settings__ || {default: $__settings__}).WalkontableSettings;
var WalkontableTable = ($__table__ = require("table"), $__table__ && $__table__.__esModule && $__table__ || {default: $__table__}).WalkontableTable;
var WalkontableViewport = ($__viewport__ = require("viewport"), $__viewport__ && $__viewport__.__esModule && $__viewport__ || {default: $__viewport__}).WalkontableViewport;
var WalkontableOverlay = ($__overlay_47__95_base_46_js__ = require("overlay/_base.js"), $__overlay_47__95_base_46_js__ && $__overlay_47__95_base_46_js__.__esModule && $__overlay_47__95_base_46_js__ || {default: $__overlay_47__95_base_46_js__}).WalkontableOverlay;
var WalkontableTopOverlay = ($__overlay_47_top_46_js__ = require("overlay/top.js"), $__overlay_47_top_46_js__ && $__overlay_47_top_46_js__.__esModule && $__overlay_47_top_46_js__ || {default: $__overlay_47_top_46_js__}).WalkontableTopOverlay;
var WalkontableLeftOverlay = ($__overlay_47_left_46_js__ = require("overlay/left.js"), $__overlay_47_left_46_js__ && $__overlay_47_left_46_js__.__esModule && $__overlay_47_left_46_js__ || {default: $__overlay_47_left_46_js__}).WalkontableLeftOverlay;
var WalkontableDebugOverlay = ($__overlay_47_debug_46_js__ = require("overlay/debug.js"), $__overlay_47_debug_46_js__ && $__overlay_47_debug_46_js__.__esModule && $__overlay_47_debug_46_js__ || {default: $__overlay_47_debug_46_js__}).WalkontableDebugOverlay;
var WalkontableTopLeftCornerOverlay = ($__overlay_47_topLeftCorner_46_js__ = require("overlay/topLeftCorner.js"), $__overlay_47_topLeftCorner_46_js__ && $__overlay_47_topLeftCorner_46_js__.__esModule && $__overlay_47_topLeftCorner_46_js__ || {default: $__overlay_47_topLeftCorner_46_js__}).WalkontableTopLeftCornerOverlay;
var Walkontable = function Walkontable(settings) {
var originalHeaders = [];
this.guid = 'wt_' + randomString();
if (settings.cloneSource) {
this.cloneSource = settings.cloneSource;
this.cloneOverlay = settings.cloneOverlay;
this.wtSettings = settings.cloneSource.wtSettings;
this.wtTable = new WalkontableTable(this, settings.table, settings.wtRootElement);
this.wtScroll = new WalkontableScroll(this);
this.wtViewport = settings.cloneSource.wtViewport;
this.wtEvent = new WalkontableEvent(this);
this.selections = this.cloneSource.selections;
} else {
this.wtSettings = new WalkontableSettings(this, settings);
this.wtTable = new WalkontableTable(this, settings.table);
this.wtScroll = new WalkontableScroll(this);
this.wtViewport = new WalkontableViewport(this);
this.wtEvent = new WalkontableEvent(this);
this.selections = this.getSetting('selections');
this.wtOverlays = new WalkontableOverlays(this);
this.exportSettingsAsClassNames();
}
if (this.wtTable.THEAD.childNodes.length && this.wtTable.THEAD.childNodes[0].childNodes.length) {
for (var c = 0,
clen = this.wtTable.THEAD.childNodes[0].childNodes.length; c < clen; c++) {
originalHeaders.push(this.wtTable.THEAD.childNodes[0].childNodes[c].innerHTML);
}
if (!this.getSetting('columnHeaders').length) {
this.update('columnHeaders', [function(column, TH) {
fastInnerText(TH, originalHeaders[column]);
}]);
}
}
this.drawn = false;
this.drawInterrupted = false;
};
($traceurRuntime.createClass)(Walkontable, {
draw: function() {
var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false;
this.drawInterrupted = false;
if (!fastDraw && !isVisible(this.wtTable.TABLE)) {
this.drawInterrupted = true;
} else {
this.wtTable.draw(fastDraw);
}
return this;
},
getCell: function(coords) {
var topmost = arguments[1] !== (void 0) ? arguments[1] : false;
if (!topmost) {
return this.wtTable.getCell(coords);
}
var totalRows = this.wtSettings.getSetting('totalRows');
var fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
var fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');
var fixedColumns = this.wtSettings.getSetting('fixedColumnsLeft');
if (coords.row < fixedRowsTop && coords.col < fixedColumns) {
return this.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell(coords);
} else if (coords.row < fixedRowsTop) {
return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords);
} else if (coords.col < fixedColumns && coords.row >= totalRows - fixedRowsBottom) {
if (this.wtOverlays.bottomLeftCornerOverlay.clone) {
return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(coords);
}
} else if (coords.col < fixedColumns) {
return this.wtOverlays.leftOverlay.clone.wtTable.getCell(coords);
} else if (coords.row < totalRows && coords.row > totalRows - fixedRowsBottom) {
if (this.wtOverlays.bottomOverlay.clone) {
return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords);
}
}
return this.wtTable.getCell(coords);
},
update: function(settings, value) {
return this.wtSettings.update(settings, value);
},
scrollVertical: function(row) {
this.wtOverlays.topOverlay.scrollTo(row);
this.getSetting('onScrollVertically');
return this;
},
scrollHorizontal: function(column) {
this.wtOverlays.leftOverlay.scrollTo(column);
this.getSetting('onScrollHorizontally');
return this;
},
scrollViewport: function(coords) {
this.wtScroll.scrollViewport(coords);
return this;
},
getViewport: function() {
return [this.wtTable.getFirstVisibleRow(), this.wtTable.getFirstVisibleColumn(), this.wtTable.getLastVisibleRow(), this.wtTable.getLastVisibleColumn()];
},
getOverlayName: function() {
return this.cloneOverlay ? this.cloneOverlay.type : 'master';
},
isOverlayName: function(name) {
if (this.cloneOverlay) {
return this.cloneOverlay.type === name;
}
return false;
},
exportSettingsAsClassNames: function() {
var $__14 = this;
var toExport = {
rowHeaders: ['array'],
columnHeaders: ['array']
};
var allClassNames = [];
var newClassNames = [];
objectEach(toExport, (function(optionType, key) {
if (optionType.indexOf('array') > -1 && $__14.getSetting(key).length) {
newClassNames.push('ht' + toUpperCaseFirst(key));
}
allClassNames.push('ht' + toUpperCaseFirst(key));
}));
removeClass(this.wtTable.wtRootElement.parentNode, allClassNames);
addClass(this.wtTable.wtRootElement.parentNode, newClassNames);
},
getSetting: function(key, param1, param2, param3, param4) {
return this.wtSettings.getSetting(key, param1, param2, param3, param4);
},
hasSetting: function(key) {
return this.wtSettings.has(key);
},
destroy: function() {
this.wtOverlays.destroy();
this.wtEvent.destroy();
}
}, {});
;
window.Walkontable = Walkontable;
//#
},{"event":8,"helpers/dom/element":45,"helpers/object":50,"helpers/string":52,"overlay/_base.js":11,"overlay/debug.js":12,"overlay/left.js":13,"overlay/top.js":14,"overlay/topLeftCorner.js":15,"overlays":16,"scroll":17,"settings":19,"table":20,"viewport":22}],8:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableEvent: {get: function() {
return WalkontableEvent;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47__46__46__47_eventManager__;
var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
closest = $__0.closest,
hasClass = $__0.hasClass,
isChildOf = $__0.isChildOf;
var eventManagerObject = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).eventManager;
function WalkontableEvent(instance) {
var that = this;
var eventManager = eventManagerObject(instance);
this.instance = instance;
var dblClickOrigin = [null, null];
this.dblClickTimeout = [null, null];
var onMouseDown = function(event) {
var cell = that.parentCell(event.realTarget);
if (hasClass(event.realTarget, 'corner')) {
that.instance.getSetting('onCellCornerMouseDown', event, event.realTarget);
} else if (cell.TD) {
if (that.instance.hasSetting('onCellMouseDown')) {
that.instance.getSetting('onCellMouseDown', event, cell.coords, cell.TD, that.instance);
}
}
if (event.button !== 2) {
if (cell.TD) {
dblClickOrigin[0] = cell.TD;
clearTimeout(that.dblClickTimeout[0]);
that.dblClickTimeout[0] = setTimeout(function() {
dblClickOrigin[0] = null;
}, 1000);
}
}
};
var onTouchMove = function(event) {
that.instance.touchMoving = true;
};
var longTouchTimeout;
var onTouchStart = function(event) {
var container = this;
eventManager.addEventListener(this, 'touchmove', onTouchMove);
that.checkIfTouchMove = setTimeout(function() {
if (that.instance.touchMoving === true) {
that.instance.touchMoving = void 0;
eventManager.removeEventListener('touchmove', onTouchMove, false);
return;
} else {
onMouseDown(event);
}
}, 30);
};
var onMouseOver = function(event) {
var table,
td,
mainWOT;
if (that.instance.hasSetting('onCellMouseOver')) {
table = that.instance.wtTable.TABLE;
td = closest(event.realTarget, ['TD', 'TH'], table);
mainWOT = that.instance.cloneSource || that.instance;
if (td && td !== mainWOT.lastMouseOver && isChildOf(td, table)) {
mainWOT.lastMouseOver = td;
that.instance.getSetting('onCellMouseOver', event, that.instance.wtTable.getCoords(td), td, that.instance);
}
}
};
var onMouseUp = function(event) {
if (event.button !== 2) {
var cell = that.parentCell(event.realTarget);
if (cell.TD === dblClickOrigin[0] && cell.TD === dblClickOrigin[1]) {
if (hasClass(event.realTarget, 'corner')) {
that.instance.getSetting('onCellCornerDblClick', event, cell.coords, cell.TD, that.instance);
} else {
that.instance.getSetting('onCellDblClick', event, cell.coords, cell.TD, that.instance);
}
dblClickOrigin[0] = null;
dblClickOrigin[1] = null;
} else if (cell.TD === dblClickOrigin[0]) {
dblClickOrigin[1] = cell.TD;
clearTimeout(that.dblClickTimeout[1]);
that.dblClickTimeout[1] = setTimeout(function() {
dblClickOrigin[1] = null;
}, 500);
}
}
};
var onTouchEnd = function(event) {
clearTimeout(longTouchTimeout);
event.preventDefault();
onMouseUp(event);
};
eventManager.addEventListener(this.instance.wtTable.holder, 'mousedown', onMouseDown);
eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseover', onMouseOver);
eventManager.addEventListener(this.instance.wtTable.holder, 'mouseup', onMouseUp);
if (this.instance.wtTable.holder.parentNode.parentNode && Handsontable.mobileBrowser && !that.instance.wtTable.isWorkingOnClone()) {
var classSelector = '.' + this.instance.wtTable.holder.parentNode.className.split(' ').join('.');
eventManager.addEventListener(this.instance.wtTable.holder, 'touchstart', function(event) {
that.instance.touchApplied = true;
if (isChildOf(event.target, classSelector)) {
onTouchStart.call(event.target, event);
}
});
eventManager.addEventListener(this.instance.wtTable.holder, 'touchend', function(event) {
that.instance.touchApplied = false;
if (isChildOf(event.target, classSelector)) {
onTouchEnd.call(event.target, event);
}
});
if (!that.instance.momentumScrolling) {
that.instance.momentumScrolling = {};
}
eventManager.addEventListener(this.instance.wtTable.holder, 'scroll', function(event) {
clearTimeout(that.instance.momentumScrolling._timeout);
if (!that.instance.momentumScrolling.ongoing) {
that.instance.getSetting('onBeforeTouchScroll');
}
that.instance.momentumScrolling.ongoing = true;
that.instance.momentumScrolling._timeout = setTimeout(function() {
if (!that.instance.touchApplied) {
that.instance.momentumScrolling.ongoing = false;
that.instance.getSetting('onAfterMomentumScroll');
}
}, 200);
});
}
eventManager.addEventListener(window, 'resize', function() {
if (that.instance.getSetting('stretchH') !== 'none') {
that.instance.draw();
}
});
this.destroy = function() {
clearTimeout(this.dblClickTimeout[0]);
clearTimeout(this.dblClickTimeout[1]);
eventManager.destroy();
};
}
WalkontableEvent.prototype.parentCell = function(elem) {
var cell = {};
var TABLE = this.instance.wtTable.TABLE;
var TD = closest(elem, ['TD', 'TH'], TABLE);
if (TD && isChildOf(TD, TABLE)) {
cell.coords = this.instance.wtTable.getCoords(TD);
cell.TD = TD;
} else if (hasClass(elem, 'wtBorder') && hasClass(elem, 'current')) {
cell.coords = this.instance.selections.current.cellRange.highlight;
cell.TD = this.instance.wtTable.getCell(cell.coords);
} else if (hasClass(elem, 'wtBorder') && hasClass(elem, 'area')) {
if (this.instance.selections.area.cellRange) {
cell.coords = this.instance.selections.area.cellRange.to;
cell.TD = this.instance.wtTable.getCell(cell.coords);
}
}
return cell;
};
;
window.WalkontableEvent = WalkontableEvent;
//#
},{"eventManager":41,"helpers/dom/element":45}],9:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableColumnFilter: {get: function() {
return WalkontableColumnFilter;
}},
__esModule: {value: true}
});
var WalkontableColumnFilter = function WalkontableColumnFilter(offset, total, countTH) {
this.offset = offset;
this.total = total;
this.countTH = countTH;
};
($traceurRuntime.createClass)(WalkontableColumnFilter, {
offsetted: function(index) {
return index + this.offset;
},
unOffsetted: function(index) {
return index - this.offset;
},
renderedToSource: function(index) {
return this.offsetted(index);
},
sourceToRendered: function(index) {
return this.unOffsetted(index);
},
offsettedTH: function(index) {
return index - this.countTH;
},
unOffsettedTH: function(index) {
return index + this.countTH;
},
visibleRowHeadedColumnToSourceColumn: function(index) {
return this.renderedToSource(this.offsettedTH(index));
},
sourceColumnToVisibleRowHeadedColumn: function(index) {
return this.unOffsettedTH(this.sourceToRendered(index));
}
}, {});
;
window.WalkontableColumnFilter = WalkontableColumnFilter;
//#
},{}],10:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableRowFilter: {get: function() {
return WalkontableRowFilter;
}},
__esModule: {value: true}
});
var WalkontableRowFilter = function WalkontableRowFilter(offset, total, countTH) {
this.offset = offset;
this.total = total;
this.countTH = countTH;
};
($traceurRuntime.createClass)(WalkontableRowFilter, {
offsetted: function(index) {
return index + this.offset;
},
unOffsetted: function(index) {
return index - this.offset;
},
renderedToSource: function(index) {
return this.offsetted(index);
},
sourceToRendered: function(index) {
return this.unOffsetted(index);
},
offsettedTH: function(index) {
return index - this.countTH;
},
unOffsettedTH: function(index) {
return index + this.countTH;
},
visibleColHeadedRowToSourceRow: function(index) {
return this.renderedToSource(this.offsettedTH(index));
},
sourceRowToVisibleColHeadedRow: function(index) {
return this.unOffsettedTH(this.sourceToRendered(index));
}
}, {});
;
window.WalkontableRowFilter = WalkontableRowFilter;
//#
},{}],11:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableOverlay: {get: function() {
return WalkontableOverlay;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__,
$___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__;
var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
getScrollableElement = $__0.getScrollableElement,
getTrimmingContainer = $__0.getTrimmingContainer;
var defineGetter = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_object__}).defineGetter;
var eventManagerObject = ($___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_eventManager__}).eventManager;
var registeredOverlays = {};
var WalkontableOverlay = function WalkontableOverlay(wotInstance) {
defineGetter(this, 'wot', wotInstance, {writable: false});
this.instance = this.wot;
this.type = '';
this.mainTableScrollableElement = null;
this.TABLE = this.wot.wtTable.TABLE;
this.hider = this.wot.wtTable.hider;
this.spreader = this.wot.wtTable.spreader;
this.holder = this.wot.wtTable.holder;
this.wtRootElement = this.wot.wtTable.wtRootElement;
this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode);
this.needFullRender = this.shouldBeRendered();
this.areElementSizesAdjusted = false;
};
var $WalkontableOverlay = WalkontableOverlay;
($traceurRuntime.createClass)(WalkontableOverlay, {
shouldBeRendered: function() {
return true;
},
makeClone: function(direction) {
if ($WalkontableOverlay.CLONE_TYPES.indexOf(direction) === -1) {
throw new Error('Clone type "' + direction + '" is not supported.');
}
var clone = document.createElement('DIV');
var clonedTable = document.createElement('TABLE');
clone.className = 'ht_clone_' + direction + ' handsontable';
clone.style.position = 'absolute';
clone.style.top = 0;
clone.style.left = 0;
clone.style.overflow = 'hidden';
clonedTable.className = this.wot.wtTable.TABLE.className;
clone.appendChild(clonedTable);
this.type = direction;
this.wot.wtTable.wtRootElement.parentNode.appendChild(clone);
var preventOverflow = this.wot.getSetting('preventOverflow');
if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === $WalkontableOverlay.CLONE_TOP || preventOverflow === 'vertical' && this.type === $WalkontableOverlay.CLONE_LEFT) {
this.mainTableScrollableElement = window;
} else {
this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE);
}
return new Walkontable({
cloneSource: this.wot,
cloneOverlay: this,
table: clonedTable
});
},
refresh: function() {
var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false;
var nextCycleRenderFlag = this.shouldBeRendered();
if (this.clone && (this.needFullRender || nextCycleRenderFlag)) {
this.clone.draw(fastDraw);
}
this.needFullRender = nextCycleRenderFlag;
},
destroy: function() {
eventManagerObject(this.clone).destroy();
}
}, {
get CLONE_TOP() {
return 'top';
},
get CLONE_BOTTOM() {
return 'bottom';
},
get CLONE_LEFT() {
return 'left';
},
get CLONE_TOP_LEFT_CORNER() {
return 'top_left_corner';
},
get CLONE_BOTTOM_LEFT_CORNER() {
return 'bottom_left_corner';
},
get CLONE_DEBUG() {
return 'debug';
},
get CLONE_TYPES() {
return [$WalkontableOverlay.CLONE_TOP, $WalkontableOverlay.CLONE_BOTTOM, $WalkontableOverlay.CLONE_LEFT, $WalkontableOverlay.CLONE_TOP_LEFT_CORNER, $WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER, $WalkontableOverlay.CLONE_DEBUG];
},
registerOverlay: function(type, overlayClass) {
if ($WalkontableOverlay.CLONE_TYPES.indexOf(type) === -1) {
throw new Error(("Unsupported overlay (" + type + ")."));
}
registeredOverlays[type] = overlayClass;
},
createOverlay: function(type, wot) {
return new registeredOverlays[type](wot);
},
isOverlayTypeOf: function(overlay, type) {
if (!overlay || !registeredOverlays[type]) {
return false;
}
return overlay instanceof registeredOverlays[type];
}
});
;
window.WalkontableOverlay = WalkontableOverlay;
//#
},{"eventManager":41,"helpers/dom/element":45,"helpers/object":50}],12:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableDebugOverlay: {get: function() {
return WalkontableDebugOverlay;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$___95_base__;
var addClass = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}).addClass;
var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay;
var WalkontableDebugOverlay = function WalkontableDebugOverlay(wotInstance) {
$traceurRuntime.superConstructor($WalkontableDebugOverlay).call(this, wotInstance);
this.clone = this.makeClone(WalkontableOverlay.CLONE_DEBUG);
this.clone.wtTable.holder.style.opacity = 0.4;
this.clone.wtTable.holder.style.textShadow = '0 0 2px #ff0000';
addClass(this.clone.wtTable.holder.parentNode, 'wtDebugVisible');
};
var $WalkontableDebugOverlay = WalkontableDebugOverlay;
($traceurRuntime.createClass)(WalkontableDebugOverlay, {}, {}, WalkontableOverlay);
;
window.WalkontableDebugOverlay = WalkontableDebugOverlay;
WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_DEBUG, WalkontableDebugOverlay);
//#
},{"_base":11,"helpers/dom/element":45}],13:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableLeftOverlay: {get: function() {
return WalkontableLeftOverlay;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$___95_base__;
var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
getScrollbarWidth = $__0.getScrollbarWidth,
getScrollLeft = $__0.getScrollLeft,
getWindowScrollTop = $__0.getWindowScrollTop,
hasClass = $__0.hasClass,
outerWidth = $__0.outerWidth,
innerHeight = $__0.innerHeight,
removeClass = $__0.removeClass,
setOverlayPosition = $__0.setOverlayPosition;
var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay;
var WalkontableLeftOverlay = function WalkontableLeftOverlay(wotInstance) {
$traceurRuntime.superConstructor($WalkontableLeftOverlay).call(this, wotInstance);
this.clone = this.makeClone(WalkontableOverlay.CLONE_LEFT);
};
var $WalkontableLeftOverlay = WalkontableLeftOverlay;
($traceurRuntime.createClass)(WalkontableLeftOverlay, {
shouldBeRendered: function() {
return this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length ? true : false;
},
resetFixedPosition: function() {
if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {
return;
}
var overlayRoot = this.clone.wtTable.holder.parentNode;
var headerPosition = 0;
var preventOverflow = this.wot.getSetting('preventOverflow');
if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'horizontal')) {
var box = this.wot.wtTable.hider.getBoundingClientRect();
var left = Math.ceil(box.left);
var right = Math.ceil(box.right);
var finalLeft;
var finalTop;
finalTop = this.wot.wtTable.hider.style.top;
finalTop = finalTop === '' ? 0 : finalTop;
if (left < 0 && (right - overlayRoot.offsetWidth) > 0) {
finalLeft = -left;
} else {
finalLeft = 0;
}
headerPosition = finalLeft;
finalLeft = finalLeft + 'px';
setOverlayPosition(overlayRoot, finalLeft, finalTop);
} else {
headerPosition = this.getScrollPosition();
}
this.adjustHeaderBordersPosition(headerPosition);
this.adjustElementsSize();
},
setScrollPosition: function(pos) {
if (this.mainTableScrollableElement === window) {
window.scrollTo(pos, getWindowScrollTop());
} else {
this.mainTableScrollableElement.scrollLeft = pos;
}
},
onScroll: function() {
this.wot.getSetting('onScrollVertically');
},
sumCellSizes: function(from, to) {
var sum = 0;
var defaultColumnWidth = this.wot.wtSettings.defaultColumnWidth;
while (from < to) {
sum += this.wot.wtTable.getStretchedColumnWidth(from) || defaultColumnWidth;
from++;
}
return sum;
},
adjustElementsSize: function() {
var force = arguments[0] !== (void 0) ? arguments[0] : false;
if (this.needFullRender || force) {
this.adjustRootElementSize();
this.adjustRootChildrenSize();
if (!force) {
this.areElementSizesAdjusted = true;
}
}
},
adjustRootElementSize: function() {
var masterHolder = this.wot.wtTable.holder;
var scrollbarHeight = masterHolder.clientHeight === masterHolder.offsetHeight ? 0 : getScrollbarWidth();
var overlayRoot = this.clone.wtTable.holder.parentNode;
var overlayRootStyle = overlayRoot.style;
var preventOverflow = this.wot.getSetting('preventOverflow');
var tableWidth;
if (this.trimmingContainer !== window || preventOverflow === 'vertical') {
var height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight;
height = Math.min(height, innerHeight(this.wot.wtTable.wtRootElement));
overlayRootStyle.height = height + 'px';
}
this.clone.wtTable.holder.style.height = overlayRootStyle.height;
tableWidth = outerWidth(this.clone.wtTable.TABLE);
overlayRootStyle.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px';
},
adjustRootChildrenSize: function() {
var scrollbarWidth = getScrollbarWidth();
this.clone.wtTable.hider.style.height = this.hider.style.height;
this.clone.wtTable.holder.style.height = this.clone.wtTable.holder.parentNode.style.height;
if (scrollbarWidth === 0) {
scrollbarWidth = 30;
}
this.clone.wtTable.holder.style.width = parseInt(this.clone.wtTable.holder.parentNode.style.width, 10) + scrollbarWidth + 'px';
},
applyToDOM: function() {
var total = this.wot.getSetting('totalColumns');
if (!this.areElementSizesAdjusted) {
this.adjustElementsSize();
}
if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {
this.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px';
} else if (total === 0) {
this.spreader.style.left = '0';
} else {
throw new Error('Incorrect value of the columnsRenderCalculator');
}
this.spreader.style.right = '';
if (this.needFullRender) {
this.syncOverlayOffset();
}
},
syncOverlayOffset: function() {
if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {
this.clone.wtTable.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px';
} else {
this.clone.wtTable.spreader.style.top = '';
}
},
scrollTo: function(sourceCol, beyondRendered) {
var newX = this.getTableParentOffset();
var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;
var mainHolder = sourceInstance.wtTable.holder;
var scrollbarCompensation = 0;
if (beyondRendered && mainHolder.offsetWidth !== mainHolder.clientWidth) {
scrollbarCompensation = getScrollbarWidth();
}
if (beyondRendered) {
newX += this.sumCellSizes(0, sourceCol + 1);
newX -= this.wot.wtViewport.getViewportWidth();
} else {
newX += this.sumCellSizes(this.wot.getSetting('fixedColumnsLeft'), sourceCol);
}
newX += scrollbarCompensation;
this.setScrollPosition(newX);
},
getTableParentOffset: function() {
var preventOverflow = this.wot.getSetting('preventOverflow');
var offset = 0;
if (!preventOverflow && this.trimmingContainer === window) {
offset = this.wot.wtTable.holderOffset.left;
}
return offset;
},
getScrollPosition: function() {
return getScrollLeft(this.mainTableScrollableElement);
},
adjustHeaderBordersPosition: function(position) {
var masterParent = this.wot.wtTable.holder.parentNode;
var rowHeaders = this.wot.getSetting('rowHeaders');
var fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');
if (fixedColumnsLeft && !rowHeaders.length) {
addClass(masterParent, 'innerBorderLeft');
} else if (!fixedColumnsLeft && rowHeaders.length) {
var previousState = hasClass(masterParent, 'innerBorderLeft');
if (position) {
addClass(masterParent, 'innerBorderLeft');
} else {
removeClass(masterParent, 'innerBorderLeft');
}
if (!previousState && position || previousState && !position) {
this.wot.wtOverlays.adjustElementsSize();
}
}
}
}, {}, WalkontableOverlay);
;
window.WalkontableLeftOverlay = WalkontableLeftOverlay;
WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_LEFT, WalkontableLeftOverlay);
//#
},{"_base":11,"helpers/dom/element":45}],14:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableTopOverlay: {get: function() {
return WalkontableTopOverlay;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$___95_base__;
var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
getScrollbarWidth = $__0.getScrollbarWidth,
getScrollTop = $__0.getScrollTop,
getWindowScrollLeft = $__0.getWindowScrollLeft,
hasClass = $__0.hasClass,
outerHeight = $__0.outerHeight,
innerWidth = $__0.innerWidth,
removeClass = $__0.removeClass,
setOverlayPosition = $__0.setOverlayPosition;
var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay;
var WalkontableTopOverlay = function WalkontableTopOverlay(wotInstance) {
$traceurRuntime.superConstructor($WalkontableTopOverlay).call(this, wotInstance);
this.clone = this.makeClone(WalkontableOverlay.CLONE_TOP);
};
var $WalkontableTopOverlay = WalkontableTopOverlay;
($traceurRuntime.createClass)(WalkontableTopOverlay, {
shouldBeRendered: function() {
return this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length ? true : false;
},
resetFixedPosition: function() {
if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {
return;
}
var overlayRoot = this.clone.wtTable.holder.parentNode;
var headerPosition = 0;
var preventOverflow = this.wot.getSetting('preventOverflow');
if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'vertical')) {
var box = this.wot.wtTable.hider.getBoundingClientRect();
var top = Math.ceil(box.top);
var bottom = Math.ceil(box.bottom);
var finalLeft;
var finalTop;
finalLeft = this.wot.wtTable.hider.style.left;
finalLeft = finalLeft === '' ? 0 : finalLeft;
if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) {
finalTop = -top;
} else {
finalTop = 0;
}
headerPosition = finalTop;
finalTop = finalTop + 'px';
setOverlayPosition(overlayRoot, finalLeft, finalTop);
} else {
headerPosition = this.getScrollPosition();
}
this.adjustHeaderBordersPosition(headerPosition);
this.adjustElementsSize();
},
setScrollPosition: function(pos) {
if (this.mainTableScrollableElement === window) {
window.scrollTo(getWindowScrollLeft(), pos);
} else {
this.mainTableScrollableElement.scrollTop = pos;
}
},
onScroll: function() {
this.wot.getSetting('onScrollHorizontally');
},
sumCellSizes: function(from, to) {
var sum = 0;
var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;
while (from < to) {
var height = this.wot.wtTable.getRowHeight(from);
sum += height === void 0 ? defaultRowHeight : height;
from++;
}
return sum;
},
adjustElementsSize: function() {
var force = arguments[0] !== (void 0) ? arguments[0] : false;
if (this.needFullRender || force) {
this.adjustRootElementSize();
this.adjustRootChildrenSize();
if (!force) {
this.areElementSizesAdjusted = true;
}
}
},
adjustRootElementSize: function() {
var masterHolder = this.wot.wtTable.holder;
var scrollbarWidth = masterHolder.clientWidth === masterHolder.offsetWidth ? 0 : getScrollbarWidth();
var overlayRoot = this.clone.wtTable.holder.parentNode;
var overlayRootStyle = overlayRoot.style;
var preventOverflow = this.wot.getSetting('preventOverflow');
var tableHeight;
if (this.trimmingContainer !== window || preventOverflow === 'horizontal') {
var width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth;
width = Math.min(width, innerWidth(this.wot.wtTable.wtRootElement));
overlayRootStyle.width = width + 'px';
}
this.clone.wtTable.holder.style.width = overlayRootStyle.width;
tableHeight = outerHeight(this.clone.wtTable.TABLE);
overlayRootStyle.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px';
},
adjustRootChildrenSize: function() {
var scrollbarWidth = getScrollbarWidth();
this.clone.wtTable.hider.style.width = this.hider.style.width;
this.clone.wtTable.holder.style.width = this.clone.wtTable.holder.parentNode.style.width;
if (scrollbarWidth === 0) {
scrollbarWidth = 30;
}
this.clone.wtTable.holder.style.height = parseInt(this.clone.wtTable.holder.parentNode.style.height, 10) + scrollbarWidth + 'px';
},
applyToDOM: function() {
var total = this.wot.getSetting('totalRows');
if (!this.areElementSizesAdjusted) {
this.adjustElementsSize();
}
if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {
this.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px';
} else if (total === 0) {
this.spreader.style.top = '0';
} else {
throw new Error('Incorrect value of the rowsRenderCalculator');
}
this.spreader.style.bottom = '';
if (this.needFullRender) {
this.syncOverlayOffset();
}
},
syncOverlayOffset: function() {
if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {
this.clone.wtTable.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px';
} else {
this.clone.wtTable.spreader.style.left = '';
}
},
scrollTo: function(sourceRow, bottomEdge) {
var newY = this.getTableParentOffset();
var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;
var mainHolder = sourceInstance.wtTable.holder;
var scrollbarCompensation = 0;
if (bottomEdge && mainHolder.offsetHeight !== mainHolder.clientHeight) {
scrollbarCompensation = getScrollbarWidth();
}
if (bottomEdge) {
var fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');
var fixedRowsTop = this.wot.getSetting('fixedRowsTop');
var totalRows = this.wot.getSetting('totalRows');
newY += this.sumCellSizes(0, sourceRow + 1);
newY -= this.wot.wtViewport.getViewportHeight() - this.sumCellSizes(totalRows - fixedRowsBottom, totalRows);
newY += 1;
} else {
newY += this.sumCellSizes(this.wot.getSetting('fixedRowsTop'), sourceRow);
}
newY += scrollbarCompensation;
this.setScrollPosition(newY);
},
getTableParentOffset: function() {
if (this.mainTableScrollableElement === window) {
return this.wot.wtTable.holderOffset.top;
} else {
return 0;
}
},
getScrollPosition: function() {
return getScrollTop(this.mainTableScrollableElement);
},
adjustHeaderBordersPosition: function(position) {
if (this.wot.getSetting('fixedRowsTop') === 0 && this.wot.getSetting('columnHeaders').length > 0) {
var masterParent = this.wot.wtTable.holder.parentNode;
var previousState = hasClass(masterParent, 'innerBorderTop');
if (position || this.wot.getSetting('totalRows') === 0) {
addClass(masterParent, 'innerBorderTop');
} else {
removeClass(masterParent, 'innerBorderTop');
}
if (!previousState && position || previousState && !position) {
this.wot.wtOverlays.adjustElementsSize();
}
}
if (this.wot.getSetting('rowHeaders').length === 0) {
var secondHeaderCell = this.clone.wtTable.THEAD.querySelectorAll('th:nth-of-type(2)');
if (secondHeaderCell) {
for (var i = 0; i < secondHeaderCell.length; i++) {
secondHeaderCell[i].style['border-left-width'] = 0;
}
}
}
}
}, {}, WalkontableOverlay);
;
window.WalkontableTopOverlay = WalkontableTopOverlay;
WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_TOP, WalkontableTopOverlay);
//#
},{"_base":11,"helpers/dom/element":45}],15:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableTopLeftCornerOverlay: {get: function() {
return WalkontableTopLeftCornerOverlay;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$___95_base__;
var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
outerHeight = $__0.outerHeight,
outerWidth = $__0.outerWidth,
setOverlayPosition = $__0.setOverlayPosition;
var WalkontableOverlay = ($___95_base__ = require("_base"), $___95_base__ && $___95_base__.__esModule && $___95_base__ || {default: $___95_base__}).WalkontableOverlay;
var WalkontableTopLeftCornerOverlay = function WalkontableTopLeftCornerOverlay(wotInstance) {
$traceurRuntime.superConstructor($WalkontableTopLeftCornerOverlay).call(this, wotInstance);
this.clone = this.makeClone(WalkontableOverlay.CLONE_TOP_LEFT_CORNER);
};
var $WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay;
($traceurRuntime.createClass)(WalkontableTopLeftCornerOverlay, {
shouldBeRendered: function() {
return (this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length) && (this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length) ? true : false;
},
resetFixedPosition: function() {
if (!this.wot.wtTable.holder.parentNode) {
return;
}
var overlayRoot = this.clone.wtTable.holder.parentNode;
var tableHeight = outerHeight(this.clone.wtTable.TABLE);
var tableWidth = outerWidth(this.clone.wtTable.TABLE);
var preventOverflow = this.wot.getSetting('preventOverflow');
if (this.trimmingContainer === window) {
var box = this.wot.wtTable.hider.getBoundingClientRect();
var top = Math.ceil(box.top);
var left = Math.ceil(box.left);
var bottom = Math.ceil(box.bottom);
var right = Math.ceil(box.right);
var finalLeft = '0';
var finalTop = '0';
if (!preventOverflow || preventOverflow === 'vertical') {
if (left < 0 && (right - overlayRoot.offsetWidth) > 0) {
finalLeft = -left + 'px';
}
}
if (!preventOverflow || preventOverflow === 'horizontal') {
if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) {
finalTop = -top + 'px';
}
}
setOverlayPosition(overlayRoot, finalLeft, finalTop);
}
overlayRoot.style.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px';
overlayRoot.style.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px';
}
}, {}, WalkontableOverlay);
;
window.WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay;
WalkontableOverlay.registerOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER, WalkontableTopLeftCornerOverlay);
//#
},{"_base":11,"helpers/dom/element":45}],16:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableOverlays: {get: function() {
return WalkontableOverlays;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47__46__46__47_helpers_47_unicode__,
$___46__46__47__46__46__47__46__46__47_eventManager__;
var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
getScrollableElement = $__0.getScrollableElement,
getScrollbarWidth = $__0.getScrollbarWidth,
getScrollLeft = $__0.getScrollLeft,
getScrollTop = $__0.getScrollTop;
var isKey = ($___46__46__47__46__46__47__46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__ && $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_unicode__}).isKey;
var EventManager = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).EventManager;
var WalkontableOverlays = function WalkontableOverlays(wotInstance) {
this.wot = wotInstance;
this.instance = this.wot;
this.eventManager = new EventManager(this.wot);
this.wot.update('scrollbarWidth', getScrollbarWidth());
this.wot.update('scrollbarHeight', getScrollbarWidth());
this.scrollableElement = getScrollableElement(this.wot.wtTable.TABLE);
this.topOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP, this.wot);
if (typeof WalkontableBottomOverlay === 'undefined') {
this.bottomOverlay = {needFullRender: false};
} else {
this.bottomOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM, this.wot);
}
this.leftOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT, this.wot);
if (this.topOverlay.needFullRender && this.leftOverlay.needFullRender) {
this.topLeftCornerOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER, this.wot);
}
if (this.bottomOverlay.needFullRender && this.leftOverlay.needFullRender && typeof WalkontableBottomLeftCornerOverlay !== 'undefined') {
this.bottomLeftCornerOverlay = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER, this.wot);
} else {
this.bottomLeftCornerOverlay = {needFullRender: false};
}
if (this.wot.getSetting('debug')) {
this.debug = WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG, this.wot);
}
this.destroyed = false;
this.keyPressed = false;
this.spreaderLastSize = {
width: null,
height: null
};
this.overlayScrollPositions = {
master: {
top: 0,
left: 0
},
top: {
top: null,
left: 0
},
bottom: {
top: null,
left: 0
},
left: {
top: 0,
left: null
}
};
this.verticalScrolling = false;
this.horizontalScrolling = false;
this.delegatedScrollCallback = false;
this.registerListeners();
};
($traceurRuntime.createClass)(WalkontableOverlays, {
refreshAll: function() {
if (!this.wot.drawn) {
return;
}
if (!this.wot.wtTable.holder.parentNode) {
this.destroy();
return;
}
this.wot.draw(true);
if (this.verticalScrolling) {
this.leftOverlay.onScroll();
}
if (this.horizontalScrolling) {
this.topOverlay.onScroll();
}
this.verticalScrolling = false;
this.horizontalScrolling = false;
},
registerListeners: function() {
var $__3 = this;
this.eventManager.addEventListener(document.documentElement, 'keydown', (function(event) {
return $__3.onKeyDown(event);
}));
this.eventManager.addEventListener(document.documentElement, 'keyup', (function() {
return $__3.onKeyUp();
}));
this.eventManager.addEventListener(document, 'visibilitychange', (function() {
return $__3.onKeyUp();
}));
var topOverlayScrollable = this.topOverlay.mainTableScrollableElement;
var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement;
this.eventManager.addEventListener(topOverlayScrollable, 'scroll', (function(event) {
return $__3.onTableScroll(event);
}));
if (topOverlayScrollable !== leftOverlayScrollable) {
this.eventManager.addEventListener(leftOverlayScrollable, 'scroll', (function(event) {
return $__3.onTableScroll(event);
}));
}
if (this.topOverlay.needFullRender) {
this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'scroll', (function(event) {
return $__3.onTableScroll(event);
}));
this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'wheel', (function(event) {
return $__3.onTableScroll(event);
}));
}
if (this.bottomOverlay.needFullRender) {
this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder, 'scroll', (function(event) {
return $__3.onTableScroll(event);
}));
this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder, 'wheel', (function(event) {
return $__3.onTableScroll(event);
}));
}
if (this.leftOverlay.needFullRender) {
this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder, 'scroll', (function(event) {
return $__3.onTableScroll(event);
}));
this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder, 'wheel', (function(event) {
return $__3.onTableScroll(event);
}));
}
if (this.topOverlay.trimmingContainer !== window && this.leftOverlay.trimmingContainer !== window) {
this.eventManager.addEventListener(window, 'wheel', (function(event) {
var overlay;
var deltaY = event.wheelDeltaY || event.deltaY;
var deltaX = event.wheelDeltaX || event.deltaX;
if ($__3.topOverlay.clone.wtTable.holder.contains(event.realTarget)) {
overlay = 'top';
} else if ($__3.bottomOverlay.clone && $__3.bottomOverlay.clone.wtTable.holder.contains(event.realTarget)) {
overlay = 'bottom';
} else if ($__3.leftOverlay.clone.wtTable.holder.contains(event.realTarget)) {
overlay = 'left';
}
if (overlay == 'top' && deltaY !== 0) {
event.preventDefault();
} else if (overlay == 'left' && deltaX !== 0) {
event.preventDefault();
} else if (overlay == 'bottom' && deltaY !== 0) {
event.preventDefault();
}
}));
}
},
onTableScroll: function(event) {
if (Handsontable.mobileBrowser) {
return;
}
var masterHorizontal = this.leftOverlay.mainTableScrollableElement;
var masterVertical = this.topOverlay.mainTableScrollableElement;
var target = event.target;
if (this.keyPressed) {
if ((masterVertical !== window && target !== window && !event.target.contains(masterVertical)) || (masterHorizontal !== window && target !== window && !event.target.contains(masterHorizontal))) {
return;
}
}
if (event.type === 'scroll') {
this.syncScrollPositions(event);
} else {
this.translateMouseWheelToScroll(event);
}
},
onKeyDown: function(event) {
this.keyPressed = isKey(event.keyCode, 'ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT');
},
onKeyUp: function() {
this.keyPressed = false;
},
translateMouseWheelToScroll: function(event) {
var topOverlay = this.topOverlay.clone.wtTable.holder;
var bottomOverlay = this.bottomOverlay.clone ? this.bottomOverlay.clone.wtTable.holder : null;
var leftOverlay = this.leftOverlay.clone.wtTable.holder;
var eventMockup = {type: 'wheel'};
var tempElem = event.target;
var deltaY = event.wheelDeltaY || (-1) * event.deltaY;
var deltaX = event.wheelDeltaX || (-1) * event.deltaX;
var parentHolder;
if (event.deltaMode === 1) {
deltaY = deltaY * 120;
deltaX = deltaX * 120;
}
while (tempElem != document && tempElem != null) {
if (tempElem.className.indexOf('wtHolder') > -1) {
parentHolder = tempElem;
break;
}
tempElem = tempElem.parentNode;
}
eventMockup.target = parentHolder;
if (parentHolder == topOverlay) {
this.syncScrollPositions(eventMockup, (-0.2) * deltaY);
} else if (parentHolder == bottomOverlay) {
this.syncScrollPositions(eventMockup, (-0.2) * deltaY);
} else if (parentHolder == leftOverlay) {
this.syncScrollPositions(eventMockup, (-0.2) * deltaX);
}
return false;
},
syncScrollPositions: function(event) {
var fakeScrollValue = arguments[1] !== (void 0) ? arguments[1] : null;
if (this.destroyed) {
return;
}
if (arguments.length === 0) {
this.syncScrollWithMaster();
return;
}
var masterHorizontal = this.leftOverlay.mainTableScrollableElement;
var masterVertical = this.topOverlay.mainTableScrollableElement;
var target = event.target;
var tempScrollValue = 0;
var scrollValueChanged = false;
var topOverlay;
var leftOverlay;
var bottomOverlay;
var delegatedScroll = false;
var preventOverflow = this.wot.getSetting('preventOverflow');
if (this.topOverlay.needFullRender) {
topOverlay = this.topOverlay.clone.wtTable.holder;
}
if (this.bottomOverlay.needFullRender) {
bottomOverlay = this.bottomOverlay.clone.wtTable.holder;
}
if (this.leftOverlay.needFullRender) {
leftOverlay = this.leftOverlay.clone.wtTable.holder;
}
if (target === document) {
target = window;
}
if (target === masterHorizontal || target === masterVertical) {
if (preventOverflow) {
tempScrollValue = getScrollLeft(this.scrollableElement);
} else {
tempScrollValue = getScrollLeft(target);
}
if (this.overlayScrollPositions.master.left !== tempScrollValue) {
this.horizontalScrolling = true;
this.overlayScrollPositions.master.left = tempScrollValue;
scrollValueChanged = true;
if (topOverlay && topOverlay.scrollLeft !== tempScrollValue) {
topOverlay.scrollLeft = tempScrollValue;
delegatedScroll = (masterHorizontal !== window);
}
if (bottomOverlay && bottomOverlay.scrollLeft !== tempScrollValue) {
bottomOverlay.scrollLeft = tempScrollValue;
delegatedScroll = (masterHorizontal !== window);
}
}
tempScrollValue = getScrollTop(target);
if (this.overlayScrollPositions.master.top !== tempScrollValue) {
this.verticalScrolling = true;
this.overlayScrollPositions.master.top = tempScrollValue;
scrollValueChanged = true;
if (leftOverlay && leftOverlay.scrollTop !== tempScrollValue) {
leftOverlay.scrollTop = tempScrollValue;
delegatedScroll = (masterVertical !== window);
}
}
} else if (target === bottomOverlay) {
tempScrollValue = getScrollLeft(target);
if (this.overlayScrollPositions.bottom.left !== tempScrollValue) {
this.horizontalScrolling = true;
this.overlayScrollPositions.bottom.left = tempScrollValue;
scrollValueChanged = true;
if (masterHorizontal.scrollLeft !== tempScrollValue) {
masterHorizontal.scrollLeft = tempScrollValue;
}
}
if (fakeScrollValue !== null) {
scrollValueChanged = true;
masterVertical.scrollTop += fakeScrollValue;
}
} else if (target === topOverlay) {
tempScrollValue = getScrollLeft(target);
if (this.overlayScrollPositions.top.left !== tempScrollValue) {
this.horizontalScrolling = true;
this.overlayScrollPositions.top.left = tempScrollValue;
scrollValueChanged = true;
if (masterHorizontal.scrollLeft !== tempScrollValue) {
masterHorizontal.scrollLeft = tempScrollValue;
}
}
if (fakeScrollValue !== null) {
scrollValueChanged = true;
masterVertical.scrollTop += fakeScrollValue;
}
} else if (target === leftOverlay) {
tempScrollValue = getScrollTop(target);
if (this.overlayScrollPositions.left.top !== tempScrollValue) {
this.verticalScrolling = true;
this.overlayScrollPositions.left.top = tempScrollValue;
scrollValueChanged = true;
if (masterVertical.scrollTop !== tempScrollValue) {
masterVertical.scrollTop = tempScrollValue;
}
}
if (fakeScrollValue !== null) {
scrollValueChanged = true;
masterVertical.scrollLeft += fakeScrollValue;
}
}
if (!this.keyPressed && scrollValueChanged && event.type === 'scroll') {
if (this.delegatedScrollCallback) {
this.delegatedScrollCallback = false;
} else {
this.refreshAll();
}
if (delegatedScroll) {
this.delegatedScrollCallback = true;
}
}
},
syncScrollWithMaster: function() {
var master = this.topOverlay.mainTableScrollableElement;
if (this.topOverlay.needFullRender) {
this.topOverlay.clone.wtTable.holder.scrollLeft = master.scrollLeft;
}
if (this.leftOverlay.needFullRender) {
this.leftOverlay.clone.wtTable.holder.scrollTop = master.scrollTop;
}
},
destroy: function() {
this.eventManager.destroy();
this.topOverlay.destroy();
if (this.bottomOverlay.clone) {
this.bottomOverlay.destroy();
}
this.leftOverlay.destroy();
if (this.topLeftCornerOverlay) {
this.topLeftCornerOverlay.destroy();
}
if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {
this.bottomLeftCornerOverlay.destroy();
}
if (this.debug) {
this.debug.destroy();
}
this.destroyed = true;
},
refresh: function() {
var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false;
if (this.topOverlay.areElementSizesAdjusted && this.leftOverlay.areElementSizesAdjusted) {
var container = this.wot.wtTable.wtRootElement.parentNode || this.wot.wtTable.wtRootElement;
var width = container.clientWidth;
var height = container.clientHeight;
if (width !== this.spreaderLastSize.width || height !== this.spreaderLastSize.height) {
this.spreaderLastSize.width = width;
this.spreaderLastSize.height = height;
this.adjustElementsSize();
}
}
if (this.bottomOverlay.clone) {
this.bottomOverlay.refresh(fastDraw);
}
this.leftOverlay.refresh(fastDraw);
this.topOverlay.refresh(fastDraw);
if (this.topLeftCornerOverlay) {
this.topLeftCornerOverlay.refresh(fastDraw);
}
if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {
this.bottomLeftCornerOverlay.refresh(fastDraw);
}
if (this.debug) {
this.debug.refresh(fastDraw);
}
},
adjustElementsSize: function() {
var force = arguments[0] !== (void 0) ? arguments[0] : false;
var totalColumns = this.wot.getSetting('totalColumns');
var totalRows = this.wot.getSetting('totalRows');
var headerRowSize = this.wot.wtViewport.getRowHeaderWidth();
var headerColumnSize = this.wot.wtViewport.getColumnHeaderHeight();
var hiderStyle = this.wot.wtTable.hider.style;
hiderStyle.width = (headerRowSize + this.leftOverlay.sumCellSizes(0, totalColumns)) + 'px';
hiderStyle.height = (headerColumnSize + this.topOverlay.sumCellSizes(0, totalRows) + 1) + 'px';
this.topOverlay.adjustElementsSize(force);
this.leftOverlay.adjustElementsSize(force);
if (this.bottomOverlay.clone) {
this.bottomOverlay.adjustElementsSize(force);
}
},
applyToDOM: function() {
if (!this.topOverlay.areElementSizesAdjusted || !this.leftOverlay.areElementSizesAdjusted) {
this.adjustElementsSize();
}
this.topOverlay.applyToDOM();
if (this.bottomOverlay.clone) {
this.bottomOverlay.applyToDOM();
}
this.leftOverlay.applyToDOM();
}
}, {});
;
window.WalkontableOverlays = WalkontableOverlays;
//#
},{"eventManager":41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableScroll: {get: function() {
return WalkontableScroll;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47__46__46__47_helpers_47_number__;
var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
innerHeight = $__0.innerHeight,
innerWidth = $__0.innerWidth,
getScrollLeft = $__0.getScrollLeft,
getScrollTop = $__0.getScrollTop,
offset = $__0.offset;
var $__1 = ($___46__46__47__46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_number__}),
rangeEach = $__1.rangeEach,
rangeEachReverse = $__1.rangeEachReverse;
var WalkontableScroll = function WalkontableScroll(wotInstance) {
this.wot = wotInstance;
this.instance = wotInstance;
};
($traceurRuntime.createClass)(WalkontableScroll, {
scrollViewport: function(coords) {
if (!this.wot.drawn) {
return;
}
var $__3 = this._getVariables(),
topOverlay = $__3.topOverlay,
leftOverlay = $__3.leftOverlay,
totalRows = $__3.totalRows,
totalColumns = $__3.totalColumns,
fixedRowsTop = $__3.fixedRowsTop,
fixedRowsBottom = $__3.fixedRowsBottom,
fixedColumnsLeft = $__3.fixedColumnsLeft;
if (coords.row < 0 || coords.row > totalRows - 1) {
throw new Error(("row " + coords.row + " does not exist"));
}
if (coords.col < 0 || coords.col > totalColumns - 1) {
throw new Error(("column " + coords.col + " does not exist"));
}
if (coords.row >= fixedRowsTop && coords.row < this.getFirstVisibleRow()) {
topOverlay.scrollTo(coords.row);
} else if (coords.row > this.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) {
topOverlay.scrollTo(coords.row, true);
}
if (coords.col >= fixedColumnsLeft && coords.col < this.getFirstVisibleColumn()) {
leftOverlay.scrollTo(coords.col);
} else if (coords.col > this.getLastVisibleColumn()) {
leftOverlay.scrollTo(coords.col, true);
}
},
getFirstVisibleRow: function() {
var $__3 = this._getVariables(),
topOverlay = $__3.topOverlay,
wtTable = $__3.wtTable,
wtViewport = $__3.wtViewport,
totalRows = $__3.totalRows,
fixedRowsTop = $__3.fixedRowsTop;
var firstVisibleRow = wtTable.getFirstVisibleRow();
if (topOverlay.mainTableScrollableElement === window) {
var rootElementOffset = offset(wtTable.wtRootElement);
var totalTableHeight = innerHeight(wtTable.hider);
var windowHeight = innerHeight(window);
var windowScrollTop = getScrollTop(window);
if (rootElementOffset.top + totalTableHeight - windowHeight <= windowScrollTop) {
var rowsHeight = wtViewport.getColumnHeaderHeight();
rowsHeight += topOverlay.sumCellSizes(0, fixedRowsTop);
rangeEachReverse(totalRows, 1, (function(row) {
rowsHeight += topOverlay.sumCellSizes(row - 1, row);
if (rootElementOffset.top + totalTableHeight - rowsHeight <= windowScrollTop) {
firstVisibleRow = row;
return false;
}
}));
}
}
return firstVisibleRow;
},
getLastVisibleRow: function() {
var $__3 = this._getVariables(),
topOverlay = $__3.topOverlay,
wtTable = $__3.wtTable,
wtViewport = $__3.wtViewport,
totalRows = $__3.totalRows;
var lastVisibleRow = wtTable.getLastVisibleRow();
if (topOverlay.mainTableScrollableElement === window) {
var rootElementOffset = offset(wtTable.wtRootElement);
var windowHeight = innerHeight(window);
var windowScrollTop = getScrollTop(window);
if (rootElementOffset.top > windowScrollTop) {
var rowsHeight = wtViewport.getColumnHeaderHeight();
rangeEach(1, totalRows, (function(row) {
rowsHeight += topOverlay.sumCellSizes(row - 1, row);
if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) {
lastVisibleRow = row - 2;
return false;
}
}));
}
}
return lastVisibleRow;
},
getFirstVisibleColumn: function() {
var $__3 = this._getVariables(),
leftOverlay = $__3.leftOverlay,
wtTable = $__3.wtTable,
wtViewport = $__3.wtViewport,
totalColumns = $__3.totalColumns,
fixedColumnsLeft = $__3.fixedColumnsLeft;
var firstVisibleColumn = wtTable.getFirstVisibleColumn();
if (leftOverlay.mainTableScrollableElement === window) {
var rootElementOffset = offset(wtTable.wtRootElement);
var totalTableWidth = innerWidth(wtTable.hider);
var windowWidth = innerWidth(window);
var windowScrollLeft = getScrollLeft(window);
if (rootElementOffset.left + totalTableWidth - windowWidth <= windowScrollLeft) {
var columnsWidth = wtViewport.getRowHeaderWidth();
rangeEachReverse(totalColumns, 1, (function(column) {
columnsWidth += leftOverlay.sumCellSizes(column - 1, column);
if (rootElementOffset.left + totalTableWidth - columnsWidth <= windowScrollLeft) {
firstVisibleColumn = column;
return false;
}
}));
}
}
return firstVisibleColumn;
},
getLastVisibleColumn: function() {
var $__3 = this._getVariables(),
leftOverlay = $__3.leftOverlay,
wtTable = $__3.wtTable,
wtViewport = $__3.wtViewport,
totalColumns = $__3.totalColumns;
var lastVisibleColumn = wtTable.getLastVisibleColumn();
if (leftOverlay.mainTableScrollableElement === window) {
var rootElementOffset = offset(wtTable.wtRootElement);
var windowWidth = innerWidth(window);
var windowScrollLeft = getScrollLeft(window);
if (rootElementOffset.left > windowScrollLeft) {
var columnsWidth = wtViewport.getRowHeaderWidth();
rangeEach(1, totalColumns, (function(column) {
columnsWidth += leftOverlay.sumCellSizes(column - 1, column);
if (rootElementOffset.left + columnsWidth - windowScrollLeft >= windowWidth) {
lastVisibleColumn = column - 2;
return false;
}
}));
}
}
return lastVisibleColumn;
},
_getVariables: function() {
var wot = this.wot;
var topOverlay = wot.wtOverlays.topOverlay;
var leftOverlay = wot.wtOverlays.leftOverlay;
var wtTable = wot.wtTable;
var wtViewport = wot.wtViewport;
var totalRows = wot.getSetting('totalRows');
var totalColumns = wot.getSetting('totalColumns');
var fixedRowsTop = wot.getSetting('fixedRowsTop');
var fixedRowsBottom = wot.getSetting('fixedRowsBottom');
var fixedColumnsLeft = wot.getSetting('fixedColumnsLeft');
return {
topOverlay: topOverlay,
leftOverlay: leftOverlay,
wtTable: wtTable,
wtViewport: wtViewport,
totalRows: totalRows,
totalColumns: totalColumns,
fixedRowsTop: fixedRowsTop,
fixedRowsBottom: fixedRowsBottom,
fixedColumnsLeft: fixedColumnsLeft
};
}
}, {});
;
window.WalkontableScroll = WalkontableScroll;
//#
},{"helpers/dom/element":45,"helpers/number":49}],18:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableSelection: {get: function() {
return WalkontableSelection;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$__border__,
$__cell_47_coords__,
$__cell_47_range__;
var addClass = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}).addClass;
var WalkontableBorder = ($__border__ = require("border"), $__border__ && $__border__.__esModule && $__border__ || {default: $__border__}).WalkontableBorder;
var WalkontableCellCoords = ($__cell_47_coords__ = require("cell/coords"), $__cell_47_coords__ && $__cell_47_coords__.__esModule && $__cell_47_coords__ || {default: $__cell_47_coords__}).WalkontableCellCoords;
var WalkontableCellRange = ($__cell_47_range__ = require("cell/range"), $__cell_47_range__ && $__cell_47_range__.__esModule && $__cell_47_range__ || {default: $__cell_47_range__}).WalkontableCellRange;
var WalkontableSelection = function WalkontableSelection(settings, cellRange) {
this.settings = settings;
this.cellRange = cellRange || null;
this.instanceBorders = {};
};
($traceurRuntime.createClass)(WalkontableSelection, {
getBorder: function(wotInstance) {
if (this.instanceBorders[wotInstance.guid]) {
return this.instanceBorders[wotInstance.guid];
}
this.instanceBorders[wotInstance.guid] = new WalkontableBorder(wotInstance, this.settings);
},
isEmpty: function() {
return this.cellRange === null;
},
add: function(coords) {
if (this.isEmpty()) {
this.cellRange = new WalkontableCellRange(coords, coords, coords);
} else {
this.cellRange.expand(coords);
}
},
replace: function(oldCoords, newCoords) {
if (!this.isEmpty()) {
if (this.cellRange.from.isEqual(oldCoords)) {
this.cellRange.from = newCoords;
return true;
}
if (this.cellRange.to.isEqual(oldCoords)) {
this.cellRange.to = newCoords;
return true;
}
}
return false;
},
clear: function() {
this.cellRange = null;
},
getCorners: function() {
var topLeft = this.cellRange.getTopLeftCorner();
var bottomRight = this.cellRange.getBottomRightCorner();
return [topLeft.row, topLeft.col, bottomRight.row, bottomRight.col];
},
addClassAtCoords: function(wotInstance, sourceRow, sourceColumn, className) {
var TD = wotInstance.wtTable.getCell(new WalkontableCellCoords(sourceRow, sourceColumn));
if (typeof TD === 'object') {
addClass(TD, className);
}
},
draw: function(wotInstance) {
if (this.isEmpty()) {
if (this.settings.border) {
var border = this.getBorder(wotInstance);
if (border) {
border.disappear();
}
}
return;
}
var renderedRows = wotInstance.wtTable.getRenderedRowsCount();
var renderedColumns = wotInstance.wtTable.getRenderedColumnsCount();
var corners = this.getCorners();
var sourceRow,
sourceCol,
TH;
for (var column = 0; column < renderedColumns; column++) {
sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column);
if (sourceCol >= corners[1] && sourceCol <= corners[3]) {
TH = wotInstance.wtTable.getColumnHeader(sourceCol);
if (TH && this.settings.highlightColumnClassName) {
addClass(TH, this.settings.highlightColumnClassName);
}
}
}
for (var row = 0; row < renderedRows; row++) {
sourceRow = wotInstance.wtTable.rowFilter.renderedToSource(row);
if (sourceRow >= corners[0] && sourceRow <= corners[2]) {
TH = wotInstance.wtTable.getRowHeader(sourceRow);
if (TH && this.settings.highlightRowClassName) {
addClass(TH, this.settings.highlightRowClassName);
}
}
for (var column$__5 = 0; column$__5 < renderedColumns; column$__5++) {
sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column$__5);
if (sourceRow >= corners[0] && sourceRow <= corners[2] && sourceCol >= corners[1] && sourceCol <= corners[3]) {
if (this.settings.className) {
this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.className);
}
} else if (sourceRow >= corners[0] && sourceRow <= corners[2]) {
if (this.settings.highlightRowClassName) {
this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightRowClassName);
}
} else if (sourceCol >= corners[1] && sourceCol <= corners[3]) {
if (this.settings.highlightColumnClassName) {
this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightColumnClassName);
}
}
}
}
wotInstance.getSetting('onBeforeDrawBorders', corners, this.settings.className);
if (this.settings.border) {
var border$__6 = this.getBorder(wotInstance);
if (border$__6) {
border$__6.appear(corners);
}
}
}
}, {});
;
window.WalkontableSelection = WalkontableSelection;
//#
},{"border":2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableSettings: {get: function() {
return WalkontableSettings;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__;
var fastInnerText = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}).fastInnerText;
var WalkontableSettings = function WalkontableSettings(wotInstance, settings) {
var $__1 = this;
this.wot = wotInstance;
this.instance = wotInstance;
this.defaults = {
table: void 0,
debug: false,
externalRowCalculator: false,
stretchH: 'none',
currentRowClassName: null,
currentColumnClassName: null,
preventOverflow: function() {
return false;
},
data: void 0,
fixedColumnsLeft: 0,
fixedRowsTop: 0,
fixedRowsBottom: 0,
minSpareRows: 0,
rowHeaders: function() {
return [];
},
columnHeaders: function() {
return [];
},
totalRows: void 0,
totalColumns: void 0,
cellRenderer: (function(row, column, TD) {
var cellData = $__1.getSetting('data', row, column);
fastInnerText(TD, cellData === void 0 || cellData === null ? '' : cellData);
}),
columnWidth: function(col) {
return;
},
rowHeight: function(row) {
return;
},
defaultRowHeight: 23,
defaultColumnWidth: 50,
selections: null,
hideBorderOnMouseDownOver: false,
viewportRowCalculatorOverride: null,
viewportColumnCalculatorOverride: null,
onCellMouseDown: null,
onCellMouseOver: null,
onCellDblClick: null,
onCellCornerMouseDown: null,
onCellCornerDblClick: null,
beforeDraw: null,
onDraw: null,
onBeforeDrawBorders: null,
onScrollVertically: null,
onScrollHorizontally: null,
onBeforeTouchScroll: null,
onAfterMomentumScroll: null,
onBeforeStretchingColumnWidth: (function(width) {
return width;
}),
scrollbarWidth: 10,
scrollbarHeight: 10,
renderAllRows: false,
groups: false,
rowHeaderWidth: null,
columnHeaderHeight: null
};
this.settings = {};
for (var i in this.defaults) {
if (this.defaults.hasOwnProperty(i)) {
if (settings[i] !== void 0) {
this.settings[i] = settings[i];
} else if (this.defaults[i] === void 0) {
throw new Error('A required setting "' + i + '" was not provided');
} else {
this.settings[i] = this.defaults[i];
}
}
}
};
($traceurRuntime.createClass)(WalkontableSettings, {
update: function(settings, value) {
if (value === void 0) {
for (var i in settings) {
if (settings.hasOwnProperty(i)) {
this.settings[i] = settings[i];
}
}
} else {
this.settings[settings] = value;
}
return this.wot;
},
getSetting: function(key, param1, param2, param3, param4) {
if (typeof this.settings[key] === 'function') {
return this.settings[key](param1, param2, param3, param4);
} else if (param1 !== void 0 && Array.isArray(this.settings[key])) {
return this.settings[key][param1];
} else {
return this.settings[key];
}
},
has: function(key) {
return !!this.settings[key];
}
}, {});
;
window.WalkontableSettings = WalkontableSettings;
//#
},{"helpers/dom/element":45}],20:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableTable: {get: function() {
return WalkontableTable;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$__cell_47_coords__,
$__cell_47_range__,
$__filter_47_column__,
$__filter_47_row__,
$__tableRenderer__;
var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
getStyle = $__0.getStyle,
getTrimmingContainer = $__0.getTrimmingContainer,
hasClass = $__0.hasClass,
index = $__0.index,
offset = $__0.offset,
removeClass = $__0.removeClass,
removeTextNodes = $__0.removeTextNodes,
overlayContainsElement = $__0.overlayContainsElement,
closest = $__0.closest;
var WalkontableCellCoords = ($__cell_47_coords__ = require("cell/coords"), $__cell_47_coords__ && $__cell_47_coords__.__esModule && $__cell_47_coords__ || {default: $__cell_47_coords__}).WalkontableCellCoords;
var WalkontableCellRange = ($__cell_47_range__ = require("cell/range"), $__cell_47_range__ && $__cell_47_range__.__esModule && $__cell_47_range__ || {default: $__cell_47_range__}).WalkontableCellRange;
var WalkontableColumnFilter = ($__filter_47_column__ = require("filter/column"), $__filter_47_column__ && $__filter_47_column__.__esModule && $__filter_47_column__ || {default: $__filter_47_column__}).WalkontableColumnFilter;
var WalkontableRowFilter = ($__filter_47_row__ = require("filter/row"), $__filter_47_row__ && $__filter_47_row__.__esModule && $__filter_47_row__ || {default: $__filter_47_row__}).WalkontableRowFilter;
var WalkontableTableRenderer = ($__tableRenderer__ = require("tableRenderer"), $__tableRenderer__ && $__tableRenderer__.__esModule && $__tableRenderer__ || {default: $__tableRenderer__}).WalkontableTableRenderer;
var WalkontableTable = function WalkontableTable(wotInstance, table) {
this.wot = wotInstance;
this.instance = this.wot;
this.TABLE = table;
this.TBODY = null;
this.THEAD = null;
this.COLGROUP = null;
this.tableOffset = 0;
this.holderOffset = 0;
removeTextNodes(this.TABLE);
this.spreader = this.createSpreader(this.TABLE);
this.hider = this.createHider(this.spreader);
this.holder = this.createHolder(this.hider);
this.wtRootElement = this.holder.parentNode;
this.alignOverlaysWithTrimmingContainer();
this.fixTableDomTree();
this.colgroupChildrenLength = this.COLGROUP.childNodes.length;
this.theadChildrenLength = this.THEAD.firstChild ? this.THEAD.firstChild.childNodes.length : 0;
this.tbodyChildrenLength = this.TBODY.childNodes.length;
this.rowFilter = null;
this.columnFilter = null;
};
($traceurRuntime.createClass)(WalkontableTable, {
fixTableDomTree: function() {
this.TBODY = this.TABLE.querySelector('tbody');
if (!this.TBODY) {
this.TBODY = document.createElement('tbody');
this.TABLE.appendChild(this.TBODY);
}
this.THEAD = this.TABLE.querySelector('thead');
if (!this.THEAD) {
this.THEAD = document.createElement('thead');
this.TABLE.insertBefore(this.THEAD, this.TBODY);
}
this.COLGROUP = this.TABLE.querySelector('colgroup');
if (!this.COLGROUP) {
this.COLGROUP = document.createElement('colgroup');
this.TABLE.insertBefore(this.COLGROUP, this.THEAD);
}
if (this.wot.getSetting('columnHeaders').length && !this.THEAD.childNodes.length) {
this.THEAD.appendChild(document.createElement('TR'));
}
},
createSpreader: function(table) {
var parent = table.parentNode;
var spreader;
if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) {
spreader = document.createElement('div');
spreader.className = 'wtSpreader';
if (parent) {
parent.insertBefore(spreader, table);
}
spreader.appendChild(table);
}
spreader.style.position = 'relative';
return spreader;
},
createHider: function(spreader) {
var parent = spreader.parentNode;
var hider;
if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) {
hider = document.createElement('div');
hider.className = 'wtHider';
if (parent) {
parent.insertBefore(hider, spreader);
}
hider.appendChild(spreader);
}
return hider;
},
createHolder: function(hider) {
var parent = hider.parentNode;
var holder;
if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) {
holder = document.createElement('div');
holder.style.position = 'relative';
holder.className = 'wtHolder';
if (parent) {
parent.insertBefore(holder, hider);
}
if (!this.isWorkingOnClone()) {
holder.parentNode.className += 'ht_master handsontable';
}
holder.appendChild(hider);
}
return holder;
},
alignOverlaysWithTrimmingContainer: function() {
var trimmingElement = getTrimmingContainer(this.wtRootElement);
if (!this.isWorkingOnClone()) {
this.holder.parentNode.style.position = 'relative';
if (trimmingElement === window) {
var preventOverflow = this.wot.getSetting('preventOverflow');
if (!preventOverflow) {
this.holder.style.overflow = 'visible';
this.wtRootElement.style.overflow = 'visible';
}
} else {
this.holder.style.width = getStyle(trimmingElement, 'width');
this.holder.style.height = getStyle(trimmingElement, 'height');
this.holder.style.overflow = '';
}
}
},
isWorkingOnClone: function() {
return !!this.wot.cloneSource;
},
draw: function(fastDraw) {
var totalRows = this.instance.getSetting('totalRows');
if (!this.isWorkingOnClone()) {
this.holderOffset = offset(this.holder);
fastDraw = this.wot.wtViewport.createRenderCalculators(fastDraw);
}
if (fastDraw) {
if (!this.isWorkingOnClone()) {
this.wot.wtViewport.createVisibleCalculators();
}
if (this.wot.wtOverlays) {
this.wot.wtOverlays.refresh(true);
}
} else {
if (this.isWorkingOnClone()) {
this.tableOffset = this.wot.cloneSource.wtTable.tableOffset;
} else {
this.tableOffset = offset(this.TABLE);
}
var startRow;
if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_DEBUG) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER)) {
startRow = 0;
} else if (WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM) || WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) {
startRow = Math.max(totalRows - this.wot.getSetting('fixedRowsBottom'), 0);
} else {
startRow = this.wot.wtViewport.rowsRenderCalculator.startRow;
}
var startColumn;
if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_DEBUG) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_LEFT) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_TOP_LEFT_CORNER) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) {
startColumn = 0;
} else {
startColumn = this.wot.wtViewport.columnsRenderCalculator.startColumn;
}
this.rowFilter = new WalkontableRowFilter(startRow, totalRows, this.wot.getSetting('columnHeaders').length);
this.columnFilter = new WalkontableColumnFilter(startColumn, this.wot.getSetting('totalColumns'), this.wot.getSetting('rowHeaders').length);
this._doDraw();
this.alignOverlaysWithTrimmingContainer();
}
this.refreshSelections(fastDraw);
if (!this.isWorkingOnClone()) {
this.wot.wtOverlays.topOverlay.resetFixedPosition();
if (this.wot.wtOverlays.bottomOverlay.clone) {
this.wot.wtOverlays.bottomOverlay.resetFixedPosition();
}
this.wot.wtOverlays.leftOverlay.resetFixedPosition();
if (this.wot.wtOverlays.topLeftCornerOverlay) {
this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition();
}
if (this.instance.wtOverlays.bottomLeftCornerOverlay && this.instance.wtOverlays.bottomLeftCornerOverlay.clone) {
this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition();
}
}
this.wot.drawn = true;
return this;
},
_doDraw: function() {
var wtRenderer = new WalkontableTableRenderer(this);
wtRenderer.render();
},
removeClassFromCells: function(className) {
var nodes = this.TABLE.querySelectorAll('.' + className);
for (var i = 0,
len = nodes.length; i < len; i++) {
removeClass(nodes[i], className);
}
},
refreshSelections: function(fastDraw) {
if (!this.wot.selections) {
return;
}
var len = this.wot.selections.length;
if (fastDraw) {
for (var i = 0; i < len; i++) {
if (this.wot.selections[i].settings.className) {
this.removeClassFromCells(this.wot.selections[i].settings.className);
}
if (this.wot.selections[i].settings.highlightRowClassName) {
this.removeClassFromCells(this.wot.selections[i].settings.highlightRowClassName);
}
if (this.wot.selections[i].settings.highlightColumnClassName) {
this.removeClassFromCells(this.wot.selections[i].settings.highlightColumnClassName);
}
}
}
for (var i$__7 = 0; i$__7 < len; i$__7++) {
this.wot.selections[i$__7].draw(this.wot, fastDraw);
}
},
getCell: function(coords) {
if (this.isRowBeforeRenderedRows(coords.row)) {
return -1;
} else if (this.isRowAfterRenderedRows(coords.row)) {
return -2;
}
var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(coords.row)];
if (TR) {
return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(coords.col)];
}
},
getColumnHeader: function(col) {
var level = arguments[1] !== (void 0) ? arguments[1] : 0;
var TR = this.THEAD.childNodes[level];
if (TR) {
return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(col)];
}
},
getRowHeader: function(row) {
if (this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0) === 0) {
return null;
}
var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];
if (TR) {
return TR.childNodes[0];
}
},
getCoords: function(TD) {
if (TD.nodeName !== 'TD' && TD.nodeName !== 'TH') {
TD = closest(TD, ['TD', 'TH']);
}
var TR = TD.parentNode;
var CONTAINER = TR.parentNode;
var row = index(TR);
var col = TD.cellIndex;
if (overlayContainsElement(WalkontableOverlay.CLONE_TOP_LEFT_CORNER, TD) || overlayContainsElement(WalkontableOverlay.CLONE_TOP, TD)) {
if (CONTAINER.nodeName === 'THEAD') {
row -= CONTAINER.childNodes.length;
}
} else {
if (CONTAINER === this.THEAD) {
row = this.rowFilter.visibleColHeadedRowToSourceRow(row);
} else {
row = this.rowFilter.renderedToSource(row);
}
}
if (overlayContainsElement(WalkontableOverlay.CLONE_TOP_LEFT_CORNER, TD) || overlayContainsElement(WalkontableOverlay.CLONE_LEFT, TD)) {
col = this.columnFilter.offsettedTH(col);
} else {
col = this.columnFilter.visibleRowHeadedColumnToSourceColumn(col);
}
return new WalkontableCellCoords(row, col);
},
getTrForRow: function(row) {
return this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];
},
getFirstRenderedRow: function() {
return this.wot.wtViewport.rowsRenderCalculator.startRow;
},
getFirstVisibleRow: function() {
return this.wot.wtViewport.rowsVisibleCalculator.startRow;
},
getFirstRenderedColumn: function() {
return this.wot.wtViewport.columnsRenderCalculator.startColumn;
},
getFirstVisibleColumn: function() {
return this.wot.wtViewport.columnsVisibleCalculator.startColumn;
},
getLastRenderedRow: function() {
return this.wot.wtViewport.rowsRenderCalculator.endRow;
},
getLastVisibleRow: function() {
return this.wot.wtViewport.rowsVisibleCalculator.endRow;
},
getLastRenderedColumn: function() {
return this.wot.wtViewport.columnsRenderCalculator.endColumn;
},
getLastVisibleColumn: function() {
return this.wot.wtViewport.columnsVisibleCalculator.endColumn;
},
isRowBeforeRenderedRows: function(row) {
return (this.rowFilter.sourceToRendered(row) < 0 && row >= 0);
},
isRowAfterViewport: function(row) {
return (this.rowFilter.sourceToRendered(row) > this.getLastVisibleRow());
},
isRowAfterRenderedRows: function(row) {
return (this.rowFilter.sourceToRendered(row) > this.getLastRenderedRow());
},
isColumnBeforeViewport: function(column) {
return this.columnFilter.sourceToRendered(column) < 0 && column >= 0;
},
isColumnAfterViewport: function(column) {
return (this.columnFilter.sourceToRendered(column) > this.getLastVisibleColumn());
},
isLastRowFullyVisible: function() {
return this.getLastVisibleRow() === this.getLastRenderedRow();
},
isLastColumnFullyVisible: function() {
return this.getLastVisibleColumn() === this.getLastRenderedColumn();
},
getRenderedColumnsCount: function() {
var columnsCount = this.wot.wtViewport.columnsRenderCalculator.count;
var totalColumns = this.wot.getSetting('totalColumns');
if (this.wot.isOverlayName(WalkontableOverlay.CLONE_DEBUG)) {
columnsCount = totalColumns;
} else if (this.wot.isOverlayName(WalkontableOverlay.CLONE_LEFT) || this.wot.isOverlayName(WalkontableOverlay.CLONE_TOP_LEFT_CORNER) || this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) {
return Math.min(this.wot.getSetting('fixedColumnsLeft'), totalColumns);
}
return columnsCount;
},
getRenderedRowsCount: function() {
var rowsCount = this.wot.wtViewport.rowsRenderCalculator.count;
var totalRows = this.wot.getSetting('totalRows');
if (this.wot.isOverlayName(WalkontableOverlay.CLONE_DEBUG)) {
rowsCount = totalRows;
} else if (this.wot.isOverlayName(WalkontableOverlay.CLONE_TOP) || this.wot.isOverlayName(WalkontableOverlay.CLONE_TOP_LEFT_CORNER)) {
rowsCount = Math.min(this.wot.getSetting('fixedRowsTop'), totalRows);
} else if (this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM) || this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) {
rowsCount = Math.min(this.wot.getSetting('fixedRowsBottom'), totalRows);
}
return rowsCount;
},
getVisibleRowsCount: function() {
return this.wot.wtViewport.rowsVisibleCalculator.count;
},
allRowsInViewport: function() {
return this.wot.getSetting('totalRows') == this.getVisibleRowsCount();
},
getRowHeight: function(sourceRow) {
var height = this.wot.wtSettings.settings.rowHeight(sourceRow);
var oversizedHeight = this.wot.wtViewport.oversizedRows[sourceRow];
if (oversizedHeight !== void 0) {
height = height === void 0 ? oversizedHeight : Math.max(height, oversizedHeight);
}
return height;
},
getColumnHeaderHeight: function(level) {
var height = this.wot.wtSettings.settings.defaultRowHeight;
var oversizedHeight = this.wot.wtViewport.oversizedColumnHeaders[level];
if (oversizedHeight !== void 0) {
height = height ? Math.max(height, oversizedHeight) : oversizedHeight;
}
return height;
},
getVisibleColumnsCount: function() {
return this.wot.wtViewport.columnsVisibleCalculator.count;
},
allColumnsInViewport: function() {
return this.wot.getSetting('totalColumns') == this.getVisibleColumnsCount();
},
getColumnWidth: function(sourceColumn) {
var width = this.wot.wtSettings.settings.columnWidth;
if (typeof width === 'function') {
width = width(sourceColumn);
} else if (typeof width === 'object') {
width = width[sourceColumn];
}
return width || this.wot.wtSettings.settings.defaultColumnWidth;
},
getStretchedColumnWidth: function(sourceColumn) {
var columnWidth = this.getColumnWidth(sourceColumn);
var width = columnWidth == null ? this.instance.wtSettings.settings.defaultColumnWidth : columnWidth;
var calculator = this.wot.wtViewport.columnsRenderCalculator;
if (calculator) {
var stretchedWidth = calculator.getStretchedColumnWidth(sourceColumn, width);
if (stretchedWidth) {
width = stretchedWidth;
}
}
return width;
}
}, {});
;
window.WalkontableTable = WalkontableTable;
//#
},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,"tableRenderer":21}],21:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableTableRenderer: {get: function() {
return WalkontableTableRenderer;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__;
var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
empty = $__0.empty,
getScrollbarWidth = $__0.getScrollbarWidth,
hasClass = $__0.hasClass,
innerHeight = $__0.innerHeight,
outerWidth = $__0.outerWidth;
var WalkontableTableRenderer = function WalkontableTableRenderer(wtTable) {
this.wtTable = wtTable;
this.wot = wtTable.instance;
this.instance = wtTable.instance;
this.rowFilter = wtTable.rowFilter;
this.columnFilter = wtTable.columnFilter;
this.TABLE = wtTable.TABLE;
this.THEAD = wtTable.THEAD;
this.TBODY = wtTable.TBODY;
this.COLGROUP = wtTable.COLGROUP;
this.rowHeaders = [];
this.rowHeaderCount = 0;
this.columnHeaders = [];
this.columnHeaderCount = 0;
this.fixedRowsTop = 0;
this.fixedRowsBottom = 0;
};
($traceurRuntime.createClass)(WalkontableTableRenderer, {
render: function() {
if (!this.wtTable.isWorkingOnClone()) {
this.wot.getSetting('beforeDraw', true);
}
this.rowHeaders = this.wot.getSetting('rowHeaders');
this.rowHeaderCount = this.rowHeaders.length;
this.fixedRowsTop = this.wot.getSetting('fixedRowsTop');
this.fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');
this.columnHeaders = this.wot.getSetting('columnHeaders');
this.columnHeaderCount = this.columnHeaders.length;
var columnsToRender = this.wtTable.getRenderedColumnsCount();
var rowsToRender = this.wtTable.getRenderedRowsCount();
var totalColumns = this.wot.getSetting('totalColumns');
var totalRows = this.wot.getSetting('totalRows');
var workspaceWidth;
var adjusted = false;
if (WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM) || WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay, WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)) {
this.columnHeaders = [];
this.columnHeaderCount = 0;
}
if (totalColumns > 0) {
this.adjustAvailableNodes();
adjusted = true;
this.renderColumnHeaders();
this.renderRows(totalRows, rowsToRender, columnsToRender);
if (!this.wtTable.isWorkingOnClone()) {
workspaceWidth = this.wot.wtViewport.getWorkspaceWidth();
this.wot.wtViewport.containerWidth = null;
}
this.adjustColumnHeaderHeights();
this.adjustColumnWidths(columnsToRender);
this.markOversizedColumns();
}
if (!adjusted) {
this.adjustAvailableNodes();
}
this.removeRedundantRows(rowsToRender);
if (!this.wtTable.isWorkingOnClone() || this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)) {
this.markOversizedRows();
}
if (!this.wtTable.isWorkingOnClone()) {
this.wot.wtViewport.createVisibleCalculators();
this.wot.wtOverlays.refresh(false);
var hiderWidth = outerWidth(this.wtTable.hider);
var tableWidth = outerWidth(this.wtTable.TABLE);
if (hiderWidth !== 0 && (tableWidth !== hiderWidth)) {
this.adjustColumnWidths(columnsToRender);
}
this.wot.wtOverlays.applyToDOM();
if (workspaceWidth !== this.wot.wtViewport.getWorkspaceWidth()) {
this.wot.wtViewport.containerWidth = null;
var firstRendered = this.wtTable.getFirstRenderedColumn();
var lastRendered = this.wtTable.getLastRenderedColumn();
var rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');
if (rowHeaderWidthSetting != null) {
for (var i = 0; i < this.rowHeaderCount; i++) {
this.COLGROUP.childNodes[i].style.width = (isNaN(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting) + 'px';
}
}
for (var i$__2 = firstRendered; i$__2 < lastRendered; i$__2++) {
var width = this.wtTable.getStretchedColumnWidth(i$__2);
var renderedIndex = this.columnFilter.sourceToRendered(i$__2);
this.COLGROUP.childNodes[renderedIndex + this.rowHeaderCount].style.width = width + 'px';
}
}
this.wot.getSetting('onDraw', true);
} else if (this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)) {
this.wot.cloneSource.wtOverlays.adjustElementsSize();
}
},
removeRedundantRows: function(renderedRowsCount) {
while (this.wtTable.tbodyChildrenLength > renderedRowsCount) {
this.TBODY.removeChild(this.TBODY.lastChild);
this.wtTable.tbodyChildrenLength--;
}
},
renderRows: function(totalRows, rowsToRender, columnsToRender) {
var lastTD,
TR;
var visibleRowIndex = 0;
var sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);
var isWorkingOnClone = this.wtTable.isWorkingOnClone();
while (sourceRowIndex < totalRows && sourceRowIndex >= 0) {
if (visibleRowIndex > 1000) {
console.error('Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars.');
}
if (rowsToRender !== void 0 && visibleRowIndex === rowsToRender) {
break;
}
TR = this.getOrCreateTrForRow(visibleRowIndex, TR);
this.renderRowHeaders(sourceRowIndex, TR);
this.adjustColumns(TR, columnsToRender + this.rowHeaderCount);
lastTD = this.renderCells(sourceRowIndex, TR, columnsToRender);
if (!isWorkingOnClone || this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)) {
this.resetOversizedRow(sourceRowIndex);
}
if (TR.firstChild) {
var height = this.wot.wtTable.getRowHeight(sourceRowIndex);
if (height) {
height--;
TR.firstChild.style.height = height + 'px';
} else {
TR.firstChild.style.height = '';
}
}
visibleRowIndex++;
sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);
}
},
resetOversizedRow: function(sourceRow) {
if (this.wot.getSetting('externalRowCalculator')) {
return;
}
if (this.wot.wtViewport.oversizedRows && this.wot.wtViewport.oversizedRows[sourceRow]) {
this.wot.wtViewport.oversizedRows[sourceRow] = void 0;
}
},
markOversizedRows: function() {
if (this.wot.getSetting('externalRowCalculator')) {
return;
}
var rowCount = this.instance.wtTable.TBODY.childNodes.length;
var expectedTableHeight = rowCount * this.instance.wtSettings.settings.defaultRowHeight;
var actualTableHeight = innerHeight(this.instance.wtTable.TBODY) - 1;
var previousRowHeight;
var rowInnerHeight;
var sourceRowIndex;
var currentTr;
var rowHeader;
var totalRows = this.instance.getSetting('totalRows');
if (expectedTableHeight === actualTableHeight && !this.instance.getSetting('fixedRowsBottom')) {
return;
}
while (rowCount) {
rowCount--;
sourceRowIndex = this.instance.wtTable.rowFilter.renderedToSource(rowCount);
previousRowHeight = this.instance.wtTable.getRowHeight(sourceRowIndex);
currentTr = this.instance.wtTable.getTrForRow(sourceRowIndex);
rowHeader = currentTr.querySelector('th');
if (rowHeader) {
rowInnerHeight = innerHeight(rowHeader);
} else {
rowInnerHeight = innerHeight(currentTr) - 1;
}
if ((!previousRowHeight && this.instance.wtSettings.settings.defaultRowHeight < rowInnerHeight || previousRowHeight < rowInnerHeight)) {
this.instance.wtViewport.oversizedRows[sourceRowIndex] = ++rowInnerHeight;
}
}
},
markOversizedColumns: function() {
var overlayName = this.wot.getOverlayName();
if (!this.columnHeaderCount || this.wot.wtViewport.isMarkedOversizedColumn[overlayName] || this.wtTable.isWorkingOnClone()) {
return;
}
var columnCount = this.wtTable.getRenderedColumnsCount();
for (var i = 0; i < this.columnHeaderCount; i++) {
for (var renderedColumnIndex = (-1) * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {
this.markIfOversizedColumnHeader(renderedColumnIndex);
}
}
this.wot.wtViewport.isMarkedOversizedColumn[overlayName] = true;
},
adjustColumnHeaderHeights: function() {
var columnHeaders = this.wot.getSetting('columnHeaders');
var childs = this.wot.wtTable.THEAD.childNodes;
var oversizedCols = this.wot.wtViewport.oversizedColumnHeaders;
for (var i = 0,
len = columnHeaders.length; i < len; i++) {
if (oversizedCols[i]) {
if (childs[i].childNodes.length === 0) {
return;
}
childs[i].childNodes[0].style.height = oversizedCols[i] + 'px';
}
}
},
markIfOversizedColumnHeader: function(col) {
var sourceColIndex = this.wot.wtTable.columnFilter.renderedToSource(col);
var level = this.columnHeaderCount;
var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;
var previousColHeaderHeight;
var currentHeader;
var currentHeaderHeight;
var columnHeaderHeightSetting = this.wot.getSetting('columnHeaderHeight') || [];
while (level) {
level--;
previousColHeaderHeight = this.wot.wtTable.getColumnHeaderHeight(level);
currentHeader = this.wot.wtTable.getColumnHeader(sourceColIndex, level);
if (!currentHeader) {
continue;
}
currentHeaderHeight = innerHeight(currentHeader);
if (!previousColHeaderHeight && defaultRowHeight < currentHeaderHeight || previousColHeaderHeight < currentHeaderHeight) {
this.wot.wtViewport.oversizedColumnHeaders[level] = currentHeaderHeight;
}
if (this.wot.wtViewport.oversizedColumnHeaders[level] < (columnHeaderHeightSetting[level] || columnHeaderHeightSetting)) {
this.wot.wtViewport.oversizedColumnHeaders[level] = (columnHeaderHeightSetting[level] || columnHeaderHeightSetting);
}
}
},
renderCells: function(sourceRowIndex, TR, columnsToRender) {
var TD;
var sourceColIndex;
for (var visibleColIndex = 0; visibleColIndex < columnsToRender; visibleColIndex++) {
sourceColIndex = this.columnFilter.renderedToSource(visibleColIndex);
if (visibleColIndex === 0) {
TD = TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(sourceColIndex)];
} else {
TD = TD.nextSibling;
}
if (TD.nodeName == 'TH') {
TD = replaceThWithTd(TD, TR);
}
if (!hasClass(TD, 'hide')) {
TD.className = '';
}
TD.removeAttribute('style');
this.wot.wtSettings.settings.cellRenderer(sourceRowIndex, sourceColIndex, TD);
}
return TD;
},
adjustColumnWidths: function(columnsToRender) {
var scrollbarCompensation = 0;
var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;
var mainHolder = sourceInstance.wtTable.holder;
if (mainHolder.offsetHeight < mainHolder.scrollHeight) {
scrollbarCompensation = getScrollbarWidth();
}
this.wot.wtViewport.columnsRenderCalculator.refreshStretching(this.wot.wtViewport.getViewportWidth() - scrollbarCompensation);
var rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');
if (rowHeaderWidthSetting != null) {
for (var i = 0; i < this.rowHeaderCount; i++) {
this.COLGROUP.childNodes[i].style.width = (isNaN(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting) + 'px';
}
}
for (var renderedColIndex = 0; renderedColIndex < columnsToRender; renderedColIndex++) {
var width = this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(renderedColIndex));
this.COLGROUP.childNodes[renderedColIndex + this.rowHeaderCount].style.width = width + 'px';
}
},
appendToTbody: function(TR) {
this.TBODY.appendChild(TR);
this.wtTable.tbodyChildrenLength++;
},
getOrCreateTrForRow: function(rowIndex, currentTr) {
var TR;
if (rowIndex >= this.wtTable.tbodyChildrenLength) {
TR = this.createRow();
this.appendToTbody(TR);
} else if (rowIndex === 0) {
TR = this.TBODY.firstChild;
} else {
TR = currentTr.nextSibling;
}
if (TR.className) {
TR.removeAttribute('class');
}
return TR;
},
createRow: function() {
var TR = document.createElement('TR');
for (var visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {
TR.appendChild(document.createElement('TH'));
}
return TR;
},
renderRowHeader: function(row, col, TH) {
TH.className = '';
TH.removeAttribute('style');
this.rowHeaders[col](row, TH, col);
},
renderRowHeaders: function(row, TR) {
for (var TH = TR.firstChild,
visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {
if (!TH) {
TH = document.createElement('TH');
TR.appendChild(TH);
} else if (TH.nodeName == 'TD') {
TH = replaceTdWithTh(TH, TR);
}
this.renderRowHeader(row, visibleColIndex, TH);
TH = TH.nextSibling;
}
},
adjustAvailableNodes: function() {
this.adjustColGroups();
this.adjustThead();
},
renderColumnHeaders: function() {
var overlayName = this.wot.getOverlayName();
if (!this.columnHeaderCount) {
return;
}
var columnCount = this.wtTable.getRenderedColumnsCount();
for (var i = 0; i < this.columnHeaderCount; i++) {
var TR = this.getTrForColumnHeaders(i);
for (var renderedColumnIndex = (-1) * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {
var sourceCol = this.columnFilter.renderedToSource(renderedColumnIndex);
this.renderColumnHeader(i, sourceCol, TR.childNodes[renderedColumnIndex + this.rowHeaderCount]);
}
}
},
adjustColGroups: function() {
var columnCount = this.wtTable.getRenderedColumnsCount();
while (this.wtTable.colgroupChildrenLength < columnCount + this.rowHeaderCount) {
this.COLGROUP.appendChild(document.createElement('COL'));
this.wtTable.colgroupChildrenLength++;
}
while (this.wtTable.colgroupChildrenLength > columnCount + this.rowHeaderCount) {
this.COLGROUP.removeChild(this.COLGROUP.lastChild);
this.wtTable.colgroupChildrenLength--;
}
if (this.rowHeaderCount) {
addClass(this.COLGROUP.childNodes[0], 'rowHeader');
}
},
adjustThead: function() {
var columnCount = this.wtTable.getRenderedColumnsCount();
var TR = this.THEAD.firstChild;
if (this.columnHeaders.length) {
for (var i = 0,
len = this.columnHeaders.length; i < len; i++) {
TR = this.THEAD.childNodes[i];
if (!TR) {
TR = document.createElement('TR');
this.THEAD.appendChild(TR);
}
this.theadChildrenLength = TR.childNodes.length;
while (this.theadChildrenLength < columnCount + this.rowHeaderCount) {
TR.appendChild(document.createElement('TH'));
this.theadChildrenLength++;
}
while (this.theadChildrenLength > columnCount + this.rowHeaderCount) {
TR.removeChild(TR.lastChild);
this.theadChildrenLength--;
}
}
var theadChildrenLength = this.THEAD.childNodes.length;
if (theadChildrenLength > this.columnHeaders.length) {
for (var i$__3 = this.columnHeaders.length; i$__3 < theadChildrenLength; i$__3++) {
this.THEAD.removeChild(this.THEAD.lastChild);
}
}
} else if (TR) {
empty(TR);
}
},
getTrForColumnHeaders: function(index) {
return this.THEAD.childNodes[index];
},
renderColumnHeader: function(row, col, TH) {
TH.className = '';
TH.removeAttribute('style');
return this.columnHeaders[row](col, TH, row);
},
adjustColumns: function(TR, desiredCount) {
var count = TR.childNodes.length;
while (count < desiredCount) {
var TD = document.createElement('TD');
TR.appendChild(TD);
count++;
}
while (count > desiredCount) {
TR.removeChild(TR.lastChild);
count--;
}
},
removeRedundantColumns: function(columnsToRender) {
while (this.wtTable.tbodyChildrenLength > columnsToRender) {
this.TBODY.removeChild(this.TBODY.lastChild);
this.wtTable.tbodyChildrenLength--;
}
}
}, {});
function replaceTdWithTh(TD, TR) {
var TH = document.createElement('TH');
TR.insertBefore(TH, TD);
TR.removeChild(TD);
return TH;
}
function replaceThWithTd(TH, TR) {
var TD = document.createElement('TD');
TR.insertBefore(TD, TH);
TR.removeChild(TH);
return TD;
}
;
window.WalkontableTableRenderer = WalkontableTableRenderer;
//#
},{"helpers/dom/element":45}],22:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
WalkontableViewport: {get: function() {
return WalkontableViewport;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47__46__46__47_eventManager__,
$__calculator_47_viewportColumns__,
$__calculator_47_viewportRows__;
var $__0 = ($___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47__46__46__47_helpers_47_dom_47_element__}),
getScrollbarWidth = $__0.getScrollbarWidth,
getScrollTop = $__0.getScrollTop,
getStyle = $__0.getStyle,
offset = $__0.offset,
outerHeight = $__0.outerHeight,
outerWidth = $__0.outerWidth;
var EventManager = ($___46__46__47__46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47__46__46__47_eventManager__}).EventManager;
var WalkontableViewportColumnsCalculator = ($__calculator_47_viewportColumns__ = require("calculator/viewportColumns"), $__calculator_47_viewportColumns__ && $__calculator_47_viewportColumns__.__esModule && $__calculator_47_viewportColumns__ || {default: $__calculator_47_viewportColumns__}).WalkontableViewportColumnsCalculator;
var WalkontableViewportRowsCalculator = ($__calculator_47_viewportRows__ = require("calculator/viewportRows"), $__calculator_47_viewportRows__ && $__calculator_47_viewportRows__.__esModule && $__calculator_47_viewportRows__ || {default: $__calculator_47_viewportRows__}).WalkontableViewportRowsCalculator;
var WalkontableViewport = function WalkontableViewport(wotInstance) {
var $__4 = this;
this.wot = wotInstance;
this.instance = this.wot;
this.oversizedRows = [];
this.oversizedColumnHeaders = [];
this.isMarkedOversizedColumn = {};
this.clientHeight = 0;
this.containerWidth = NaN;
this.rowHeaderWidth = NaN;
this.rowsVisibleCalculator = null;
this.columnsVisibleCalculator = null;
this.eventManager = new EventManager(this.wot);
this.eventManager.addEventListener(window, 'resize', (function() {
$__4.clientHeight = $__4.getWorkspaceHeight();
}));
};
($traceurRuntime.createClass)(WalkontableViewport, {
getWorkspaceHeight: function() {
var trimmingContainer = this.instance.wtOverlays.topOverlay.trimmingContainer;
var elemHeight;
var height = 0;
if (trimmingContainer === window) {
height = document.documentElement.clientHeight;
} else {
elemHeight = outerHeight(trimmingContainer);
height = (elemHeight > 0 && trimmingContainer.clientHeight > 0) ? trimmingContainer.clientHeight : Infinity;
}
return height;
},
getWorkspaceWidth: function() {
var width;
var totalColumns = this.wot.getSetting('totalColumns');
var trimmingContainer = this.instance.wtOverlays.leftOverlay.trimmingContainer;
var overflow;
var stretchSetting = this.wot.getSetting('stretchH');
var docOffsetWidth = document.documentElement.offsetWidth;
var preventOverflow = this.wot.getSetting('preventOverflow');
if (preventOverflow) {
return outerWidth(this.instance.wtTable.wtRootElement);
}
if (Handsontable.freezeOverlays) {
width = Math.min(docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);
} else {
width = Math.min(this.getContainerFillWidth(), docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);
}
if (trimmingContainer === window && totalColumns > 0 && this.sumColumnWidths(0, totalColumns - 1) > width) {
return document.documentElement.clientWidth;
}
if (trimmingContainer !== window) {
overflow = getStyle(this.instance.wtOverlays.leftOverlay.trimmingContainer, 'overflow');
if (overflow == 'scroll' || overflow == 'hidden' || overflow == 'auto') {
return Math.max(width, trimmingContainer.clientWidth);
}
}
if (stretchSetting === 'none' || !stretchSetting) {
return Math.max(width, outerWidth(this.instance.wtTable.TABLE));
} else {
return width;
}
},
hasVerticalScroll: function() {
return this.getWorkspaceActualHeight() > this.getWorkspaceHeight();
},
hasHorizontalScroll: function() {
return this.getWorkspaceActualWidth() > this.getWorkspaceWidth();
},
sumColumnWidths: function(from, length) {
var sum = 0;
while (from < length) {
sum += this.wot.wtTable.getColumnWidth(from);
from++;
}
return sum;
},
getContainerFillWidth: function() {
if (this.containerWidth) {
return this.containerWidth;
}
var mainContainer = this.instance.wtTable.holder;
var fillWidth;
var dummyElement;
dummyElement = document.createElement('div');
dummyElement.style.width = '100%';
dummyElement.style.height = '1px';
mainContainer.appendChild(dummyElement);
fillWidth = dummyElement.offsetWidth;
this.containerWidth = fillWidth;
mainContainer.removeChild(dummyElement);
return fillWidth;
},
getWorkspaceOffset: function() {
return offset(this.wot.wtTable.TABLE);
},
getWorkspaceActualHeight: function() {
return outerHeight(this.wot.wtTable.TABLE);
},
getWorkspaceActualWidth: function() {
return outerWidth(this.wot.wtTable.TABLE) || outerWidth(this.wot.wtTable.TBODY) || outerWidth(this.wot.wtTable.THEAD);
},
getColumnHeaderHeight: function() {
if (isNaN(this.columnHeaderHeight)) {
this.columnHeaderHeight = outerHeight(this.wot.wtTable.THEAD);
}
return this.columnHeaderHeight;
},
getViewportHeight: function() {
var containerHeight = this.getWorkspaceHeight();
var columnHeaderHeight;
if (containerHeight === Infinity) {
return containerHeight;
}
columnHeaderHeight = this.getColumnHeaderHeight();
if (columnHeaderHeight > 0) {
containerHeight -= columnHeaderHeight;
}
return containerHeight;
},
getRowHeaderWidth: function() {
var rowHeadersHeightSetting = this.instance.getSetting('rowHeaderWidth');
var rowHeaders = this.instance.getSetting('rowHeaders');
if (rowHeadersHeightSetting) {
this.rowHeaderWidth = 0;
for (var i = 0,
len = rowHeaders.length; i < len; i++) {
this.rowHeaderWidth += rowHeadersHeightSetting[i] || rowHeadersHeightSetting;
}
}
if (this.wot.cloneSource) {
return this.wot.cloneSource.wtViewport.getRowHeaderWidth();
}
if (isNaN(this.rowHeaderWidth)) {
if (rowHeaders.length) {
var TH = this.instance.wtTable.TABLE.querySelector('TH');
this.rowHeaderWidth = 0;
for (var i$__6 = 0,
len$__7 = rowHeaders.length; i$__6 < len$__7; i$__6++) {
if (TH) {
this.rowHeaderWidth += outerWidth(TH);
TH = TH.nextSibling;
} else {
this.rowHeaderWidth += 50;
}
}
} else {
this.rowHeaderWidth = 0;
}
}
return this.rowHeaderWidth;
},
getViewportWidth: function() {
var containerWidth = this.getWorkspaceWidth();
var rowHeaderWidth;
if (containerWidth === Infinity) {
return containerWidth;
}
rowHeaderWidth = this.getRowHeaderWidth();
if (rowHeaderWidth > 0) {
return containerWidth - rowHeaderWidth;
}
return containerWidth;
},
createRowsCalculator: function() {
var visible = arguments[0] !== (void 0) ? arguments[0] : false;
var $__4 = this;
var height;
var pos;
var fixedRowsTop;
var scrollbarHeight;
var fixedRowsBottom;
var fixedRowsHeight;
var totalRows;
this.rowHeaderWidth = NaN;
if (this.wot.wtSettings.settings.renderAllRows) {
height = Infinity;
} else {
height = this.getViewportHeight();
}
pos = this.wot.wtOverlays.topOverlay.getScrollPosition() - this.wot.wtOverlays.topOverlay.getTableParentOffset();
if (pos < 0) {
pos = 0;
}
fixedRowsTop = this.wot.getSetting('fixedRowsTop');
fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');
totalRows = this.wot.getSetting('totalRows');
if (fixedRowsTop) {
fixedRowsHeight = this.wot.wtOverlays.topOverlay.sumCellSizes(0, fixedRowsTop);
pos += fixedRowsHeight;
height -= fixedRowsHeight;
}
if (fixedRowsBottom && this.wot.wtOverlays.bottomOverlay.clone) {
fixedRowsHeight = this.wot.wtOverlays.bottomOverlay.sumCellSizes(totalRows - fixedRowsBottom, totalRows);
height -= fixedRowsHeight;
}
if (this.wot.wtTable.holder.clientHeight === this.wot.wtTable.holder.offsetHeight) {
scrollbarHeight = 0;
} else {
scrollbarHeight = getScrollbarWidth();
}
return new WalkontableViewportRowsCalculator(height, pos, this.wot.getSetting('totalRows'), (function(sourceRow) {
return $__4.wot.wtTable.getRowHeight(sourceRow);
}), visible ? null : this.wot.wtSettings.settings.viewportRowCalculatorOverride, visible, scrollbarHeight);
},
createColumnsCalculator: function() {
var visible = arguments[0] !== (void 0) ? arguments[0] : false;
var $__4 = this;
var width = this.getViewportWidth();
var pos;
var fixedColumnsLeft;
this.columnHeaderHeight = NaN;
pos = this.wot.wtOverlays.leftOverlay.getScrollPosition() - this.wot.wtOverlays.leftOverlay.getTableParentOffset();
if (pos < 0) {
pos = 0;
}
fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');
if (fixedColumnsLeft) {
var fixedColumnsWidth = this.wot.wtOverlays.leftOverlay.sumCellSizes(0, fixedColumnsLeft);
pos += fixedColumnsWidth;
width -= fixedColumnsWidth;
}
if (this.wot.wtTable.holder.clientWidth !== this.wot.wtTable.holder.offsetWidth) {
width -= getScrollbarWidth();
}
return new WalkontableViewportColumnsCalculator(width, pos, this.wot.getSetting('totalColumns'), (function(sourceCol) {
return $__4.wot.wtTable.getColumnWidth(sourceCol);
}), visible ? null : this.wot.wtSettings.settings.viewportColumnCalculatorOverride, visible, this.wot.getSetting('stretchH'), (function(stretchedWidth, column) {
return $__4.wot.getSetting('onBeforeStretchingColumnWidth', stretchedWidth, column);
}));
},
createRenderCalculators: function() {
var fastDraw = arguments[0] !== (void 0) ? arguments[0] : false;
if (fastDraw) {
var proposedRowsVisibleCalculator = this.createRowsCalculator(true);
var proposedColumnsVisibleCalculator = this.createColumnsCalculator(true);
if (!(this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) && this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator))) {
fastDraw = false;
}
}
if (!fastDraw) {
this.rowsRenderCalculator = this.createRowsCalculator();
this.columnsRenderCalculator = this.createColumnsCalculator();
}
this.rowsVisibleCalculator = null;
this.columnsVisibleCalculator = null;
return fastDraw;
},
createVisibleCalculators: function() {
this.rowsVisibleCalculator = this.createRowsCalculator(true);
this.columnsVisibleCalculator = this.createColumnsCalculator(true);
},
areAllProposedVisibleRowsAlreadyRendered: function(proposedRowsVisibleCalculator) {
if (this.rowsVisibleCalculator) {
if (proposedRowsVisibleCalculator.startRow < this.rowsRenderCalculator.startRow || (proposedRowsVisibleCalculator.startRow === this.rowsRenderCalculator.startRow && proposedRowsVisibleCalculator.startRow > 0)) {
return false;
} else if (proposedRowsVisibleCalculator.endRow > this.rowsRenderCalculator.endRow || (proposedRowsVisibleCalculator.endRow === this.rowsRenderCalculator.endRow && proposedRowsVisibleCalculator.endRow < this.wot.getSetting('totalRows') - 1)) {
return false;
} else {
return true;
}
}
return false;
},
areAllProposedVisibleColumnsAlreadyRendered: function(proposedColumnsVisibleCalculator) {
if (this.columnsVisibleCalculator) {
if (proposedColumnsVisibleCalculator.startColumn < this.columnsRenderCalculator.startColumn || (proposedColumnsVisibleCalculator.startColumn === this.columnsRenderCalculator.startColumn && proposedColumnsVisibleCalculator.startColumn > 0)) {
return false;
} else if (proposedColumnsVisibleCalculator.endColumn > this.columnsRenderCalculator.endColumn || (proposedColumnsVisibleCalculator.endColumn === this.columnsRenderCalculator.endColumn && proposedColumnsVisibleCalculator.endColumn < this.wot.getSetting('totalColumns') - 1)) {
return false;
} else {
return true;
}
}
return false;
}
}, {});
;
window.WalkontableViewport = WalkontableViewport;
//#
},{"calculator/viewportColumns":3,"calculator/viewportRows":4,"eventManager":41,"helpers/dom/element":45}],23:[function(require,module,exports){
"use strict";
var $__shims_47_classes__,
$__es6collections__,
$__pluginHooks__,
$__core__,
$__renderers_47__95_cellDecorator__,
$__cellTypes__,
$___46__46__47_plugins_47_jqueryHandsontable__,
$__helpers_47_array__,
$__helpers_47_browser__,
$__helpers_47_data__,
$__helpers_47_function__,
$__helpers_47_mixed__,
$__helpers_47_number__,
$__helpers_47_object__,
$__helpers_47_setting__,
$__helpers_47_string__,
$__helpers_47_unicode__,
$__helpers_47_dom_47_element__,
$__helpers_47_dom_47_event__,
$__plugins__;
window.Handsontable = function Handsontable(rootElement, userSettings) {
var instance = new Handsontable.Core(rootElement, userSettings || {});
instance.init();
return instance;
};
($__shims_47_classes__ = require("shims/classes"), $__shims_47_classes__ && $__shims_47_classes__.__esModule && $__shims_47_classes__ || {default: $__shims_47_classes__});
($__es6collections__ = require("es6collections"), $__es6collections__ && $__es6collections__.__esModule && $__es6collections__ || {default: $__es6collections__});
var Hooks = ($__pluginHooks__ = require("pluginHooks"), $__pluginHooks__ && $__pluginHooks__.__esModule && $__pluginHooks__ || {default: $__pluginHooks__}).Hooks;
if (!Handsontable.hooks) {
Handsontable.hooks = new Hooks();
}
($__core__ = require("core"), $__core__ && $__core__.__esModule && $__core__ || {default: $__core__});
($__renderers_47__95_cellDecorator__ = require("renderers/_cellDecorator"), $__renderers_47__95_cellDecorator__ && $__renderers_47__95_cellDecorator__.__esModule && $__renderers_47__95_cellDecorator__ || {default: $__renderers_47__95_cellDecorator__});
($__cellTypes__ = require("cellTypes"), $__cellTypes__ && $__cellTypes__.__esModule && $__cellTypes__ || {default: $__cellTypes__});
($___46__46__47_plugins_47_jqueryHandsontable__ = require("plugins/jqueryHandsontable"), $___46__46__47_plugins_47_jqueryHandsontable__ && $___46__46__47_plugins_47_jqueryHandsontable__.__esModule && $___46__46__47_plugins_47_jqueryHandsontable__ || {default: $___46__46__47_plugins_47_jqueryHandsontable__});
var arrayHelpers = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__});
var browserHelpers = ($__helpers_47_browser__ = require("helpers/browser"), $__helpers_47_browser__ && $__helpers_47_browser__.__esModule && $__helpers_47_browser__ || {default: $__helpers_47_browser__});
var dataHelpers = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__});
var functionHelpers = ($__helpers_47_function__ = require("helpers/function"), $__helpers_47_function__ && $__helpers_47_function__.__esModule && $__helpers_47_function__ || {default: $__helpers_47_function__});
var mixedHelpers = ($__helpers_47_mixed__ = require("helpers/mixed"), $__helpers_47_mixed__ && $__helpers_47_mixed__.__esModule && $__helpers_47_mixed__ || {default: $__helpers_47_mixed__});
var numberHelpers = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__});
var objectHelpers = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__});
var settingHelpers = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__});
var stringHelpers = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__});
var unicodeHelpers = ($__helpers_47_unicode__ = require("helpers/unicode"), $__helpers_47_unicode__ && $__helpers_47_unicode__.__esModule && $__helpers_47_unicode__ || {default: $__helpers_47_unicode__});
var domHelpers = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__});
var domEventHelpers = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__});
var HELPERS = [arrayHelpers, browserHelpers, dataHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers];
var DOM = [domHelpers, domEventHelpers];
Handsontable.buildDate = 'Wed Feb 03 2016 13:43:22 GMT+0100 (CET)';
Handsontable.packageName = 'handsontable';
Handsontable.version = '0.22.0';
var baseVersion = '@@baseVersion';
if (!/^@@/.test(baseVersion)) {
Handsontable.baseVersion = baseVersion;
}
Handsontable.plugins = {};
var registerPlugin = ($__plugins__ = require("plugins"), $__plugins__ && $__plugins__.__esModule && $__plugins__ || {default: $__plugins__}).registerPlugin;
Handsontable.plugins.registerPlugin = registerPlugin;
Handsontable.helper = {};
Handsontable.dom = {};
Handsontable.Dom = Handsontable.dom;
arrayHelpers.arrayEach(HELPERS, (function(helper) {
arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), (function(key) {
if (key.charAt(0) !== '_') {
Handsontable.helper[key] = helper[key];
}
}));
}));
arrayHelpers.arrayEach(DOM, (function(helper) {
arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), (function(key) {
if (key.charAt(0) !== '_') {
Handsontable.dom[key] = helper[key];
}
}));
}));
//#
},{"cellTypes":24,"core":25,"es6collections":"es6collections","helpers/array":42,"helpers/browser":43,"helpers/data":44,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/mixed":48,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,"helpers/unicode":53,"pluginHooks":56,"plugins":57,"plugins/jqueryHandsontable":1,"renderers/_cellDecorator":89,"shims/classes":96}],24:[function(require,module,exports){
"use strict";
var $__helpers_47_browser__,
$__editors__,
$__renderers__,
$__editors_47_autocompleteEditor__,
$__editors_47_checkboxEditor__,
$__editors_47_dateEditor__,
$__editors_47_dropdownEditor__,
$__editors_47_handsontableEditor__,
$__editors_47_mobileTextEditor__,
$__editors_47_numericEditor__,
$__editors_47_passwordEditor__,
$__editors_47_selectEditor__,
$__editors_47_textEditor__,
$__renderers_47_autocompleteRenderer__,
$__renderers_47_checkboxRenderer__,
$__renderers_47_htmlRenderer__,
$__renderers_47_numericRenderer__,
$__renderers_47_passwordRenderer__,
$__renderers_47_textRenderer__,
$__validators_47_autocompleteValidator__,
$__validators_47_dateValidator__,
$__validators_47_numericValidator__;
var isMobileBrowser = ($__helpers_47_browser__ = require("helpers/browser"), $__helpers_47_browser__ && $__helpers_47_browser__.__esModule && $__helpers_47_browser__ || {default: $__helpers_47_browser__}).isMobileBrowser;
var getEditorConstructor = ($__editors__ = require("editors"), $__editors__ && $__editors__.__esModule && $__editors__ || {default: $__editors__}).getEditorConstructor;
var getRenderer = ($__renderers__ = require("renderers"), $__renderers__ && $__renderers__.__esModule && $__renderers__ || {default: $__renderers__}).getRenderer;
var AutocompleteEditor = ($__editors_47_autocompleteEditor__ = require("editors/autocompleteEditor"), $__editors_47_autocompleteEditor__ && $__editors_47_autocompleteEditor__.__esModule && $__editors_47_autocompleteEditor__ || {default: $__editors_47_autocompleteEditor__}).AutocompleteEditor;
var CheckboxEditor = ($__editors_47_checkboxEditor__ = require("editors/checkboxEditor"), $__editors_47_checkboxEditor__ && $__editors_47_checkboxEditor__.__esModule && $__editors_47_checkboxEditor__ || {default: $__editors_47_checkboxEditor__}).CheckboxEditor;
var DateEditor = ($__editors_47_dateEditor__ = require("editors/dateEditor"), $__editors_47_dateEditor__ && $__editors_47_dateEditor__.__esModule && $__editors_47_dateEditor__ || {default: $__editors_47_dateEditor__}).DateEditor;
var DropdownEditor = ($__editors_47_dropdownEditor__ = require("editors/dropdownEditor"), $__editors_47_dropdownEditor__ && $__editors_47_dropdownEditor__.__esModule && $__editors_47_dropdownEditor__ || {default: $__editors_47_dropdownEditor__}).DropdownEditor;
var HandsontableEditor = ($__editors_47_handsontableEditor__ = require("editors/handsontableEditor"), $__editors_47_handsontableEditor__ && $__editors_47_handsontableEditor__.__esModule && $__editors_47_handsontableEditor__ || {default: $__editors_47_handsontableEditor__}).HandsontableEditor;
var MobileTextEditor = ($__editors_47_mobileTextEditor__ = require("editors/mobileTextEditor"), $__editors_47_mobileTextEditor__ && $__editors_47_mobileTextEditor__.__esModule && $__editors_47_mobileTextEditor__ || {default: $__editors_47_mobileTextEditor__}).MobileTextEditor;
var NumericEditor = ($__editors_47_numericEditor__ = require("editors/numericEditor"), $__editors_47_numericEditor__ && $__editors_47_numericEditor__.__esModule && $__editors_47_numericEditor__ || {default: $__editors_47_numericEditor__}).NumericEditor;
var PasswordEditor = ($__editors_47_passwordEditor__ = require("editors/passwordEditor"), $__editors_47_passwordEditor__ && $__editors_47_passwordEditor__.__esModule && $__editors_47_passwordEditor__ || {default: $__editors_47_passwordEditor__}).PasswordEditor;
var SelectEditor = ($__editors_47_selectEditor__ = require("editors/selectEditor"), $__editors_47_selectEditor__ && $__editors_47_selectEditor__.__esModule && $__editors_47_selectEditor__ || {default: $__editors_47_selectEditor__}).SelectEditor;
var TextEditor = ($__editors_47_textEditor__ = require("editors/textEditor"), $__editors_47_textEditor__ && $__editors_47_textEditor__.__esModule && $__editors_47_textEditor__ || {default: $__editors_47_textEditor__}).TextEditor;
var AutocompleteRenderer = ($__renderers_47_autocompleteRenderer__ = require("renderers/autocompleteRenderer"), $__renderers_47_autocompleteRenderer__ && $__renderers_47_autocompleteRenderer__.__esModule && $__renderers_47_autocompleteRenderer__ || {default: $__renderers_47_autocompleteRenderer__}).AutocompleteRenderer;
var CheckboxRenderer = ($__renderers_47_checkboxRenderer__ = require("renderers/checkboxRenderer"), $__renderers_47_checkboxRenderer__ && $__renderers_47_checkboxRenderer__.__esModule && $__renderers_47_checkboxRenderer__ || {default: $__renderers_47_checkboxRenderer__}).CheckboxRenderer;
var HtmlRenderer = ($__renderers_47_htmlRenderer__ = require("renderers/htmlRenderer"), $__renderers_47_htmlRenderer__ && $__renderers_47_htmlRenderer__.__esModule && $__renderers_47_htmlRenderer__ || {default: $__renderers_47_htmlRenderer__}).HtmlRenderer;
var NumericRenderer = ($__renderers_47_numericRenderer__ = require("renderers/numericRenderer"), $__renderers_47_numericRenderer__ && $__renderers_47_numericRenderer__.__esModule && $__renderers_47_numericRenderer__ || {default: $__renderers_47_numericRenderer__}).NumericRenderer;
var PasswordRenderer = ($__renderers_47_passwordRenderer__ = require("renderers/passwordRenderer"), $__renderers_47_passwordRenderer__ && $__renderers_47_passwordRenderer__.__esModule && $__renderers_47_passwordRenderer__ || {default: $__renderers_47_passwordRenderer__}).PasswordRenderer;
var TextRenderer = ($__renderers_47_textRenderer__ = require("renderers/textRenderer"), $__renderers_47_textRenderer__ && $__renderers_47_textRenderer__.__esModule && $__renderers_47_textRenderer__ || {default: $__renderers_47_textRenderer__}).TextRenderer;
var AutocompleteValidator = ($__validators_47_autocompleteValidator__ = require("validators/autocompleteValidator"), $__validators_47_autocompleteValidator__ && $__validators_47_autocompleteValidator__.__esModule && $__validators_47_autocompleteValidator__ || {default: $__validators_47_autocompleteValidator__}).AutocompleteValidator;
var DateValidator = ($__validators_47_dateValidator__ = require("validators/dateValidator"), $__validators_47_dateValidator__ && $__validators_47_dateValidator__.__esModule && $__validators_47_dateValidator__ || {default: $__validators_47_dateValidator__}).DateValidator;
var NumericValidator = ($__validators_47_numericValidator__ = require("validators/numericValidator"), $__validators_47_numericValidator__ && $__validators_47_numericValidator__.__esModule && $__validators_47_numericValidator__ || {default: $__validators_47_numericValidator__}).NumericValidator;
Handsontable.mobileBrowser = isMobileBrowser();
Handsontable.AutocompleteCell = {
editor: getEditorConstructor('autocomplete'),
renderer: getRenderer('autocomplete'),
validator: Handsontable.AutocompleteValidator
};
Handsontable.CheckboxCell = {
editor: getEditorConstructor('checkbox'),
renderer: getRenderer('checkbox')
};
Handsontable.TextCell = {
editor: Handsontable.mobileBrowser ? getEditorConstructor('mobile') : getEditorConstructor('text'),
renderer: getRenderer('text')
};
Handsontable.NumericCell = {
editor: getEditorConstructor('numeric'),
renderer: getRenderer('numeric'),
validator: Handsontable.NumericValidator,
dataType: 'number'
};
Handsontable.DateCell = {
editor: getEditorConstructor('date'),
validator: Handsontable.DateValidator,
renderer: getRenderer('autocomplete')
};
Handsontable.HandsontableCell = {
editor: getEditorConstructor('handsontable'),
renderer: getRenderer('autocomplete')
};
Handsontable.PasswordCell = {
editor: getEditorConstructor('password'),
renderer: getRenderer('password'),
copyable: false
};
Handsontable.DropdownCell = {
editor: getEditorConstructor('dropdown'),
renderer: getRenderer('autocomplete'),
validator: Handsontable.AutocompleteValidator
};
Handsontable.cellTypes = {
text: Handsontable.TextCell,
date: Handsontable.DateCell,
numeric: Handsontable.NumericCell,
checkbox: Handsontable.CheckboxCell,
autocomplete: Handsontable.AutocompleteCell,
handsontable: Handsontable.HandsontableCell,
password: Handsontable.PasswordCell,
dropdown: Handsontable.DropdownCell
};
Handsontable.cellLookup = {validator: {
numeric: Handsontable.NumericValidator,
autocomplete: Handsontable.AutocompleteValidator
}};
//#
},{"editors":29,"editors/autocompleteEditor":31,"editors/checkboxEditor":32,"editors/dateEditor":33,"editors/dropdownEditor":34,"editors/handsontableEditor":35,"editors/mobileTextEditor":36,"editors/numericEditor":37,"editors/passwordEditor":38,"editors/selectEditor":39,"editors/textEditor":40,"helpers/browser":43,"renderers":88,"renderers/autocompleteRenderer":90,"renderers/checkboxRenderer":91,"renderers/htmlRenderer":92,"renderers/numericRenderer":93,"renderers/passwordRenderer":94,"renderers/textRenderer":95,"validators/autocompleteValidator":100,"validators/dateValidator":101,"validators/numericValidator":102}],25:[function(require,module,exports){
"use strict";
var $__numeral__,
$__helpers_47_dom_47_element__,
$__helpers_47_setting__,
$__dataMap__,
$__editorManager__,
$__eventManager__,
$__helpers_47_object__,
$__helpers_47_array__,
$__plugins__,
$__renderers__,
$__helpers_47_string__,
$__helpers_47_number__,
$__tableView__,
$__dataSource__,
$__helpers_47_data__,
$__3rdparty_47_walkontable_47_src_47_cell_47_coords__,
$__3rdparty_47_walkontable_47_src_47_cell_47_range__,
$__3rdparty_47_walkontable_47_src_47_selection__,
$__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__;
var numeral = ($__numeral__ = require("numeral"), $__numeral__ && $__numeral__.__esModule && $__numeral__ || {default: $__numeral__}).default;
var $__1 = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__}),
addClass = $__1.addClass,
empty = $__1.empty,
isChildOfWebComponentTable = $__1.isChildOfWebComponentTable,
removeClass = $__1.removeClass;
var columnFactory = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__}).columnFactory;
var DataMap = ($__dataMap__ = require("dataMap"), $__dataMap__ && $__dataMap__.__esModule && $__dataMap__ || {default: $__dataMap__}).DataMap;
var EditorManager = ($__editorManager__ = require("editorManager"), $__editorManager__ && $__editorManager__.__esModule && $__editorManager__ || {default: $__editorManager__}).EditorManager;
var eventManagerObject = ($__eventManager__ = require("eventManager"), $__eventManager__ && $__eventManager__.__esModule && $__eventManager__ || {default: $__eventManager__}).eventManager;
var $__6 = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}),
extend = $__6.extend,
duckSchema = $__6.duckSchema,
isObjectEquals = $__6.isObjectEquals,
deepClone = $__6.deepClone;
var arrayFlatten = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}).arrayFlatten;
var getPlugin = ($__plugins__ = require("plugins"), $__plugins__ && $__plugins__.__esModule && $__plugins__ || {default: $__plugins__}).getPlugin;
var getRenderer = ($__renderers__ = require("renderers"), $__renderers__ && $__renderers__.__esModule && $__renderers__ || {default: $__renderers__}).getRenderer;
var randomString = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).randomString;
var rangeEach = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__}).rangeEach;
var TableView = ($__tableView__ = require("tableView"), $__tableView__ && $__tableView__.__esModule && $__tableView__ || {default: $__tableView__}).TableView;
var DataSource = ($__dataSource__ = require("dataSource"), $__dataSource__ && $__dataSource__.__esModule && $__dataSource__ || {default: $__dataSource__}).DataSource;
var $__14 = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__}),
translateRowsToColumns = $__14.translateRowsToColumns,
cellMethodLookupFactory = $__14.cellMethodLookupFactory,
spreadsheetColumnLabel = $__14.spreadsheetColumnLabel;
var WalkontableCellCoords = ($__3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords;
var WalkontableCellRange = ($__3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $__3rdparty_47_walkontable_47_src_47_cell_47_range__ && $__3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange;
var WalkontableSelection = ($__3rdparty_47_walkontable_47_src_47_selection__ = require("3rdparty/walkontable/src/selection"), $__3rdparty_47_walkontable_47_src_47_selection__ && $__3rdparty_47_walkontable_47_src_47_selection__.__esModule && $__3rdparty_47_walkontable_47_src_47_selection__ || {default: $__3rdparty_47_walkontable_47_src_47_selection__}).WalkontableSelection;
var WalkontableViewportColumnsCalculator = ($__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ = require("3rdparty/walkontable/src/calculator/viewportColumns"), $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ && $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__.__esModule && $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ || {default: $__3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__}).WalkontableViewportColumnsCalculator;
Handsontable.activeGuid = null;
Handsontable.Core = function Core(rootElement, userSettings) {
var priv,
datamap,
dataSource,
grid,
selection,
editorManager,
instance = this,
GridSettings = function() {},
eventManager = eventManagerObject(instance);
extend(GridSettings.prototype, DefaultSettings.prototype);
extend(GridSettings.prototype, userSettings);
extend(GridSettings.prototype, expandType(userSettings));
this.rootElement = rootElement;
this.isHotTableEnv = isChildOfWebComponentTable(this.rootElement);
Handsontable.eventManager.isHotTableEnv = this.isHotTableEnv;
this.container = document.createElement('DIV');
this.renderCall = false;
rootElement.insertBefore(this.container, rootElement.firstChild);
this.guid = 'ht_' + randomString();
dataSource = new DataSource(instance);
if (!this.rootElement.id || this.rootElement.id.substring(0, 3) === 'ht_') {
this.rootElement.id = this.guid;
}
priv = {
cellSettings: [],
columnSettings: [],
columnsSettingConflicts: ['data', 'width'],
settings: new GridSettings(),
selRange: null,
isPopulated: null,
scrollable: null,
firstRun: true
};
grid = {
alter: function(action, index, amount, source, keepEmptyRows) {
var delta;
amount = amount || 1;
switch (action) {
case 'insert_row':
if (instance.getSettings().maxRows === instance.countSourceRows()) {
return;
}
delta = datamap.createRow(index, amount);
if (delta) {
if (selection.isSelected() && priv.selRange.from.row >= index) {
priv.selRange.from.row = priv.selRange.from.row + delta;
selection.transformEnd(delta, 0);
} else {
selection.refreshBorders();
}
}
break;
case 'insert_col':
delta = datamap.createCol(index, amount);
if (delta) {
if (Array.isArray(instance.getSettings().colHeaders)) {
var spliceArray = [index, 0];
spliceArray.length += delta;
Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArray);
}
if (selection.isSelected() && priv.selRange.from.col >= index) {
priv.selRange.from.col = priv.selRange.from.col + delta;
selection.transformEnd(0, delta);
} else {
selection.refreshBorders();
}
}
break;
case 'remove_row':
datamap.removeRow(index, amount);
priv.cellSettings.splice(index, amount);
var totalRows = instance.countRows();
var fixedRowsTop = instance.getSettings().fixedRowsTop;
if (fixedRowsTop >= index + 1) {
instance.getSettings().fixedRowsTop -= Math.min(amount, fixedRowsTop - index);
}
var fixedRowsBottom = instance.getSettings().fixedRowsBottom;
if (fixedRowsBottom && index >= totalRows - fixedRowsBottom) {
instance.getSettings().fixedRowsBottom -= Math.min(amount, fixedRowsBottom);
}
grid.adjustRowsAndCols();
selection.refreshBorders();
break;
case 'remove_col':
datamap.removeCol(index, amount);
for (var row = 0,
len = datamap.getAll().length; row < len; row++) {
if (row in priv.cellSettings) {
priv.cellSettings[row].splice(index, amount);
}
}
var fixedColumnsLeft = instance.getSettings().fixedColumnsLeft;
if (fixedColumnsLeft >= index + 1) {
instance.getSettings().fixedColumnsLeft -= Math.min(amount, fixedColumnsLeft - index);
}
if (Array.isArray(instance.getSettings().colHeaders)) {
if (typeof index == 'undefined') {
index = -1;
}
instance.getSettings().colHeaders.splice(index, amount);
}
grid.adjustRowsAndCols();
selection.refreshBorders();
break;
default:
throw new Error('There is no such action "' + action + '"');
break;
}
if (!keepEmptyRows) {
grid.adjustRowsAndCols();
}
},
adjustRowsAndCols: function() {
if (priv.settings.minRows) {
var rows = instance.countRows();
if (rows < priv.settings.minRows) {
for (var r = 0,
minRows = priv.settings.minRows; r < minRows - rows; r++) {
datamap.createRow(instance.countRows(), 1, true);
}
}
}
if (priv.settings.minSpareRows) {
var emptyRows = instance.countEmptyRows(true);
if (emptyRows < priv.settings.minSpareRows) {
for (; emptyRows < priv.settings.minSpareRows && instance.countRows() < priv.settings.maxRows; emptyRows++) {
datamap.createRow(instance.countRows(), 1, true);
}
}
}
{
var emptyCols;
if (priv.settings.minCols || priv.settings.minSpareCols) {
emptyCols = instance.countEmptyCols(true);
}
if (priv.settings.minCols && !priv.settings.columns && instance.countCols() < priv.settings.minCols) {
for (; instance.countCols() < priv.settings.minCols; emptyCols++) {
datamap.createCol(instance.countCols(), 1, true);
}
}
if (priv.settings.minSpareCols && !priv.settings.columns && instance.dataType === 'array' && emptyCols < priv.settings.minSpareCols) {
for (; emptyCols < priv.settings.minSpareCols && instance.countCols() < priv.settings.maxCols; emptyCols++) {
datamap.createCol(instance.countCols(), 1, true);
}
}
}
var rowCount = instance.countRows();
var colCount = instance.countCols();
if (rowCount === 0 || colCount === 0) {
selection.deselect();
}
if (selection.isSelected()) {
var selectionChanged = false;
var fromRow = priv.selRange.from.row;
var fromCol = priv.selRange.from.col;
var toRow = priv.selRange.to.row;
var toCol = priv.selRange.to.col;
if (fromRow > rowCount - 1) {
fromRow = rowCount - 1;
selectionChanged = true;
if (toRow > fromRow) {
toRow = fromRow;
}
} else if (toRow > rowCount - 1) {
toRow = rowCount - 1;
selectionChanged = true;
if (fromRow > toRow) {
fromRow = toRow;
}
}
if (fromCol > colCount - 1) {
fromCol = colCount - 1;
selectionChanged = true;
if (toCol > fromCol) {
toCol = fromCol;
}
} else if (toCol > colCount - 1) {
toCol = colCount - 1;
selectionChanged = true;
if (fromCol > toCol) {
fromCol = toCol;
}
}
if (selectionChanged) {
instance.selectCell(fromRow, fromCol, toRow, toCol);
}
}
if (instance.view) {
instance.view.wt.wtOverlays.adjustElementsSize();
}
},
populateFromArray: function(start, input, end, source, method, direction, deltas) {
var r,
rlen,
c,
clen,
setData = [],
current = {};
rlen = input.length;
if (rlen === 0) {
return false;
}
var repeatCol,
repeatRow,
cmax,
rmax,
baseEnd = {
row: end === null ? null : end.row,
col: end === null ? null : end.col
};
switch (method) {
case 'shift_down':
repeatCol = end ? end.col - start.col + 1 : 0;
repeatRow = end ? end.row - start.row + 1 : 0;
input = translateRowsToColumns(input);
for (c = 0, clen = input.length, cmax = Math.max(clen, repeatCol); c < cmax; c++) {
if (c < clen) {
for (r = 0, rlen = input[c].length; r < repeatRow - rlen; r++) {
input[c].push(input[c][r % rlen]);
}
input[c].unshift(start.col + c, start.row, 0);
instance.spliceCol.apply(instance, input[c]);
} else {
input[c % clen][0] = start.col + c;
instance.spliceCol.apply(instance, input[c % clen]);
}
}
break;
case 'shift_right':
repeatCol = end ? end.col - start.col + 1 : 0;
repeatRow = end ? end.row - start.row + 1 : 0;
for (r = 0, rlen = input.length, rmax = Math.max(rlen, repeatRow); r < rmax; r++) {
if (r < rlen) {
for (c = 0, clen = input[r].length; c < repeatCol - clen; c++) {
input[r].push(input[r][c % clen]);
}
input[r].unshift(start.row + r, start.col, 0);
instance.spliceRow.apply(instance, input[r]);
} else {
input[r % rlen][0] = start.row + r;
instance.spliceRow.apply(instance, input[r % rlen]);
}
}
break;
case 'overwrite':
default:
current.row = start.row;
current.col = start.col;
var selected = {
row: (end && start) ? (end.row - start.row + 1) : 1,
col: (end && start) ? (end.col - start.col + 1) : 1
};
var skippedRow = 0;
var skippedColumn = 0;
var pushData = true;
var cellMeta;
var getInputValue = function getInputValue(row) {
var col = arguments[1] !== (void 0) ? arguments[1] : null;
var rowValue = input[row % input.length];
if (col !== null) {
return rowValue[col % rowValue.length];
}
return rowValue;
};
var rowInputLength = input.length;
var rowSelectionLength = end ? end.row - start.row + 1 : 0;
if (end) {
rlen = rowSelectionLength;
} else {
rlen = Math.max(rowInputLength, rowSelectionLength);
}
for (r = 0; r < rlen; r++) {
if ((end && current.row > end.row && rowSelectionLength > rowInputLength) || (!priv.settings.allowInsertRow && current.row > instance.countRows() - 1) || (current.row >= priv.settings.maxRows)) {
break;
}
var logicalRow = r - skippedRow;
var colInputLength = getInputValue(logicalRow).length;
var colSelectionLength = end ? end.col - start.col + 1 : 0;
if (end) {
clen = colSelectionLength;
} else {
clen = Math.max(colInputLength, colSelectionLength);
}
current.col = start.col;
cellMeta = instance.getCellMeta(current.row, current.col);
if ((source === 'paste' || source === 'autofill') && cellMeta.skipRowOnPaste) {
skippedRow++;
current.row++;
rlen++;
continue;
}
skippedColumn = 0;
for (c = 0; c < clen; c++) {
if ((end && current.col > end.col && colSelectionLength > colInputLength) || (!priv.settings.allowInsertColumn && current.col > instance.countCols() - 1) || (current.col >= priv.settings.maxCols)) {
break;
}
cellMeta = instance.getCellMeta(current.row, current.col);
if ((source === 'paste' || source === 'autofill') && cellMeta.skipColumnOnPaste) {
skippedColumn++;
current.col++;
clen++;
continue;
}
if (cellMeta.readOnly) {
current.col++;
continue;
}
var logicalColumn = c - skippedColumn;
var value = getInputValue(logicalRow, logicalColumn);
var orgValue = instance.getDataAtCell(current.row, current.col);
var index = {
row: logicalRow,
col: logicalColumn
};
if (source === 'autofill') {
var result = instance.runHooks('beforeAutofillInsidePopulate', index, direction, input, deltas, {}, selected);
if (result) {
value = typeof(result.value) === 'undefined' ? value : result.value;
}
}
if (value !== null && typeof value === 'object') {
if (orgValue === null || typeof orgValue !== 'object') {
pushData = false;
} else {
var orgValueSchema = duckSchema(orgValue[0] || orgValue);
var valueSchema = duckSchema(value[0] || value);
if (isObjectEquals(orgValueSchema, valueSchema)) {
value = deepClone(value);
} else {
pushData = false;
}
}
} else if (orgValue !== null && typeof orgValue === 'object') {
pushData = false;
}
if (pushData) {
setData.push([current.row, current.col, value]);
}
pushData = true;
current.col++;
}
current.row++;
}
instance.setDataAtCell(setData, null, null, source || 'populateFromArray');
break;
}
}
};
this.selection = selection = {
inProgress: false,
selectedHeader: {
cols: false,
rows: false
},
setSelectedHeaders: function(rows, cols) {
instance.selection.selectedHeader.rows = rows;
instance.selection.selectedHeader.cols = cols;
},
begin: function() {
instance.selection.inProgress = true;
},
finish: function() {
var sel = instance.getSelected();
Handsontable.hooks.run(instance, 'afterSelectionEnd', sel[0], sel[1], sel[2], sel[3]);
Handsontable.hooks.run(instance, 'afterSelectionEndByProp', sel[0], instance.colToProp(sel[1]), sel[2], instance.colToProp(sel[3]));
instance.selection.inProgress = false;
},
isInProgress: function() {
return instance.selection.inProgress;
},
setRangeStart: function(coords, keepEditorOpened) {
Handsontable.hooks.run(instance, 'beforeSetRangeStart', coords);
priv.selRange = new WalkontableCellRange(coords, coords, coords);
selection.setRangeEnd(coords, null, keepEditorOpened);
},
setRangeEnd: function(coords, scrollToCell, keepEditorOpened) {
if (priv.selRange === null) {
return;
}
var disableVisualSelection,
isHeaderSelected = false,
areCoordsPositive = true;
var firstVisibleRow = instance.view.wt.wtTable.getFirstVisibleRow();
var firstVisibleColumn = instance.view.wt.wtTable.getFirstVisibleColumn();
var newRangeCoords = {
row: null,
col: null
};
Handsontable.hooks.run(instance, 'beforeSetRangeEnd', coords);
instance.selection.begin();
newRangeCoords.row = coords.row < 0 ? firstVisibleRow : coords.row;
newRangeCoords.col = coords.col < 0 ? firstVisibleColumn : coords.col;
priv.selRange.to = new WalkontableCellCoords(newRangeCoords.row, newRangeCoords.col);
if (!priv.settings.multiSelect) {
priv.selRange.from = coords;
}
instance.view.wt.selections.current.clear();
disableVisualSelection = instance.getCellMeta(priv.selRange.highlight.row, priv.selRange.highlight.col).disableVisualSelection;
if (typeof disableVisualSelection === 'string') {
disableVisualSelection = [disableVisualSelection];
}
if (disableVisualSelection === false || Array.isArray(disableVisualSelection) && disableVisualSelection.indexOf('current') === -1) {
instance.view.wt.selections.current.add(priv.selRange.highlight);
}
instance.view.wt.selections.area.clear();
if ((disableVisualSelection === false || Array.isArray(disableVisualSelection) && disableVisualSelection.indexOf('area') === -1) && selection.isMultiple()) {
instance.view.wt.selections.area.add(priv.selRange.from);
instance.view.wt.selections.area.add(priv.selRange.to);
}
if (priv.settings.currentRowClassName || priv.settings.currentColClassName) {
instance.view.wt.selections.highlight.clear();
instance.view.wt.selections.highlight.add(priv.selRange.from);
instance.view.wt.selections.highlight.add(priv.selRange.to);
}
Handsontable.hooks.run(instance, 'afterSelection', priv.selRange.from.row, priv.selRange.from.col, priv.selRange.to.row, priv.selRange.to.col);
Handsontable.hooks.run(instance, 'afterSelectionByProp', priv.selRange.from.row, datamap.colToProp(priv.selRange.from.col), priv.selRange.to.row, datamap.colToProp(priv.selRange.to.col));
if ((priv.selRange.from.row === 0 && priv.selRange.to.row === instance.countRows() - 1 && instance.countRows() > 1) || (priv.selRange.from.col === 0 && priv.selRange.to.col === instance.countCols() - 1 && instance.countCols() > 1)) {
isHeaderSelected = true;
}
if (coords.row < 0 || coords.col < 0) {
areCoordsPositive = false;
}
if (scrollToCell !== false && !isHeaderSelected && areCoordsPositive) {
if (priv.selRange.from && !selection.isMultiple()) {
instance.view.scrollViewport(priv.selRange.from);
} else {
instance.view.scrollViewport(coords);
}
}
selection.refreshBorders(null, keepEditorOpened);
},
refreshBorders: function(revertOriginal, keepEditor) {
if (!keepEditor) {
editorManager.destroyEditor(revertOriginal);
}
instance.view.render();
if (selection.isSelected() && !keepEditor) {
editorManager.prepareEditor();
}
},
isMultiple: function() {
var isMultiple = !(priv.selRange.to.col === priv.selRange.from.col && priv.selRange.to.row === priv.selRange.from.row),
modifier = Handsontable.hooks.run(instance, 'afterIsMultipleSelection', isMultiple);
if (isMultiple) {
return modifier;
}
},
transformStart: function(rowDelta, colDelta, force, keepEditorOpened) {
var delta = new WalkontableCellCoords(rowDelta, colDelta),
rowTransformDir = 0,
colTransformDir = 0,
totalRows,
totalCols,
coords,
fixedRowsBottom;
instance.runHooks('modifyTransformStart', delta);
totalRows = instance.countRows();
totalCols = instance.countCols();
fixedRowsBottom = instance.getSettings().fixedRowsBottom;
if (priv.selRange.highlight.row + rowDelta > totalRows - 1) {
if (force && priv.settings.minSpareRows > 0 && !(fixedRowsBottom && priv.selRange.highlight.row >= totalRows - fixedRowsBottom - 1)) {
instance.alter('insert_row', totalRows);
totalRows = instance.countRows();
} else if (priv.settings.autoWrapCol) {
delta.row = 1 - totalRows;
delta.col = priv.selRange.highlight.col + delta.col == totalCols - 1 ? 1 - totalCols : 1;
}
} else if (priv.settings.autoWrapCol && priv.selRange.highlight.row + delta.row < 0 && priv.selRange.highlight.col + delta.col >= 0) {
delta.row = totalRows - 1;
delta.col = priv.selRange.highlight.col + delta.col == 0 ? totalCols - 1 : -1;
}
if (priv.selRange.highlight.col + delta.col > totalCols - 1) {
if (force && priv.settings.minSpareCols > 0) {
instance.alter('insert_col', totalCols);
totalCols = instance.countCols();
} else if (priv.settings.autoWrapRow) {
delta.row = priv.selRange.highlight.row + delta.row == totalRows - 1 ? 1 - totalRows : 1;
delta.col = 1 - totalCols;
}
} else if (priv.settings.autoWrapRow && priv.selRange.highlight.col + delta.col < 0 && priv.selRange.highlight.row + delta.row >= 0) {
delta.row = priv.selRange.highlight.row + delta.row == 0 ? totalRows - 1 : -1;
delta.col = totalCols - 1;
}
coords = new WalkontableCellCoords(priv.selRange.highlight.row + delta.row, priv.selRange.highlight.col + delta.col);
if (coords.row < 0) {
rowTransformDir = -1;
coords.row = 0;
} else if (coords.row > 0 && coords.row >= totalRows) {
rowTransformDir = 1;
coords.row = totalRows - 1;
}
if (coords.col < 0) {
colTransformDir = -1;
coords.col = 0;
} else if (coords.col > 0 && coords.col >= totalCols) {
colTransformDir = 1;
coords.col = totalCols - 1;
}
instance.runHooks('afterModifyTransformStart', coords, rowTransformDir, colTransformDir);
selection.setRangeStart(coords, keepEditorOpened);
},
transformEnd: function(rowDelta, colDelta) {
var delta = new WalkontableCellCoords(rowDelta, colDelta),
rowTransformDir = 0,
colTransformDir = 0,
totalRows,
totalCols,
coords;
instance.runHooks('modifyTransformEnd', delta);
totalRows = instance.countRows();
totalCols = instance.countCols();
coords = new WalkontableCellCoords(priv.selRange.to.row + delta.row, priv.selRange.to.col + delta.col);
if (coords.row < 0) {
rowTransformDir = -1;
coords.row = 0;
} else if (coords.row > 0 && coords.row >= totalRows) {
rowTransformDir = 1;
coords.row = totalRows - 1;
}
if (coords.col < 0) {
colTransformDir = -1;
coords.col = 0;
} else if (coords.col > 0 && coords.col >= totalCols) {
colTransformDir = 1;
coords.col = totalCols - 1;
}
instance.runHooks('afterModifyTransformEnd', coords, rowTransformDir, colTransformDir);
selection.setRangeEnd(coords, true);
},
isSelected: function() {
return (priv.selRange !== null);
},
inInSelection: function(coords) {
if (!selection.isSelected()) {
return false;
}
return priv.selRange.includes(coords);
},
deselect: function() {
if (!selection.isSelected()) {
return;
}
instance.selection.inProgress = false;
priv.selRange = null;
instance.view.wt.selections.current.clear();
instance.view.wt.selections.area.clear();
if (priv.settings.currentRowClassName || priv.settings.currentColClassName) {
instance.view.wt.selections.highlight.clear();
}
editorManager.destroyEditor();
selection.refreshBorders();
Handsontable.hooks.run(instance, 'afterDeselect');
},
selectAll: function() {
if (!priv.settings.multiSelect) {
return;
}
selection.setRangeStart(new WalkontableCellCoords(0, 0));
selection.setRangeEnd(new WalkontableCellCoords(instance.countRows() - 1, instance.countCols() - 1), false);
},
empty: function() {
if (!selection.isSelected()) {
return;
}
var topLeft = priv.selRange.getTopLeftCorner();
var bottomRight = priv.selRange.getBottomRightCorner();
var r,
c,
changes = [];
for (r = topLeft.row; r <= bottomRight.row; r++) {
for (c = topLeft.col; c <= bottomRight.col; c++) {
if (!instance.getCellMeta(r, c).readOnly) {
changes.push([r, c, '']);
}
}
}
instance.setDataAtCell(changes);
}
};
this.init = function() {
dataSource.setData(priv.settings.data);
Handsontable.hooks.run(instance, 'beforeInit');
if (Handsontable.mobileBrowser) {
addClass(instance.rootElement, 'mobile');
}
this.updateSettings(priv.settings, true);
this.view = new TableView(this);
editorManager = new EditorManager(instance, priv, selection, datamap);
this.forceFullRender = true;
Handsontable.hooks.run(instance, 'init');
this.view.render();
if (typeof priv.firstRun === 'object') {
Handsontable.hooks.run(instance, 'afterChange', priv.firstRun[0], priv.firstRun[1]);
priv.firstRun = false;
}
Handsontable.hooks.run(instance, 'afterInit');
};
function ValidatorsQueue() {
var resolved = false;
return {
validatorsInQueue: 0,
valid: true,
addValidatorToQueue: function() {
this.validatorsInQueue++;
resolved = false;
},
removeValidatorFormQueue: function() {
this.validatorsInQueue = this.validatorsInQueue - 1 < 0 ? 0 : this.validatorsInQueue - 1;
this.checkIfQueueIsEmpty();
},
onQueueEmpty: function(valid) {},
checkIfQueueIsEmpty: function() {
if (this.validatorsInQueue == 0 && resolved == false) {
resolved = true;
this.onQueueEmpty(this.valid);
}
}
};
}
function validateChanges(changes, source, callback) {
var waitingForValidator = new ValidatorsQueue();
waitingForValidator.onQueueEmpty = resolve;
for (var i = changes.length - 1; i >= 0; i--) {
if (changes[i] === null) {
changes.splice(i, 1);
} else {
var row = changes[i][0];
var col = datamap.propToCol(changes[i][1]);
var logicalCol = instance.runHooks('modifyCol', col);
var cellProperties = instance.getCellMeta(row, logicalCol);
if (cellProperties.type === 'numeric' && typeof changes[i][3] === 'string') {
if (changes[i][3].length > 0 && (/^-?[\d\s]*(\.|\,)?\d*$/.test(changes[i][3]) || cellProperties.format)) {
var len = changes[i][3].length;
if (typeof cellProperties.language == 'undefined') {
numeral.language('en');
} else if (changes[i][3].indexOf('.') === len - 3 && changes[i][3].indexOf(',') === -1) {
numeral.language('en');
} else {
numeral.language(cellProperties.language);
}
if (numeral.validate(changes[i][3])) {
changes[i][3] = numeral().unformat(changes[i][3]);
}
}
}
if (instance.getCellValidator(cellProperties)) {
waitingForValidator.addValidatorToQueue();
instance.validateCell(changes[i][3], cellProperties, (function(i, cellProperties) {
return function(result) {
if (typeof result !== 'boolean') {
throw new Error('Validation error: result is not boolean');
}
if (result === false && cellProperties.allowInvalid === false) {
changes.splice(i, 1);
cellProperties.valid = true;
--i;
}
waitingForValidator.removeValidatorFormQueue();
};
})(i, cellProperties), source);
}
}
}
waitingForValidator.checkIfQueueIsEmpty();
function resolve() {
var beforeChangeResult;
if (changes.length) {
beforeChangeResult = Handsontable.hooks.run(instance, 'beforeChange', changes, source);
if (typeof beforeChangeResult === 'function') {
console.warn('Your beforeChange callback returns a function. It\'s not supported since Handsontable 0.12.1 (and the returned function will not be executed).');
} else if (beforeChangeResult === false) {
changes.splice(0, changes.length);
}
}
callback();
}
}
function applyChanges(changes, source) {
var i = changes.length - 1;
if (i < 0) {
return;
}
for (; 0 <= i; i--) {
if (changes[i] === null) {
changes.splice(i, 1);
continue;
}
if (changes[i][2] == null && changes[i][3] == null) {
continue;
}
if (priv.settings.allowInsertRow) {
while (changes[i][0] > instance.countRows() - 1) {
datamap.createRow();
}
}
if (instance.dataType === 'array' && priv.settings.allowInsertColumn) {
while (datamap.propToCol(changes[i][1]) > instance.countCols() - 1) {
datamap.createCol();
}
}
datamap.set(changes[i][0], changes[i][1], changes[i][3]);
}
instance.forceFullRender = true;
grid.adjustRowsAndCols();
Handsontable.hooks.run(instance, 'beforeChangeRender', changes, source);
selection.refreshBorders(null, true);
instance.view.wt.wtOverlays.adjustElementsSize();
Handsontable.hooks.run(instance, 'afterChange', changes, source || 'edit');
}
this.validateCell = function(value, cellProperties, callback, source) {
var validator = instance.getCellValidator(cellProperties);
function done(valid) {
var col = cellProperties.visualCol,
row = cellProperties.visualRow,
td = instance.getCell(row, col, true);
if (td) {
instance.view.wt.wtSettings.settings.cellRenderer(row, col, td);
}
callback(valid);
}
if (Object.prototype.toString.call(validator) === '[object RegExp]') {
validator = (function(validator) {
return function(value, callback) {
callback(validator.test(value));
};
})(validator);
}
if (typeof validator == 'function') {
value = Handsontable.hooks.run(instance, 'beforeValidate', value, cellProperties.visualRow, cellProperties.prop, source);
instance._registerTimeout(setTimeout(function() {
validator.call(cellProperties, value, function(valid) {
valid = Handsontable.hooks.run(instance, 'afterValidate', valid, value, cellProperties.visualRow, cellProperties.prop, source);
cellProperties.valid = valid;
done(valid);
Handsontable.hooks.run(instance, 'postAfterValidate', valid, value, cellProperties.visualRow, cellProperties.prop, source);
});
}, 0));
} else {
cellProperties.valid = true;
done(cellProperties.valid);
}
};
function setDataInputToArray(row, propOrCol, value) {
if (typeof row === 'object') {
return row;
} else {
return [[row, propOrCol, value]];
}
}
this.setDataAtCell = function(row, col, value, source) {
var input = setDataInputToArray(row, col, value),
i,
ilen,
changes = [],
prop;
for (i = 0, ilen = input.length; i < ilen; i++) {
if (typeof input[i] !== 'object') {
throw new Error('Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter');
}
if (typeof input[i][1] !== 'number') {
throw new Error('Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`');
}
prop = datamap.colToProp(input[i][1]);
changes.push([input[i][0], prop, datamap.get(input[i][0], prop), input[i][2]]);
}
if (!source && typeof row === 'object') {
source = col;
}
validateChanges(changes, source, function() {
applyChanges(changes, source);
});
};
this.setDataAtRowProp = function(row, prop, value, source) {
var input = setDataInputToArray(row, prop, value),
i,
ilen,
changes = [];
for (i = 0, ilen = input.length; i < ilen; i++) {
changes.push([input[i][0], input[i][1], datamap.get(input[i][0], input[i][1]), input[i][2]]);
}
if (!source && typeof row === 'object') {
source = prop;
}
validateChanges(changes, source, function() {
applyChanges(changes, source);
});
};
this.listen = function() {
Handsontable.activeGuid = instance.guid;
};
this.unlisten = function() {
Handsontable.activeGuid = null;
};
this.isListening = function() {
return Handsontable.activeGuid === instance.guid;
};
this.destroyEditor = function(revertOriginal) {
selection.refreshBorders(revertOriginal);
};
this.populateFromArray = function(row, col, input, endRow, endCol, source, method, direction, deltas) {
var c;
if (!(typeof input === 'object' && typeof input[0] === 'object')) {
throw new Error('populateFromArray parameter `input` must be an array of arrays');
}
c = typeof endRow === 'number' ? new WalkontableCellCoords(endRow, endCol) : null;
return grid.populateFromArray(new WalkontableCellCoords(row, col), input, c, source, method, direction, deltas);
};
this.spliceCol = function(col, index, amount) {
return datamap.spliceCol.apply(datamap, arguments);
};
this.spliceRow = function(row, index, amount) {
return datamap.spliceRow.apply(datamap, arguments);
};
this.getSelected = function() {
if (selection.isSelected()) {
return [priv.selRange.from.row, priv.selRange.from.col, priv.selRange.to.row, priv.selRange.to.col];
}
};
this.getSelectedRange = function() {
if (selection.isSelected()) {
return priv.selRange;
}
};
this.render = function() {
if (instance.view) {
instance.renderCall = true;
instance.forceFullRender = true;
selection.refreshBorders(null, true);
}
};
this.loadData = function(data) {
if (typeof data === 'object' && data !== null) {
if (!(data.push && data.splice)) {
data = [data];
}
} else if (data === null) {
data = [];
var row;
for (var r = 0,
rlen = priv.settings.startRows; r < rlen; r++) {
row = [];
for (var c = 0,
clen = priv.settings.startCols; c < clen; c++) {
row.push(null);
}
data.push(row);
}
} else {
throw new Error('loadData only accepts array of objects or array of arrays (' + typeof data + ' given)');
}
priv.isPopulated = false;
GridSettings.prototype.data = data;
if (Array.isArray(priv.settings.dataSchema) || Array.isArray(data[0])) {
instance.dataType = 'array';
} else if (typeof priv.settings.dataSchema === 'function') {
instance.dataType = 'function';
} else {
instance.dataType = 'object';
}
datamap = new DataMap(instance, priv, GridSettings);
dataSource.data = data;
dataSource.dataType = instance.dataType;
dataSource.colToProp = datamap.colToProp.bind(datamap);
dataSource.propToCol = datamap.propToCol.bind(datamap);
clearCellSettingCache();
grid.adjustRowsAndCols();
Handsontable.hooks.run(instance, 'afterLoadData', priv.firstRun);
if (priv.firstRun) {
priv.firstRun = [null, 'loadData'];
} else {
Handsontable.hooks.run(instance, 'afterChange', null, 'loadData');
instance.render();
}
priv.isPopulated = true;
function clearCellSettingCache() {
priv.cellSettings.length = 0;
}
};
this.getData = function(r, c, r2, c2) {
if (typeof r === 'undefined') {
return datamap.getAll();
} else {
return datamap.getRange(new WalkontableCellCoords(r, c), new WalkontableCellCoords(r2, c2), datamap.DESTINATION_RENDERER);
}
};
this.getCopyableText = function(startRow, startCol, endRow, endCol) {
return datamap.getCopyableText(new WalkontableCellCoords(startRow, startCol), new WalkontableCellCoords(endRow, endCol));
};
this.getCopyableData = function(row, column) {
return datamap.getCopyable(row, datamap.colToProp(column));
};
this.getSchema = function() {
return datamap.getSchema();
};
this.updateSettings = function(settings, init) {
var i,
clen;
if (typeof settings.rows !== 'undefined') {
throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');
}
if (typeof settings.cols !== 'undefined') {
throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');
}
for (i in settings) {
if (i === 'data') {
continue;
} else {
if (Handsontable.hooks.getRegistered().indexOf(i) > -1) {
if (typeof settings[i] === 'function' || Array.isArray(settings[i])) {
instance.addHook(i, settings[i]);
}
} else {
if (!init && settings.hasOwnProperty(i)) {
GridSettings.prototype[i] = settings[i];
}
}
}
}
if (settings.data === void 0 && priv.settings.data === void 0) {
instance.loadData(null);
} else if (settings.data !== void 0) {
instance.loadData(settings.data);
} else if (settings.columns !== void 0) {
datamap.createMap();
}
clen = instance.countCols();
priv.cellSettings.length = 0;
if (clen > 0) {
var proto,
column;
for (i = 0; i < clen; i++) {
priv.columnSettings[i] = columnFactory(GridSettings, priv.columnsSettingConflicts);
proto = priv.columnSettings[i].prototype;
if (GridSettings.prototype.columns) {
column = GridSettings.prototype.columns[i];
extend(proto, column);
extend(proto, expandType(column));
}
}
}
if (typeof settings.cell !== 'undefined') {
for (i in settings.cell) {
if (settings.cell.hasOwnProperty(i)) {
var cell = settings.cell[i];
instance.setCellMetaObject(cell.row, cell.col, cell);
}
}
}
Handsontable.hooks.run(instance, 'afterCellMetaReset');
if (typeof settings.className !== 'undefined') {
if (GridSettings.prototype.className) {
removeClass(instance.rootElement, GridSettings.prototype.className);
}
if (settings.className) {
addClass(instance.rootElement, settings.className);
}
}
if (typeof settings.height != 'undefined') {
var height = settings.height;
if (typeof height == 'function') {
height = height();
}
instance.rootElement.style.height = height + 'px';
}
if (typeof settings.width != 'undefined') {
var width = settings.width;
if (typeof width == 'function') {
width = width();
}
instance.rootElement.style.width = width + 'px';
}
if (height) {
instance.rootElement.style.overflow = 'hidden';
}
if (!init) {
Handsontable.hooks.run(instance, 'afterUpdateSettings');
}
grid.adjustRowsAndCols();
if (instance.view && !priv.firstRun) {
instance.forceFullRender = true;
selection.refreshBorders(null, true);
}
};
this.getValue = function() {
var sel = instance.getSelected();
if (GridSettings.prototype.getValue) {
if (typeof GridSettings.prototype.getValue === 'function') {
return GridSettings.prototype.getValue.call(instance);
} else if (sel) {
return instance.getData()[sel[0]][GridSettings.prototype.getValue];
}
} else if (sel) {
return instance.getDataAtCell(sel[0], sel[1]);
}
};
function expandType(obj) {
if (!obj.hasOwnProperty('type')) {
return;
}
var type,
expandedType = {};
if (typeof obj.type === 'object') {
type = obj.type;
} else if (typeof obj.type === 'string') {
type = Handsontable.cellTypes[obj.type];
if (type === void 0) {
throw new Error('You declared cell type "' + obj.type + '" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');
}
}
for (var i in type) {
if (type.hasOwnProperty(i) && !obj.hasOwnProperty(i)) {
expandedType[i] = type[i];
}
}
return expandedType;
}
this.getSettings = function() {
return priv.settings;
};
this.clear = function() {
selection.selectAll();
selection.empty();
};
this.alter = function(action, index, amount, source, keepEmptyRows) {
grid.alter(action, index, amount, source, keepEmptyRows);
};
this.getCell = function(row, col, topmost) {
return instance.view.getCellAtCoords(new WalkontableCellCoords(row, col), topmost);
};
this.getCoords = function(elem) {
return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable, elem);
};
this.colToProp = function(col) {
return datamap.colToProp(col);
};
this.propToCol = function(prop) {
return datamap.propToCol(prop);
};
this.getDataAtCell = function(row, col) {
return datamap.get(row, datamap.colToProp(col));
};
this.getDataAtRowProp = function(row, prop) {
return datamap.get(row, prop);
};
this.getDataAtCol = function(col) {
var out = [];
return out.concat.apply(out, datamap.getRange(new WalkontableCellCoords(0, col), new WalkontableCellCoords(priv.settings.data.length - 1, col), datamap.DESTINATION_RENDERER));
};
this.getDataAtProp = function(prop) {
var out = [],
range;
range = datamap.getRange(new WalkontableCellCoords(0, datamap.propToCol(prop)), new WalkontableCellCoords(priv.settings.data.length - 1, datamap.propToCol(prop)), datamap.DESTINATION_RENDERER);
return out.concat.apply(out, range);
};
this.getSourceData = function(r, c, r2, c2) {
var data;
if (r === void 0) {
data = dataSource.getData();
} else {
data = dataSource.getByRange(new WalkontableCellCoords(r, c), new WalkontableCellCoords(r2, c2));
}
return data;
};
this.getSourceDataAtCol = function(column) {
return dataSource.getAtColumn(column);
};
this.getSourceDataAtRow = function(row) {
return dataSource.getAtRow(row);
};
this.getSourceDataAtCell = function(row, column) {
return dataSource.getAtCell(row, column);
};
this.getDataAtRow = function(row) {
var data = datamap.getRange(new WalkontableCellCoords(row, 0), new WalkontableCellCoords(row, this.countCols() - 1), datamap.DESTINATION_RENDERER);
return data[0];
};
this.getDataType = function(rowFrom, columnFrom, rowTo, columnTo) {
var $__19 = this;
var previousType = null;
var currentType = null;
if (rowFrom === void 0) {
rowFrom = 0;
rowTo = this.countRows();
columnFrom = 0;
columnTo = this.countCols();
}
if (rowTo === void 0) {
rowTo = rowFrom;
}
if (columnTo === void 0) {
columnTo = columnFrom;
}
var type = 'mixed';
rangeEach(Math.min(rowFrom, rowTo), Math.max(rowFrom, rowTo), (function(row) {
var isTypeEqual = true;
rangeEach(Math.min(columnFrom, columnTo), Math.max(columnFrom, columnTo), (function(column) {
var cellType = $__19.getCellMeta(row, column);
currentType = cellType.type;
if (previousType) {
isTypeEqual = previousType === currentType;
} else {
previousType = currentType;
}
return isTypeEqual;
}));
type = isTypeEqual ? currentType : 'mixed';
return isTypeEqual;
}));
return type;
};
this.removeCellMeta = function(row, col, key) {
var cellMeta = instance.getCellMeta(row, col);
if (cellMeta[key] != undefined) {
delete priv.cellSettings[row][col][key];
}
};
this.setCellMetaObject = function(row, col, prop) {
if (typeof prop === 'object') {
for (var key in prop) {
if (prop.hasOwnProperty(key)) {
var value = prop[key];
this.setCellMeta(row, col, key, value);
}
}
}
};
this.setCellMeta = function(row, col, key, val) {
if (!priv.cellSettings[row]) {
priv.cellSettings[row] = [];
}
if (!priv.cellSettings[row][col]) {
priv.cellSettings[row][col] = new priv.columnSettings[col]();
}
priv.cellSettings[row][col][key] = val;
Handsontable.hooks.run(instance, 'afterSetCellMeta', row, col, key, val);
};
this.getCellsMeta = function() {
return arrayFlatten(priv.cellSettings);
};
this.getCellMeta = function(row, col) {
var prop = datamap.colToProp(col),
cellProperties;
var visualRow = row;
var visualCol = col;
row = translateRowIndex(row);
col = translateColIndex(col);
if (!priv.columnSettings[col]) {
priv.columnSettings[col] = columnFactory(GridSettings, priv.columnsSettingConflicts);
}
if (!priv.cellSettings[row]) {
priv.cellSettings[row] = [];
}
if (!priv.cellSettings[row][col]) {
priv.cellSettings[row][col] = new priv.columnSettings[col]();
}
cellProperties = priv.cellSettings[row][col];
cellProperties.row = row;
cellProperties.col = col;
cellProperties.visualRow = visualRow;
cellProperties.visualCol = visualCol;
cellProperties.prop = prop;
cellProperties.instance = instance;
Handsontable.hooks.run(instance, 'beforeGetCellMeta', row, col, cellProperties);
extend(cellProperties, expandType(cellProperties));
if (cellProperties.cells) {
var settings = cellProperties.cells.call(cellProperties, row, col, prop);
if (settings) {
extend(cellProperties, settings);
extend(cellProperties, expandType(settings));
}
}
Handsontable.hooks.run(instance, 'afterGetCellMeta', row, col, cellProperties);
return cellProperties;
};
this.isColumnModificationAllowed = function() {
return !(instance.dataType === 'object' || instance.getSettings().columns);
};
function translateRowIndex(row) {
return Handsontable.hooks.run(instance, 'modifyRow', row);
}
function translateColIndex(col) {
return Handsontable.hooks.run(instance, 'modifyCol', col);
}
var rendererLookup = cellMethodLookupFactory('renderer');
this.getCellRenderer = function(row, col) {
var renderer = rendererLookup.call(this, row, col);
return getRenderer(renderer);
};
this.getCellEditor = cellMethodLookupFactory('editor');
this.getCellValidator = cellMethodLookupFactory('validator');
this.validateCells = function(callback) {
var waitingForValidator = new ValidatorsQueue();
if (callback) {
waitingForValidator.onQueueEmpty = callback;
}
var i = instance.countRows() - 1;
while (i >= 0) {
var j = instance.countCols() - 1;
while (j >= 0) {
waitingForValidator.addValidatorToQueue();
instance.validateCell(instance.getDataAtCell(i, j), instance.getCellMeta(i, j), function(result) {
if (typeof result !== 'boolean') {
throw new Error('Validation error: result is not boolean');
}
if (result === false) {
waitingForValidator.valid = false;
}
waitingForValidator.removeValidatorFormQueue();
}, 'validateCells');
j--;
}
i--;
}
waitingForValidator.checkIfQueueIsEmpty();
};
this.getRowHeader = function(row) {
var rowHeader = priv.settings.rowHeaders;
if (row !== void 0) {
row = Handsontable.hooks.run(instance, 'modifyRowHeader', row);
}
if (row === void 0) {
rowHeader = [];
rangeEach(instance.countRows() - 1, (function(i) {
rowHeader.push(instance.getRowHeader(i));
}));
} else if (Array.isArray(rowHeader) && rowHeader[row] !== void 0) {
rowHeader = rowHeader[row];
} else if (typeof rowHeader === 'function') {
rowHeader = rowHeader(row);
} else if (rowHeader && typeof rowHeader !== 'string' && typeof rowHeader !== 'number') {
rowHeader = row + 1;
}
return rowHeader;
};
this.hasRowHeaders = function() {
return !!priv.settings.rowHeaders;
};
this.hasColHeaders = function() {
if (priv.settings.colHeaders !== void 0 && priv.settings.colHeaders !== null) {
return !!priv.settings.colHeaders;
}
for (var i = 0,
ilen = instance.countCols(); i < ilen; i++) {
if (instance.getColHeader(i)) {
return true;
}
}
return false;
};
this.getColHeader = function(col) {
col = Handsontable.hooks.run(instance, 'modifyColHeader', col);
if (col === void 0) {
var out = [];
for (var i = 0,
ilen = instance.countCols(); i < ilen; i++) {
out.push(instance.getColHeader(i));
}
return out;
} else {
var baseCol = col;
col = Handsontable.hooks.run(instance, 'modifyCol', col);
if (priv.settings.columns && priv.settings.columns[col] && priv.settings.columns[col].title) {
return priv.settings.columns[col].title;
} else if (Array.isArray(priv.settings.colHeaders) && priv.settings.colHeaders[col] !== void 0) {
return priv.settings.colHeaders[col];
} else if (typeof priv.settings.colHeaders === 'function') {
return priv.settings.colHeaders(col);
} else if (priv.settings.colHeaders && typeof priv.settings.colHeaders !== 'string' && typeof priv.settings.colHeaders !== 'number') {
return spreadsheetColumnLabel(baseCol);
} else {
return priv.settings.colHeaders;
}
}
};
this._getColWidthFromSettings = function(col) {
var cellProperties = instance.getCellMeta(0, col);
var width = cellProperties.width;
if (width === void 0 || width === priv.settings.width) {
width = cellProperties.colWidths;
}
if (width !== void 0 && width !== null) {
switch (typeof width) {
case 'object':
width = width[col];
break;
case 'function':
width = width(col);
break;
}
if (typeof width === 'string') {
width = parseInt(width, 10);
}
}
return width;
};
this.getColWidth = function(col) {
var width = instance._getColWidthFromSettings(col);
width = Handsontable.hooks.run(instance, 'modifyColWidth', width, col);
if (width === void 0) {
width = WalkontableViewportColumnsCalculator.DEFAULT_WIDTH;
}
return width;
};
this._getRowHeightFromSettings = function(row) {
var height = priv.settings.rowHeights;
if (height !== void 0 && height !== null) {
switch (typeof height) {
case 'object':
height = height[row];
break;
case 'function':
height = height(row);
break;
}
if (typeof height === 'string') {
height = parseInt(height, 10);
}
}
return height;
};
this.getRowHeight = function(row) {
var height = instance._getRowHeightFromSettings(row);
height = Handsontable.hooks.run(instance, 'modifyRowHeight', height, row);
return height;
};
this.countSourceRows = function() {
return instance.getSourceData() ? instance.getSourceData().length : 0;
};
this.countRows = function() {
return datamap.getLength();
};
this.countCols = function() {
if (instance.dataType === 'object' || instance.dataType === 'function') {
if (priv.settings.columns && priv.settings.columns.length) {
return priv.settings.columns.length;
} else {
return datamap.colToPropCache.length;
}
} else if (instance.dataType === 'array') {
if (priv.settings.columns && priv.settings.columns.length) {
return priv.settings.columns.length;
} else if (priv.settings.data && priv.settings.data[0] && priv.settings.data[0].length) {
return priv.settings.data[0].length;
} else {
return 0;
}
}
};
this.getColspanOffset = function(col, level) {
var colspanSum = 0;
if (instance.colspanArray) {
for (var i = 0; i < col; i++) {
colspanSum += instance.colspanArray[level][i] - 1 || 0;
}
return colspanSum;
}
var colspanSum = 0;
var TRindex = instance.view.wt.wtTable.THEAD.childNodes.length - level - 1;
var TR = instance.view.wt.wtTable.THEAD.querySelector('tr:nth-child(' + parseInt(TRindex + 1, 10) + ')');
var rowHeadersCount = instance.view.wt.wtSettings.settings.rowHeaders().length;
for (var i = rowHeadersCount; i < rowHeadersCount + col; i++) {
if (TR.childNodes[i].hasAttribute('colspan')) {
colspanSum += parseInt(TR.childNodes[i].getAttribute('colspan'), 10) - 1;
}
}
return colspanSum;
};
this.getHeaderColspan = function(col, level) {
var TRindex = instance.view.wt.wtTable.THEAD.childNodes.length - level - 1;
var rowHeadersCount = instance.view.wt.wtSettings.settings.rowHeaders().length;
var TR = instance.view.wt.wtTable.THEAD.querySelector('tr:nth-child(' + parseInt(TRindex + 1, 10) + ')');
var offsettedColIndex = rowHeadersCount + col - instance.view.wt.wtViewport.columnsRenderCalculator.startColumn;
if (TR.childNodes[offsettedColIndex].hasAttribute('colspan')) {
return parseInt(TR.childNodes[offsettedColIndex].getAttribute('colspan'), 10);
}
return 0;
};
this.rowOffset = function() {
return instance.view.wt.wtTable.getFirstRenderedRow();
};
this.colOffset = function() {
return instance.view.wt.wtTable.getFirstRenderedColumn();
};
this.countRenderedRows = function() {
return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedRowsCount() : -1;
};
this.countVisibleRows = function() {
return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleRowsCount() : -1;
};
this.countRenderedCols = function() {
return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedColumnsCount() : -1;
};
this.countVisibleCols = function() {
return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleColumnsCount() : -1;
};
this.countEmptyRows = function(ending) {
var i = instance.countRows() - 1,
empty = 0,
row;
while (i >= 0) {
row = Handsontable.hooks.run(this, 'modifyRow', i);
if (instance.isEmptyRow(row)) {
empty++;
} else if (ending) {
break;
}
i--;
}
return empty;
};
this.countEmptyCols = function(ending) {
if (instance.countRows() < 1) {
return 0;
}
var i = instance.countCols() - 1,
empty = 0;
while (i >= 0) {
if (instance.isEmptyCol(i)) {
empty++;
} else if (ending) {
break;
}
i--;
}
return empty;
};
this.isEmptyRow = function(row) {
return priv.settings.isEmptyRow.call(instance, row);
};
this.isEmptyCol = function(col) {
return priv.settings.isEmptyCol.call(instance, col);
};
this.selectCell = function(row, col, endRow, endCol, scrollToCell, changeListener) {
var coords;
changeListener = typeof changeListener === 'undefined' || changeListener === true;
if (typeof row !== 'number' || row < 0 || row >= instance.countRows()) {
return false;
}
if (typeof col !== 'number' || col < 0 || col >= instance.countCols()) {
return false;
}
if (typeof endRow !== 'undefined') {
if (typeof endRow !== 'number' || endRow < 0 || endRow >= instance.countRows()) {
return false;
}
if (typeof endCol !== 'number' || endCol < 0 || endCol >= instance.countCols()) {
return false;
}
}
coords = new WalkontableCellCoords(row, col);
priv.selRange = new WalkontableCellRange(coords, coords, coords);
if (changeListener) {
instance.listen();
}
if (typeof endRow === 'undefined') {
selection.setRangeEnd(priv.selRange.from, scrollToCell);
} else {
selection.setRangeEnd(new WalkontableCellCoords(endRow, endCol), scrollToCell);
}
instance.selection.finish();
return true;
};
this.selectCellByProp = function(row, prop, endRow, endProp, scrollToCell) {
arguments[1] = datamap.propToCol(arguments[1]);
if (typeof arguments[3] !== 'undefined') {
arguments[3] = datamap.propToCol(arguments[3]);
}
return instance.selectCell.apply(instance, arguments);
};
this.deselectCell = function() {
selection.deselect();
};
this.destroy = function() {
instance._clearTimeouts();
if (instance.view) {
instance.view.destroy();
}
if (dataSource) {
dataSource.destroy();
}
dataSource = null;
empty(instance.rootElement);
eventManager.destroy();
Handsontable.hooks.run(instance, 'afterDestroy');
Handsontable.hooks.destroy(instance);
for (var i in instance) {
if (instance.hasOwnProperty(i)) {
if (typeof instance[i] === 'function') {
instance[i] = postMortem;
} else if (i !== 'guid') {
instance[i] = null;
}
}
}
priv = null;
datamap = null;
grid = null;
selection = null;
editorManager = null;
instance = null;
GridSettings = null;
};
function postMortem() {
throw new Error('This method cannot be called because this Handsontable instance has been destroyed');
}
this.getActiveEditor = function() {
return editorManager.getActiveEditor();
};
this.getPlugin = function(pluginName) {
return getPlugin(this, pluginName);
};
this.getInstance = function() {
return instance;
};
this.addHook = function(key, callback) {
Handsontable.hooks.add(key, callback, instance);
};
this.hasHook = function(key) {
return Handsontable.hooks.has(key, instance);
};
this.addHookOnce = function(key, callback) {
Handsontable.hooks.once(key, callback, instance);
};
this.removeHook = function(key, callback) {
Handsontable.hooks.remove(key, callback, instance);
};
this.runHooks = function(key, p1, p2, p3, p4, p5, p6) {
return Handsontable.hooks.run(instance, key, p1, p2, p3, p4, p5, p6);
};
this.timeouts = [];
this._registerTimeout = function(handle) {
this.timeouts.push(handle);
};
this._clearTimeouts = function() {
for (var i = 0,
ilen = this.timeouts.length; i < ilen; i++) {
clearTimeout(this.timeouts[i]);
}
};
this.version = Handsontable.version;
Handsontable.hooks.run(instance, 'construct');
};
var DefaultSettings = function() {};
DefaultSettings.prototype = {
data: void 0,
dataSchema: void 0,
width: void 0,
height: void 0,
startRows: 5,
startCols: 5,
rowHeaders: void 0,
colHeaders: null,
colWidths: void 0,
rowHeights: void 0,
columns: void 0,
cells: void 0,
cell: [],
comments: false,
customBorders: false,
minRows: 0,
minCols: 0,
maxRows: Infinity,
maxCols: Infinity,
minSpareRows: 0,
minSpareCols: 0,
allowInsertRow: true,
allowInsertColumn: true,
allowRemoveRow: true,
allowRemoveColumn: true,
multiSelect: true,
fillHandle: true,
fixedRowsTop: 0,
fixedRowsBottom: 0,
fixedColumnsLeft: 0,
outsideClickDeselects: true,
enterBeginsEditing: true,
enterMoves: {
row: 1,
col: 0
},
tabMoves: {
row: 0,
col: 1
},
autoWrapRow: false,
autoWrapCol: false,
copyRowsLimit: 1000,
copyColsLimit: 1000,
pasteMode: 'overwrite',
persistentState: void 0,
currentRowClassName: void 0,
currentColClassName: void 0,
className: void 0,
tableClassName: void 0,
stretchH: 'none',
isEmptyRow: function(row) {
var col,
colLen,
value,
meta;
for (col = 0, colLen = this.countCols(); col < colLen; col++) {
value = this.getDataAtCell(row, col);
if (value !== '' && value !== null && typeof value !== 'undefined') {
if (typeof value === 'object') {
meta = this.getCellMeta(row, col);
return isObjectEquals(this.getSchema()[meta.prop], value);
}
return false;
}
}
return true;
},
isEmptyCol: function(col) {
var row,
rowLen,
value;
for (row = 0, rowLen = this.countRows(); row < rowLen; row++) {
value = this.getDataAtCell(row, col);
if (value !== '' && value !== null && typeof value !== 'undefined') {
return false;
}
}
return true;
},
observeDOMVisibility: true,
allowInvalid: true,
invalidCellClassName: 'htInvalid',
placeholder: false,
placeholderCellClassName: 'htPlaceholder',
readOnlyCellClassName: 'htDimmed',
renderer: void 0,
commentedCellClassName: 'htCommentCell',
fragmentSelection: false,
readOnly: false,
skipColumnOnPaste: false,
search: false,
type: 'text',
copyable: true,
editor: void 0,
autoComplete: void 0,
visibleRows: 10,
trimDropdown: true,
debug: false,
wordWrap: true,
noWordWrapClassName: 'htNoWrap',
contextMenu: void 0,
contextMenuCopyPaste: void 0,
copyPaste: void 0,
undo: void 0,
columnSorting: void 0,
manualColumnMove: void 0,
manualColumnResize: void 0,
manualRowMove: void 0,
manualRowResize: void 0,
mergeCells: false,
viewportRowRenderingOffset: 'auto',
viewportColumnRenderingOffset: 'auto',
validator: void 0,
disableVisualSelection: false,
sortIndicator: void 0,
manualColumnFreeze: void 0,
trimWhitespace: true,
settings: void 0,
source: void 0,
title: void 0,
checkedTemplate: void 0,
uncheckedTemplate: void 0,
label: void 0,
format: void 0,
language: void 0,
selectOptions: void 0,
autoColumnSize: void 0,
autoRowSize: void 0,
dateFormat: void 0,
correctFormat: false,
defaultDate: void 0,
strict: void 0,
renderAllRows: void 0,
preventOverflow: false,
bindRowsWithHeaders: void 0,
collapsibleColumns: void 0,
columnSummary: void 0,
dropdownMenu: void 0,
filters: void 0,
ganttChart: void 0,
headerTooltips: void 0,
hiddenColumns: void 0,
hiddenRows: void 0,
nestedHeaders: void 0,
trimRows: void 0,
rowHeaderWidth: void 0,
columnHeaderHeight: void 0
};
Handsontable.DefaultSettings = DefaultSettings;
//#
},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,"dataMap":26,"dataSource":27,"editorManager":28,"eventManager":41,"helpers/array":42,"helpers/data":44,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"helpers/string":52,"numeral":"numeral","plugins":57,"renderers":88,"tableView":97}],26:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
DataMap: {get: function() {
return DataMap;
}},
__esModule: {value: true}
});
var $__SheetClip__,
$__helpers_47_data__,
$__helpers_47_setting__,
$__helpers_47_object__,
$__helpers_47_array__,
$__helpers_47_number__,
$__multiMap__;
var SheetClip = ($__SheetClip__ = require("SheetClip"), $__SheetClip__ && $__SheetClip__.__esModule && $__SheetClip__ || {default: $__SheetClip__}).default;
var cellMethodLookupFactory = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__}).cellMethodLookupFactory;
var columnFactory = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__}).columnFactory;
var $__3 = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}),
duckSchema = $__3.duckSchema,
deepExtend = $__3.deepExtend;
var $__4 = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}),
extendArray = $__4.extendArray,
to2dArray = $__4.to2dArray;
var rangeEach = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__}).rangeEach;
var MultiMap = ($__multiMap__ = require("multiMap"), $__multiMap__ && $__multiMap__.__esModule && $__multiMap__ || {default: $__multiMap__}).MultiMap;
function DataMap(instance, priv, GridSettings) {
this.instance = instance;
this.priv = priv;
this.GridSettings = GridSettings;
this.dataSource = this.instance.getSettings().data;
if (this.dataSource[0]) {
this.duckSchema = this.recursiveDuckSchema(this.dataSource[0]);
} else {
this.duckSchema = {};
}
this.createMap();
}
DataMap.prototype.DESTINATION_RENDERER = 1;
DataMap.prototype.DESTINATION_CLIPBOARD_GENERATOR = 2;
DataMap.prototype.recursiveDuckSchema = function(object) {
return duckSchema(object);
};
DataMap.prototype.recursiveDuckColumns = function(schema, lastCol, parent) {
var prop,
i;
if (typeof lastCol === 'undefined') {
lastCol = 0;
parent = '';
}
if (typeof schema === 'object' && !Array.isArray(schema)) {
for (i in schema) {
if (schema.hasOwnProperty(i)) {
if (schema[i] === null) {
prop = parent + i;
this.colToPropCache.push(prop);
this.propToColCache.set(prop, lastCol);
lastCol++;
} else {
lastCol = this.recursiveDuckColumns(schema[i], lastCol, i + '.');
}
}
}
}
return lastCol;
};
DataMap.prototype.createMap = function() {
var i,
ilen,
schema = this.getSchema();
if (typeof schema === 'undefined') {
throw new Error('trying to create `columns` definition but you didnt\' provide `schema` nor `data`');
}
this.colToPropCache = [];
this.propToColCache = new MultiMap();
var columns = this.instance.getSettings().columns;
if (columns) {
for (i = 0, ilen = columns.length; i < ilen; i++) {
if (typeof columns[i].data != 'undefined') {
this.colToPropCache[i] = columns[i].data;
this.propToColCache.set(columns[i].data, i);
}
}
} else {
this.recursiveDuckColumns(schema);
}
};
DataMap.prototype.colToProp = function(col) {
col = Handsontable.hooks.run(this.instance, 'modifyCol', col);
if (this.colToPropCache && typeof this.colToPropCache[col] !== 'undefined') {
return this.colToPropCache[col];
}
return col;
};
DataMap.prototype.propToCol = function(prop) {
var col;
if (typeof this.propToColCache.get(prop) === 'undefined') {
col = prop;
} else {
col = this.propToColCache.get(prop);
}
col = Handsontable.hooks.run(this.instance, 'modifyCol', col);
return col;
};
DataMap.prototype.getSchema = function() {
var schema = this.instance.getSettings().dataSchema;
if (schema) {
if (typeof schema === 'function') {
return schema();
}
return schema;
}
return this.duckSchema;
};
DataMap.prototype.createRow = function(index, amount, createdAutomatically) {
var row,
colCount = this.instance.countCols(),
numberOfCreatedRows = 0,
currentIndex;
if (!amount) {
amount = 1;
}
if (typeof index !== 'number' || index >= this.instance.countSourceRows()) {
index = this.instance.countSourceRows();
}
currentIndex = index;
var maxRows = this.instance.getSettings().maxRows;
while (numberOfCreatedRows < amount && this.instance.countSourceRows() < maxRows) {
if (this.instance.dataType === 'array') {
row = [];
for (var c = 0; c < colCount; c++) {
row.push(null);
}
} else if (this.instance.dataType === 'function') {
row = this.instance.getSettings().dataSchema(index);
} else {
row = {};
deepExtend(row, this.getSchema());
}
if (index === this.instance.countSourceRows()) {
this.dataSource.push(row);
} else {
this.dataSource.splice(index, 0, row);
}
numberOfCreatedRows++;
currentIndex++;
}
Handsontable.hooks.run(this.instance, 'afterCreateRow', index, numberOfCreatedRows, createdAutomatically);
this.instance.forceFullRender = true;
return numberOfCreatedRows;
};
DataMap.prototype.createCol = function(index, amount, createdAutomatically) {
if (!this.instance.isColumnModificationAllowed()) {
throw new Error('Cannot create new column. When data source in an object, ' + 'you can only have as much columns as defined in first data row, data schema or in the \'columns\' setting.' + 'If you want to be able to add new columns, you have to use array datasource.');
}
var rlen = this.instance.countSourceRows(),
data = this.dataSource,
constructor,
numberOfCreatedCols = 0,
currentIndex;
if (!amount) {
amount = 1;
}
currentIndex = index;
var maxCols = this.instance.getSettings().maxCols;
while (numberOfCreatedCols < amount && this.instance.countCols() < maxCols) {
constructor = columnFactory(this.GridSettings, this.priv.columnsSettingConflicts);
if (typeof index !== 'number' || index >= this.instance.countCols()) {
for (var r = 0; r < rlen; r++) {
if (typeof data[r] === 'undefined') {
data[r] = [];
}
data[r].push(null);
}
this.priv.columnSettings.push(constructor);
} else {
for (var r = 0; r < rlen; r++) {
data[r].splice(currentIndex, 0, null);
}
this.priv.columnSettings.splice(currentIndex, 0, constructor);
}
numberOfCreatedCols++;
currentIndex++;
}
Handsontable.hooks.run(this.instance, 'afterCreateCol', index, numberOfCreatedCols, createdAutomatically);
this.instance.forceFullRender = true;
return numberOfCreatedCols;
};
DataMap.prototype.removeRow = function(index, amount) {
if (!amount) {
amount = 1;
}
if (typeof index !== 'number') {
index = -amount;
}
index = (this.instance.countSourceRows() + index) % this.instance.countSourceRows();
var logicRows = this.physicalRowsToLogical(index, amount);
var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveRow', index, amount, logicRows);
if (actionWasNotCancelled === false) {
return;
}
var data = this.dataSource;
var newData = data.filter(function(row, index) {
return logicRows.indexOf(index) == -1;
});
data.length = 0;
Array.prototype.push.apply(data, newData);
Handsontable.hooks.run(this.instance, 'afterRemoveRow', index, amount, logicRows);
this.instance.forceFullRender = true;
};
DataMap.prototype.removeCol = function(index, amount) {
if (this.instance.dataType === 'object' || this.instance.getSettings().columns) {
throw new Error('cannot remove column with object data source or columns option specified');
}
if (!amount) {
amount = 1;
}
if (typeof index !== 'number') {
index = -amount;
}
index = (this.instance.countCols() + index) % this.instance.countCols();
var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveCol', index, amount);
if (actionWasNotCancelled === false) {
return;
}
var data = this.dataSource;
for (var r = 0,
rlen = this.instance.countSourceRows(); r < rlen; r++) {
data[r].splice(index, amount);
}
this.priv.columnSettings.splice(index, amount);
Handsontable.hooks.run(this.instance, 'afterRemoveCol', index, amount);
this.instance.forceFullRender = true;
};
DataMap.prototype.spliceCol = function(col, index, amount) {
var elements = 4 <= arguments.length ? [].slice.call(arguments, 3) : [];
var colData = this.instance.getDataAtCol(col);
var removed = colData.slice(index, index + amount);
var after = colData.slice(index + amount);
extendArray(elements, after);
var i = 0;
while (i < amount) {
elements.push(null);
i++;
}
to2dArray(elements);
this.instance.populateFromArray(index, col, elements, null, null, 'spliceCol');
return removed;
};
DataMap.prototype.spliceRow = function(row, index, amount) {
var elements = 4 <= arguments.length ? [].slice.call(arguments, 3) : [];
var rowData = this.instance.getSourceDataAtRow(row);
var removed = rowData.slice(index, index + amount);
var after = rowData.slice(index + amount);
extendArray(elements, after);
var i = 0;
while (i < amount) {
elements.push(null);
i++;
}
this.instance.populateFromArray(row, index, [elements], null, null, 'spliceRow');
return removed;
};
DataMap.prototype.get = function(row, prop) {
row = Handsontable.hooks.run(this.instance, 'modifyRow', row);
if (typeof prop === 'string' && prop.indexOf('.') > -1) {
var sliced = prop.split('.');
var out = this.dataSource[row];
if (!out) {
return null;
}
for (var i = 0,
ilen = sliced.length; i < ilen; i++) {
out = out[sliced[i]];
if (typeof out === 'undefined') {
return null;
}
}
return out;
} else if (typeof prop === 'function') {
return prop(this.dataSource.slice(row, row + 1)[0]);
}
if (this.dataSource[row] && this.dataSource[row].hasOwnProperty && this.dataSource[row].hasOwnProperty(prop)) {
return this.dataSource[row][prop];
}
return null;
};
var copyableLookup = cellMethodLookupFactory('copyable', false);
DataMap.prototype.getCopyable = function(row, prop) {
if (copyableLookup.call(this.instance, row, this.propToCol(prop))) {
return this.get(row, prop);
}
return '';
};
DataMap.prototype.set = function(row, prop, value, source) {
row = Handsontable.hooks.run(this.instance, 'modifyRow', row, source || 'datamapGet');
if (typeof prop === 'string' && prop.indexOf('.') > -1) {
var sliced = prop.split('.');
var out = this.dataSource[row];
for (var i = 0,
ilen = sliced.length - 1; i < ilen; i++) {
if (typeof out[sliced[i]] === 'undefined') {
out[sliced[i]] = {};
}
out = out[sliced[i]];
}
out[sliced[i]] = value;
} else if (typeof prop === 'function') {
prop(this.dataSource.slice(row, row + 1)[0], value);
} else {
this.dataSource[row][prop] = value;
}
};
DataMap.prototype.physicalRowsToLogical = function(index, amount) {
var totalRows = this.instance.countSourceRows();
var physicRow = (totalRows + index) % totalRows;
var logicRows = [];
var rowsToRemove = amount;
var row;
while (physicRow < totalRows && rowsToRemove) {
row = Handsontable.hooks.run(this.instance, 'modifyRow', physicRow);
logicRows.push(row);
rowsToRemove--;
physicRow++;
}
return logicRows;
};
DataMap.prototype.clear = function() {
for (var r = 0; r < this.instance.countSourceRows(); r++) {
for (var c = 0; c < this.instance.countCols(); c++) {
this.set(r, this.colToProp(c), '');
}
}
};
DataMap.prototype.getLength = function() {
var $__7 = this;
var length = this.instance.countSourceRows();
if (Handsontable.hooks.has('modifyRow', this.instance)) {
rangeEach(this.instance.countSourceRows() - 1, (function(row) {
row = Handsontable.hooks.run($__7.instance, 'modifyRow', row);
if (row === null) {
length--;
}
}));
}
return length;
};
DataMap.prototype.getAll = function() {
var start = {
row: 0,
col: 0
};
var end = {
row: Math.max(this.instance.countSourceRows() - 1, 0),
col: Math.max(this.instance.countCols() - 1, 0)
};
if (start.row - end.row === 0 && !this.instance.countSourceRows()) {
return [];
}
return this.getRange(start, end, DataMap.prototype.DESTINATION_RENDERER);
};
DataMap.prototype.getRange = function(start, end, destination) {
var r,
rlen,
c,
clen,
output = [],
row,
rowExists;
var getFn = destination === this.DESTINATION_CLIPBOARD_GENERATOR ? this.getCopyable : this.get;
rlen = Math.max(start.row, end.row);
clen = Math.max(start.col, end.col);
for (r = Math.min(start.row, end.row); r <= rlen; r++) {
row = [];
var physicalRow = Handsontable.hooks.run(this.instance, 'modifyRow', r);
for (c = Math.min(start.col, end.col); c <= clen; c++) {
var rowValue;
if (physicalRow === null) {
break;
}
row.push(getFn.call(this, r, this.colToProp(c)));
}
if (physicalRow !== null) {
output.push(row);
}
}
return output;
};
DataMap.prototype.getText = function(start, end) {
return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_RENDERER));
};
DataMap.prototype.getCopyableText = function(start, end) {
return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_CLIPBOARD_GENERATOR));
};
;
Handsontable.DataMap = DataMap;
//#
},{"SheetClip":"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,"multiMap":55}],27:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
DataSource: {get: function() {
return DataSource;
}},
__esModule: {value: true}
});
var $__helpers_47_data__,
$__helpers_47_setting__,
$__helpers_47_object__,
$__helpers_47_array__,
$__helpers_47_number__;
var cellMethodLookupFactory = ($__helpers_47_data__ = require("helpers/data"), $__helpers_47_data__ && $__helpers_47_data__.__esModule && $__helpers_47_data__ || {default: $__helpers_47_data__}).cellMethodLookupFactory;
var columnFactory = ($__helpers_47_setting__ = require("helpers/setting"), $__helpers_47_setting__ && $__helpers_47_setting__.__esModule && $__helpers_47_setting__ || {default: $__helpers_47_setting__}).columnFactory;
var $__2 = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}),
duckSchema = $__2.duckSchema,
deepExtend = $__2.deepExtend,
getProperty = $__2.getProperty;
var $__3 = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}),
extendArray = $__3.extendArray,
arrayEach = $__3.arrayEach;
var rangeEach = ($__helpers_47_number__ = require("helpers/number"), $__helpers_47_number__ && $__helpers_47_number__.__esModule && $__helpers_47_number__ || {default: $__helpers_47_number__}).rangeEach;
var DataSource = function DataSource(hotInstance) {
var dataSource = arguments[1] !== (void 0) ? arguments[1] : [];
this.hot = hotInstance;
this.data = dataSource;
this.dataType = 'array';
this.colToProp = (function() {});
this.propToCol = (function() {});
};
($traceurRuntime.createClass)(DataSource, {
getData: function() {
return this.data;
},
setData: function(data) {
this.data = data;
},
getAtColumn: function(column) {
var $__5 = this;
var result = [];
arrayEach(this.data, (function(row) {
var property = $__5.colToProp(column);
if (typeof property === 'string') {
row = getProperty(row, property);
} else {
row = row[property];
}
result.push(row);
}));
return result;
},
getAtRow: function(row) {
return this.data[row];
},
getAtCell: function(row, column) {
return this.data[row][this.colToProp(column)];
},
getByRange: function(start, end) {
var $__5 = this;
var startRow = Math.min(start.row, end.row);
var startCol = Math.min(start.col, end.col);
var endRow = Math.max(start.row, end.row);
var endCol = Math.max(start.col, end.col);
var result = [];
rangeEach(startRow, endRow, (function(currentRow) {
var row = $__5.getAtRow(currentRow);
var newRow;
if ($__5.dataType === 'array') {
newRow = row.slice(startCol, endCol);
} else if ($__5.dataType === 'object') {
newRow = {};
rangeEach(startCol, endCol, (function(column) {
var prop = $__5.colToProp(column);
newRow[prop] = row[prop];
}));
}
result.push(newRow);
}));
return result;
},
destroy: function() {
this.data = null;
this.hot = null;
}
}, {});
;
//#
},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
EditorManager: {get: function() {
return EditorManager;
}},
__esModule: {value: true}
});
var $__3rdparty_47_walkontable_47_src_47_cell_47_coords__,
$__helpers_47_unicode__,
$__helpers_47_dom_47_event__,
$__editors__,
$__eventManager__;
var WalkontableCellCoords = ($__3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords;
var $__1 = ($__helpers_47_unicode__ = require("helpers/unicode"), $__helpers_47_unicode__ && $__helpers_47_unicode__.__esModule && $__helpers_47_unicode__ || {default: $__helpers_47_unicode__}),
KEY_CODES = $__1.KEY_CODES,
isMetaKey = $__1.isMetaKey,
isCtrlKey = $__1.isCtrlKey;
var $__2 = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}),
stopPropagation = $__2.stopPropagation,
stopImmediatePropagation = $__2.stopImmediatePropagation,
isImmediatePropagationStopped = $__2.isImmediatePropagationStopped;
var getEditor = ($__editors__ = require("editors"), $__editors__ && $__editors__.__esModule && $__editors__ || {default: $__editors__}).getEditor;
var eventManagerObject = ($__eventManager__ = require("eventManager"), $__eventManager__ && $__eventManager__.__esModule && $__eventManager__ || {default: $__eventManager__}).eventManager;
;
Handsontable.EditorManager = EditorManager;
function EditorManager(instance, priv, selection) {
var _this = this,
destroyed = false,
eventManager,
activeEditor;
eventManager = eventManagerObject(instance);
function moveSelectionAfterEnter(shiftKey) {
var enterMoves = typeof priv.settings.enterMoves === 'function' ? priv.settings.enterMoves(event) : priv.settings.enterMoves;
if (shiftKey) {
selection.transformStart(-enterMoves.row, -enterMoves.col);
} else {
selection.transformStart(enterMoves.row, enterMoves.col, true);
}
}
function moveSelectionUp(shiftKey) {
if (shiftKey) {
selection.transformEnd(-1, 0);
} else {
selection.transformStart(-1, 0);
}
}
function moveSelectionDown(shiftKey) {
if (shiftKey) {
selection.transformEnd(1, 0);
} else {
selection.transformStart(1, 0);
}
}
function moveSelectionRight(shiftKey) {
if (shiftKey) {
selection.transformEnd(0, 1);
} else {
selection.transformStart(0, 1);
}
}
function moveSelectionLeft(shiftKey) {
if (shiftKey) {
selection.transformEnd(0, -1);
} else {
selection.transformStart(0, -1);
}
}
function onKeyDown(event) {
var ctrlDown,
rangeModifier;
if (!instance.isListening()) {
return;
}
Handsontable.hooks.run(instance, 'beforeKeyDown', event);
if (destroyed) {
return;
}
if (isImmediatePropagationStopped(event)) {
return;
}
priv.lastKeyCode = event.keyCode;
if (!selection.isSelected()) {
return;
}
ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;
if (activeEditor && !activeEditor.isWaiting()) {
if (!isMetaKey(event.keyCode) && !isCtrlKey(event.keyCode) && !ctrlDown && !_this.isEditorOpened()) {
_this.openEditor('', event);
return;
}
}
rangeModifier = event.shiftKey ? selection.setRangeEnd : selection.setRangeStart;
switch (event.keyCode) {
case KEY_CODES.A:
if (!_this.isEditorOpened() && ctrlDown) {
selection.selectAll();
event.preventDefault();
stopPropagation(event);
}
break;
case KEY_CODES.ARROW_UP:
if (_this.isEditorOpened() && !activeEditor.isWaiting()) {
_this.closeEditorAndSaveChanges(ctrlDown);
}
moveSelectionUp(event.shiftKey);
event.preventDefault();
stopPropagation(event);
break;
case KEY_CODES.ARROW_DOWN:
if (_this.isEditorOpened() && !activeEditor.isWaiting()) {
_this.closeEditorAndSaveChanges(ctrlDown);
}
moveSelectionDown(event.shiftKey);
event.preventDefault();
stopPropagation(event);
break;
case KEY_CODES.ARROW_RIGHT:
if (_this.isEditorOpened() && !activeEditor.isWaiting()) {
_this.closeEditorAndSaveChanges(ctrlDown);
}
moveSelectionRight(event.shiftKey);
event.preventDefault();
stopPropagation(event);
break;
case KEY_CODES.ARROW_LEFT:
if (_this.isEditorOpened() && !activeEditor.isWaiting()) {
_this.closeEditorAndSaveChanges(ctrlDown);
}
moveSelectionLeft(event.shiftKey);
event.preventDefault();
stopPropagation(event);
break;
case KEY_CODES.TAB:
var tabMoves = typeof priv.settings.tabMoves === 'function' ? priv.settings.tabMoves(event) : priv.settings.tabMoves;
if (event.shiftKey) {
selection.transformStart(-tabMoves.row, -tabMoves.col);
} else {
selection.transformStart(tabMoves.row, tabMoves.col, true);
}
event.preventDefault();
stopPropagation(event);
break;
case KEY_CODES.BACKSPACE:
case KEY_CODES.DELETE:
selection.empty(event);
_this.prepareEditor();
event.preventDefault();
break;
case KEY_CODES.F2:
_this.openEditor(null, event);
if (activeEditor) {
activeEditor.enableFullEditMode();
}
event.preventDefault();
break;
case KEY_CODES.ENTER:
if (_this.isEditorOpened()) {
if (activeEditor && activeEditor.state !== Handsontable.EditorState.WAITING) {
_this.closeEditorAndSaveChanges(ctrlDown);
}
moveSelectionAfterEnter(event.shiftKey);
} else {
if (instance.getSettings().enterBeginsEditing) {
_this.openEditor(null, event);
if (activeEditor) {
activeEditor.enableFullEditMode();
}
} else {
moveSelectionAfterEnter(event.shiftKey);
}
}
event.preventDefault();
stopImmediatePropagation(event);
break;
case KEY_CODES.ESCAPE:
if (_this.isEditorOpened()) {
_this.closeEditorAndRestoreOriginalValue(ctrlDown);
}
event.preventDefault();
break;
case KEY_CODES.HOME:
if (event.ctrlKey || event.metaKey) {
rangeModifier(new WalkontableCellCoords(0, priv.selRange.from.col));
} else {
rangeModifier(new WalkontableCellCoords(priv.selRange.from.row, 0));
}
event.preventDefault();
stopPropagation(event);
break;
case KEY_CODES.END:
if (event.ctrlKey || event.metaKey) {
rangeModifier(new WalkontableCellCoords(instance.countRows() - 1, priv.selRange.from.col));
} else {
rangeModifier(new WalkontableCellCoords(priv.selRange.from.row, instance.countCols() - 1));
}
event.preventDefault();
stopPropagation(event);
break;
case KEY_CODES.PAGE_UP:
selection.transformStart(-instance.countVisibleRows(), 0);
event.preventDefault();
stopPropagation(event);
break;
case KEY_CODES.PAGE_DOWN:
selection.transformStart(instance.countVisibleRows(), 0);
event.preventDefault();
stopPropagation(event);
break;
}
}
function init() {
instance.addHook('afterDocumentKeyDown', onKeyDown);
eventManager.addEventListener(document.documentElement, 'keydown', function(event) {
instance.runHooks('afterDocumentKeyDown', event);
});
function onDblClick(event, coords, elem) {
if (elem.nodeName == 'TD') {
_this.openEditor();
if (activeEditor) {
activeEditor.enableFullEditMode();
}
}
}
instance.view.wt.update('onCellDblClick', onDblClick);
instance.addHook('afterDestroy', function() {
destroyed = true;
});
}
this.destroyEditor = function(revertOriginal) {
this.closeEditor(revertOriginal);
};
this.getActiveEditor = function() {
return activeEditor;
};
this.prepareEditor = function() {
var row,
col,
prop,
td,
originalValue,
cellProperties,
editorClass;
if (activeEditor && activeEditor.isWaiting()) {
this.closeEditor(false, false, function(dataSaved) {
if (dataSaved) {
_this.prepareEditor();
}
});
return;
}
row = priv.selRange.highlight.row;
col = priv.selRange.highlight.col;
prop = instance.colToProp(col);
td = instance.getCell(row, col);
originalValue = instance.getDataAtCell(row, col);
cellProperties = instance.getCellMeta(row, col);
editorClass = instance.getCellEditor(cellProperties);
if (editorClass) {
activeEditor = Handsontable.editors.getEditor(editorClass, instance);
activeEditor.prepare(row, col, prop, td, originalValue, cellProperties);
} else {
activeEditor = void 0;
}
};
this.isEditorOpened = function() {
return activeEditor && activeEditor.isOpened();
};
this.openEditor = function(initialValue, event) {
if (activeEditor && !activeEditor.cellProperties.readOnly) {
activeEditor.beginEditing(initialValue, event);
} else if (activeEditor && activeEditor.cellProperties.readOnly) {
if (event && event.keyCode === KEY_CODES.ENTER) {
moveSelectionAfterEnter();
}
}
};
this.closeEditor = function(restoreOriginalValue, ctrlDown, callback) {
if (activeEditor) {
activeEditor.finishEditing(restoreOriginalValue, ctrlDown, callback);
} else {
if (callback) {
callback(false);
}
}
};
this.closeEditorAndSaveChanges = function(ctrlDown) {
return this.closeEditor(false, ctrlDown);
};
this.closeEditorAndRestoreOriginalValue = function(ctrlDown) {
return this.closeEditor(true, ctrlDown);
};
init();
}
//#
},{"3rdparty/walkontable/src/cell/coords":5,"editors":29,"eventManager":41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
registerEditor: {get: function() {
return registerEditor;
}},
getEditor: {get: function() {
return getEditor;
}},
hasEditor: {get: function() {
return hasEditor;
}},
getEditorConstructor: {get: function() {
return getEditorConstructor;
}},
__esModule: {value: true}
});
var $__helpers_47_string__;
var toUpperCaseFirst = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).toUpperCaseFirst;
;
var registeredEditorNames = {},
registeredEditorClasses = new WeakMap();
Handsontable.editors = Handsontable.editors || {};
Handsontable.editors.registerEditor = registerEditor;
Handsontable.editors.getEditor = getEditor;
function RegisteredEditor(editorClass) {
var Clazz,
instances;
instances = {};
Clazz = editorClass;
this.getConstructor = function() {
return editorClass;
};
this.getInstance = function(hotInstance) {
if (!(hotInstance.guid in instances)) {
instances[hotInstance.guid] = new Clazz(hotInstance);
}
return instances[hotInstance.guid];
};
}
function registerEditor(editorName, editorClass) {
var editor = new RegisteredEditor(editorClass);
if (typeof editorName === 'string') {
registeredEditorNames[editorName] = editor;
Handsontable.editors[toUpperCaseFirst(editorName) + 'Editor'] = editorClass;
}
registeredEditorClasses.set(editorClass, editor);
}
function getEditor(editorName, hotInstance) {
var editor;
if (typeof editorName == 'function') {
if (!(registeredEditorClasses.get(editorName))) {
registerEditor(null, editorName);
}
editor = registeredEditorClasses.get(editorName);
} else if (typeof editorName == 'string') {
editor = registeredEditorNames[editorName];
} else {
throw Error('Only strings and functions can be passed as "editor" parameter ');
}
if (!editor) {
throw Error('No editor registered under name "' + editorName + '"');
}
return editor.getInstance(hotInstance);
}
function getEditorConstructor(editorName) {
var editor;
if (typeof editorName == 'string') {
editor = registeredEditorNames[editorName];
} else {
throw Error('Only strings and functions can be passed as "editor" parameter ');
}
if (!editor) {
throw Error('No editor registered under name "' + editorName + '"');
}
return editor.getConstructor();
}
function hasEditor(editorName) {
return registeredEditorNames[editorName] ? true : false;
}
//#
},{"helpers/string":52}],30:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
BaseEditor: {get: function() {
return BaseEditor;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_mixed__,
$___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__;
var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify;
var WalkontableCellCoords = ($___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords;
;
Handsontable.editors = Handsontable.editors || {};
Handsontable.editors.BaseEditor = BaseEditor;
Handsontable.EditorState = {
VIRGIN: 'STATE_VIRGIN',
EDITING: 'STATE_EDITING',
WAITING: 'STATE_WAITING',
FINISHED: 'STATE_FINISHED'
};
function BaseEditor(instance) {
this.instance = instance;
this.state = Handsontable.EditorState.VIRGIN;
this._opened = false;
this._fullEditMode = false;
this._closeCallback = null;
this.init();
}
BaseEditor.prototype._fireCallbacks = function(result) {
if (this._closeCallback) {
this._closeCallback(result);
this._closeCallback = null;
}
};
BaseEditor.prototype.init = function() {};
BaseEditor.prototype.getValue = function() {
throw Error('Editor getValue() method unimplemented');
};
BaseEditor.prototype.setValue = function(newValue) {
throw Error('Editor setValue() method unimplemented');
};
BaseEditor.prototype.open = function() {
throw Error('Editor open() method unimplemented');
};
BaseEditor.prototype.close = function() {
throw Error('Editor close() method unimplemented');
};
BaseEditor.prototype.prepare = function(row, col, prop, td, originalValue, cellProperties) {
this.TD = td;
this.row = row;
this.col = col;
this.prop = prop;
this.originalValue = originalValue;
this.cellProperties = cellProperties;
if (this.instance.view.isMouseDown() && document.activeElement && document.activeElement !== document.body) {
document.activeElement.blur();
} else if (!document.activeElement) {
document.body.focus();
}
this.state = Handsontable.EditorState.VIRGIN;
};
BaseEditor.prototype.extend = function() {
var baseClass = this.constructor;
function Editor() {
baseClass.apply(this, arguments);
}
function inherit(Child, Parent) {
function Bridge() {}
Bridge.prototype = Parent.prototype;
Child.prototype = new Bridge();
Child.prototype.constructor = Child;
return Child;
}
return inherit(Editor, baseClass);
};
BaseEditor.prototype.saveValue = function(val, ctrlDown) {
var sel,
tmp;
if (ctrlDown) {
sel = this.instance.getSelected();
if (sel[0] > sel[2]) {
tmp = sel[0];
sel[0] = sel[2];
sel[2] = tmp;
}
if (sel[1] > sel[3]) {
tmp = sel[1];
sel[1] = sel[3];
sel[3] = tmp;
}
this.instance.populateFromArray(sel[0], sel[1], val, sel[2], sel[3], 'edit');
} else {
this.instance.populateFromArray(this.row, this.col, val, null, null, 'edit');
}
};
BaseEditor.prototype.beginEditing = function(initialValue, event) {
if (this.state != Handsontable.EditorState.VIRGIN) {
return;
}
this.instance.view.scrollViewport(new WalkontableCellCoords(this.row, this.col));
this.instance.view.render();
this.state = Handsontable.EditorState.EDITING;
initialValue = typeof initialValue == 'string' ? initialValue : this.originalValue;
this.setValue(stringify(initialValue));
this.open(event);
this._opened = true;
this.focus();
this.instance.view.render();
};
BaseEditor.prototype.finishEditing = function(restoreOriginalValue, ctrlDown, callback) {
var _this = this,
val;
if (callback) {
var previousCloseCallback = this._closeCallback;
this._closeCallback = function(result) {
if (previousCloseCallback) {
previousCloseCallback(result);
}
callback(result);
};
}
if (this.isWaiting()) {
return;
}
if (this.state == Handsontable.EditorState.VIRGIN) {
this.instance._registerTimeout(setTimeout(function() {
_this._fireCallbacks(true);
}, 0));
return;
}
if (this.state == Handsontable.EditorState.EDITING) {
if (restoreOriginalValue) {
this.cancelChanges();
this.instance.view.render();
return;
}
if (this.instance.getSettings().trimWhitespace) {
val = [[typeof this.getValue() === 'string' ? String.prototype.trim.call(this.getValue() || '') : this.getValue()]];
} else {
val = [[this.getValue()]];
}
this.state = Handsontable.EditorState.WAITING;
this.saveValue(val, ctrlDown);
if (this.instance.getCellValidator(this.cellProperties)) {
this.instance.addHookOnce('postAfterValidate', function(result) {
_this.state = Handsontable.EditorState.FINISHED;
_this.discardEditor(result);
});
} else {
this.state = Handsontable.EditorState.FINISHED;
this.discardEditor(true);
}
}
};
BaseEditor.prototype.cancelChanges = function() {
this.state = Handsontable.EditorState.FINISHED;
this.discardEditor();
};
BaseEditor.prototype.discardEditor = function(result) {
if (this.state !== Handsontable.EditorState.FINISHED) {
return;
}
if (result === false && this.cellProperties.allowInvalid !== true) {
this.instance.selectCell(this.row, this.col);
this.focus();
this.state = Handsontable.EditorState.EDITING;
this._fireCallbacks(false);
} else {
this.close();
this._opened = false;
this._fullEditMode = false;
this.state = Handsontable.EditorState.VIRGIN;
this._fireCallbacks(true);
}
};
BaseEditor.prototype.enableFullEditMode = function() {
this._fullEditMode = true;
};
BaseEditor.prototype.isInFullEditMode = function() {
return this._fullEditMode;
};
BaseEditor.prototype.isOpened = function() {
return this._opened;
};
BaseEditor.prototype.isWaiting = function() {
return this.state === Handsontable.EditorState.WAITING;
};
BaseEditor.prototype.checkEditorSection = function() {
var totalRows = this.instance.countRows();
var section = '';
if (this.row < this.instance.getSettings().fixedRowsTop) {
if (this.col < this.instance.getSettings().fixedColumnsLeft) {
section = 'top-left-corner';
} else {
section = 'top';
}
} else if (this.instance.getSettings().fixedRowsBottom && this.row >= totalRows - this.instance.getSettings().fixedRowsBottom) {
if (this.col < this.instance.getSettings().fixedColumnsLeft) {
section = 'bottom-left-corner';
} else {
section = 'bottom';
}
} else {
if (this.col < this.instance.getSettings().fixedColumnsLeft) {
section = 'left';
}
}
return section;
};
//#
},{"3rdparty/walkontable/src/cell/coords":5,"helpers/mixed":48}],31:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
AutocompleteEditor: {get: function() {
return AutocompleteEditor;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_unicode__,
$___46__46__47_helpers_47_mixed__,
$___46__46__47_helpers_47_array__,
$___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_editors__,
$__handsontableEditor__;
var $__0 = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}),
KEY_CODES = $__0.KEY_CODES,
isPrintableChar = $__0.isPrintableChar;
var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify;
var pivot = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).pivot;
var $__3 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}),
addClass = $__3.addClass,
getCaretPosition = $__3.getCaretPosition,
getScrollbarWidth = $__3.getScrollbarWidth,
getSelectionEndPosition = $__3.getSelectionEndPosition,
outerWidth = $__3.outerWidth,
setCaretPosition = $__3.setCaretPosition;
var $__4 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}),
getEditorConstructor = $__4.getEditorConstructor,
registerEditor = $__4.registerEditor;
var HandsontableEditor = ($__handsontableEditor__ = require("handsontableEditor"), $__handsontableEditor__ && $__handsontableEditor__.__esModule && $__handsontableEditor__ || {default: $__handsontableEditor__}).HandsontableEditor;
var AutocompleteEditor = HandsontableEditor.prototype.extend();
AutocompleteEditor.prototype.init = function() {
HandsontableEditor.prototype.init.apply(this, arguments);
this.query = null;
this.choices = [];
};
AutocompleteEditor.prototype.createElements = function() {
HandsontableEditor.prototype.createElements.apply(this, arguments);
addClass(this.htContainer, 'autocompleteEditor');
addClass(this.htContainer, window.navigator.platform.indexOf('Mac') === -1 ? '' : 'htMacScroll');
};
var skipOne = false;
function onBeforeKeyDown(event) {
skipOne = false;
var editor = this.getActiveEditor();
if (isPrintableChar(event.keyCode) || event.keyCode === KEY_CODES.BACKSPACE || event.keyCode === KEY_CODES.DELETE || event.keyCode === KEY_CODES.INSERT) {
var timeOffset = 0;
if (event.keyCode === KEY_CODES.C && (event.ctrlKey || event.metaKey)) {
return;
}
if (!editor.isOpened()) {
timeOffset += 10;
}
if (editor.htEditor) {
editor.instance._registerTimeout(setTimeout(function() {
editor.queryChoices(editor.TEXTAREA.value);
skipOne = true;
}, timeOffset));
}
}
}
AutocompleteEditor.prototype.prepare = function() {
this.instance.addHook('beforeKeyDown', onBeforeKeyDown);
HandsontableEditor.prototype.prepare.apply(this, arguments);
};
AutocompleteEditor.prototype.open = function() {
this.TEXTAREA_PARENT.style.overflow = 'auto';
HandsontableEditor.prototype.open.apply(this, arguments);
this.TEXTAREA_PARENT.style.overflow = '';
var choicesListHot = this.htEditor.getInstance();
var that = this;
var trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown;
this.TEXTAREA.style.visibility = 'visible';
this.focus();
choicesListHot.updateSettings({
colWidths: trimDropdown ? [outerWidth(this.TEXTAREA) - 2] : void 0,
width: trimDropdown ? outerWidth(this.TEXTAREA) + getScrollbarWidth() + 2 : void 0,
afterRenderer: function(TD, row, col, prop, value) {
var caseSensitive = this.getCellMeta(row, col).filteringCaseSensitive === true,
indexOfMatch,
match,
value = stringify(value);
if (value) {
indexOfMatch = caseSensitive ? value.indexOf(this.query) : value.toLowerCase().indexOf(that.query.toLowerCase());
if (indexOfMatch != -1) {
match = value.substr(indexOfMatch, that.query.length);
TD.innerHTML = value.replace(match, '<strong>' + match + '</strong>');
}
}
},
autoColumnSize: true,
modifyColWidth: function(width, col) {
var autoWidths = this.getPlugin('autoColumnSize').widths;
if (autoWidths[col]) {
width = autoWidths[col];
}
return trimDropdown ? width : width + 15;
}
});
this.htEditor.view.wt.wtTable.holder.parentNode.style['padding-right'] = getScrollbarWidth() + 2 + 'px';
if (skipOne) {
skipOne = false;
}
that.instance._registerTimeout(setTimeout(function() {
that.queryChoices(that.TEXTAREA.value);
}, 0));
};
AutocompleteEditor.prototype.close = function() {
HandsontableEditor.prototype.close.apply(this, arguments);
};
AutocompleteEditor.prototype.queryChoices = function(query) {
this.query = query;
if (typeof this.cellProperties.source == 'function') {
var that = this;
this.cellProperties.source(query, function(choices) {
that.updateChoicesList(choices);
});
} else if (Array.isArray(this.cellProperties.source)) {
var choices;
if (!query || this.cellProperties.filter === false) {
choices = this.cellProperties.source;
} else {
var filteringCaseSensitive = this.cellProperties.filteringCaseSensitive === true;
var lowerCaseQuery = query.toLowerCase();
choices = this.cellProperties.source.filter(function(choice) {
if (filteringCaseSensitive) {
return choice.indexOf(query) != -1;
} else {
return choice.toLowerCase().indexOf(lowerCaseQuery) != -1;
}
});
}
this.updateChoicesList(choices);
} else {
this.updateChoicesList([]);
}
};
AutocompleteEditor.prototype.updateChoicesList = function(choices) {
var pos = getCaretPosition(this.TEXTAREA),
endPos = getSelectionEndPosition(this.TEXTAREA);
var orderByRelevance = AutocompleteEditor.sortByRelevance(this.getValue(), choices, this.cellProperties.filteringCaseSensitive);
var highlightIndex;
if (this.cellProperties.filter == false) {
highlightIndex = orderByRelevance[0];
} else {
var sorted = [];
for (var i = 0,
choicesCount = orderByRelevance.length; i < choicesCount; i++) {
sorted.push(choices[orderByRelevance[i]]);
}
highlightIndex = 0;
choices = sorted;
}
this.choices = choices;
this.htEditor.loadData(pivot([choices]));
this.updateDropdownHeight();
if (this.cellProperties.strict === true) {
this.highlightBestMatchingChoice(highlightIndex);
}
this.instance.listen();
this.TEXTAREA.focus();
setCaretPosition(this.TEXTAREA, pos, (pos == endPos ? void 0 : endPos));
};
AutocompleteEditor.prototype.updateDropdownHeight = function() {
var currentDropdownWidth = this.htEditor.getColWidth(0) + getScrollbarWidth() + 2;
var trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown;
this.htEditor.updateSettings({
height: this.getDropdownHeight(),
width: trimDropdown ? void 0 : currentDropdownWidth
});
this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer();
};
AutocompleteEditor.prototype.finishEditing = function(restoreOriginalValue) {
if (!restoreOriginalValue) {
this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);
}
HandsontableEditor.prototype.finishEditing.apply(this, arguments);
};
AutocompleteEditor.prototype.highlightBestMatchingChoice = function(index) {
if (typeof index === 'number') {
this.htEditor.selectCell(index, 0);
} else {
this.htEditor.deselectCell();
}
};
AutocompleteEditor.sortByRelevance = function(value, choices, caseSensitive) {
var choicesRelevance = [],
currentItem,
valueLength = value.length,
valueIndex,
charsLeft,
result = [],
i,
choicesCount;
if (valueLength === 0) {
for (i = 0, choicesCount = choices.length; i < choicesCount; i++) {
result.push(i);
}
return result;
}
for (i = 0, choicesCount = choices.length; i < choicesCount; i++) {
currentItem = stringify(choices[i]);
if (caseSensitive) {
valueIndex = currentItem.indexOf(value);
} else {
valueIndex = currentItem.toLowerCase().indexOf(value.toLowerCase());
}
if (valueIndex == -1) {
continue;
}
charsLeft = currentItem.length - valueIndex - valueLength;
choicesRelevance.push({
baseIndex: i,
index: valueIndex,
charsLeft: charsLeft,
value: currentItem
});
}
choicesRelevance.sort(function(a, b) {
if (b.index === -1) {
return -1;
}
if (a.index === -1) {
return 1;
}
if (a.index < b.index) {
return -1;
} else if (b.index < a.index) {
return 1;
} else if (a.index === b.index) {
if (a.charsLeft < b.charsLeft) {
return -1;
} else if (a.charsLeft > b.charsLeft) {
return 1;
} else {
return 0;
}
}
});
for (i = 0, choicesCount = choicesRelevance.length; i < choicesCount; i++) {
result.push(choicesRelevance[i].baseIndex);
}
return result;
};
AutocompleteEditor.prototype.getDropdownHeight = function() {
var firstRowHeight = this.htEditor.getInstance().getRowHeight(0) || 23;
var _visibleRows = this.cellProperties.visibleRows;
return this.choices.length >= _visibleRows ? _visibleRows * firstRowHeight : this.choices.length * firstRowHeight + 8;
};
AutocompleteEditor.prototype.allowKeyEventPropagation = function(keyCode) {
var selected = {row: this.htEditor.getSelectedRange() ? this.htEditor.getSelectedRange().from.row : -1};
var allowed = false;
if (keyCode === KEY_CODES.ARROW_DOWN && selected.row < this.htEditor.countRows() - 1) {
allowed = true;
}
if (keyCode === KEY_CODES.ARROW_UP && selected.row > -1) {
allowed = true;
}
return allowed;
};
;
registerEditor('autocomplete', AutocompleteEditor);
//#
},{"editors":29,"handsontableEditor":35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
CheckboxEditor: {get: function() {
return CheckboxEditor;
}},
__esModule: {value: true}
});
var $___46__46__47_editors__,
$___95_baseEditor__,
$___46__46__47_helpers_47_dom_47_element__;
var registerEditor = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}).registerEditor;
var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor;
var hasClass = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).hasClass;
var CheckboxEditor = function CheckboxEditor() {
$traceurRuntime.superConstructor($CheckboxEditor).apply(this, arguments);
};
var $CheckboxEditor = CheckboxEditor;
($traceurRuntime.createClass)(CheckboxEditor, {
beginEditing: function() {
var checkbox = this.TD.querySelector('input[type="checkbox"]');
if (!hasClass(checkbox, 'htBadValue')) {
checkbox.click();
}
},
finishEditing: function() {},
init: function() {},
open: function() {},
close: function() {},
getValue: function() {},
setValue: function() {},
focus: function() {}
}, {}, BaseEditor);
;
registerEditor('checkbox', CheckboxEditor);
//#
},{"_baseEditor":30,"editors":29,"helpers/dom/element":45}],33:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
DateEditor: {get: function() {
return DateEditor;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_helpers_47_object__,
$___46__46__47_eventManager__,
$___46__46__47_editors__,
$___46__46__47_helpers_47_unicode__,
$___46__46__47_helpers_47_dom_47_event__,
$__textEditor__,
$__moment__,
$__pikaday__;
var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
outerHeight = $__0.outerHeight;
var deepExtend = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).deepExtend;
var EventManager = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).EventManager;
var $__3 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}),
getEditor = $__3.getEditor,
registerEditor = $__3.registerEditor;
var isMetaKey = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).isMetaKey;
var stopPropagation = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}).stopPropagation;
var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor;
var moment = ($__moment__ = require("moment"), $__moment__ && $__moment__.__esModule && $__moment__ || {default: $__moment__}).default;
var Pikaday = ($__pikaday__ = require("pikaday"), $__pikaday__ && $__pikaday__.__esModule && $__pikaday__ || {default: $__pikaday__}).default;
Handsontable.editors = Handsontable.editors || {};
Handsontable.editors.DateEditor = DateEditor;
var DateEditor = function DateEditor(hotInstance) {
this.$datePicker = null;
this.datePicker = null;
this.datePickerStyle = null;
this.defaultDateFormat = 'DD/MM/YYYY';
this.isCellEdited = false;
this.parentDestroyed = false;
$traceurRuntime.superConstructor($DateEditor).call(this, hotInstance);
};
var $DateEditor = DateEditor;
($traceurRuntime.createClass)(DateEditor, {
init: function() {
var $__9 = this;
if (typeof moment !== 'function') {
throw new Error('You need to include moment.js to your project.');
}
if (typeof Pikaday !== 'function') {
throw new Error('You need to include Pikaday to your project.');
}
$traceurRuntime.superGet(this, $DateEditor.prototype, "init").call(this);
this.instance.addHook('afterDestroy', (function() {
$__9.parentDestroyed = true;
$__9.destroyElements();
}));
},
createElements: function() {
$traceurRuntime.superGet(this, $DateEditor.prototype, "createElements").call(this);
this.datePicker = document.createElement('DIV');
this.datePickerStyle = this.datePicker.style;
this.datePickerStyle.position = 'absolute';
this.datePickerStyle.top = 0;
this.datePickerStyle.left = 0;
this.datePickerStyle.zIndex = 9999;
addClass(this.datePicker, 'htDatepickerHolder');
document.body.appendChild(this.datePicker);
this.$datePicker = new Pikaday(this.getDatePickerConfig());
var eventManager = new EventManager(this);
eventManager.addEventListener(this.datePicker, 'mousedown', (function(event) {
return stopPropagation(event);
}));
this.hideDatepicker();
},
destroyElements: function() {
this.$datePicker.destroy();
},
prepare: function(row, col, prop, td, originalValue, cellProperties) {
this._opened = false;
$traceurRuntime.superGet(this, $DateEditor.prototype, "prepare").call(this, row, col, prop, td, originalValue, cellProperties);
},
open: function() {
var event = arguments[0] !== (void 0) ? arguments[0] : null;
$traceurRuntime.superGet(this, $DateEditor.prototype, "open").call(this);
this.showDatepicker(event);
},
close: function() {
var $__9 = this;
this._opened = false;
this.instance._registerTimeout(setTimeout((function() {
$__9.instance.selection.refreshBorders();
}), 0));
$traceurRuntime.superGet(this, $DateEditor.prototype, "close").call(this);
},
finishEditing: function() {
var isCancelled = arguments[0] !== (void 0) ? arguments[0] : false;
var ctrlDown = arguments[1] !== (void 0) ? arguments[1] : false;
if (isCancelled) {
var value = this.originalValue;
if (value !== void 0) {
this.setValue(value);
}
}
this.hideDatepicker();
$traceurRuntime.superGet(this, $DateEditor.prototype, "finishEditing").call(this, isCancelled, ctrlDown);
},
showDatepicker: function(event) {
this.$datePicker.config(this.getDatePickerConfig());
var offset = this.TD.getBoundingClientRect();
var dateFormat = this.cellProperties.dateFormat || this.defaultDateFormat;
var datePickerConfig = this.$datePicker.config();
var dateStr;
var isMouseDown = this.instance.view.isMouseDown();
var isMeta = event ? isMetaKey(event.keyCode) : false;
this.datePickerStyle.top = (window.pageYOffset + offset.top + outerHeight(this.TD)) + 'px';
this.datePickerStyle.left = (window.pageXOffset + offset.left) + 'px';
this.$datePicker._onInputFocus = function() {};
datePickerConfig.format = dateFormat;
if (this.originalValue) {
dateStr = this.originalValue;
if (moment(dateStr, dateFormat, true).isValid()) {
this.$datePicker.setMoment(moment(dateStr, dateFormat), true);
}
if (!isMeta && !isMouseDown) {
this.setValue('');
}
} else {
if (this.cellProperties.defaultDate) {
dateStr = this.cellProperties.defaultDate;
datePickerConfig.defaultDate = dateStr;
if (moment(dateStr, dateFormat, true).isValid()) {
this.$datePicker.setMoment(moment(dateStr, dateFormat), true);
}
if (!isMeta && !isMouseDown) {
this.setValue('');
}
} else {
this.$datePicker.gotoToday();
}
}
this.datePickerStyle.display = 'block';
this.$datePicker.show();
},
hideDatepicker: function() {
this.datePickerStyle.display = 'none';
this.$datePicker.hide();
},
getDatePickerConfig: function() {
var $__9 = this;
var htInput = this.TEXTAREA;
var options = {};
if (this.cellProperties && this.cellProperties.datePickerConfig) {
deepExtend(options, this.cellProperties.datePickerConfig);
}
var origOnSelect = options.onSelect;
var origOnClose = options.onClose;
options.field = htInput;
options.trigger = htInput;
options.container = this.datePicker;
options.bound = false;
options.format = options.format || this.defaultDateFormat;
options.reposition = options.reposition || false;
options.onSelect = (function(dateStr) {
if (!isNaN(dateStr.getTime())) {
dateStr = moment(dateStr).format($__9.cellProperties.dateFormat || $__9.defaultDateFormat);
}
$__9.setValue(dateStr);
$__9.hideDatepicker();
if (origOnSelect) {
origOnSelect();
}
});
options.onClose = (function() {
if (!$__9.parentDestroyed) {
$__9.finishEditing(false);
}
if (origOnClose) {
origOnClose();
}
});
return options;
}
}, {}, TextEditor);
;
registerEditor('date', DateEditor);
//#
},{"editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"moment":"moment","pikaday":"pikaday","textEditor":40}],34:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
DropdownEditor: {get: function() {
return DropdownEditor;
}},
__esModule: {value: true}
});
var $___46__46__47_editors__,
$__autocompleteEditor__;
var $__0 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}),
getEditor = $__0.getEditor,
registerEditor = $__0.registerEditor;
var AutocompleteEditor = ($__autocompleteEditor__ = require("autocompleteEditor"), $__autocompleteEditor__ && $__autocompleteEditor__.__esModule && $__autocompleteEditor__ || {default: $__autocompleteEditor__}).AutocompleteEditor;
var DropdownEditor = function DropdownEditor() {
$traceurRuntime.superConstructor($DropdownEditor).apply(this, arguments);
};
var $DropdownEditor = DropdownEditor;
($traceurRuntime.createClass)(DropdownEditor, {prepare: function(row, col, prop, td, originalValue, cellProperties) {
$traceurRuntime.superGet(this, $DropdownEditor.prototype, "prepare").call(this, row, col, prop, td, originalValue, cellProperties);
this.cellProperties.filter = false;
this.cellProperties.strict = true;
}}, {}, AutocompleteEditor);
Handsontable.hooks.add('beforeValidate', function(value, row, col, source) {
var cellMeta = this.getCellMeta(row, col);
if (cellMeta.editor === Handsontable.editors.DropdownEditor) {
if (cellMeta.strict === void 0) {
cellMeta.filter = false;
cellMeta.strict = true;
}
}
});
;
registerEditor('dropdown', DropdownEditor);
//#
},{"autocompleteEditor":31,"editors":29}],35:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
HandsontableEditor: {get: function() {
return HandsontableEditor;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_unicode__,
$___46__46__47_helpers_47_object__,
$___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_helpers_47_dom_47_event__,
$___46__46__47_editors__,
$__textEditor__;
var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES;
var extend = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).extend;
var setCaretPosition = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).setCaretPosition;
var $__3 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}),
stopImmediatePropagation = $__3.stopImmediatePropagation,
isImmediatePropagationStopped = $__3.isImmediatePropagationStopped;
var $__4 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}),
getEditor = $__4.getEditor,
registerEditor = $__4.registerEditor;
var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor;
var HandsontableEditor = TextEditor.prototype.extend();
HandsontableEditor.prototype.createElements = function() {
TextEditor.prototype.createElements.apply(this, arguments);
var DIV = document.createElement('DIV');
DIV.className = 'handsontableEditor';
this.TEXTAREA_PARENT.appendChild(DIV);
this.htContainer = DIV;
this.assignHooks();
};
HandsontableEditor.prototype.prepare = function(td, row, col, prop, value, cellProperties) {
TextEditor.prototype.prepare.apply(this, arguments);
var parent = this;
var options = {
startRows: 0,
startCols: 0,
minRows: 0,
minCols: 0,
className: 'listbox',
copyPaste: false,
autoColumnSize: false,
autoRowSize: false,
readOnly: true,
fillHandle: false,
afterOnCellMouseDown: function() {
var value = this.getValue();
if (value !== void 0) {
parent.setValue(value);
}
parent.instance.destroyEditor();
}
};
if (this.cellProperties.handsontable) {
extend(options, cellProperties.handsontable);
}
this.htOptions = options;
};
var onBeforeKeyDown = function(event) {
if (isImmediatePropagationStopped(event)) {
return;
}
var editor = this.getActiveEditor();
var innerHOT = editor.htEditor.getInstance();
var rowToSelect;
if (event.keyCode == KEY_CODES.ARROW_DOWN) {
if (innerHOT.getSelected()) {
var selectedRow = innerHOT.getSelected()[0];
var lastRow = innerHOT.countRows() - 1;
rowToSelect = Math.min(lastRow, selectedRow + 1);
} else {
rowToSelect = 0;
}
} else if (event.keyCode == KEY_CODES.ARROW_UP) {
if (innerHOT.getSelected()) {
var selectedRow = innerHOT.getSelected()[0];
rowToSelect = selectedRow - 1;
}
}
if (rowToSelect !== void 0) {
if (rowToSelect < 0) {
innerHOT.deselectCell();
} else {
innerHOT.selectCell(rowToSelect, 0);
}
if (innerHOT.getData().length) {
event.preventDefault();
stopImmediatePropagation(event);
editor.instance.listen();
editor.TEXTAREA.focus();
}
}
};
HandsontableEditor.prototype.open = function() {
this.instance.addHook('beforeKeyDown', onBeforeKeyDown);
TextEditor.prototype.open.apply(this, arguments);
if (this.htEditor) {
this.htEditor.destroy();
}
this.htEditor = new Handsontable(this.htContainer, this.htOptions);
if (this.cellProperties.strict) {
this.htEditor.selectCell(0, 0);
this.TEXTAREA.style.visibility = 'hidden';
} else {
this.htEditor.deselectCell();
this.TEXTAREA.style.visibility = 'visible';
}
setCaretPosition(this.TEXTAREA, 0, this.TEXTAREA.value.length);
};
HandsontableEditor.prototype.close = function() {
this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);
this.instance.listen();
TextEditor.prototype.close.apply(this, arguments);
};
HandsontableEditor.prototype.focus = function() {
this.instance.listen();
TextEditor.prototype.focus.apply(this, arguments);
};
HandsontableEditor.prototype.beginEditing = function(initialValue) {
var onBeginEditing = this.instance.getSettings().onBeginEditing;
if (onBeginEditing && onBeginEditing() === false) {
return;
}
TextEditor.prototype.beginEditing.apply(this, arguments);
};
HandsontableEditor.prototype.finishEditing = function(isCancelled, ctrlDown) {
if (this.htEditor && this.htEditor.isListening()) {
this.instance.listen();
}
if (this.htEditor && this.htEditor.getSelected()) {
var value = this.htEditor.getInstance().getValue();
if (value !== void 0) {
this.setValue(value);
}
}
return TextEditor.prototype.finishEditing.apply(this, arguments);
};
HandsontableEditor.prototype.assignHooks = function() {
var _this = this;
this.instance.addHook('afterDestroy', function() {
if (_this.htEditor) {
_this.htEditor.destroy();
}
});
};
;
registerEditor('handsontable', HandsontableEditor);
//#
},{"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"textEditor":40}],36:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
MobileTextEditor: {get: function() {
return MobileTextEditor;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_unicode__,
$___46__46__47_helpers_47_dom_47_event__,
$___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_editors__,
$___95_baseEditor__,
$___46__46__47_eventManager__;
var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES;
var $__1 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}),
stopImmediatePropagation = $__1.stopImmediatePropagation,
isImmediatePropagationStopped = $__1.isImmediatePropagationStopped;
var $__2 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}),
addClass = $__2.addClass,
getScrollLeft = $__2.getScrollLeft,
getScrollTop = $__2.getScrollTop,
hasClass = $__2.hasClass,
isChildOf = $__2.isChildOf,
offset = $__2.offset,
outerHeight = $__2.outerHeight,
outerWidth = $__2.outerWidth,
removeClass = $__2.removeClass,
setCaretPosition = $__2.setCaretPosition;
var $__3 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}),
getEditor = $__3.getEditor,
registerEditor = $__3.registerEditor;
var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor;
var eventManagerObject = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).eventManager;
var MobileTextEditor = BaseEditor.prototype.extend(),
domDimensionsCache = {};
var createControls = function() {
this.controls = {};
this.controls.leftButton = document.createElement('DIV');
this.controls.leftButton.className = 'leftButton';
this.controls.rightButton = document.createElement('DIV');
this.controls.rightButton.className = 'rightButton';
this.controls.upButton = document.createElement('DIV');
this.controls.upButton.className = 'upButton';
this.controls.downButton = document.createElement('DIV');
this.controls.downButton.className = 'downButton';
for (var button in this.controls) {
if (this.controls.hasOwnProperty(button)) {
this.positionControls.appendChild(this.controls[button]);
}
}
};
MobileTextEditor.prototype.valueChanged = function() {
return this.initValue != this.getValue();
};
MobileTextEditor.prototype.init = function() {
var that = this;
this.eventManager = eventManagerObject(this.instance);
this.createElements();
this.bindEvents();
this.instance.addHook('afterDestroy', function() {
that.destroy();
});
};
MobileTextEditor.prototype.getValue = function() {
return this.TEXTAREA.value;
};
MobileTextEditor.prototype.setValue = function(newValue) {
this.initValue = newValue;
this.TEXTAREA.value = newValue;
};
MobileTextEditor.prototype.createElements = function() {
this.editorContainer = document.createElement('DIV');
this.editorContainer.className = 'htMobileEditorContainer';
this.cellPointer = document.createElement('DIV');
this.cellPointer.className = 'cellPointer';
this.moveHandle = document.createElement('DIV');
this.moveHandle.className = 'moveHandle';
this.inputPane = document.createElement('DIV');
this.inputPane.className = 'inputs';
this.positionControls = document.createElement('DIV');
this.positionControls.className = 'positionControls';
this.TEXTAREA = document.createElement('TEXTAREA');
addClass(this.TEXTAREA, 'handsontableInput');
this.inputPane.appendChild(this.TEXTAREA);
this.editorContainer.appendChild(this.cellPointer);
this.editorContainer.appendChild(this.moveHandle);
this.editorContainer.appendChild(this.inputPane);
this.editorContainer.appendChild(this.positionControls);
createControls.call(this);
document.body.appendChild(this.editorContainer);
};
MobileTextEditor.prototype.onBeforeKeyDown = function(event) {
var instance = this;
var that = instance.getActiveEditor();
if (event.target !== that.TEXTAREA || isImmediatePropagationStopped(event)) {
return;
}
switch (event.keyCode) {
case KEY_CODES.ENTER:
that.close();
event.preventDefault();
break;
case KEY_CODES.BACKSPACE:
stopImmediatePropagation(event);
break;
}
};
MobileTextEditor.prototype.open = function() {
this.instance.addHook('beforeKeyDown', this.onBeforeKeyDown);
addClass(this.editorContainer, 'active');
removeClass(this.cellPointer, 'hidden');
this.updateEditorPosition();
};
MobileTextEditor.prototype.focus = function() {
this.TEXTAREA.focus();
setCaretPosition(this.TEXTAREA, this.TEXTAREA.value.length);
};
MobileTextEditor.prototype.close = function() {
this.TEXTAREA.blur();
this.instance.removeHook('beforeKeyDown', this.onBeforeKeyDown);
removeClass(this.editorContainer, 'active');
};
MobileTextEditor.prototype.scrollToView = function() {
var coords = this.instance.getSelectedRange().highlight;
this.instance.view.scrollViewport(coords);
};
MobileTextEditor.prototype.hideCellPointer = function() {
if (!hasClass(this.cellPointer, 'hidden')) {
addClass(this.cellPointer, 'hidden');
}
};
MobileTextEditor.prototype.updateEditorPosition = function(x, y) {
if (x && y) {
x = parseInt(x, 10);
y = parseInt(y, 10);
this.editorContainer.style.top = y + 'px';
this.editorContainer.style.left = x + 'px';
} else {
var selection = this.instance.getSelected(),
selectedCell = this.instance.getCell(selection[0], selection[1]);
if (!domDimensionsCache.cellPointer) {
domDimensionsCache.cellPointer = {
height: outerHeight(this.cellPointer),
width: outerWidth(this.cellPointer)
};
}
if (!domDimensionsCache.editorContainer) {
domDimensionsCache.editorContainer = {width: outerWidth(this.editorContainer)};
}
if (selectedCell !== undefined) {
var scrollLeft = this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer == window ? 0 : getScrollLeft(this.instance.view.wt.wtOverlays.leftOverlay.holder);
var scrollTop = this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer == window ? 0 : getScrollTop(this.instance.view.wt.wtOverlays.topOverlay.holder);
var selectedCellOffset = offset(selectedCell),
selectedCellWidth = outerWidth(selectedCell),
currentScrollPosition = {
x: scrollLeft,
y: scrollTop
};
this.editorContainer.style.top = parseInt(selectedCellOffset.top + outerHeight(selectedCell) - currentScrollPosition.y + domDimensionsCache.cellPointer.height, 10) + 'px';
this.editorContainer.style.left = parseInt((window.innerWidth / 2) - (domDimensionsCache.editorContainer.width / 2), 10) + 'px';
if (selectedCellOffset.left + selectedCellWidth / 2 > parseInt(this.editorContainer.style.left, 10) + domDimensionsCache.editorContainer.width) {
this.editorContainer.style.left = window.innerWidth - domDimensionsCache.editorContainer.width + 'px';
} else if (selectedCellOffset.left + selectedCellWidth / 2 < parseInt(this.editorContainer.style.left, 10) + 20) {
this.editorContainer.style.left = 0 + 'px';
}
this.cellPointer.style.left = parseInt(selectedCellOffset.left - (domDimensionsCache.cellPointer.width / 2) - offset(this.editorContainer).left + (selectedCellWidth / 2) - currentScrollPosition.x, 10) + 'px';
}
}
};
MobileTextEditor.prototype.updateEditorData = function() {
var selected = this.instance.getSelected(),
selectedValue = this.instance.getDataAtCell(selected[0], selected[1]);
this.row = selected[0];
this.col = selected[1];
this.setValue(selectedValue);
this.updateEditorPosition();
};
MobileTextEditor.prototype.prepareAndSave = function() {
var val;
if (!this.valueChanged()) {
return true;
}
if (this.instance.getSettings().trimWhitespace) {
val = [[String.prototype.trim.call(this.getValue())]];
} else {
val = [[this.getValue()]];
}
this.saveValue(val);
};
MobileTextEditor.prototype.bindEvents = function() {
var that = this;
this.eventManager.addEventListener(this.controls.leftButton, 'touchend', function(event) {
that.prepareAndSave();
that.instance.selection.transformStart(0, -1, null, true);
that.updateEditorData();
event.preventDefault();
});
this.eventManager.addEventListener(this.controls.rightButton, 'touchend', function(event) {
that.prepareAndSave();
that.instance.selection.transformStart(0, 1, null, true);
that.updateEditorData();
event.preventDefault();
});
this.eventManager.addEventListener(this.controls.upButton, 'touchend', function(event) {
that.prepareAndSave();
that.instance.selection.transformStart(-1, 0, null, true);
that.updateEditorData();
event.preventDefault();
});
this.eventManager.addEventListener(this.controls.downButton, 'touchend', function(event) {
that.prepareAndSave();
that.instance.selection.transformStart(1, 0, null, true);
that.updateEditorData();
event.preventDefault();
});
this.eventManager.addEventListener(this.moveHandle, 'touchstart', function(event) {
if (event.touches.length == 1) {
var touch = event.touches[0],
onTouchPosition = {
x: that.editorContainer.offsetLeft,
y: that.editorContainer.offsetTop
},
onTouchOffset = {
x: touch.pageX - onTouchPosition.x,
y: touch.pageY - onTouchPosition.y
};
that.eventManager.addEventListener(this, 'touchmove', function(event) {
var touch = event.touches[0];
that.updateEditorPosition(touch.pageX - onTouchOffset.x, touch.pageY - onTouchOffset.y);
that.hideCellPointer();
event.preventDefault();
});
}
});
this.eventManager.addEventListener(document.body, 'touchend', function(event) {
if (!isChildOf(event.target, that.editorContainer) && !isChildOf(event.target, that.instance.rootElement)) {
that.close();
}
});
this.eventManager.addEventListener(this.instance.view.wt.wtOverlays.leftOverlay.holder, 'scroll', function(event) {
if (that.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer != window) {
that.hideCellPointer();
}
});
this.eventManager.addEventListener(this.instance.view.wt.wtOverlays.topOverlay.holder, 'scroll', function(event) {
if (that.instance.view.wt.wtOverlays.topOverlay.trimmingContainer != window) {
that.hideCellPointer();
}
});
};
MobileTextEditor.prototype.destroy = function() {
this.eventManager.clear();
this.editorContainer.parentNode.removeChild(this.editorContainer);
};
;
registerEditor('mobile', MobileTextEditor);
//#
},{"_baseEditor":30,"editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],37:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
NumericEditor: {get: function() {
return NumericEditor;
}},
__esModule: {value: true}
});
var $__numeral__,
$___46__46__47_editors__,
$__textEditor__;
var numeral = ($__numeral__ = require("numeral"), $__numeral__ && $__numeral__.__esModule && $__numeral__ || {default: $__numeral__}).default;
var $__1 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}),
getEditor = $__1.getEditor,
registerEditor = $__1.registerEditor;
var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor;
var NumericEditor = function NumericEditor() {
$traceurRuntime.superConstructor($NumericEditor).apply(this, arguments);
};
var $NumericEditor = NumericEditor;
($traceurRuntime.createClass)(NumericEditor, {beginEditing: function(initialValue) {
if (typeof initialValue === 'undefined' && this.originalValue) {
if (typeof this.cellProperties.language !== 'undefined') {
numeral.language(this.cellProperties.language);
}
var decimalDelimiter = numeral.languageData().delimiters.decimal;
initialValue = ('' + this.originalValue).replace('.', decimalDelimiter);
}
$traceurRuntime.superGet(this, $NumericEditor.prototype, "beginEditing").call(this, initialValue);
}}, {}, TextEditor);
;
registerEditor('numeric', NumericEditor);
//#
},{"editors":29,"numeral":"numeral","textEditor":40}],38:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
PasswordEditor: {get: function() {
return PasswordEditor;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_editors__,
$__textEditor__;
var empty = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).empty;
var $__1 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}),
getEditor = $__1.getEditor,
registerEditor = $__1.registerEditor;
var TextEditor = ($__textEditor__ = require("textEditor"), $__textEditor__ && $__textEditor__.__esModule && $__textEditor__ || {default: $__textEditor__}).TextEditor;
var PasswordEditor = function PasswordEditor() {
$traceurRuntime.superConstructor($PasswordEditor).apply(this, arguments);
};
var $PasswordEditor = PasswordEditor;
($traceurRuntime.createClass)(PasswordEditor, {createElements: function() {
$traceurRuntime.superGet(this, $PasswordEditor.prototype, "createElements").call(this);
this.TEXTAREA = document.createElement('input');
this.TEXTAREA.setAttribute('type', 'password');
this.TEXTAREA.className = 'handsontableInput';
this.textareaStyle = this.TEXTAREA.style;
this.textareaStyle.width = 0;
this.textareaStyle.height = 0;
empty(this.TEXTAREA_PARENT);
this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);
}}, {}, TextEditor);
;
registerEditor('password', PasswordEditor);
//#
},{"editors":29,"helpers/dom/element":45,"textEditor":40}],39:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
SelectEditor: {get: function() {
return SelectEditor;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_helpers_47_dom_47_event__,
$___46__46__47_helpers_47_unicode__,
$___46__46__47_editors__,
$___95_baseEditor__;
var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
empty = $__0.empty,
fastInnerHTML = $__0.fastInnerHTML,
getComputedStyle = $__0.getComputedStyle,
getCssTransform = $__0.getCssTransform,
getScrollableElement = $__0.getScrollableElement,
offset = $__0.offset,
outerHeight = $__0.outerHeight,
outerWidth = $__0.outerWidth,
resetCssTransform = $__0.resetCssTransform;
var stopImmediatePropagation = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation;
var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES;
var $__3 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}),
getEditor = $__3.getEditor,
registerEditor = $__3.registerEditor;
var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor;
var SelectEditor = BaseEditor.prototype.extend();
SelectEditor.prototype.init = function() {
this.select = document.createElement('SELECT');
addClass(this.select, 'htSelectEditor');
this.select.style.display = 'none';
this.instance.rootElement.appendChild(this.select);
this.registerHooks();
};
SelectEditor.prototype.registerHooks = function() {
var $__5 = this;
this.instance.addHook('afterScrollHorizontally', (function() {
return $__5.refreshDimensions();
}));
this.instance.addHook('afterScrollVertically', (function() {
return $__5.refreshDimensions();
}));
this.instance.addHook('afterColumnResize', (function() {
return $__5.refreshDimensions();
}));
this.instance.addHook('afterRowResize', (function() {
return $__5.refreshDimensions();
}));
};
SelectEditor.prototype.prepare = function() {
BaseEditor.prototype.prepare.apply(this, arguments);
var selectOptions = this.cellProperties.selectOptions;
var options;
if (typeof selectOptions == 'function') {
options = this.prepareOptions(selectOptions(this.row, this.col, this.prop));
} else {
options = this.prepareOptions(selectOptions);
}
empty(this.select);
for (var option in options) {
if (options.hasOwnProperty(option)) {
var optionElement = document.createElement('OPTION');
optionElement.value = option;
fastInnerHTML(optionElement, options[option]);
this.select.appendChild(optionElement);
}
}
};
SelectEditor.prototype.prepareOptions = function(optionsToPrepare) {
var preparedOptions = {};
if (Array.isArray(optionsToPrepare)) {
for (var i = 0,
len = optionsToPrepare.length; i < len; i++) {
preparedOptions[optionsToPrepare[i]] = optionsToPrepare[i];
}
} else if (typeof optionsToPrepare == 'object') {
preparedOptions = optionsToPrepare;
}
return preparedOptions;
};
SelectEditor.prototype.getValue = function() {
return this.select.value;
};
SelectEditor.prototype.setValue = function(value) {
this.select.value = value;
};
var onBeforeKeyDown = function(event) {
var instance = this;
var editor = instance.getActiveEditor();
switch (event.keyCode) {
case KEY_CODES.ARROW_UP:
var previousOptionIndex = editor.select.selectedIndex - 1;
if (previousOptionIndex >= 0) {
editor.select[previousOptionIndex].selected = true;
}
stopImmediatePropagation(event);
event.preventDefault();
break;
case KEY_CODES.ARROW_DOWN:
var nextOptionIndex = editor.select.selectedIndex + 1;
if (nextOptionIndex <= editor.select.length - 1) {
editor.select[nextOptionIndex].selected = true;
}
stopImmediatePropagation(event);
event.preventDefault();
break;
}
};
SelectEditor.prototype.open = function() {
this._opened = true;
this.refreshDimensions();
this.select.style.display = '';
this.instance.addHook('beforeKeyDown', onBeforeKeyDown);
};
SelectEditor.prototype.close = function() {
this._opened = false;
this.select.style.display = 'none';
this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);
};
SelectEditor.prototype.focus = function() {
this.select.focus();
};
SelectEditor.prototype.refreshDimensions = function() {
if (this.state !== Handsontable.EditorState.EDITING) {
return;
}
this.TD = this.getEditedCell();
if (!this.TD) {
this.close();
return;
}
var width = outerWidth(this.TD) + 1,
height = outerHeight(this.TD) + 1,
currentOffset = offset(this.TD),
containerOffset = offset(this.instance.rootElement),
scrollableContainer = getScrollableElement(this.TD),
editTop = currentOffset.top - containerOffset.top - 1 - (scrollableContainer.scrollTop || 0),
editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0),
editorSection = this.checkEditorSection(),
cssTransformOffset;
var settings = this.instance.getSettings();
var rowHeadersCount = settings.rowHeaders ? 1 : 0;
var colHeadersCount = settings.colHeaders ? 1 : 0;
switch (editorSection) {
case 'top':
cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);
break;
case 'left':
cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);
break;
case 'top-left-corner':
cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);
break;
case 'bottom-left-corner':
cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);
break;
case 'bottom':
cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode);
break;
}
if (this.instance.getSelected()[0] === 0) {
editTop += 1;
}
if (this.instance.getSelected()[1] === 0) {
editLeft += 1;
}
var selectStyle = this.select.style;
if (cssTransformOffset && cssTransformOffset != -1) {
selectStyle[cssTransformOffset[0]] = cssTransformOffset[1];
} else {
resetCssTransform(this.select);
}
var cellComputedStyle = getComputedStyle(this.TD);
if (parseInt(cellComputedStyle.borderTopWidth, 10) > 0) {
height -= 1;
}
if (parseInt(cellComputedStyle.borderLeftWidth, 10) > 0) {
width -= 1;
}
selectStyle.height = height + 'px';
selectStyle.minWidth = width + 'px';
selectStyle.top = editTop + 'px';
selectStyle.left = editLeft + 'px';
selectStyle.margin = '0px';
};
SelectEditor.prototype.getEditedCell = function() {
var editorSection = this.checkEditorSection(),
editedCell;
switch (editorSection) {
case 'top':
editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({
row: this.row,
col: this.col
});
this.select.style.zIndex = 101;
break;
case 'corner':
editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({
row: this.row,
col: this.col
});
this.select.style.zIndex = 103;
break;
case 'left':
editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({
row: this.row,
col: this.col
});
this.select.style.zIndex = 102;
break;
default:
editedCell = this.instance.getCell(this.row, this.col);
this.select.style.zIndex = '';
break;
}
return editedCell != -1 && editedCell != -2 ? editedCell : void 0;
};
;
registerEditor('select', SelectEditor);
//#
},{"_baseEditor":30,"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
TextEditor: {get: function() {
return TextEditor;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$__autoResize__,
$___95_baseEditor__,
$___46__46__47_eventManager__,
$___46__46__47_editors__,
$___46__46__47_helpers_47_unicode__,
$___46__46__47_helpers_47_dom_47_event__;
var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
getCaretPosition = $__0.getCaretPosition,
getComputedStyle = $__0.getComputedStyle,
getCssTransform = $__0.getCssTransform,
getScrollableElement = $__0.getScrollableElement,
getScrollbarWidth = $__0.getScrollbarWidth,
innerWidth = $__0.innerWidth,
offset = $__0.offset,
resetCssTransform = $__0.resetCssTransform,
setCaretPosition = $__0.setCaretPosition,
hasVerticalScrollbar = $__0.hasVerticalScrollbar,
hasHorizontalScrollbar = $__0.hasHorizontalScrollbar;
var autoResize = ($__autoResize__ = require("autoResize"), $__autoResize__ && $__autoResize__.__esModule && $__autoResize__ || {default: $__autoResize__}).default;
var BaseEditor = ($___95_baseEditor__ = require("_baseEditor"), $___95_baseEditor__ && $___95_baseEditor__.__esModule && $___95_baseEditor__ || {default: $___95_baseEditor__}).BaseEditor;
var eventManagerObject = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).eventManager;
var $__4 = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}),
getEditor = $__4.getEditor,
registerEditor = $__4.registerEditor;
var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES;
var $__6 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}),
stopPropagation = $__6.stopPropagation,
stopImmediatePropagation = $__6.stopImmediatePropagation,
isImmediatePropagationStopped = $__6.isImmediatePropagationStopped;
var TextEditor = BaseEditor.prototype.extend();
TextEditor.prototype.init = function() {
var that = this;
this.createElements();
this.eventManager = eventManagerObject(this);
this.bindEvents();
this.autoResize = autoResize();
this.instance.addHook('afterDestroy', function() {
that.destroy();
});
};
TextEditor.prototype.getValue = function() {
return this.TEXTAREA.value;
};
TextEditor.prototype.setValue = function(newValue) {
this.TEXTAREA.value = newValue;
};
var onBeforeKeyDown = function onBeforeKeyDown(event) {
var instance = this,
that = instance.getActiveEditor(),
ctrlDown;
ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;
if (event.target !== that.TEXTAREA || isImmediatePropagationStopped(event)) {
return;
}
if (event.keyCode === 17 || event.keyCode === 224 || event.keyCode === 91 || event.keyCode === 93) {
stopImmediatePropagation(event);
return;
}
switch (event.keyCode) {
case KEY_CODES.ARROW_RIGHT:
if (that.isInFullEditMode()) {
if ((!that.isWaiting() && !that.allowKeyEventPropagation) || (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) {
stopImmediatePropagation(event);
}
}
break;
case KEY_CODES.ARROW_LEFT:
if (that.isInFullEditMode()) {
if ((!that.isWaiting() && !that.allowKeyEventPropagation) || (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) {
stopImmediatePropagation(event);
}
}
break;
case KEY_CODES.ARROW_UP:
case KEY_CODES.ARROW_DOWN:
if (that.isInFullEditMode()) {
if ((!that.isWaiting() && !that.allowKeyEventPropagation) || (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) {
stopImmediatePropagation(event);
}
}
break;
case KEY_CODES.ENTER:
var selected = that.instance.getSelected();
var isMultipleSelection = !(selected[0] === selected[2] && selected[1] === selected[3]);
if ((ctrlDown && !isMultipleSelection) || event.altKey) {
if (that.isOpened()) {
var caretPosition = getCaretPosition(that.TEXTAREA),
value = that.getValue();
var newValue = value.slice(0, caretPosition) + '\n' + value.slice(caretPosition);
that.setValue(newValue);
setCaretPosition(that.TEXTAREA, caretPosition + 1);
} else {
that.beginEditing(that.originalValue + '\n');
}
stopImmediatePropagation(event);
}
event.preventDefault();
break;
case KEY_CODES.A:
case KEY_CODES.X:
case KEY_CODES.C:
case KEY_CODES.V:
if (ctrlDown) {
stopImmediatePropagation(event);
}
break;
case KEY_CODES.BACKSPACE:
case KEY_CODES.DELETE:
case KEY_CODES.HOME:
case KEY_CODES.END:
stopImmediatePropagation(event);
break;
}
if ([KEY_CODES.ARROW_UP, KEY_CODES.ARROW_RIGHT, KEY_CODES.ARROW_DOWN, KEY_CODES.ARROW_LEFT].indexOf(event.keyCode) === -1) {
that.autoResize.resize(String.fromCharCode(event.keyCode));
}
};
TextEditor.prototype.open = function() {
this.refreshDimensions();
this.instance.addHook('beforeKeyDown', onBeforeKeyDown);
};
TextEditor.prototype.close = function(tdOutside) {
this.textareaParentStyle.display = 'none';
this.autoResize.unObserve();
if (document.activeElement === this.TEXTAREA) {
this.instance.listen();
}
this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);
};
TextEditor.prototype.focus = function() {
this.TEXTAREA.focus();
setCaretPosition(this.TEXTAREA, this.TEXTAREA.value.length);
};
TextEditor.prototype.createElements = function() {
this.TEXTAREA = document.createElement('TEXTAREA');
addClass(this.TEXTAREA, 'handsontableInput');
this.textareaStyle = this.TEXTAREA.style;
this.textareaStyle.width = 0;
this.textareaStyle.height = 0;
this.TEXTAREA_PARENT = document.createElement('DIV');
addClass(this.TEXTAREA_PARENT, 'handsontableInputHolder');
this.textareaParentStyle = this.TEXTAREA_PARENT.style;
this.textareaParentStyle.top = 0;
this.textareaParentStyle.left = 0;
this.textareaParentStyle.display = 'none';
this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);
this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);
var that = this;
this.instance._registerTimeout(setTimeout(function() {
that.refreshDimensions();
}, 0));
};
TextEditor.prototype.getEditedCell = function() {
var editorSection = this.checkEditorSection(),
editedCell;
switch (editorSection) {
case 'top':
editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({
row: this.row,
col: this.col
});
this.textareaParentStyle.zIndex = 101;
break;
case 'top-left-corner':
editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({
row: this.row,
col: this.col
});
this.textareaParentStyle.zIndex = 103;
break;
case 'bottom-left-corner':
editedCell = this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({
row: this.row,
col: this.col
});
this.textareaParentStyle.zIndex = 103;
break;
case 'left':
editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({
row: this.row,
col: this.col
});
this.textareaParentStyle.zIndex = 102;
break;
case 'bottom':
editedCell = this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({
row: this.row,
col: this.col
});
this.textareaParentStyle.zIndex = 102;
break;
default:
editedCell = this.instance.getCell(this.row, this.col);
this.textareaParentStyle.zIndex = '';
break;
}
return editedCell != -1 && editedCell != -2 ? editedCell : void 0;
};
TextEditor.prototype.refreshDimensions = function() {
if (this.state !== Handsontable.EditorState.EDITING) {
return;
}
this.TD = this.getEditedCell();
if (!this.TD) {
this.close(true);
return;
}
var currentOffset = offset(this.TD),
containerOffset = offset(this.instance.rootElement),
scrollableContainer = getScrollableElement(this.TD),
totalRowsCount = this.instance.countRows(),
editTop = currentOffset.top - containerOffset.top - 1 - (scrollableContainer.scrollTop || 0),
editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0),
settings = this.instance.getSettings(),
rowHeadersCount = this.instance.hasRowHeaders(),
colHeadersCount = this.instance.hasColHeaders(),
editorSection = this.checkEditorSection(),
backgroundColor = this.TD.style.backgroundColor,
cssTransformOffset;
switch (editorSection) {
case 'top':
cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);
break;
case 'left':
cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);
break;
case 'top-left-corner':
cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);
break;
case 'bottom-left-corner':
cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);
break;
case 'bottom':
cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode);
break;
}
if (colHeadersCount && this.instance.getSelected()[0] === 0 || (settings.fixedRowsBottom && this.instance.getSelected()[0] === totalRowsCount - settings.fixedRowsBottom)) {
editTop += 1;
}
if (this.instance.getSelected()[1] === 0) {
editLeft += 1;
}
if (cssTransformOffset && cssTransformOffset != -1) {
this.textareaParentStyle[cssTransformOffset[0]] = cssTransformOffset[1];
} else {
resetCssTransform(this.textareaParentStyle);
}
this.textareaParentStyle.top = editTop + 'px';
this.textareaParentStyle.left = editLeft + 'px';
var firstRowOffset = this.instance.view.wt.wtViewport.rowsRenderCalculator.startPosition;
var firstColumnOffset = this.instance.view.wt.wtViewport.columnsRenderCalculator.startPosition;
var horizontalScrollPosition = this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition();
var verticalScrollPosition = this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition();
var scrollbarWidth = getScrollbarWidth();
var cellTopOffset = this.TD.offsetTop + firstRowOffset - verticalScrollPosition;
var cellLeftOffset = this.TD.offsetLeft + firstColumnOffset - horizontalScrollPosition;
var width = innerWidth(this.TD) - 8;
var actualVerticalScrollbarWidth = hasVerticalScrollbar(scrollableContainer) ? scrollbarWidth : 0;
var actualHorizontalScrollbarWidth = hasHorizontalScrollbar(scrollableContainer) ? scrollbarWidth : 0;
var maxWidth = this.instance.view.maximumVisibleElementWidth(cellLeftOffset) - 9 - actualVerticalScrollbarWidth;
var height = this.TD.scrollHeight + 1;
var maxHeight = Math.max(this.instance.view.maximumVisibleElementHeight(cellTopOffset) - actualHorizontalScrollbarWidth, 23);
var cellComputedStyle = getComputedStyle(this.TD);
this.TEXTAREA.style.fontSize = cellComputedStyle.fontSize;
this.TEXTAREA.style.fontFamily = cellComputedStyle.fontFamily;
this.TEXTAREA.style.backgroundColor = '';
this.TEXTAREA.style.backgroundColor = backgroundColor ? backgroundColor : getComputedStyle(this.TEXTAREA).backgroundColor;
this.autoResize.init(this.TEXTAREA, {
minHeight: Math.min(height, maxHeight),
maxHeight: maxHeight,
minWidth: Math.min(width, maxWidth),
maxWidth: maxWidth
}, true);
this.textareaParentStyle.display = 'block';
};
TextEditor.prototype.bindEvents = function() {
var editor = this;
this.eventManager.addEventListener(this.TEXTAREA, 'cut', function(event) {
stopPropagation(event);
});
this.eventManager.addEventListener(this.TEXTAREA, 'paste', function(event) {
stopPropagation(event);
});
this.instance.addHook('afterScrollHorizontally', function() {
editor.refreshDimensions();
});
this.instance.addHook('afterScrollVertically', function() {
editor.refreshDimensions();
});
this.instance.addHook('afterColumnResize', function() {
editor.refreshDimensions();
editor.focus();
});
this.instance.addHook('afterRowResize', function() {
editor.refreshDimensions();
editor.focus();
});
this.instance.addHook('afterDestroy', function() {
editor.eventManager.destroy();
});
};
TextEditor.prototype.destroy = function() {
this.eventManager.destroy();
};
;
registerEditor('text', TextEditor);
//#
},{"_baseEditor":30,"autoResize":"autoResize","editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
EventManager: {get: function() {
return EventManager;
}},
eventManager: {get: function() {
return eventManager;
}},
__esModule: {value: true}
});
var $__helpers_47_dom_47_element__,
$__helpers_47_browser__;
var $__0 = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__}),
polymerWrap = $__0.polymerWrap,
closest = $__0.closest;
var isWebComponentSupportedNatively = ($__helpers_47_browser__ = require("helpers/browser"), $__helpers_47_browser__ && $__helpers_47_browser__.__esModule && $__helpers_47_browser__ || {default: $__helpers_47_browser__}).isWebComponentSupportedNatively;
var EventManager = function EventManager() {
var context = arguments[0] !== (void 0) ? arguments[0] : null;
this.context = context || this;
if (!this.context.eventListeners) {
this.context.eventListeners = [];
}
};
($traceurRuntime.createClass)(EventManager, {
addEventListener: function(element, eventName, callback) {
var $__2 = this;
var context = this.context;
function callbackProxy(event) {
if (event.target == void 0 && event.srcElement != void 0) {
if (event.definePoperty) {
event.definePoperty('target', {value: event.srcElement});
} else {
event.target = event.srcElement;
}
}
if (event.preventDefault == void 0) {
if (event.definePoperty) {
event.definePoperty('preventDefault', {value: function() {
this.returnValue = false;
}});
} else {
event.preventDefault = function() {
this.returnValue = false;
};
}
}
event = extendEvent(context, event);
callback.call(this, event);
}
this.context.eventListeners.push({
element: element,
event: eventName,
callback: callback,
callbackProxy: callbackProxy
});
if (window.addEventListener) {
element.addEventListener(eventName, callbackProxy, false);
} else {
element.attachEvent('on' + eventName, callbackProxy);
}
Handsontable.countEventManagerListeners++;
return (function() {
$__2.removeEventListener(element, eventName, callback);
});
},
removeEventListener: function(element, eventName, callback) {
var len = this.context.eventListeners.length;
var tmpEvent;
while (len--) {
tmpEvent = this.context.eventListeners[len];
if (tmpEvent.event == eventName && tmpEvent.element == element) {
if (callback && callback != tmpEvent.callback) {
continue;
}
this.context.eventListeners.splice(len, 1);
if (tmpEvent.element.removeEventListener) {
tmpEvent.element.removeEventListener(tmpEvent.event, tmpEvent.callbackProxy, false);
} else {
tmpEvent.element.detachEvent('on' + tmpEvent.event, tmpEvent.callbackProxy);
}
Handsontable.countEventManagerListeners--;
}
}
},
clearEvents: function() {
if (!this.context) {
return;
}
var len = this.context.eventListeners.length;
while (len--) {
var event = this.context.eventListeners[len];
if (event) {
this.removeEventListener(event.element, event.event, event.callback);
}
}
},
clear: function() {
this.clearEvents();
},
destroy: function() {
this.clearEvents();
this.context = null;
},
fireEvent: function(element, eventName) {
var options = {
bubbles: true,
cancelable: (eventName !== 'mousemove'),
view: window,
detail: 0,
screenX: 0,
screenY: 0,
clientX: 1,
clientY: 1,
ctrlKey: false,
altKey: false,
shiftKey: false,
metaKey: false,
button: 0,
relatedTarget: undefined
};
var event;
if (document.createEvent) {
event = document.createEvent('MouseEvents');
event.initMouseEvent(eventName, options.bubbles, options.cancelable, options.view, options.detail, options.screenX, options.screenY, options.clientX, options.clientY, options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, options.relatedTarget || document.body.parentNode);
} else {
event = document.createEventObject();
}
if (element.dispatchEvent) {
element.dispatchEvent(event);
} else {
element.fireEvent('on' + eventName, event);
}
}
}, {});
function extendEvent(context, event) {
var componentName = 'HOT-TABLE';
var isHotTableSpotted;
var fromElement;
var realTarget;
var target;
var len;
event.isTargetWebComponent = false;
event.realTarget = event.target;
if (!Handsontable.eventManager.isHotTableEnv) {
return event;
}
event = polymerWrap(event);
len = event.path ? event.path.length : 0;
while (len--) {
if (event.path[len].nodeName === componentName) {
isHotTableSpotted = true;
} else if (isHotTableSpotted && event.path[len].shadowRoot) {
target = event.path[len];
break;
}
if (len === 0 && !target) {
target = event.path[len];
}
}
if (!target) {
target = event.target;
}
event.isTargetWebComponent = true;
if (isWebComponentSupportedNatively()) {
event.realTarget = event.srcElement || event.toElement;
} else if (context instanceof Handsontable.Core || context instanceof Walkontable) {
if (context instanceof Handsontable.Core) {
fromElement = context.view ? context.view.wt.wtTable.TABLE : null;
} else if (context instanceof Walkontable) {
fromElement = context.wtTable.TABLE.parentNode.parentNode;
}
realTarget = closest(event.target, [componentName], fromElement);
if (realTarget) {
event.realTarget = fromElement.querySelector(componentName) || event.target;
} else {
event.realTarget = event.target;
}
}
Object.defineProperty(event, 'target', {
get: function() {
return polymerWrap(target);
},
enumerable: true,
configurable: true
});
return event;
}
;
window.Handsontable = window.Handsontable || {};
Handsontable.countEventManagerListeners = 0;
Handsontable.eventManager = eventManager;
function eventManager(context) {
return new EventManager(context);
}
//#
},{"helpers/browser":43,"helpers/dom/element":45}],42:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
to2dArray: {get: function() {
return to2dArray;
}},
extendArray: {get: function() {
return extendArray;
}},
pivot: {get: function() {
return pivot;
}},
arrayReduce: {get: function() {
return arrayReduce;
}},
arrayFilter: {get: function() {
return arrayFilter;
}},
arrayMap: {get: function() {
return arrayMap;
}},
arrayEach: {get: function() {
return arrayEach;
}},
arraySum: {get: function() {
return arraySum;
}},
arrayMax: {get: function() {
return arrayMax;
}},
arrayMin: {get: function() {
return arrayMin;
}},
arrayAvg: {get: function() {
return arrayAvg;
}},
arrayFlatten: {get: function() {
return arrayFlatten;
}},
arrayUnique: {get: function() {
return arrayUnique;
}},
__esModule: {value: true}
});
function to2dArray(arr) {
var i = 0,
ilen = arr.length;
while (i < ilen) {
arr[i] = [arr[i]];
i++;
}
}
function extendArray(arr, extension) {
var i = 0,
ilen = extension.length;
while (i < ilen) {
arr.push(extension[i]);
i++;
}
}
function pivot(arr) {
var pivotedArr = [];
if (!arr || arr.length === 0 || !arr[0] || arr[0].length === 0) {
return pivotedArr;
}
var rowCount = arr.length;
var colCount = arr[0].length;
for (var i = 0; i < rowCount; i++) {
for (var j = 0; j < colCount; j++) {
if (!pivotedArr[j]) {
pivotedArr[j] = [];
}
pivotedArr[j][i] = arr[i][j];
}
}
return pivotedArr;
}
function arrayReduce(array, iteratee, accumulator, initFromArray) {
var index = -1,
length = array.length;
if (initFromArray && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
function arrayFilter(array, predicate) {
var index = -1,
length = array.length,
resIndex = -1,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[++resIndex] = value;
}
}
return result;
}
function arrayMap(array, iteratee) {
var index = -1,
length = array.length,
resIndex = -1,
result = [];
while (++index < length) {
var value = array[index];
result[++resIndex] = iteratee(value, index, array);
}
return result;
}
function arrayEach(array, iteratee) {
var index = -1,
length = array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
function arraySum(array) {
return arrayReduce(array, (function(a, b) {
return (a + b);
}), 0);
}
function arrayMax(array) {
return arrayReduce(array, (function(a, b) {
return (a > b ? a : b);
}), Array.isArray(array) ? array[0] : void 0);
}
function arrayMin(array) {
return arrayReduce(array, (function(a, b) {
return (a < b ? a : b);
}), Array.isArray(array) ? array[0] : void 0);
}
function arrayAvg(array) {
if (!array.length) {
return 0;
}
return arraySum(array) / array.length;
}
function arrayFlatten(array) {
return arrayReduce(array, (function(initial, value) {
return initial.concat(Array.isArray(value) ? arrayFlatten(value) : value);
}), []);
}
function arrayUnique(array) {
var unique = [];
arrayEach(array, (function(value) {
if (unique.indexOf(value) === -1) {
unique.push(value);
}
}));
return unique;
}
//#
},{}],43:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
isIE8: {get: function() {
return isIE8;
}},
isIE9: {get: function() {
return isIE9;
}},
isSafari: {get: function() {
return isSafari;
}},
isChrome: {get: function() {
return isChrome;
}},
isMobileBrowser: {get: function() {
return isMobileBrowser;
}},
isTouchSupported: {get: function() {
return isTouchSupported;
}},
isWebComponentSupportedNatively: {get: function() {
return isWebComponentSupportedNatively;
}},
hasCaptionProblem: {get: function() {
return hasCaptionProblem;
}},
__esModule: {value: true}
});
var _isIE8 = !(document.createTextNode('test').textContent);
function isIE8() {
return _isIE8;
}
var _isIE9 = !!(document.documentMode);
function isIE9() {
return _isIE9;
}
var _isSafari = (/Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor));
function isSafari() {
return _isSafari;
}
var _isChrome = (/Chrome/.test(navigator.userAgent) && /Google/.test(navigator.vendor));
function isChrome() {
return _isChrome;
}
function isMobileBrowser(userAgent) {
if (!userAgent) {
userAgent = navigator.userAgent;
}
return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent));
}
function isTouchSupported() {
return ('ontouchstart' in window);
}
function isWebComponentSupportedNatively() {
var test = document.createElement('div');
return test.createShadowRoot && test.createShadowRoot.toString().match(/\[native code\]/) ? true : false;
}
var _hasCaptionProblem;
function detectCaptionProblem() {
var TABLE = document.createElement('TABLE');
TABLE.style.borderSpacing = 0;
TABLE.style.borderWidth = 0;
TABLE.style.padding = 0;
var TBODY = document.createElement('TBODY');
TABLE.appendChild(TBODY);
TBODY.appendChild(document.createElement('TR'));
TBODY.firstChild.appendChild(document.createElement('TD'));
TBODY.firstChild.firstChild.innerHTML = '<tr><td>t<br>t</td></tr>';
var CAPTION = document.createElement('CAPTION');
CAPTION.innerHTML = 'c<br>c<br>c<br>c';
CAPTION.style.padding = 0;
CAPTION.style.margin = 0;
TABLE.insertBefore(CAPTION, TBODY);
document.body.appendChild(TABLE);
_hasCaptionProblem = (TABLE.offsetHeight < 2 * TABLE.lastChild.offsetHeight);
document.body.removeChild(TABLE);
}
function hasCaptionProblem() {
if (_hasCaptionProblem === void 0) {
detectCaptionProblem();
}
return _hasCaptionProblem;
}
//#
},{}],44:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
spreadsheetColumnLabel: {get: function() {
return spreadsheetColumnLabel;
}},
createSpreadsheetData: {get: function() {
return createSpreadsheetData;
}},
createSpreadsheetObjectData: {get: function() {
return createSpreadsheetObjectData;
}},
createEmptySpreadsheetData: {get: function() {
return createEmptySpreadsheetData;
}},
translateRowsToColumns: {get: function() {
return translateRowsToColumns;
}},
cellMethodLookupFactory: {get: function() {
return cellMethodLookupFactory;
}},
__esModule: {value: true}
});
var $__object__;
var getPrototypeOf = ($__object__ = require("object"), $__object__ && $__object__.__esModule && $__object__ || {default: $__object__}).getPrototypeOf;
function spreadsheetColumnLabel(index) {
var dividend = index + 1;
var columnLabel = '';
var modulo;
while (dividend > 0) {
modulo = (dividend - 1) % 26;
columnLabel = String.fromCharCode(65 + modulo) + columnLabel;
dividend = parseInt((dividend - modulo) / 26, 10);
}
return columnLabel;
}
function createSpreadsheetData(rowCount, colCount) {
rowCount = typeof rowCount === 'number' ? rowCount : 100;
colCount = typeof colCount === 'number' ? colCount : 4;
var rows = [],
i,
j;
for (i = 0; i < rowCount; i++) {
var row = [];
for (j = 0; j < colCount; j++) {
row.push(spreadsheetColumnLabel(j) + (i + 1));
}
rows.push(row);
}
return rows;
}
function createSpreadsheetObjectData(rowCount, colCount) {
rowCount = typeof rowCount === 'number' ? rowCount : 100;
colCount = typeof colCount === 'number' ? colCount : 4;
var rows = [],
i,
j;
for (i = 0; i < rowCount; i++) {
var row = {};
for (j = 0; j < colCount; j++) {
row['prop' + j] = spreadsheetColumnLabel(j) + (i + 1);
}
rows.push(row);
}
return rows;
}
function createEmptySpreadsheetData(rows, columns) {
var data = [];
var row;
for (var i = 0; i < rows; i++) {
row = [];
for (var j = 0; j < columns; j++) {
row.push('');
}
data.push(row);
}
return data;
}
function translateRowsToColumns(input) {
var i,
ilen,
j,
jlen,
output = [],
olen = 0;
for (i = 0, ilen = input.length; i < ilen; i++) {
for (j = 0, jlen = input[i].length; j < jlen; j++) {
if (j == olen) {
output.push([]);
olen++;
}
output[j].push(input[i][j]);
}
}
return output;
}
function cellMethodLookupFactory(methodName, allowUndefined) {
allowUndefined = typeof allowUndefined == 'undefined' ? true : allowUndefined;
return function cellMethodLookup(row, col) {
return (function getMethodFromProperties(properties) {
if (!properties) {
return;
} else if (properties.hasOwnProperty(methodName) && properties[methodName] !== void 0) {
return properties[methodName];
} else if (properties.hasOwnProperty('type') && properties.type) {
var type;
if (typeof properties.type != 'string') {
throw new Error('Cell type must be a string ');
}
type = translateTypeNameToObject(properties.type);
if (type.hasOwnProperty(methodName)) {
return type[methodName];
} else if (allowUndefined) {
return;
}
}
return getMethodFromProperties(getPrototypeOf(properties));
})(typeof row == 'number' ? this.getCellMeta(row, col) : row);
};
function translateTypeNameToObject(typeName) {
var type = Handsontable.cellTypes[typeName];
if (typeof type == 'undefined') {
throw new Error('You declared cell type "' + typeName + '" as a string that is not mapped to a known object. ' + 'Cell type must be an object or a string mapped to an object in Handsontable.cellTypes');
}
return type;
}
}
//#
},{"object":50}],45:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
closest: {get: function() {
return closest;
}},
isChildOf: {get: function() {
return isChildOf;
}},
isChildOfWebComponentTable: {get: function() {
return isChildOfWebComponentTable;
}},
polymerWrap: {get: function() {
return polymerWrap;
}},
polymerUnwrap: {get: function() {
return polymerUnwrap;
}},
index: {get: function() {
return index;
}},
overlayContainsElement: {get: function() {
return overlayContainsElement;
}},
hasClass: {get: function() {
return hasClass;
}},
addClass: {get: function() {
return addClass;
}},
removeClass: {get: function() {
return removeClass;
}},
removeTextNodes: {get: function() {
return removeTextNodes;
}},
empty: {get: function() {
return empty;
}},
HTML_CHARACTERS: {get: function() {
return HTML_CHARACTERS;
}},
fastInnerHTML: {get: function() {
return fastInnerHTML;
}},
fastInnerText: {get: function() {
return fastInnerText;
}},
isVisible: {get: function() {
return isVisible;
}},
offset: {get: function() {
return offset;
}},
getWindowScrollTop: {get: function() {
return getWindowScrollTop;
}},
getWindowScrollLeft: {get: function() {
return getWindowScrollLeft;
}},
getScrollTop: {get: function() {
return getScrollTop;
}},
getScrollLeft: {get: function() {
return getScrollLeft;
}},
getScrollableElement: {get: function() {
return getScrollableElement;
}},
getTrimmingContainer: {get: function() {
return getTrimmingContainer;
}},
getStyle: {get: function() {
return getStyle;
}},
getComputedStyle: {get: function() {
return getComputedStyle;
}},
outerWidth: {get: function() {
return outerWidth;
}},
outerHeight: {get: function() {
return outerHeight;
}},
innerHeight: {get: function() {
return innerHeight;
}},
innerWidth: {get: function() {
return innerWidth;
}},
addEvent: {get: function() {
return addEvent;
}},
removeEvent: {get: function() {
return removeEvent;
}},
getCaretPosition: {get: function() {
return getCaretPosition;
}},
getSelectionEndPosition: {get: function() {
return getSelectionEndPosition;
}},
getSelectionText: {get: function() {
return getSelectionText;
}},
setCaretPosition: {get: function() {
return setCaretPosition;
}},
getScrollbarWidth: {get: function() {
return getScrollbarWidth;
}},
hasVerticalScrollbar: {get: function() {
return hasVerticalScrollbar;
}},
hasHorizontalScrollbar: {get: function() {
return hasHorizontalScrollbar;
}},
setOverlayPosition: {get: function() {
return setOverlayPosition;
}},
getCssTransform: {get: function() {
return getCssTransform;
}},
resetCssTransform: {get: function() {
return resetCssTransform;
}},
isInput: {get: function() {
return isInput;
}},
isOutsideInput: {get: function() {
return isOutsideInput;
}},
requestAnimationFrame: {get: function() {
return requestAnimationFrame;
}},
cancelAnimationFrame: {get: function() {
return cancelAnimationFrame;
}},
__esModule: {value: true}
});
var $___46__46__47_browser__;
var $__0 = ($___46__46__47_browser__ = require("../browser"), $___46__46__47_browser__ && $___46__46__47_browser__.__esModule && $___46__46__47_browser__ || {default: $___46__46__47_browser__}),
isIE8 = $__0.isIE8,
isIE9 = $__0.isIE9,
isSafari = $__0.isSafari,
hasCaptionProblem = $__0.hasCaptionProblem;
function closest(element, nodes, until) {
while (element != null && element !== until) {
if (element.nodeType === Node.ELEMENT_NODE && (nodes.indexOf(element.nodeName) > -1 || nodes.indexOf(element) > -1)) {
return element;
}
if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
element = element.host;
} else {
element = element.parentNode;
}
}
return null;
}
function isChildOf(child, parent) {
var node = child.parentNode;
var queriedParents = [];
if (typeof parent === 'string') {
queriedParents = Array.prototype.slice.call(document.querySelectorAll(parent), 0);
} else {
queriedParents.push(parent);
}
while (node != null) {
if (queriedParents.indexOf(node) > -1) {
return true;
}
node = node.parentNode;
}
return false;
}
function isChildOfWebComponentTable(element) {
var hotTableName = 'hot-table',
result = false,
parentNode;
parentNode = polymerWrap(element);
function isHotTable(element) {
return element.nodeType === Node.ELEMENT_NODE && element.nodeName === hotTableName.toUpperCase();
}
while (parentNode != null) {
if (isHotTable(parentNode)) {
result = true;
break;
} else if (parentNode.host && parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
result = isHotTable(parentNode.host);
if (result) {
break;
}
parentNode = parentNode.host;
}
parentNode = parentNode.parentNode;
}
return result;
}
function polymerWrap(element) {
return typeof Polymer !== 'undefined' && typeof wrap === 'function' ? wrap(element) : element;
}
function polymerUnwrap(element) {
return typeof Polymer !== 'undefined' && typeof unwrap === 'function' ? unwrap(element) : element;
}
function index(element) {
var i = 0;
if (element.previousSibling) {
while (element = element.previousSibling) {
++i;
}
}
return i;
}
function overlayContainsElement(overlayType, element) {
var overlayElement = document.querySelector('.ht_clone_' + overlayType);
return overlayElement ? overlayElement.contains(element) : null;
}
var classListSupport = document.documentElement.classList ? true : false;
var _hasClass,
_addClass,
_removeClass;
function filterEmptyClassNames(classNames) {
var len = 0,
result = [];
if (!classNames || !classNames.length) {
return result;
}
while (classNames[len]) {
result.push(classNames[len]);
len++;
}
return result;
}
if (classListSupport) {
var isSupportMultipleClassesArg = (function() {
var element = document.createElement('div');
element.classList.add('test', 'test2');
return element.classList.contains('test2');
}());
_hasClass = function _hasClass(element, className) {
if (className === '') {
return false;
}
return element.classList.contains(className);
};
_addClass = function _addClass(element, className) {
var len = 0;
if (typeof className === 'string') {
className = className.split(' ');
}
className = filterEmptyClassNames(className);
if (isSupportMultipleClassesArg) {
element.classList.add.apply(element.classList, className);
} else {
while (className && className[len]) {
element.classList.add(className[len]);
len++;
}
}
};
_removeClass = function _removeClass(element, className) {
var len = 0;
if (typeof className === 'string') {
className = className.split(' ');
}
className = filterEmptyClassNames(className);
if (isSupportMultipleClassesArg) {
element.classList.remove.apply(element.classList, className);
} else {
while (className && className[len]) {
element.classList.remove(className[len]);
len++;
}
}
};
} else {
var createClassNameRegExp = function createClassNameRegExp(className) {
return new RegExp('(\\s|^)' + className + '(\\s|$)');
};
_hasClass = function _hasClass(element, className) {
return element.className.match(createClassNameRegExp(className)) ? true : false;
};
_addClass = function _addClass(element, className) {
var len = 0,
_className = element.className;
if (typeof className === 'string') {
className = className.split(' ');
}
if (_className === '') {
_className = className.join(' ');
} else {
while (className && className[len]) {
if (!createClassNameRegExp(className[len]).test(_className)) {
_className += ' ' + className[len];
}
len++;
}
}
element.className = _className;
};
_removeClass = function _removeClass(element, className) {
var len = 0,
_className = element.className;
if (typeof className === 'string') {
className = className.split(' ');
}
while (className && className[len]) {
_className = _className.replace(createClassNameRegExp(className[len]), ' ').trim();
len++;
}
if (element.className !== _className) {
element.className = _className;
}
};
}
function hasClass(element, className) {
return _hasClass(element, className);
}
function addClass(element, className) {
return _addClass(element, className);
}
function removeClass(element, className) {
return _removeClass(element, className);
}
function removeTextNodes(element, parent) {
if (element.nodeType === 3) {
parent.removeChild(element);
} else if (['TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR'].indexOf(element.nodeName) > -1) {
var childs = element.childNodes;
for (var i = childs.length - 1; i >= 0; i--) {
removeTextNodes(childs[i], element);
}
}
}
function empty(element) {
var child;
while (child = element.lastChild) {
element.removeChild(child);
}
}
var HTML_CHARACTERS = /(<(.*)>|&(.*);)/;
function fastInnerHTML(element, content) {
if (HTML_CHARACTERS.test(content)) {
element.innerHTML = content;
} else {
fastInnerText(element, content);
}
}
var textContextSupport = document.createTextNode('test').textContent ? true : false;
function fastInnerText(element, content) {
var child = element.firstChild;
if (child && child.nodeType === 3 && child.nextSibling === null) {
if (textContextSupport) {
child.textContent = content;
} else {
child.data = content;
}
} else {
empty(element);
element.appendChild(document.createTextNode(content));
}
}
function isVisible(elem) {
var next = elem;
while (polymerUnwrap(next) !== document.documentElement) {
if (next === null) {
return false;
} else if (next.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
if (next.host) {
if (next.host.impl) {
return isVisible(next.host.impl);
} else if (next.host) {
return isVisible(next.host);
} else {
throw new Error('Lost in Web Components world');
}
} else {
return false;
}
} else if (next.style.display === 'none') {
return false;
}
next = next.parentNode;
}
return true;
}
function offset(elem) {
var offsetLeft,
offsetTop,
lastElem,
docElem,
box;
docElem = document.documentElement;
if (hasCaptionProblem() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {
box = elem.getBoundingClientRect();
return {
top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),
left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)
};
}
offsetLeft = elem.offsetLeft;
offsetTop = elem.offsetTop;
lastElem = elem;
while (elem = elem.offsetParent) {
if (elem === document.body) {
break;
}
offsetLeft += elem.offsetLeft;
offsetTop += elem.offsetTop;
lastElem = elem;
}
if (lastElem && lastElem.style.position === 'fixed') {
offsetLeft += window.pageXOffset || docElem.scrollLeft;
offsetTop += window.pageYOffset || docElem.scrollTop;
}
return {
left: offsetLeft,
top: offsetTop
};
}
function getWindowScrollTop() {
var res = window.scrollY;
if (res === void 0) {
res = document.documentElement.scrollTop;
}
return res;
}
function getWindowScrollLeft() {
var res = window.scrollX;
if (res === void 0) {
res = document.documentElement.scrollLeft;
}
return res;
}
function getScrollTop(element) {
if (element === window) {
return getWindowScrollTop();
} else {
return element.scrollTop;
}
}
function getScrollLeft(element) {
if (element === window) {
return getWindowScrollLeft();
} else {
return element.scrollLeft;
}
}
function getScrollableElement(element) {
var el = element.parentNode,
props = ['auto', 'scroll'],
overflow,
overflowX,
overflowY,
computedStyle = '',
computedOverflow = '',
computedOverflowY = '',
computedOverflowX = '';
while (el && el.style && document.body !== el) {
overflow = el.style.overflow;
overflowX = el.style.overflowX;
overflowY = el.style.overflowY;
if (overflow == 'scroll' || overflowX == 'scroll' || overflowY == 'scroll') {
return el;
} else if (window.getComputedStyle) {
computedStyle = window.getComputedStyle(el);
computedOverflow = computedStyle.getPropertyValue('overflow');
computedOverflowY = computedStyle.getPropertyValue('overflow-y');
computedOverflowX = computedStyle.getPropertyValue('overflow-x');
if (computedOverflow === 'scroll' || computedOverflowX === 'scroll' || computedOverflowY === 'scroll') {
return el;
}
}
if (el.clientHeight <= el.scrollHeight && (props.indexOf(overflowY) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowY) !== -1)) {
return el;
}
if (el.clientWidth <= el.scrollWidth && (props.indexOf(overflowX) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowX) !== -1)) {
return el;
}
el = el.parentNode;
}
return window;
}
function getTrimmingContainer(base) {
var el = base.parentNode;
while (el && el.style && document.body !== el) {
if (el.style.overflow !== 'visible' && el.style.overflow !== '') {
return el;
} else if (window.getComputedStyle) {
var computedStyle = window.getComputedStyle(el);
if (computedStyle.getPropertyValue('overflow') !== 'visible' && computedStyle.getPropertyValue('overflow') !== '') {
return el;
}
}
el = el.parentNode;
}
return window;
}
function getStyle(element, prop) {
if (!element) {
return;
} else if (element === window) {
if (prop === 'width') {
return window.innerWidth + 'px';
} else if (prop === 'height') {
return window.innerHeight + 'px';
}
return;
}
var styleProp = element.style[prop],
computedStyle;
if (styleProp !== '' && styleProp !== void 0) {
return styleProp;
} else {
computedStyle = getComputedStyle(element);
if (computedStyle[prop] !== '' && computedStyle[prop] !== void 0) {
return computedStyle[prop];
}
return void 0;
}
}
function getComputedStyle(element) {
return element.currentStyle || document.defaultView.getComputedStyle(element);
}
function outerWidth(element) {
return element.offsetWidth;
}
function outerHeight(elem) {
if (hasCaptionProblem() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {
return elem.offsetHeight + elem.firstChild.offsetHeight;
} else {
return elem.offsetHeight;
}
}
function innerHeight(element) {
return element.clientHeight || element.innerHeight;
}
function innerWidth(element) {
return element.clientWidth || element.innerWidth;
}
function addEvent(element, event, callback) {
if (window.addEventListener) {
element.addEventListener(event, callback, false);
} else {
element.attachEvent('on' + event, callback);
}
}
function removeEvent(element, event, callback) {
if (window.removeEventListener) {
element.removeEventListener(event, callback, false);
} else {
element.detachEvent('on' + event, callback);
}
}
function getCaretPosition(el) {
if (el.selectionStart) {
return el.selectionStart;
} else if (document.selection) {
el.focus();
var r = document.selection.createRange();
if (r == null) {
return 0;
}
var re = el.createTextRange();
var rc = re.duplicate();
re.moveToBookmark(r.getBookmark());
rc.setEndPoint('EndToStart', re);
return rc.text.length;
}
return 0;
}
function getSelectionEndPosition(el) {
if (el.selectionEnd) {
return el.selectionEnd;
} else if (document.selection) {
var r = document.selection.createRange();
if (r == null) {
return 0;
}
var re = el.createTextRange();
return re.text.indexOf(r.text) + r.text.length;
}
}
function getSelectionText() {
var text = '';
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type !== 'Control') {
text = document.selection.createRange().text;
}
return text;
}
function setCaretPosition(element, pos, endPos) {
if (endPos === void 0) {
endPos = pos;
}
if (element.setSelectionRange) {
element.focus();
try {
element.setSelectionRange(pos, endPos);
} catch (err) {
var elementParent = element.parentNode;
var parentDisplayValue = elementParent.style.display;
elementParent.style.display = 'block';
element.setSelectionRange(pos, endPos);
elementParent.style.display = parentDisplayValue;
}
} else if (element.createTextRange) {
var range = element.createTextRange();
range.collapse(true);
range.moveEnd('character', endPos);
range.moveStart('character', pos);
range.select();
}
}
var cachedScrollbarWidth;
function walkontableCalculateScrollbarWidth() {
var inner = document.createElement('p');
inner.style.width = '100%';
inner.style.height = '200px';
var outer = document.createElement('div');
outer.style.position = 'absolute';
outer.style.top = '0px';
outer.style.left = '0px';
outer.style.visibility = 'hidden';
outer.style.width = '200px';
outer.style.height = '150px';
outer.style.overflow = 'hidden';
outer.appendChild(inner);
(document.body || document.documentElement).appendChild(outer);
var w1 = inner.offsetWidth;
outer.style.overflow = 'scroll';
var w2 = inner.offsetWidth;
if (w1 == w2) {
w2 = outer.clientWidth;
}
(document.body || document.documentElement).removeChild(outer);
return (w1 - w2);
}
function getScrollbarWidth() {
if (cachedScrollbarWidth === void 0) {
cachedScrollbarWidth = walkontableCalculateScrollbarWidth();
}
return cachedScrollbarWidth;
}
function hasVerticalScrollbar(element) {
return element.offsetWidth !== element.clientWidth;
}
function hasHorizontalScrollbar(element) {
return element.offsetHeight !== element.clientHeight;
}
function setOverlayPosition(overlayElem, left, top) {
if (isIE8() || isIE9()) {
overlayElem.style.top = top;
overlayElem.style.left = left;
} else if (isSafari()) {
overlayElem.style['-webkit-transform'] = 'translate3d(' + left + ',' + top + ',0)';
} else {
overlayElem.style.transform = 'translate3d(' + left + ',' + top + ',0)';
}
}
function getCssTransform(element) {
var transform;
if (element.style.transform && (transform = element.style.transform) !== '') {
return ['transform', transform];
} else if (element.style['-webkit-transform'] && (transform = element.style['-webkit-transform']) !== '') {
return ['-webkit-transform', transform];
}
return -1;
}
function resetCssTransform(element) {
if (element.transform && element.transform !== '') {
element.transform = '';
} else if (element['-webkit-transform'] && element['-webkit-transform'] !== '') {
element['-webkit-transform'] = '';
}
}
function isInput(element) {
var inputs = ['INPUT', 'SELECT', 'TEXTAREA'];
return inputs.indexOf(element.nodeName) > -1 || element.contentEditable === 'true';
}
function isOutsideInput(element) {
return isInput(element) && element.className.indexOf('handsontableInput') == -1 && element.className.indexOf('copyPaste') == -1;
}
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
var _requestAnimationFrame = window.requestAnimationFrame;
var _cancelAnimationFrame = window.cancelAnimationFrame;
for (var x = 0; x < vendors.length && !_requestAnimationFrame; ++x) {
_requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
_cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
}
if (!_requestAnimationFrame) {
_requestAnimationFrame = function(callback) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() {
callback(currTime + timeToCall);
}, timeToCall);
lastTime = currTime + timeToCall;
return id;
};
}
if (!_cancelAnimationFrame) {
_cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}
function requestAnimationFrame(callback) {
return _requestAnimationFrame.call(window, callback);
}
function cancelAnimationFrame(id) {
_cancelAnimationFrame.call(window, id);
}
//#
},{"../browser":43}],46:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
stopImmediatePropagation: {get: function() {
return stopImmediatePropagation;
}},
isImmediatePropagationStopped: {get: function() {
return isImmediatePropagationStopped;
}},
stopPropagation: {get: function() {
return stopPropagation;
}},
pageX: {get: function() {
return pageX;
}},
pageY: {get: function() {
return pageY;
}},
__esModule: {value: true}
});
var $__element__;
var $__0 = ($__element__ = require("element"), $__element__ && $__element__.__esModule && $__element__ || {default: $__element__}),
getWindowScrollTop = $__0.getWindowScrollTop,
getWindowScrollLeft = $__0.getWindowScrollLeft;
function stopImmediatePropagation(event) {
event.isImmediatePropagationEnabled = false;
event.cancelBubble = true;
}
function isImmediatePropagationStopped(event) {
return event.isImmediatePropagationEnabled === false;
}
function stopPropagation(event) {
if (typeof event.stopPropagation === 'function') {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
}
function pageX(event) {
if (event.pageX) {
return event.pageX;
}
return event.clientX + getWindowScrollLeft();
}
function pageY(event) {
if (event.pageY) {
return event.pageY;
}
return event.clientY + getWindowScrollTop();
}
//#
},{"element":45}],47:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
proxy: {get: function() {
return proxy;
}},
throttle: {get: function() {
return throttle;
}},
throttleAfterHits: {get: function() {
return throttleAfterHits;
}},
debounce: {get: function() {
return debounce;
}},
__esModule: {value: true}
});
function proxy(func, context) {
return function() {
return func.apply(context, arguments);
};
}
function throttle(func) {
var wait = arguments[1] !== (void 0) ? arguments[1] : 200;
var lastCalled = 0;
var result = {lastCallThrottled: true};
var lastTimer = null;
function _throttle() {
var $__0 = this;
var args = arguments;
var stamp = Date.now();
var needCall = false;
result.lastCallThrottled = true;
if (!lastCalled) {
lastCalled = stamp;
needCall = true;
}
var remaining = wait - (stamp - lastCalled);
if (needCall) {
result.lastCallThrottled = false;
func.apply(this, args);
} else {
if (lastTimer) {
clearTimeout(lastTimer);
}
lastTimer = setTimeout((function() {
result.lastCallThrottled = false;
func.apply($__0, args);
lastCalled = 0;
lastTimer = void 0;
}), remaining);
}
return result;
}
return _throttle;
}
function throttleAfterHits(func) {
var wait = arguments[1] !== (void 0) ? arguments[1] : 200;
var hits = arguments[2] !== (void 0) ? arguments[2] : 10;
var funcThrottle = throttle(func, wait);
var remainHits = hits;
function _clearHits() {
remainHits = hits;
}
function _throttleAfterHits() {
if (remainHits) {
remainHits--;
return func.apply(this, arguments);
}
return funcThrottle.apply(this, arguments);
}
_throttleAfterHits.clearHits = _clearHits;
return _throttleAfterHits;
}
function debounce(func) {
var wait = arguments[1] !== (void 0) ? arguments[1] : 200;
var needCall = false;
var lastTimer = null;
var result;
function _debounce() {
var $__0 = this;
var args = arguments;
if (lastTimer) {
clearTimeout(lastTimer);
}
lastTimer = setTimeout((function() {
result = func.apply($__0, args);
}), wait);
return result;
}
return _debounce;
}
//#
},{}],48:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
stringify: {get: function() {
return stringify;
}},
__esModule: {value: true}
});
function stringify(value) {
switch (typeof value) {
case 'string':
case 'number':
return value + '';
case 'object':
if (value === null) {
return '';
} else {
return value.toString();
}
break;
case 'undefined':
return '';
default:
return value.toString();
}
}
//#
},{}],49:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
isNumeric: {get: function() {
return isNumeric;
}},
rangeEach: {get: function() {
return rangeEach;
}},
rangeEachReverse: {get: function() {
return rangeEachReverse;
}},
valueAccordingPercent: {get: function() {
return valueAccordingPercent;
}},
__esModule: {value: true}
});
function isNumeric(n) {
var t = typeof n;
return t == 'number' ? !isNaN(n) && isFinite(n) : t == 'string' ? !n.length ? false : n.length == 1 ? /\d/.test(n) : /^\s*[+-]?\s*(?:(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?)|(?:0x[a-f\d]+))\s*$/i.test(n) : t == 'object' ? !!n && typeof n.valueOf() == 'number' && !(n instanceof Date) : false;
}
function rangeEach(rangeFrom, rangeTo, iteratee) {
var index = -1;
if (typeof rangeTo === 'function') {
iteratee = rangeTo;
rangeTo = rangeFrom;
} else {
index = rangeFrom - 1;
}
while (++index <= rangeTo) {
if (iteratee(index) === false) {
break;
}
}
}
function rangeEachReverse(rangeFrom, rangeTo, iteratee) {
var index = rangeFrom + 1;
if (typeof rangeTo === 'function') {
iteratee = rangeTo;
rangeTo = 0;
}
while (--index >= rangeTo) {
if (iteratee(index) === false) {
break;
}
}
}
function valueAccordingPercent(value, percent) {
percent = parseInt(percent.toString().replace('%', ''), 10);
percent = parseInt(value * percent / 100);
return percent;
}
//#
},{}],50:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
duckSchema: {get: function() {
return duckSchema;
}},
inherit: {get: function() {
return inherit;
}},
extend: {get: function() {
return extend;
}},
deepExtend: {get: function() {
return deepExtend;
}},
deepClone: {get: function() {
return deepClone;
}},
clone: {get: function() {
return clone;
}},
mixin: {get: function() {
return mixin;
}},
isObjectEquals: {get: function() {
return isObjectEquals;
}},
isObject: {get: function() {
return isObject;
}},
getPrototypeOf: {get: function() {
return getPrototypeOf;
}},
defineGetter: {get: function() {
return defineGetter;
}},
objectEach: {get: function() {
return objectEach;
}},
getProperty: {get: function() {
return getProperty;
}},
__esModule: {value: true}
});
var $__array__;
var arrayEach = ($__array__ = require("array"), $__array__ && $__array__.__esModule && $__array__ || {default: $__array__}).arrayEach;
function duckSchema(object) {
var schema;
if (Array.isArray(object)) {
schema = [];
} else {
schema = {};
objectEach(object, function(value, key) {
if (value && typeof value === 'object' && !Array.isArray(value)) {
schema[key] = duckSchema(value);
} else if (Array.isArray(value)) {
if (value.length && typeof value[0] === 'object' && !Array.isArray(value[0])) {
schema[key] = [duckSchema(value[0])];
} else {
schema[key] = [];
}
} else {
schema[key] = null;
}
});
}
return schema;
}
function inherit(Child, Parent) {
Parent.prototype.constructor = Parent;
Child.prototype = new Parent();
Child.prototype.constructor = Child;
return Child;
}
function extend(target, extension) {
objectEach(extension, function(value, key) {
target[key] = value;
});
return target;
}
function deepExtend(target, extension) {
objectEach(extension, function(value, key) {
if (extension[key] && typeof extension[key] === 'object') {
if (!target[key]) {
if (Array.isArray(extension[key])) {
target[key] = [];
} else {
target[key] = {};
}
}
deepExtend(target[key], extension[key]);
} else {
target[key] = extension[key];
}
});
}
function deepClone(obj) {
if (typeof obj === 'object') {
return JSON.parse(JSON.stringify(obj));
}
return obj;
}
function clone(object) {
var result = {};
objectEach(object, (function(value, key) {
result[key] = value;
}));
return result;
}
function mixin(Base) {
for (var mixins = [],
$__1 = 1; $__1 < arguments.length; $__1++)
mixins[$__1 - 1] = arguments[$__1];
if (!Base.MIXINS) {
Base.MIXINS = [];
}
arrayEach(mixins, (function(mixin) {
Base.MIXINS.push(mixin.MIXIN_NAME);
objectEach(mixin, (function(value, key) {
if (Base.prototype[key] !== void 0) {
throw new Error(("Mixin conflict. Property '" + key + "' already exist and cannot be overwritten."));
}
if (typeof value === 'function') {
Base.prototype[key] = value;
} else {
var getter = function _getter(propertyName, initialValue) {
propertyName = '_' + propertyName;
var initValue = (function(value) {
if (Array.isArray(value) || isObject(value)) {
value = deepClone(value);
}
return value;
});
return function() {
if (this[propertyName] === void 0) {
this[propertyName] = initValue(initialValue);
}
return this[propertyName];
};
};
var setter = function _setter(propertyName) {
propertyName = '_' + propertyName;
return function(value) {
this[propertyName] = value;
};
};
Object.defineProperty(Base.prototype, key, {
get: getter(key, value),
set: setter(key),
configurable: true
});
}
}));
}));
return Base;
}
function isObjectEquals(object1, object2) {
return JSON.stringify(object1) === JSON.stringify(object2);
}
function isObject(obj) {
return Object.prototype.toString.call(obj) == '[object Object]';
}
function getPrototypeOf(obj) {
var prototype;
if (typeof obj.__proto__ == 'object') {
prototype = obj.__proto__;
} else {
var oldConstructor,
constructor = obj.constructor;
if (typeof obj.constructor == 'function') {
oldConstructor = constructor;
if (delete obj.constructor) {
constructor = obj.constructor;
obj.constructor = oldConstructor;
}
}
prototype = constructor ? constructor.prototype : null;
}
return prototype;
}
function defineGetter(object, property, value, options) {
options.value = value;
options.writable = options.writable !== false;
options.enumerable = options.enumerable !== false;
options.configurable = options.configurable !== false;
Object.defineProperty(object, property, options);
}
function objectEach(object, iteratee) {
for (var key in object) {
if (!object.hasOwnProperty || (object.hasOwnProperty && object.hasOwnProperty(key))) {
if (iteratee(object[key], key, object) === false) {
break;
}
}
}
return object;
}
function getProperty(object, name) {
var names = name.split('.');
var result = object;
objectEach(names, (function(name) {
result = result[name];
if (result === void 0) {
result = void 0;
return false;
}
}));
return result;
}
//#
},{"array":42}],51:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
columnFactory: {get: function() {
return columnFactory;
}},
__esModule: {value: true}
});
var $__object__;
var inherit = ($__object__ = require("object"), $__object__ && $__object__.__esModule && $__object__ || {default: $__object__}).inherit;
function columnFactory(GridSettings, conflictList) {
function ColumnSettings() {}
;
inherit(ColumnSettings, GridSettings);
for (var i = 0,
len = conflictList.length; i < len; i++) {
ColumnSettings.prototype[conflictList[i]] = void 0;
}
return ColumnSettings;
}
//#
},{"object":50}],52:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
toUpperCaseFirst: {get: function() {
return toUpperCaseFirst;
}},
startsWith: {get: function() {
return startsWith;
}},
endsWith: {get: function() {
return endsWith;
}},
equalsIgnoreCase: {get: function() {
return equalsIgnoreCase;
}},
randomString: {get: function() {
return randomString;
}},
isPercentValue: {get: function() {
return isPercentValue;
}},
substitute: {get: function() {
return substitute;
}},
padStart: {get: function() {
return padStart;
}},
__esModule: {value: true}
});
var $__mixed__,
$__number__;
var stringify = ($__mixed__ = require("mixed"), $__mixed__ && $__mixed__.__esModule && $__mixed__ || {default: $__mixed__}).stringify;
var rangeEach = ($__number__ = require("number"), $__number__ && $__number__.__esModule && $__number__ || {default: $__number__}).rangeEach;
function toUpperCaseFirst(string) {
return string[0].toUpperCase() + string.substr(1);
}
function startsWith(string, needle) {
var result = true;
rangeEach(needle.length - 1, (function(index) {
if (string.charAt(index) !== needle.charAt(index)) {
result = false;
return false;
}
}));
return result;
}
function endsWith(string, needle) {
var result = true;
var needleLength = needle.length - 1;
var stringLength = string.length - 1;
rangeEach(needleLength, (function(index) {
var stringIndex = stringLength - index;
var needleIndex = needleLength - index;
if (string.charAt(stringIndex) !== needle.charAt(needleIndex)) {
result = false;
return false;
}
}));
return result;
}
function equalsIgnoreCase() {
for (var strings = [],
$__2 = 0; $__2 < arguments.length; $__2++)
strings[$__2] = arguments[$__2];
var unique = [];
var length = strings.length;
while (length--) {
var string = stringify(strings[length]).toLowerCase();
if (unique.indexOf(string) === -1) {
unique.push(string);
}
}
return unique.length === 1;
}
function randomString() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}
return s4() + s4() + s4() + s4();
}
function isPercentValue(value) {
return /^([0-9][0-9]?\%$)|(^100\%$)/.test(value);
}
function substitute(template) {
var variables = arguments[1] !== (void 0) ? arguments[1] : {};
return (template + '').replace(/(?:\\)?\[([^\[\]]+)]/g, function(match, name) {
if (match.charAt(0) === '\\') {
return match.substr(1, match.length - 1);
}
return variables[name] === void 0 ? '' : variables[name];
});
}
function padStart(string, maxLength) {
var fillString = arguments[2] !== (void 0) ? arguments[2] : ' ';
string = string + '';
if (string.length >= maxLength) {
return string;
}
fillString = String(fillString);
var fillStringLength = fillString.length;
if (!fillStringLength) {
fillString = ' ';
}
var fillLen = maxLength - string.length;
var timesToRepeat = Math.ceil(fillLen / fillString.length);
var truncatedString = '';
rangeEach(timesToRepeat, (function(index) {
truncatedString += fillString;
}));
truncatedString = truncatedString.slice(0, fillLen);
return truncatedString + string;
}
;
//#
},{"mixed":48,"number":49}],53:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
KEY_CODES: {get: function() {
return KEY_CODES;
}},
isPrintableChar: {get: function() {
return isPrintableChar;
}},
isMetaKey: {get: function() {
return isMetaKey;
}},
isCtrlKey: {get: function() {
return isCtrlKey;
}},
isKey: {get: function() {
return isKey;
}},
__esModule: {value: true}
});
var $__array__;
var arrayEach = ($__array__ = require("array"), $__array__ && $__array__.__esModule && $__array__ || {default: $__array__}).arrayEach;
var KEY_CODES = {
MOUSE_LEFT: 1,
MOUSE_RIGHT: 3,
MOUSE_MIDDLE: 2,
BACKSPACE: 8,
COMMA: 188,
INSERT: 45,
DELETE: 46,
END: 35,
ENTER: 13,
ESCAPE: 27,
CONTROL_LEFT: 91,
COMMAND_LEFT: 17,
COMMAND_RIGHT: 93,
ALT: 18,
HOME: 36,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
SPACE: 32,
SHIFT: 16,
CAPS_LOCK: 20,
TAB: 9,
ARROW_RIGHT: 39,
ARROW_LEFT: 37,
ARROW_UP: 38,
ARROW_DOWN: 40,
F1: 112,
F2: 113,
F3: 114,
F4: 115,
F5: 116,
F6: 117,
F7: 118,
F8: 119,
F9: 120,
F10: 121,
F11: 122,
F12: 123,
A: 65,
X: 88,
C: 67,
V: 86
};
function isPrintableChar(keyCode) {
return ((keyCode == 32) || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 111) || (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222) || keyCode >= 226 || (keyCode >= 65 && keyCode <= 90));
}
function isMetaKey(keyCode) {
var metaKeys = [KEY_CODES.ARROW_DOWN, KEY_CODES.ARROW_UP, KEY_CODES.ARROW_LEFT, KEY_CODES.ARROW_RIGHT, KEY_CODES.HOME, KEY_CODES.END, KEY_CODES.DELETE, KEY_CODES.BACKSPACE, KEY_CODES.F1, KEY_CODES.F2, KEY_CODES.F3, KEY_CODES.F4, KEY_CODES.F5, KEY_CODES.F6, KEY_CODES.F7, KEY_CODES.F8, KEY_CODES.F9, KEY_CODES.F10, KEY_CODES.F11, KEY_CODES.F12, KEY_CODES.TAB, KEY_CODES.PAGE_DOWN, KEY_CODES.PAGE_UP, KEY_CODES.ENTER, KEY_CODES.ESCAPE, KEY_CODES.SHIFT, KEY_CODES.CAPS_LOCK, KEY_CODES.ALT];
return metaKeys.indexOf(keyCode) !== -1;
}
function isCtrlKey(keyCode) {
return [KEY_CODES.CONTROL_LEFT, 224, KEY_CODES.COMMAND_LEFT, KEY_CODES.COMMAND_RIGHT].indexOf(keyCode) !== -1;
}
function isKey(keyCode, baseCode) {
var keys = baseCode.split('|');
var result = false;
arrayEach(keys, function(key) {
if (keyCode === KEY_CODES[key]) {
result = true;
return false;
}
});
return result;
}
//#
},{"array":42}],54:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
localHooks: {get: function() {
return localHooks;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_array__,
$___46__46__47_helpers_47_object__;
var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach;
var defineGetter = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).defineGetter;
var MIXIN_NAME = 'localHooks';
var localHooks = {
_localHooks: Object.create(null),
addLocalHook: function(key, callback) {
if (!this._localHooks[key]) {
this._localHooks[key] = [];
}
this._localHooks[key].push(callback);
},
runLocalHooks: function(key) {
for (var params = [],
$__3 = 1; $__3 < arguments.length; $__3++)
params[$__3 - 1] = arguments[$__3];
var $__2 = this;
if (this._localHooks[key]) {
arrayEach(this._localHooks[key], (function(callback) {
return callback.apply($__2, params);
}));
}
},
clearLocalHooks: function() {
this._localHooks = {};
}
};
defineGetter(localHooks, 'MIXIN_NAME', MIXIN_NAME, {
writable: false,
enumerable: false
});
;
Handsontable.utils = Handsontable.utils || {};
Handsontable.utils.localHooks = localHooks;
//#
},{"helpers/array":42,"helpers/object":50}],55:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
MultiMap: {get: function() {
return MultiMap;
}},
__esModule: {value: true}
});
;
window.MultiMap = MultiMap;
function MultiMap() {
var map = {
arrayMap: [],
weakMap: new WeakMap()
};
return {
get: function(key) {
if (canBeAnArrayMapKey(key)) {
return map.arrayMap[key];
} else if (canBeAWeakMapKey(key)) {
return map.weakMap.get(key);
}
},
set: function(key, value) {
if (canBeAnArrayMapKey(key)) {
map.arrayMap[key] = value;
} else if (canBeAWeakMapKey(key)) {
map.weakMap.set(key, value);
} else {
throw new Error('Invalid key type');
}
},
delete: function(key) {
if (canBeAnArrayMapKey(key)) {
delete map.arrayMap[key];
} else if (canBeAWeakMapKey(key)) {
map.weakMap.delete(key);
}
}
};
function canBeAnArrayMapKey(obj) {
return obj !== null && !isNaNSymbol(obj) && (typeof obj == 'string' || typeof obj == 'number');
}
function canBeAWeakMapKey(obj) {
return obj !== null && (typeof obj == 'object' || typeof obj == 'function');
}
function isNaNSymbol(obj) {
return obj !== obj;
}
}
//#
},{}],56:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
Hooks: {get: function() {
return Hooks;
}},
__esModule: {value: true}
});
var $__helpers_47_array__,
$__helpers_47_object__;
var REGISTERED_HOOKS = ['afterCellMetaReset', 'afterChange', 'afterChangesObserved', 'afterContextMenuDefaultOptions', 'afterContextMenuHide', 'afterContextMenuShow', 'afterCopyLimit', 'afterCreateCol', 'afterCreateRow', 'afterDeselect', 'afterDestroy', 'afterDocumentKeyDown', 'afterGetCellMeta', 'afterGetColHeader', 'afterGetRowHeader', 'afterInit', 'afterLoadData', 'afterMomentumScroll', 'afterOnCellCornerMouseDown', 'afterOnCellMouseDown', 'afterOnCellMouseOver', 'afterRemoveCol', 'afterRemoveRow', 'afterRender', 'afterRenderer', 'afterScrollHorizontally', 'afterScrollVertically', 'afterSelection', 'afterSelectionByProp', 'afterSelectionEnd', 'afterSelectionEndByProp', 'afterSetCellMeta', 'afterUpdateSettings', 'afterValidate', 'beforeAutofill', 'beforeCellAlignment', 'beforeChange', 'beforeChangeRender', 'beforeDrawBorders', 'beforeGetCellMeta', 'beforeInit', 'beforeInitWalkontable', 'beforeKeyDown', 'beforeOnCellMouseDown', 'beforeRemoveCol', 'beforeRemoveRow', 'beforeRender', 'beforeSetRangeEnd', 'beforeTouchScroll', 'beforeValidate', 'construct', 'init', 'modifyCol', 'modifyColHeader', 'modifyColWidth', 'modifyRow', 'modifyRowHeader', 'modifyRowHeight', 'persistentStateLoad', 'persistentStateReset', 'persistentStateSave', 'beforeColumnSort', 'afterColumnSort', 'afterAutofillApplyValues', 'modifyCopyableRange', 'beforeColumnMove', 'afterColumnMove', 'beforeRowMove', 'afterRowMove', 'beforeColumnResize', 'afterColumnResize', 'beforeRowResize', 'afterRowResize', 'afterGetColumnHeaderRenderers', 'afterGetRowHeaderRenderers', 'beforeStretchingColumnWidth'];
var arrayEach = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}).arrayEach;
var objectEach = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}).objectEach;
var Hooks = function Hooks() {
this.globalBucket = this.createEmptyBucket();
};
($traceurRuntime.createClass)(Hooks, {
createEmptyBucket: function() {
var bucket = Object.create(null);
arrayEach(REGISTERED_HOOKS, (function(hook) {
return (bucket[hook] = []);
}));
return bucket;
},
getBucket: function() {
var context = arguments[0] !== (void 0) ? arguments[0] : null;
if (context) {
if (!context.pluginHookBucket) {
context.pluginHookBucket = this.createEmptyBucket();
}
return context.pluginHookBucket;
}
return this.globalBucket;
},
add: function(key, callback) {
var context = arguments[2] !== (void 0) ? arguments[2] : null;
var $__2 = this;
if (Array.isArray(callback)) {
arrayEach(callback, (function(c) {
return ($__2.add(key, c, context));
}));
} else {
var bucket = this.getBucket(context);
if (typeof bucket[key] === 'undefined') {
this.register(key);
bucket[key] = [];
}
callback.skip = false;
if (bucket[key].indexOf(callback) === -1) {
bucket[key].push(callback);
}
}
return this;
},
once: function(key, callback) {
var context = arguments[2] !== (void 0) ? arguments[2] : null;
var $__2 = this;
if (Array.isArray(callback)) {
arrayEach(callback, (function(c) {
return ($__2.once(key, c, context));
}));
} else {
callback.runOnce = true;
this.add(key, callback, context);
}
},
remove: function(key, callback) {
var context = arguments[2] !== (void 0) ? arguments[2] : null;
var bucket = this.getBucket(context);
if (typeof bucket[key] !== 'undefined') {
if (bucket[key].indexOf(callback) >= 0) {
callback.skip = true;
return true;
}
}
return false;
},
has: function(key) {
var context = arguments[1] !== (void 0) ? arguments[1] : null;
var bucket = this.getBucket(context);
return bucket[key] !== void 0 && bucket[key].length ? true : false;
},
run: function(context, key, p1, p2, p3, p4, p5, p6) {
{
var globalHandlers = this.globalBucket[key];
var index = -1;
var length = globalHandlers ? globalHandlers.length : 0;
if (length) {
while (++index < length) {
if (!globalHandlers[index] || globalHandlers[index].skip) {
continue;
}
var res = globalHandlers[index].call(context, p1, p2, p3, p4, p5, p6);
if (res !== void 0) {
p1 = res;
}
if (globalHandlers[index] && globalHandlers[index].runOnce) {
this.remove(key, globalHandlers[index]);
}
}
}
}
{
var localHandlers = this.getBucket(context)[key];
var index$__4 = -1;
var length$__5 = localHandlers ? localHandlers.length : 0;
if (length$__5) {
while (++index$__4 < length$__5) {
if (!localHandlers[index$__4] || localHandlers[index$__4].skip) {
continue;
}
var res$__6 = localHandlers[index$__4].call(context, p1, p2, p3, p4, p5, p6);
if (res$__6 !== void 0) {
p1 = res$__6;
}
if (localHandlers[index$__4] && localHandlers[index$__4].runOnce) {
this.remove(key, localHandlers[index$__4], context);
}
}
}
}
return p1;
},
destroy: function() {
var context = arguments[0] !== (void 0) ? arguments[0] : null;
objectEach(this.getBucket(context), (function(value, key, bucket) {
return (bucket[key].length = 0);
}));
},
register: function(key) {
if (!this.isRegistered(key)) {
REGISTERED_HOOKS.push(key);
}
},
deregister: function(key) {
if (this.isRegistered(key)) {
REGISTERED_HOOKS.splice(REGISTERED_HOOKS.indexOf(key), 1);
}
},
isRegistered: function(key) {
return REGISTERED_HOOKS.indexOf(key) >= 0;
},
getRegistered: function() {
return REGISTERED_HOOKS;
}
}, {});
;
Handsontable.utils = Handsontable.utils || {};
Handsontable.utils.Hooks = Hooks;
//#
},{"helpers/array":42,"helpers/object":50}],57:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
registerPlugin: {get: function() {
return registerPlugin;
}},
getPlugin: {get: function() {
return getPlugin;
}},
getRegistredPluginNames: {get: function() {
return getRegistredPluginNames;
}},
getPluginName: {get: function() {
return getPluginName;
}},
__esModule: {value: true}
});
var $__helpers_47_object__,
$__helpers_47_string__;
var objectEach = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_object__ && $__helpers_47_object__.__esModule && $__helpers_47_object__ || {default: $__helpers_47_object__}).objectEach;
var toUpperCaseFirst = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).toUpperCaseFirst;
var registeredPlugins = new WeakMap();
function registerPlugin(pluginName, PluginClass) {
pluginName = toUpperCaseFirst(pluginName);
Handsontable.plugins[pluginName] = PluginClass;
Handsontable.hooks.add('construct', function() {
var holder;
if (!registeredPlugins.has(this)) {
registeredPlugins.set(this, {});
}
holder = registeredPlugins.get(this);
if (!holder[pluginName]) {
holder[pluginName] = new PluginClass(this);
}
});
Handsontable.hooks.add('afterDestroy', function() {
if (registeredPlugins.has(this)) {
var pluginsHolder = registeredPlugins.get(this);
objectEach(pluginsHolder, (function(plugin) {
return plugin.destroy();
}));
registeredPlugins.delete(this);
}
});
}
function getPlugin(instance, pluginName) {
if (typeof pluginName != 'string') {
throw Error('Only strings can be passed as "plugin" parameter');
}
var _pluginName = toUpperCaseFirst(pluginName);
if (!registeredPlugins.has(instance) || !registeredPlugins.get(instance)[_pluginName]) {
return void 0;
}
return registeredPlugins.get(instance)[_pluginName];
}
function getRegistredPluginNames(hotInstance) {
return registeredPlugins.has(hotInstance) ? Object.keys(registeredPlugins.get(hotInstance)) : [];
}
function getPluginName(hotInstance, plugin) {
var pluginName = null;
if (registeredPlugins.has(hotInstance)) {
objectEach(registeredPlugins.get(hotInstance), (function(pluginInstance, name) {
if (pluginInstance === plugin) {
pluginName = name;
}
}));
}
return pluginName;
}
;
//#
},{"helpers/object":50,"helpers/string":52}],58:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
default: {get: function() {
return $__default;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_object__,
$___46__46__47_helpers_47_array__,
$___46__46__47_plugins__;
var $__0 = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}),
defineGetter = $__0.defineGetter,
objectEach = $__0.objectEach;
var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach;
var $__2 = ($___46__46__47_plugins__ = require("plugins"), $___46__46__47_plugins__ && $___46__46__47_plugins__.__esModule && $___46__46__47_plugins__ || {default: $___46__46__47_plugins__}),
getRegistredPluginNames = $__2.getRegistredPluginNames,
getPluginName = $__2.getPluginName;
var privatePool = new WeakMap();
var initializedPlugins = null;
var BasePlugin = function BasePlugin(hotInstance) {
var $__3 = this;
defineGetter(this, 'hot', hotInstance, {writable: false});
privatePool.set(this, {hooks: {}});
initializedPlugins = null;
this.pluginName = null;
this.pluginsInitializedCallbacks = [];
this.isPluginsReady = false;
this.enabled = false;
this.initialized = false;
this.hot.addHook('afterPluginsInitialized', (function() {
return $__3.onAfterPluginsInitialized();
}));
this.hot.addHook('afterUpdateSettings', (function() {
return $__3.onUpdateSettings();
}));
this.hot.addHook('beforeInit', (function() {
return $__3.init();
}));
};
($traceurRuntime.createClass)(BasePlugin, {
init: function() {
this.pluginName = getPluginName(this.hot, this);
if (this.isEnabled && this.isEnabled()) {
this.enablePlugin();
}
if (!initializedPlugins) {
initializedPlugins = getRegistredPluginNames(this.hot);
}
if (initializedPlugins.indexOf(this.pluginName) >= 0) {
initializedPlugins.splice(initializedPlugins.indexOf(this.pluginName), 1);
}
if (!initializedPlugins.length) {
this.hot.runHooks('afterPluginsInitialized');
}
this.initialized = true;
},
enablePlugin: function() {
this.enabled = true;
},
disablePlugin: function() {
if (this.eventManager) {
this.eventManager.clear();
}
this.clearHooks();
this.enabled = false;
},
addHook: function(name, callback) {
var hooks = privatePool.get(this).hooks[name] = (privatePool.get(this).hooks[name] || []);
this.hot.addHook(name, callback);
hooks.push(callback);
privatePool.get(this).hooks[name] = hooks;
},
removeHooks: function(name) {
var $__3 = this;
arrayEach(privatePool.get(this).hooks[name] || [], (function(callback) {
$__3.hot.removeHook(name, callback);
}));
},
clearHooks: function() {
var $__3 = this;
var hooks = privatePool.get(this).hooks;
objectEach(hooks, (function(callbacks, name) {
return $__3.removeHooks(name);
}));
hooks.length = 0;
},
callOnPluginsReady: function(callback) {
if (this.isPluginsReady) {
callback();
} else {
this.pluginsInitializedCallbacks.push(callback);
}
},
onAfterPluginsInitialized: function() {
arrayEach(this.pluginsInitializedCallbacks, (function(callback) {
return callback();
}));
this.pluginsInitializedCallbacks.length = 0;
this.isPluginsReady = true;
},
onUpdateSettings: function() {
if (this.isEnabled) {
if (this.enabled && !this.isEnabled()) {
this.disablePlugin();
}
if (!this.enabled && this.isEnabled()) {
this.enablePlugin();
}
if (this.enabled && this.isEnabled()) {
this.updatePlugin();
}
}
},
updatePlugin: function() {},
destroy: function() {
var $__3 = this;
if (this.eventManager) {
this.eventManager.destroy();
}
this.clearHooks();
objectEach(this, (function(value, property) {
if (property !== 'hot') {
$__3[property] = null;
}
}));
delete this.hot;
}
}, {});
var $__default = BasePlugin;
Handsontable.plugins.BasePlugin = BasePlugin;
//#
},{"helpers/array":42,"helpers/object":50,"plugins":57}],59:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
AutoColumnSize: {get: function() {
return AutoColumnSize;
}},
__esModule: {value: true}
});
var $___46__46__47__95_base__,
$___46__46__47__46__46__47_helpers_47_array__,
$___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_utils_47_ghostTable__,
$___46__46__47__46__46__47_helpers_47_object__,
$___46__46__47__46__46__47_helpers_47_number__,
$___46__46__47__46__46__47_plugins__,
$___46__46__47__46__46__47_utils_47_samplesGenerator__,
$___46__46__47__46__46__47_helpers_47_string__,
$___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__;
var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default;
var $__1 = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}),
arrayEach = $__1.arrayEach,
arrayFilter = $__1.arrayFilter;
var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
cancelAnimationFrame = $__2.cancelAnimationFrame,
requestAnimationFrame = $__2.requestAnimationFrame,
isVisible = $__2.isVisible;
var GhostTable = ($___46__46__47__46__46__47_utils_47_ghostTable__ = require("utils/ghostTable"), $___46__46__47__46__46__47_utils_47_ghostTable__ && $___46__46__47__46__46__47_utils_47_ghostTable__.__esModule && $___46__46__47__46__46__47_utils_47_ghostTable__ || {default: $___46__46__47__46__46__47_utils_47_ghostTable__}).GhostTable;
var $__4 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}),
isObject = $__4.isObject,
objectEach = $__4.objectEach;
var $__5 = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}),
valueAccordingPercent = $__5.valueAccordingPercent,
rangeEach = $__5.rangeEach;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var SamplesGenerator = ($___46__46__47__46__46__47_utils_47_samplesGenerator__ = require("utils/samplesGenerator"), $___46__46__47__46__46__47_utils_47_samplesGenerator__ && $___46__46__47__46__46__47_utils_47_samplesGenerator__.__esModule && $___46__46__47__46__46__47_utils_47_samplesGenerator__ || {default: $___46__46__47__46__46__47_utils_47_samplesGenerator__}).SamplesGenerator;
var isPercentValue = ($___46__46__47__46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47__46__46__47_helpers_47_string__ && $___46__46__47__46__46__47_helpers_47_string__.__esModule && $___46__46__47__46__46__47_helpers_47_string__ || {default: $___46__46__47__46__46__47_helpers_47_string__}).isPercentValue;
var WalkontableViewportColumnsCalculator = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ = require("3rdparty/walkontable/src/calculator/viewportColumns"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_calculator_47_viewportColumns__}).WalkontableViewportColumnsCalculator;
var AutoColumnSize = function AutoColumnSize(hotInstance) {
var $__10 = this;
$traceurRuntime.superConstructor($AutoColumnSize).call(this, hotInstance);
this.widths = [];
this.ghostTable = new GhostTable(this.hot);
this.samplesGenerator = new SamplesGenerator((function(row, col) {
return $__10.hot.getDataAtCell(row, col);
}));
this.firstCalculation = true;
this.inProgress = false;
this.addHook('beforeColumnResize', (function(col, size, isDblClick) {
return $__10.onBeforeColumnResize(col, size, isDblClick);
}));
};
var $AutoColumnSize = AutoColumnSize;
($traceurRuntime.createClass)(AutoColumnSize, {
isEnabled: function() {
return this.hot.getSettings().autoColumnSize !== false && !this.hot.getSettings().colWidths;
},
enablePlugin: function() {
var $__10 = this;
if (this.enabled) {
return;
}
var setting = this.hot.getSettings().autoColumnSize;
var samplingRatio = setting && setting.hasOwnProperty('samplingRatio') ? this.hot.getSettings().autoColumnSize.samplingRatio : void 0;
if (samplingRatio && !isNaN(samplingRatio)) {
this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10);
}
this.addHook('afterLoadData', (function() {
return $__10.onAfterLoadData();
}));
this.addHook('beforeChange', (function(changes) {
return $__10.onBeforeChange(changes);
}));
this.addHook('beforeRender', (function(force) {
return $__10.onBeforeRender(force);
}));
this.addHook('modifyColWidth', (function(width, col) {
return $__10.getColumnWidth(col, width);
}));
$traceurRuntime.superGet(this, $AutoColumnSize.prototype, "enablePlugin").call(this);
},
disablePlugin: function() {
$traceurRuntime.superGet(this, $AutoColumnSize.prototype, "disablePlugin").call(this);
},
calculateColumnsWidth: function() {
var colRange = arguments[0] !== (void 0) ? arguments[0] : {
from: 0,
to: this.hot.countCols() - 1
};
var rowRange = arguments[1] !== (void 0) ? arguments[1] : {
from: 0,
to: this.hot.countRows() - 1
};
var force = arguments[2] !== (void 0) ? arguments[2] : false;
var $__10 = this;
if (typeof colRange === 'number') {
colRange = {
from: colRange,
to: colRange
};
}
if (typeof rowRange === 'number') {
rowRange = {
from: rowRange,
to: rowRange
};
}
rangeEach(colRange.from, colRange.to, (function(col) {
if (force || ($__10.widths[col] === void 0 && !$__10.hot._getColWidthFromSettings(col))) {
var samples = $__10.samplesGenerator.generateColumnSamples(col, rowRange);
samples.forEach((function(sample, col) {
return $__10.ghostTable.addColumn(col, sample);
}));
}
}));
if (this.ghostTable.columns.length) {
this.ghostTable.getWidths((function(col, width) {
return $__10.widths[col] = width;
}));
this.ghostTable.clean();
}
},
calculateAllColumnsWidth: function() {
var rowRange = arguments[0] !== (void 0) ? arguments[0] : {
from: 0,
to: this.hot.countRows() - 1
};
var $__10 = this;
var current = 0;
var length = this.hot.countCols() - 1;
var timer = null;
this.inProgress = true;
var loop = (function() {
if (!$__10.hot) {
cancelAnimationFrame(timer);
$__10.inProgress = false;
return;
}
$__10.calculateColumnsWidth({
from: current,
to: Math.min(current + $AutoColumnSize.CALCULATION_STEP, length)
}, rowRange);
current = current + $AutoColumnSize.CALCULATION_STEP + 1;
if (current < length) {
timer = requestAnimationFrame(loop);
} else {
cancelAnimationFrame(timer);
$__10.inProgress = false;
$__10.hot.view.wt.wtOverlays.adjustElementsSize(true);
if ($__10.hot.view.wt.wtOverlays.leftOverlay.needFullRender) {
$__10.hot.view.wt.wtOverlays.leftOverlay.clone.draw();
}
}
});
if (this.firstCalculation && this.getSyncCalculationLimit()) {
this.calculateColumnsWidth({
from: 0,
to: this.getSyncCalculationLimit()
}, rowRange);
this.firstCalculation = false;
current = this.getSyncCalculationLimit() + 1;
}
if (current < length) {
loop();
} else {
this.inProgress = false;
}
},
recalculateAllColumnsWidth: function() {
if (this.hot.view && isVisible(this.hot.view.wt.wtTable.TABLE)) {
this.clearCache();
this.calculateAllColumnsWidth();
}
},
getSyncCalculationLimit: function() {
var limit = $AutoColumnSize.SYNC_CALCULATION_LIMIT;
var colsLimit = this.hot.countCols() - 1;
if (isObject(this.hot.getSettings().autoColumnSize)) {
limit = this.hot.getSettings().autoColumnSize.syncLimit;
if (isPercentValue(limit)) {
limit = valueAccordingPercent(colsLimit, limit);
} else {
limit = limit >> 0;
}
}
return Math.min(limit, colsLimit);
},
getColumnWidth: function(col) {
var defaultWidth = arguments[1];
var keepMinimum = arguments[2] !== (void 0) ? arguments[2] : true;
var width = defaultWidth;
if (width === void 0) {
width = this.widths[col];
if (keepMinimum && typeof width === 'number') {
width = Math.max(width, WalkontableViewportColumnsCalculator.DEFAULT_WIDTH);
}
}
return width;
},
getFirstVisibleColumn: function() {
var wot = this.hot.view.wt;
if (wot.wtViewport.columnsVisibleCalculator) {
return wot.wtTable.getFirstVisibleColumn();
}
if (wot.wtViewport.columnsRenderCalculator) {
return wot.wtTable.getFirstRenderedColumn();
}
return -1;
},
getLastVisibleColumn: function() {
var wot = this.hot.view.wt;
if (wot.wtViewport.columnsVisibleCalculator) {
return wot.wtTable.getLastVisibleColumn();
}
if (wot.wtViewport.columnsRenderCalculator) {
return wot.wtTable.getLastRenderedColumn();
}
return -1;
},
clearCache: function() {
this.widths.length = 0;
},
isNeedRecalculate: function() {
return arrayFilter(this.widths, (function(item) {
return (item === void 0);
})).length ? true : false;
},
onBeforeRender: function() {
var force = this.hot.renderCall;
this.calculateColumnsWidth({
from: this.getFirstVisibleColumn(),
to: this.getLastVisibleColumn()
}, void 0, force);
if (this.isNeedRecalculate() && !this.inProgress) {
this.calculateAllColumnsWidth();
}
},
onAfterLoadData: function() {
var $__10 = this;
if (this.hot.view) {
this.recalculateAllColumnsWidth();
} else {
setTimeout((function() {
if ($__10.hot) {
$__10.recalculateAllColumnsWidth();
}
}), 0);
}
},
onBeforeChange: function(changes) {
var $__10 = this;
arrayEach(changes, (function(data) {
return $__10.widths[data[1]] = void 0;
}));
},
onBeforeColumnResize: function(col, size, isDblClick) {
if (isDblClick) {
this.calculateColumnsWidth(col, void 0, true);
size = this.getColumnWidth(col, void 0, false);
}
return size;
},
destroy: function() {
this.ghostTable.clean();
$traceurRuntime.superGet(this, $AutoColumnSize.prototype, "destroy").call(this);
}
}, {
get CALCULATION_STEP() {
return 50;
},
get SYNC_CALCULATION_LIMIT() {
return 50;
}
}, BasePlugin);
;
registerPlugin('autoColumnSize', AutoColumnSize);
//#
},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"_base":58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,"plugins":57,"utils/ghostTable":98,"utils/samplesGenerator":99}],60:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
AutoRowSize: {get: function() {
return AutoRowSize;
}},
__esModule: {value: true}
});
var $___46__46__47__95_base__,
$___46__46__47__46__46__47_helpers_47_array__,
$___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_utils_47_ghostTable__,
$___46__46__47__46__46__47_helpers_47_object__,
$___46__46__47__46__46__47_helpers_47_number__,
$___46__46__47__46__46__47_plugins__,
$___46__46__47__46__46__47_utils_47_samplesGenerator__,
$___46__46__47__46__46__47_helpers_47_string__;
var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default;
var $__1 = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}),
arrayEach = $__1.arrayEach,
arrayFilter = $__1.arrayFilter;
var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
cancelAnimationFrame = $__2.cancelAnimationFrame,
requestAnimationFrame = $__2.requestAnimationFrame,
isVisible = $__2.isVisible;
var GhostTable = ($___46__46__47__46__46__47_utils_47_ghostTable__ = require("utils/ghostTable"), $___46__46__47__46__46__47_utils_47_ghostTable__ && $___46__46__47__46__46__47_utils_47_ghostTable__.__esModule && $___46__46__47__46__46__47_utils_47_ghostTable__ || {default: $___46__46__47__46__46__47_utils_47_ghostTable__}).GhostTable;
var $__4 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}),
isObject = $__4.isObject,
objectEach = $__4.objectEach;
var $__5 = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}),
valueAccordingPercent = $__5.valueAccordingPercent,
rangeEach = $__5.rangeEach;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var SamplesGenerator = ($___46__46__47__46__46__47_utils_47_samplesGenerator__ = require("utils/samplesGenerator"), $___46__46__47__46__46__47_utils_47_samplesGenerator__ && $___46__46__47__46__46__47_utils_47_samplesGenerator__.__esModule && $___46__46__47__46__46__47_utils_47_samplesGenerator__ || {default: $___46__46__47__46__46__47_utils_47_samplesGenerator__}).SamplesGenerator;
var isPercentValue = ($___46__46__47__46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47__46__46__47_helpers_47_string__ && $___46__46__47__46__46__47_helpers_47_string__.__esModule && $___46__46__47__46__46__47_helpers_47_string__ || {default: $___46__46__47__46__46__47_helpers_47_string__}).isPercentValue;
var AutoRowSize = function AutoRowSize(hotInstance) {
var $__9 = this;
$traceurRuntime.superConstructor($AutoRowSize).call(this, hotInstance);
this.heights = [];
this.ghostTable = new GhostTable(this.hot);
this.samplesGenerator = new SamplesGenerator((function(row, col) {
return $__9.hot.getDataAtCell(row, col);
}));
this.firstCalculation = true;
this.inProgress = false;
this.addHook('beforeRowResize', (function(row, size, isDblClick) {
return $__9.onBeforeRowResize(row, size, isDblClick);
}));
};
var $AutoRowSize = AutoRowSize;
($traceurRuntime.createClass)(AutoRowSize, {
isEnabled: function() {
return this.hot.getSettings().autoRowSize === true || isObject(this.hot.getSettings().autoRowSize);
},
enablePlugin: function() {
var $__9 = this;
if (this.enabled) {
return;
}
var setting = this.hot.getSettings().autoRowSize;
var samplingRatio = setting && setting.hasOwnProperty('samplingRatio') ? this.hot.getSettings().autoRowSize.samplingRatio : void 0;
if (samplingRatio && !isNaN(samplingRatio)) {
this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10);
}
this.addHook('afterLoadData', (function() {
return $__9.onAfterLoadData();
}));
this.addHook('beforeChange', (function(changes) {
return $__9.onBeforeChange(changes);
}));
this.addHook('beforeColumnMove', (function() {
return $__9.recalculateAllRowsHeight();
}));
this.addHook('beforeColumnResize', (function() {
return $__9.recalculateAllRowsHeight();
}));
this.addHook('beforeColumnSort', (function() {
return $__9.clearCache();
}));
this.addHook('beforeRender', (function(force) {
return $__9.onBeforeRender(force);
}));
this.addHook('beforeRowMove', (function(rowStart, rowEnd) {
return $__9.onBeforeRowMove(rowStart, rowEnd);
}));
this.addHook('modifyRowHeight', (function(height, row) {
return $__9.getRowHeight(row, height);
}));
$traceurRuntime.superGet(this, $AutoRowSize.prototype, "enablePlugin").call(this);
},
disablePlugin: function() {
$traceurRuntime.superGet(this, $AutoRowSize.prototype, "disablePlugin").call(this);
},
calculateRowsHeight: function() {
var rowRange = arguments[0] !== (void 0) ? arguments[0] : {
from: 0,
to: this.hot.countRows() - 1
};
var colRange = arguments[1] !== (void 0) ? arguments[1] : {
from: 0,
to: this.hot.countCols() - 1
};
var force = arguments[2] !== (void 0) ? arguments[2] : false;
var $__9 = this;
if (typeof rowRange === 'number') {
rowRange = {
from: rowRange,
to: rowRange
};
}
if (typeof colRange === 'number') {
colRange = {
from: colRange,
to: colRange
};
}
rangeEach(rowRange.from, rowRange.to, (function(row) {
if (force || $__9.heights[row] === void 0) {
var samples = $__9.samplesGenerator.generateRowSamples(row, colRange);
samples.forEach((function(sample, row) {
return $__9.ghostTable.addRow(row, sample);
}));
}
}));
if (this.ghostTable.rows.length) {
this.ghostTable.getHeights((function(row, height) {
return $__9.heights[row] = height;
}));
this.ghostTable.clean();
}
},
calculateAllRowsHeight: function() {
var colRange = arguments[0] !== (void 0) ? arguments[0] : {
from: 0,
to: this.hot.countCols() - 1
};
var $__9 = this;
var current = 0;
var length = this.hot.countRows() - 1;
var timer = null;
this.inProgress = true;
var loop = (function() {
if (!$__9.hot) {
cancelAnimationFrame(timer);
$__9.inProgress = false;
return;
}
$__9.calculateRowsHeight({
from: current,
to: Math.min(current + $AutoRowSize.CALCULATION_STEP, length)
}, colRange);
current = current + $AutoRowSize.CALCULATION_STEP + 1;
if (current < length) {
timer = requestAnimationFrame(loop);
} else {
cancelAnimationFrame(timer);
$__9.inProgress = false;
$__9.hot.view.wt.wtOverlays.adjustElementsSize(true);
if ($__9.hot.view.wt.wtOverlays.leftOverlay.needFullRender) {
$__9.hot.view.wt.wtOverlays.leftOverlay.clone.draw();
}
}
});
if (this.firstCalculation && this.getSyncCalculationLimit()) {
this.calculateRowsHeight({
from: 0,
to: this.getSyncCalculationLimit()
}, colRange);
this.firstCalculation = false;
current = this.getSyncCalculationLimit() + 1;
}
if (current < length) {
loop();
} else {
this.inProgress = false;
}
},
recalculateAllRowsHeight: function() {
if (isVisible(this.hot.view.wt.wtTable.TABLE)) {
this.clearCache();
this.calculateAllRowsHeight();
}
},
getSyncCalculationLimit: function() {
var limit = $AutoRowSize.SYNC_CALCULATION_LIMIT;
var rowsLimit = this.hot.countRows() - 1;
if (isObject(this.hot.getSettings().autoRowSize)) {
limit = this.hot.getSettings().autoRowSize.syncLimit;
if (isPercentValue(limit)) {
limit = valueAccordingPercent(rowsLimit, limit);
} else {
limit = limit >> 0;
}
}
return Math.min(limit, rowsLimit);
},
getRowHeight: function(row) {
var defaultHeight = arguments[1];
var height = defaultHeight;
if (this.heights[row] !== void 0 && this.heights[row] > (defaultHeight || 0)) {
height = this.heights[row];
}
return height;
},
getFirstVisibleRow: function() {
var wot = this.hot.view.wt;
if (wot.wtViewport.rowsVisibleCalculator) {
return wot.wtTable.getFirstVisibleRow();
}
if (wot.wtViewport.rowsRenderCalculator) {
return wot.wtTable.getFirstRenderedRow();
}
return -1;
},
getLastVisibleRow: function() {
var wot = this.hot.view.wt;
if (wot.wtViewport.rowsVisibleCalculator) {
return wot.wtTable.getLastVisibleRow();
}
if (wot.wtViewport.rowsRenderCalculator) {
return wot.wtTable.getLastRenderedRow();
}
return -1;
},
clearCache: function() {
this.heights.length = 0;
},
clearCacheByRange: function(range) {
var $__9 = this;
if (typeof range === 'number') {
range = {
from: range,
to: range
};
}
rangeEach(Math.min(range.from, range.to), Math.max(range.from, range.to), (function(row) {
return $__9.heights[row] = void 0;
}));
},
isNeedRecalculate: function() {
return arrayFilter(this.heights, (function(item) {
return (item === void 0);
})).length ? true : false;
},
onBeforeRender: function() {
var force = this.hot.renderCall;
this.calculateRowsHeight({
from: this.getFirstVisibleRow(),
to: this.getLastVisibleRow()
}, void 0, force);
var fixedRowsBottom = this.hot.getSettings().fixedRowsBottom;
if (fixedRowsBottom) {
var totalRows = this.hot.countRows() - 1;
this.calculateRowsHeight({
from: totalRows - fixedRowsBottom,
to: totalRows
});
}
if (this.isNeedRecalculate() && !this.inProgress) {
this.calculateAllRowsHeight();
}
},
onBeforeRowMove: function(from, to) {
this.clearCacheByRange({
from: from,
to: to
});
this.calculateAllRowsHeight();
},
onBeforeRowResize: function(row, size, isDblClick) {
if (isDblClick) {
this.calculateRowsHeight(row, void 0, true);
size = this.getRowHeight(row);
}
return size;
},
onAfterLoadData: function() {
var $__9 = this;
if (this.hot.view) {
this.recalculateAllRowsHeight();
} else {
setTimeout((function() {
if ($__9.hot) {
$__9.recalculateAllRowsHeight();
}
}), 0);
}
},
onBeforeChange: function(changes) {
var range = null;
if (changes.length === 1) {
range = changes[0][0];
} else if (changes.length > 1) {
range = {
from: changes[0][0],
to: changes[changes.length - 1][0]
};
}
if (range !== null) {
this.clearCacheByRange(range);
}
},
destroy: function() {
this.ghostTable.clean();
$traceurRuntime.superGet(this, $AutoRowSize.prototype, "destroy").call(this);
}
}, {
get CALCULATION_STEP() {
return 50;
},
get SYNC_CALCULATION_LIMIT() {
return 500;
}
}, BasePlugin);
;
registerPlugin('autoRowSize', AutoRowSize);
//#
},{"_base":58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,"plugins":57,"utils/ghostTable":98,"utils/samplesGenerator":99}],61:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
Autofill: {get: function() {
return Autofill;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_eventManager__,
$___46__46__47__46__46__47_plugins__,
$___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
offset = $__0.offset,
outerHeight = $__0.outerHeight,
outerWidth = $__0.outerWidth;
var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords;
;
function getDeltas(start, end, data, direction) {
var rlength = data.length,
clength = data ? data[0].length : 0,
deltas = [],
arr = [],
diffRow,
diffCol,
startValue,
endValue,
delta;
diffRow = end.row - start.row;
diffCol = end.col - start.col;
if (['down', 'up'].indexOf(direction) !== -1) {
for (var col = 0; col <= diffCol; col++) {
startValue = parseInt(data[0][col], 10);
endValue = parseInt(data[rlength - 1][col], 10);
delta = (direction === 'down' ? (endValue - startValue) : (startValue - endValue)) / (rlength - 1) || 0;
arr.push(delta);
}
deltas.push(arr);
}
if (['right', 'left'].indexOf(direction) !== -1) {
for (var row = 0; row <= diffRow; row++) {
startValue = parseInt(data[row][0], 10);
endValue = parseInt(data[row][clength - 1], 10);
delta = (direction === 'right' ? (endValue - startValue) : (startValue - endValue)) / (clength - 1) || 0;
arr = [];
arr.push(delta);
deltas.push(arr);
}
}
return deltas;
}
function Autofill(instance) {
var _this = this,
mouseDownOnCellCorner = false,
wtOnCellCornerMouseDown,
wtOnCellMouseOver,
eventManager;
this.instance = instance;
this.addingStarted = false;
eventManager = eventManagerObject(instance);
function mouseUpCallback(event) {
if (!instance.autofill) {
return true;
}
if (instance.autofill.handle && instance.autofill.handle.isDragged) {
if (instance.autofill.handle.isDragged > 1) {
instance.autofill.apply();
}
instance.autofill.handle.isDragged = 0;
mouseDownOnCellCorner = false;
}
}
function mouseMoveCallback(event) {
var tableBottom,
tableRight;
if (!_this.instance.autofill) {
return false;
}
tableBottom = offset(_this.instance.table).top - (window.pageYOffset || document.documentElement.scrollTop) + outerHeight(_this.instance.table);
tableRight = offset(_this.instance.table).left - (window.pageXOffset || document.documentElement.scrollLeft) + outerWidth(_this.instance.table);
if (_this.addingStarted === false && _this.instance.autofill.handle.isDragged > 0 && event.clientY > tableBottom && event.clientX <= tableRight) {
_this.instance.mouseDragOutside = true;
_this.addingStarted = true;
} else {
_this.instance.mouseDragOutside = false;
}
if (_this.instance.mouseDragOutside) {
setTimeout(function() {
_this.addingStarted = false;
_this.instance.alter('insert_row');
}, 200);
}
}
eventManager.addEventListener(document, 'mouseup', mouseUpCallback);
eventManager.addEventListener(document, 'mousemove', mouseMoveCallback);
wtOnCellCornerMouseDown = this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown;
this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown = function(event) {
instance.autofill.handle.isDragged = 1;
mouseDownOnCellCorner = true;
wtOnCellCornerMouseDown(event);
};
wtOnCellMouseOver = this.instance.view.wt.wtSettings.settings.onCellMouseOver;
this.instance.view.wt.wtSettings.settings.onCellMouseOver = function(event, coords, TD, wt) {
if (instance.autofill && mouseDownOnCellCorner && !instance.view.isMouseDown() && instance.autofill.handle && instance.autofill.handle.isDragged) {
instance.autofill.handle.isDragged++;
instance.autofill.showBorder(coords);
instance.autofill.checkIfNewRowNeeded();
}
wtOnCellMouseOver(event, coords, TD, wt);
};
this.instance.view.wt.wtSettings.settings.onCellCornerDblClick = function() {
instance.autofill.selectAdjacent();
};
}
Autofill.prototype.init = function() {
this.handle = {};
};
Autofill.prototype.disable = function() {
this.handle.disabled = true;
};
Autofill.prototype.selectAdjacent = function() {
var select,
data,
r,
maxR,
c;
if (this.instance.selection.isMultiple()) {
select = this.instance.view.wt.selections.area.getCorners();
} else {
select = this.instance.view.wt.selections.current.getCorners();
}
data = this.instance.getData();
rows: for (r = select[2] + 1; r < this.instance.countRows(); r++) {
for (c = select[1]; c <= select[3]; c++) {
if (data[r][c]) {
break rows;
}
}
if (!!data[r][select[1] - 1] || !!data[r][select[3] + 1]) {
maxR = r;
}
}
if (maxR) {
this.instance.view.wt.selections.fill.clear();
this.instance.view.wt.selections.fill.add(new WalkontableCellCoords(select[0], select[1]));
this.instance.view.wt.selections.fill.add(new WalkontableCellCoords(maxR, select[3]));
this.apply();
}
};
Autofill.prototype.apply = function() {
var drag,
select,
start,
end,
_data,
direction,
deltas,
selRange;
this.handle.isDragged = 0;
if (this.instance.view.wt.selections.fill.isEmpty()) {
return;
}
drag = this.instance.view.wt.selections.fill.getCorners();
this.instance.view.wt.selections.fill.clear();
if (this.instance.selection.isMultiple()) {
select = this.instance.view.wt.selections.area.getCorners();
} else {
select = this.instance.view.wt.selections.current.getCorners();
}
Handsontable.hooks.run(this.instance, 'afterAutofillApplyValues', select, drag);
if (drag[0] === select[0] && drag[1] < select[1]) {
direction = 'left';
start = new WalkontableCellCoords(drag[0], drag[1]);
end = new WalkontableCellCoords(drag[2], select[1] - 1);
} else if (drag[0] === select[0] && drag[3] > select[3]) {
direction = 'right';
start = new WalkontableCellCoords(drag[0], select[3] + 1);
end = new WalkontableCellCoords(drag[2], drag[3]);
} else if (drag[0] < select[0] && drag[1] === select[1]) {
direction = 'up';
start = new WalkontableCellCoords(drag[0], drag[1]);
end = new WalkontableCellCoords(select[0] - 1, drag[3]);
} else if (drag[2] > select[2] && drag[1] === select[1]) {
direction = 'down';
start = new WalkontableCellCoords(select[2] + 1, drag[1]);
end = new WalkontableCellCoords(drag[2], drag[3]);
}
if (start && start.row > -1 && start.col > -1) {
selRange = {
from: this.instance.getSelectedRange().from,
to: this.instance.getSelectedRange().to
};
_data = this.instance.getData(selRange.from.row, selRange.from.col, selRange.to.row, selRange.to.col);
deltas = getDeltas(start, end, _data, direction);
Handsontable.hooks.run(this.instance, 'beforeAutofill', start, end, _data);
this.instance.populateFromArray(start.row, start.col, _data, end.row, end.col, 'autofill', null, direction, deltas);
this.instance.selection.setRangeStart(new WalkontableCellCoords(drag[0], drag[1]));
this.instance.selection.setRangeEnd(new WalkontableCellCoords(drag[2], drag[3]));
} else {
this.instance.selection.refreshBorders();
}
};
Autofill.prototype.showBorder = function(coords) {
var topLeft = this.instance.getSelectedRange().getTopLeftCorner(),
bottomRight = this.instance.getSelectedRange().getBottomRightCorner();
if (this.instance.getSettings().fillHandle !== 'horizontal' && (bottomRight.row < coords.row || topLeft.row > coords.row)) {
coords = new WalkontableCellCoords(coords.row, bottomRight.col);
} else if (this.instance.getSettings().fillHandle !== 'vertical') {
coords = new WalkontableCellCoords(bottomRight.row, coords.col);
} else {
return;
}
this.instance.view.wt.selections.fill.clear();
this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().from);
this.instance.view.wt.selections.fill.add(this.instance.getSelectedRange().to);
this.instance.view.wt.selections.fill.add(coords);
this.instance.view.render();
};
Autofill.prototype.checkIfNewRowNeeded = function() {
var fillCorners,
selection,
tableRows = this.instance.countRows(),
that = this;
if (this.instance.view.wt.selections.fill.cellRange && this.addingStarted === false) {
selection = this.instance.getSelected();
fillCorners = this.instance.view.wt.selections.fill.getCorners();
if (selection[2] < tableRows - 1 && fillCorners[2] === tableRows - 1) {
this.addingStarted = true;
this.instance._registerTimeout(setTimeout(function() {
that.instance.alter('insert_row');
that.addingStarted = false;
}, 200));
}
}
};
Handsontable.hooks.add('afterInit', function() {
var autofill = new Autofill(this);
if (typeof this.getSettings().fillHandle !== 'undefined') {
if (autofill.handle && this.getSettings().fillHandle === false) {
autofill.disable();
} else if (!autofill.handle && this.getSettings().fillHandle !== false) {
this.autofill = autofill;
this.autofill.init();
}
}
});
Handsontable.Autofill = Autofill;
//#
},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"plugins":57}],62:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
ColumnSorting: {get: function() {
return ColumnSorting;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_helpers_47_array__,
$___46__46__47__46__46__47_eventManager__,
$___46__46__47__95_base__,
$___46__46__47__46__46__47_plugins__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
closest = $__0.closest,
hasClass = $__0.hasClass,
index = $__0.index,
removeClass = $__0.removeClass;
var $__1 = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}),
arrayEach = $__1.arrayEach,
arrayMap = $__1.arrayMap,
arrayReduce = $__1.arrayReduce;
var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager;
var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
Handsontable.hooks.register('beforeColumnSort');
Handsontable.hooks.register('afterColumnSort');
var ColumnSorting = function ColumnSorting(hotInstance) {
$traceurRuntime.superConstructor($ColumnSorting).call(this, hotInstance);
this.sortIndicators = [];
};
var $ColumnSorting = ColumnSorting;
($traceurRuntime.createClass)(ColumnSorting, {
isEnabled: function() {
return !!(this.hot.getSettings().columnSorting);
},
enablePlugin: function() {
var $__5 = this;
if (this.enabled) {
return;
}
var _this = this;
this.hot.sortIndex = [];
this.hot.sort = function() {
var args = Array.prototype.slice.call(arguments);
return _this.sortByColumn.apply(_this, args);
};
if (typeof this.hot.getSettings().observeChanges === 'undefined') {
this.enableObserveChangesPlugin();
}
this.bindColumnSortingAfterClick();
this.addHook('afterTrimRow', (function(row) {
return $__5.sort();
}));
this.addHook('afterUntrimRow', (function(row) {
return $__5.sort();
}));
this.addHook('modifyRow', (function(row) {
return $__5.translateRow(row);
}));
this.addHook('afterUpdateSettings', (function() {
return $__5.onAfterUpdateSettings();
}));
this.addHook('afterGetColHeader', (function(col, TH) {
return $__5.getColHeader(col, TH);
}));
this.addHook('afterCreateRow', function() {
_this.afterCreateRow.apply(_this, arguments);
});
this.addHook('afterRemoveRow', function() {
_this.afterRemoveRow.apply(_this, arguments);
});
this.addHook('afterInit', (function() {
return $__5.sortBySettings();
}));
this.addHook('afterLoadData', (function() {
$__5.hot.sortIndex = [];
if ($__5.hot.view) {
$__5.sortBySettings();
}
}));
if (this.hot.view) {
this.sortBySettings();
}
$traceurRuntime.superGet(this, $ColumnSorting.prototype, "enablePlugin").call(this);
},
disablePlugin: function() {
this.hot.sort = void 0;
$traceurRuntime.superGet(this, $ColumnSorting.prototype, "disablePlugin").call(this);
},
onAfterUpdateSettings: function() {
this.sortBySettings();
},
sortBySettings: function() {
var sortingSettings = this.hot.getSettings().columnSorting;
var loadedSortingState = this.loadSortingState();
var sortingColumn;
var sortingOrder;
if (typeof loadedSortingState === 'undefined') {
sortingColumn = sortingSettings.column;
sortingOrder = sortingSettings.sortOrder;
} else {
sortingColumn = loadedSortingState.sortColumn;
sortingOrder = loadedSortingState.sortOrder;
}
if (typeof sortingColumn === 'number') {
this.sortByColumn(sortingColumn, sortingOrder);
}
},
setSortingColumn: function(col, order) {
if (typeof col == 'undefined') {
this.hot.sortColumn = void 0;
this.hot.sortOrder = void 0;
return;
} else if (this.hot.sortColumn === col && typeof order == 'undefined') {
if (this.hot.sortOrder === false) {
this.hot.sortOrder = void 0;
} else {
this.hot.sortOrder = !this.hot.sortOrder;
}
} else {
this.hot.sortOrder = typeof order === 'undefined' ? true : order;
}
this.hot.sortColumn = col;
},
sortByColumn: function(col, order) {
this.setSortingColumn(col, order);
if (typeof this.hot.sortColumn == 'undefined') {
return;
}
var allowSorting = Handsontable.hooks.run(this.hot, 'beforeColumnSort', this.hot.sortColumn, this.hot.sortOrder);
if (allowSorting !== false) {
this.sort();
}
this.updateSortIndicator();
this.hot.render();
this.saveSortingState();
Handsontable.hooks.run(this.hot, 'afterColumnSort', this.hot.sortColumn, this.hot.sortOrder);
},
saveSortingState: function() {
var sortingState = {};
if (typeof this.hot.sortColumn != 'undefined') {
sortingState.sortColumn = this.hot.sortColumn;
}
if (typeof this.hot.sortOrder != 'undefined') {
sortingState.sortOrder = this.hot.sortOrder;
}
if (sortingState.hasOwnProperty('sortColumn') || sortingState.hasOwnProperty('sortOrder')) {
Handsontable.hooks.run(this.hot, 'persistentStateSave', 'columnSorting', sortingState);
}
},
loadSortingState: function() {
var storedState = {};
Handsontable.hooks.run(this.hot, 'persistentStateLoad', 'columnSorting', storedState);
return storedState.value;
},
bindColumnSortingAfterClick: function() {
if (this.bindedSortEvent) {
return;
}
var eventManager = eventManagerObject(this.hot),
_this = this;
this.bindedSortEvent = true;
eventManager.addEventListener(this.hot.rootElement, 'click', function(e) {
if (hasClass(e.target, 'columnSorting')) {
var col = getColumn(e.target);
if (col === this.lastSortedColumn) {
switch (_this.hot.sortOrder) {
case void 0:
_this.sortOrderClass = 'ascending';
break;
case true:
_this.sortOrderClass = 'descending';
break;
case false:
_this.sortOrderClass = void 0;
}
} else {
_this.sortOrderClass = 'ascending';
}
this.lastSortedColumn = col;
_this.sortByColumn(col);
}
});
function countRowHeaders() {
var tr = _this.hot.view.TBODY.querySelector('tr');
var length = 1;
if (tr) {
length = tr.querySelectorAll('th').length;
}
return length;
}
function getColumn(target) {
var TH = closest(target, 'TH');
return _this.hot.view.wt.wtTable.getFirstRenderedColumn() + index(TH) - countRowHeaders();
}
},
enableObserveChangesPlugin: function() {
var _this = this;
this.hot._registerTimeout(setTimeout(function() {
_this.hot.updateSettings({observeChanges: true});
}, 0));
},
defaultSort: function(sortOrder) {
return function(a, b) {
if (typeof a[1] == 'string') {
a[1] = a[1].toLowerCase();
}
if (typeof b[1] == 'string') {
b[1] = b[1].toLowerCase();
}
if (a[1] === b[1]) {
return 0;
}
if (a[1] === null || a[1] === '') {
return 1;
}
if (b[1] === null || b[1] === '') {
return -1;
}
if (isNaN(a[1]) && !isNaN(b[1])) {
return sortOrder ? 1 : -1;
} else if (!isNaN(a[1]) && isNaN(b[1])) {
return sortOrder ? -1 : 1;
}
if (a[1] < b[1]) {
return sortOrder ? -1 : 1;
}
if (a[1] > b[1]) {
return sortOrder ? 1 : -1;
}
return 0;
};
},
dateSort: function(sortOrder) {
return function(a, b) {
if (a[1] === b[1]) {
return 0;
}
if (a[1] === null || a[1] === '') {
return 1;
}
if (b[1] === null || b[1] === '') {
return -1;
}
var aDate = new Date(a[1]);
var bDate = new Date(b[1]);
if (aDate < bDate) {
return sortOrder ? -1 : 1;
}
if (aDate > bDate) {
return sortOrder ? 1 : -1;
}
return 0;
};
},
sort: function() {
if (typeof this.hot.sortOrder == 'undefined') {
this.hot.sortIndex.length = 0;
return;
}
var colMeta,
sortFunction;
this.hot.sortingEnabled = false;
this.hot.sortIndex.length = 0;
for (var i = 0,
ilen = this.hot.countRows() - this.hot.getSettings().minSpareRows; i < ilen; i++) {
this.hot.sortIndex.push([i, this.hot.getDataAtCell(i, this.hot.sortColumn)]);
}
colMeta = this.hot.getCellMeta(0, this.hot.sortColumn);
this.updateSortIndicator();
switch (colMeta.type) {
case 'date':
sortFunction = this.dateSort;
break;
default:
sortFunction = this.defaultSort;
}
this.hot.sortIndex.sort(sortFunction(this.hot.sortOrder));
for (var i$__7 = this.hot.sortIndex.length; i$__7 < this.hot.countRows(); i$__7++) {
this.hot.sortIndex.push([i$__7, this.hot.getDataAtCell(i$__7, this.hot.sortColumn)]);
}
this.hot.sortingEnabled = true;
},
updateSortIndicator: function() {
if (typeof this.hot.sortOrder == 'undefined') {
return;
}
var colMeta = this.hot.getCellMeta(0, this.hot.sortColumn);
this.sortIndicators[this.hot.sortColumn] = colMeta.sortIndicator;
},
translateRow: function(row) {
if (this.hot.sortingEnabled && (typeof this.hot.sortOrder !== 'undefined') && this.hot.sortIndex && this.hot.sortIndex.length && this.hot.sortIndex[row]) {
return this.hot.sortIndex[row][0];
}
return row;
},
untranslateRow: function(row) {
if (this.hot.sortingEnabled && this.hot.sortIndex && this.hot.sortIndex.length) {
for (var i = 0; i < this.hot.sortIndex.length; i++) {
if (this.hot.sortIndex[i][0] == row) {
return i;
}
}
}
},
getColHeader: function(col, TH) {
var headerLink = TH.querySelector('.colHeader');
var colspan = TH.getAttribute('colspan');
var TRs = TH.parentNode.parentNode.childNodes;
var headerLevel = Array.prototype.indexOf.call(TRs, TH.parentNode);
headerLevel = headerLevel - TRs.length;
if (!headerLink) {
return;
}
if (this.hot.getSettings().columnSorting && col >= 0 && headerLevel === -1) {
addClass(headerLink, 'columnSorting');
}
removeClass(headerLink, 'descending');
removeClass(headerLink, 'ascending');
if (this.sortIndicators[col]) {
if (col === this.hot.sortColumn) {
if (this.sortOrderClass === 'ascending') {
addClass(headerLink, 'ascending');
} else if (this.sortOrderClass === 'descending') {
addClass(headerLink, 'descending');
}
}
}
},
isSorted: function() {
return typeof this.hot.sortColumn != 'undefined';
},
afterCreateRow: function(index, amount) {
if (!this.isSorted()) {
return;
}
for (var i = 0; i < this.hot.sortIndex.length; i++) {
if (this.hot.sortIndex[i][0] >= index) {
this.hot.sortIndex[i][0] += amount;
}
}
for (var i = 0; i < amount; i++) {
this.hot.sortIndex.splice(index + i, 0, [index + i, this.hot.getSourceData()[index + i][this.hot.sortColumn + this.hot.colOffset()]]);
}
this.saveSortingState();
},
afterRemoveRow: function(index, amount) {
if (!this.isSorted()) {
return;
}
var removedRows = this.hot.sortIndex.splice(index, amount);
removedRows = arrayMap(removedRows, (function(row) {
return row[0];
}));
function countRowShift(logicalRow) {
return arrayReduce(removedRows, (function(count, removedLogicalRow) {
if (logicalRow > removedLogicalRow) {
count++;
}
return count;
}), 0);
}
this.hot.sortIndex = arrayMap(this.hot.sortIndex, (function(logicalRow, physicalRow) {
var rowShift = countRowShift(logicalRow[0]);
if (rowShift) {
logicalRow[0] -= rowShift;
}
return logicalRow;
}));
this.saveSortingState();
}
}, {}, BasePlugin);
;
registerPlugin('columnSorting', ColumnSorting);
//#
},{"_base":58,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":57}],63:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
CommentEditor: {get: function() {
return CommentEditor;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__;
var addClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).addClass;
var CommentEditor = function CommentEditor() {
this.editor = this.createEditor();
this.editorStyle = this.editor.style;
this.editorStyle.position = 'absolute';
this.editorStyle.zIndex = 100;
this.hide();
};
var $CommentEditor = CommentEditor;
($traceurRuntime.createClass)(CommentEditor, {
setPosition: function(x, y) {
this.editorStyle.left = x + 'px';
this.editorStyle.top = y + 'px';
},
show: function() {
this.editorStyle.display = 'block';
},
hide: function() {
this.editorStyle.display = 'none';
},
isVisible: function() {
return this.editorStyle.display === 'block';
},
setValue: function() {
var value = arguments[0] !== (void 0) ? arguments[0] : '';
value = value || '';
this.getInputElement().value = value;
},
getValue: function() {
return this.getInputElement().value;
},
isFocused: function() {
return document.activeElement === this.getInputElement();
},
focus: function() {
this.getInputElement().focus();
},
createEditor: function() {
var container = document.querySelector('.' + $CommentEditor.CLASS_EDITOR_CONTAINER);
var editor;
var textArea;
if (!container) {
container = document.createElement('div');
addClass(container, $CommentEditor.CLASS_EDITOR_CONTAINER);
document.body.appendChild(container);
}
editor = document.createElement('div');
addClass(editor, $CommentEditor.CLASS_EDITOR);
textArea = document.createElement('textarea');
addClass(textArea, $CommentEditor.CLASS_INPUT);
editor.appendChild(textArea);
container.appendChild(editor);
return editor;
},
getInputElement: function() {
return this.editor.querySelector('.' + $CommentEditor.CLASS_INPUT);
},
destroy: function() {
this.editor.parentNode.removeChild(this.editor);
this.editor = null;
this.editorStyle = null;
}
}, {
get CLASS_EDITOR_CONTAINER() {
return 'htCommentsContainer';
},
get CLASS_EDITOR() {
return 'htComments';
},
get CLASS_INPUT() {
return 'htCommentTextArea';
},
get CLASS_CELL() {
return 'htCommentCell';
}
});
;
//#
},{"helpers/dom/element":45}],64:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
Comments: {get: function() {
return Comments;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_eventManager__,
$___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__,
$___46__46__47__46__46__47_plugins__,
$___46__46__47__95_base__,
$__commentEditor__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
closest = $__0.closest,
getWindowScrollLeft = $__0.getWindowScrollLeft,
getWindowScrollTop = $__0.getWindowScrollTop,
hasClass = $__0.hasClass,
offset = $__0.offset;
var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager;
var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords;
var $__3 = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}),
registerPlugin = $__3.registerPlugin,
getPlugin = $__3.getPlugin;
var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default;
var CommentEditor = ($__commentEditor__ = require("commentEditor"), $__commentEditor__ && $__commentEditor__.__esModule && $__commentEditor__ || {default: $__commentEditor__}).CommentEditor;
var Comments = function Comments(hotInstance) {
$traceurRuntime.superConstructor($Comments).call(this, hotInstance);
this.editor = null;
this.eventManager = null;
this.range = {};
this.mouseDown = false;
this.contextMenuEvent = false;
this.timer = null;
};
var $Comments = Comments;
($traceurRuntime.createClass)(Comments, {
isEnabled: function() {
return this.hot.getSettings().comments;
},
enablePlugin: function() {
var $__6 = this;
if (this.enabled) {
return;
}
if (!this.editor) {
this.editor = new CommentEditor();
}
if (!this.eventManager) {
this.eventManager = new EventManager(this);
}
this.addHook('afterContextMenuDefaultOptions', (function(options) {
return $__6.addToContextMenu(options);
}));
this.addHook('afterRenderer', (function(TD, row, col, prop, value, cellProperties) {
return $__6.onAfterRenderer(TD, cellProperties);
}));
this.addHook('afterScrollHorizontally', (function() {
return $__6.refreshEditorPosition();
}));
this.addHook('afterScrollVertically', (function() {
return $__6.refreshEditorPosition();
}));
this.addHook('afterColumnResize', (function() {
return $__6.refreshEditorPosition();
}));
this.addHook('afterRowResize', (function() {
return $__6.refreshEditorPosition();
}));
this.registerListeners();
$traceurRuntime.superGet(this, $Comments.prototype, "enablePlugin").call(this);
},
disablePlugin: function() {
$traceurRuntime.superGet(this, $Comments.prototype, "disablePlugin").call(this);
},
registerListeners: function() {
var $__6 = this;
this.eventManager.addEventListener(document, 'mouseover', (function(event) {
return $__6.onMouseOver(event);
}));
this.eventManager.addEventListener(document, 'mousedown', (function(event) {
return $__6.onMouseDown(event);
}));
this.eventManager.addEventListener(document, 'mousemove', (function(event) {
return $__6.onMouseMove(event);
}));
this.eventManager.addEventListener(document, 'mouseup', (function(event) {
return $__6.onMouseUp(event);
}));
this.eventManager.addEventListener(this.editor.getInputElement(), 'blur', (function(event) {
return $__6.onEditorBlur(event);
}));
},
setRange: function(range) {
this.range = range;
},
clearRange: function() {
this.range = {};
},
targetIsCellWithComment: function(event) {
return hasClass(event.target, 'htCommentCell') && closest(event.target, [this.hot.rootElement]) ? true : false;
},
targetIsCommentTextArea: function(event) {
return this.editor.getInputElement() === event.target;
},
saveComment: function() {
if (!this.range.from) {
throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
}
var comment = this.editor.getValue();
var row = this.range.from.row;
var col = this.range.from.col;
this.hot.setCellMeta(row, col, 'comment', comment);
this.hot.render();
},
saveCommentAtCell: function(row, col) {
this.setRange({from: new WalkontableCellCoords(row, col)});
this.saveComment();
},
removeComment: function() {
if (!this.range.from) {
throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
}
this.hot.removeCellMeta(this.range.from.row, this.range.from.col, 'comment');
this.hot.render();
this.hide();
},
removeCommentAtCell: function(row, col) {
this.setRange({from: new WalkontableCellCoords(row, col)});
this.removeComment();
},
show: function() {
if (!this.range.from) {
throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
}
var meta = this.hot.getCellMeta(this.range.from.row, this.range.from.col);
this.refreshEditorPosition(true);
this.editor.setValue(meta.comment || '');
this.editor.show();
return true;
},
showAtCell: function(row, col) {
this.setRange({from: new WalkontableCellCoords(row, col)});
return this.show();
},
hide: function() {
this.editor.hide();
},
refreshEditorPosition: function() {
var force = arguments[0] !== (void 0) ? arguments[0] : false;
if (!force && (!this.range.from || !this.editor.isVisible())) {
return;
}
var TD = this.hot.view.wt.wtTable.getCell(this.range.from);
var cellOffset = offset(TD);
var lastColWidth = this.hot.getColWidth(this.range.from.col);
var cellTopOffset = cellOffset.top;
var cellLeftOffset = cellOffset.left;
var verticalCompensation = 0;
var horizontalCompensation = 0;
if (this.hot.view.wt.wtViewport.hasVerticalScroll()) {
cellTopOffset = cellTopOffset - this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition();
verticalCompensation = 20;
}
if (this.hot.view.wt.wtViewport.hasHorizontalScroll()) {
cellLeftOffset = cellLeftOffset - this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition();
horizontalCompensation = 20;
}
var x = cellLeftOffset + lastColWidth;
var y = cellTopOffset;
var rect = this.hot.view.wt.wtTable.holder.getBoundingClientRect();
var holderPos = {
left: rect.left + getWindowScrollLeft() + horizontalCompensation,
right: rect.right + getWindowScrollLeft() - 15,
top: rect.top + getWindowScrollTop() + verticalCompensation,
bottom: rect.bottom + getWindowScrollTop()
};
if (x <= holderPos.left || x > holderPos.right || y <= holderPos.top || y > holderPos.bottom) {
this.hide();
} else {
this.editor.setPosition(x, y);
}
},
onMouseDown: function(event) {
this.mouseDown = true;
if (!this.hot.view || !this.hot.view.wt) {
return;
}
if (!this.contextMenuEvent && !this.targetIsCommentTextArea(event) && !this.targetIsCellWithComment(event)) {
this.hide();
}
this.contextMenuEvent = false;
},
onMouseOver: function(event) {
if (this.mouseDown || this.editor.isFocused()) {
return;
}
if (this.targetIsCellWithComment(event)) {
var coordinates = this.hot.view.wt.wtTable.getCoords(event.target);
var range = {from: new WalkontableCellCoords(coordinates.row, coordinates.col)};
this.setRange(range);
this.show();
} else if (!this.targetIsCommentTextArea(event) && !this.editor.isFocused()) {
this.hide();
}
},
onMouseMove: function(event) {
var $__6 = this;
if (this.targetIsCommentTextArea(event)) {
this.mouseDown = true;
clearTimeout(this.timer);
this.timer = setTimeout((function() {
$__6.mouseDown = false;
}), 200);
}
},
onMouseUp: function(event) {
this.mouseDown = false;
},
onAfterRenderer: function(TD, cellProperties) {
if (cellProperties.comment) {
addClass(TD, cellProperties.commentedCellClassName);
}
},
onEditorBlur: function(event) {
this.saveComment();
},
checkSelectionCommentsConsistency: function() {
var selected = this.hot.getSelectedRange();
if (!selected) {
return false;
}
var hasComment = false;
var cell = selected.from;
if (this.hot.getCellMeta(cell.row, cell.col).comment) {
hasComment = true;
}
return hasComment;
},
onContextMenuAddComment: function() {
var $__6 = this;
var coords = this.hot.getSelectedRange();
this.contextMenuEvent = true;
this.setRange({from: coords.from});
this.show();
setTimeout((function() {
if ($__6.hot) {
$__6.hot.deselectCell();
$__6.editor.focus();
}
}), 10);
},
onContextMenuRemoveComment: function(key, selection) {
this.contextMenuEvent = true;
this.removeCommentAtCell(selection.start.row, selection.start.col);
},
addToContextMenu: function(defaultOptions) {
var $__6 = this;
defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR, {
key: 'commentsAddEdit',
name: (function() {
return $__6.checkSelectionCommentsConsistency() ? 'Edit Comment' : 'Add Comment';
}),
callback: (function() {
return $__6.onContextMenuAddComment();
}),
disabled: function() {
return this.getSelected() ? false : true;
}
}, {
key: 'commentsRemove',
name: function() {
return 'Delete Comment';
},
callback: (function(key, selection) {
return $__6.onContextMenuRemoveComment(key, selection);
}),
disabled: (function() {
return !$__6.checkSelectionCommentsConsistency();
})
});
},
destroy: function() {
if (this.editor) {
this.editor.destroy();
}
$traceurRuntime.superGet(this, $Comments.prototype, "destroy").call(this);
}
}, {}, BasePlugin);
;
registerPlugin('comments', Comments);
//#
},{"3rdparty/walkontable/src/cell/coords":5,"_base":58,"commentEditor":63,"eventManager":41,"helpers/dom/element":45,"plugins":57}],65:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
CommandExecutor: {get: function() {
return CommandExecutor;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_array__;
var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach;
var CommandExecutor = function CommandExecutor(hotInstance) {
this.hot = hotInstance;
this.commands = {};
this.commonCallback = null;
};
($traceurRuntime.createClass)(CommandExecutor, {
registerCommand: function(name, commandDescriptor) {
this.commands[name] = commandDescriptor;
},
setCommonCallback: function(callback) {
this.commonCallback = callback;
},
execute: function(commandName) {
for (var params = [],
$__3 = 1; $__3 < arguments.length; $__3++)
params[$__3 - 1] = arguments[$__3];
var $__1 = this;
var commandSplit = commandName.split(':');
commandName = commandSplit[0];
var subCommandName = commandSplit.length === 2 ? commandSplit[1] : null;
var command = this.commands[commandName];
if (!command) {
throw new Error(("Menu command '" + commandName + "' not exists."));
}
if (subCommandName && command.submenu) {
command = findSubCommand(subCommandName, command.submenu.items);
}
if (command.disabled === true) {
return;
}
if (typeof command.disabled == 'function' && command.disabled.call(this.hot) === true) {
return;
}
if (command.hasOwnProperty('submenu')) {
return;
}
var callbacks = [];
if (typeof command.callback === 'function') {
callbacks.push(command.callback);
}
if (typeof this.commonCallback === 'function') {
callbacks.push(this.commonCallback);
}
params.unshift(commandSplit.join(':'));
arrayEach(callbacks, (function(callback) {
return callback.apply($__1.hot, params);
}));
}
}, {});
function findSubCommand(subCommandName, subCommands) {
var command;
arrayEach(subCommands, (function(cmd) {
var cmds = cmd.key ? cmd.key.split(':') : null;
if (Array.isArray(cmds) && cmds[1] === subCommandName) {
command = cmd;
return false;
}
}));
return command;
}
;
//#
},{"helpers/array":42}],66:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
ContextMenu: {get: function() {
return ContextMenu;
}},
__esModule: {value: true}
});
var $___46__46__47__95_base__,
$___46__46__47__46__46__47_helpers_47_array__,
$__commandExecutor__,
$___46__46__47__46__46__47_eventManager__,
$___46__46__47__46__46__47_helpers_47_dom_47_element__,
$__itemsFactory__,
$__menu__,
$___46__46__47__46__46__47_helpers_47_object__,
$___46__46__47__46__46__47_plugins__,
$___46__46__47__46__46__47_helpers_47_dom_47_event__,
$___46__46__47__46__46__47_helpers_47_dom_47_element__,
$__predefinedItems__;
var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default;
var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach;
var CommandExecutor = ($__commandExecutor__ = require("commandExecutor"), $__commandExecutor__ && $__commandExecutor__.__esModule && $__commandExecutor__ || {default: $__commandExecutor__}).CommandExecutor;
var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager;
var hasClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).hasClass;
var ItemsFactory = ($__itemsFactory__ = require("itemsFactory"), $__itemsFactory__ && $__itemsFactory__.__esModule && $__itemsFactory__ || {default: $__itemsFactory__}).ItemsFactory;
var Menu = ($__menu__ = require("menu"), $__menu__ && $__menu__.__esModule && $__menu__ || {default: $__menu__}).Menu;
var $__7 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}),
objectEach = $__7.objectEach,
mixin = $__7.mixin;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var $__9 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}),
stopPropagation = $__9.stopPropagation,
pageX = $__9.pageX,
pageY = $__9.pageY;
var $__10 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
getWindowScrollLeft = $__10.getWindowScrollLeft,
getWindowScrollTop = $__10.getWindowScrollTop;
var $__11 = ($__predefinedItems__ = require("predefinedItems"), $__predefinedItems__ && $__predefinedItems__.__esModule && $__predefinedItems__ || {default: $__predefinedItems__}),
ROW_ABOVE = $__11.ROW_ABOVE,
ROW_BELOW = $__11.ROW_BELOW,
COLUMN_LEFT = $__11.COLUMN_LEFT,
COLUMN_RIGHT = $__11.COLUMN_RIGHT,
REMOVE_ROW = $__11.REMOVE_ROW,
REMOVE_COLUMN = $__11.REMOVE_COLUMN,
UNDO = $__11.UNDO,
REDO = $__11.REDO,
READ_ONLY = $__11.READ_ONLY,
ALIGNMENT = $__11.ALIGNMENT,
SEPARATOR = $__11.SEPARATOR,
predefinedItems = $__11.predefinedItems;
var ContextMenu = function ContextMenu(hotInstance) {
$traceurRuntime.superConstructor($ContextMenu).call(this, hotInstance);
this.eventManager = new EventManager(this);
this.commandExecutor = new CommandExecutor(this.hot);
this.itemsFactory = null;
this.menu = null;
};
var $ContextMenu = ContextMenu;
($traceurRuntime.createClass)(ContextMenu, {
isEnabled: function() {
return this.hot.getSettings().contextMenu;
},
enablePlugin: function() {
var $__12 = this;
if (this.enabled) {
return;
}
this.itemsFactory = new ItemsFactory(this.hot, $ContextMenu.DEFAULT_ITEMS);
var settings = this.hot.getSettings().contextMenu;
var predefinedItems = {items: this.itemsFactory.getVisibleItems(settings)};
this.registerEvents();
if (typeof settings.callback === 'function') {
this.commandExecutor.setCommonCallback(settings.callback);
}
$traceurRuntime.superGet(this, $ContextMenu.prototype, "enablePlugin").call(this);
this.callOnPluginsReady((function() {
$__12.hot.runHooks('afterContextMenuDefaultOptions', predefinedItems);
$__12.itemsFactory.setPredefinedItems(predefinedItems.items);
var menuItems = $__12.itemsFactory.getVisibleItems(settings);
$__12.menu = new Menu($__12.hot, {
className: 'htContextMenu',
keepInViewport: true
});
$__12.menu.setMenuItems(menuItems);
$__12.menu.addLocalHook('afterOpen', (function() {
return $__12.onMenuAfterOpen();
}));
$__12.menu.addLocalHook('afterClose', (function() {
return $__12.onMenuAfterClose();
}));
$__12.menu.addLocalHook('executeCommand', (function() {
for (var params = [],
$__14 = 0; $__14 < arguments.length; $__14++)
params[$__14] = arguments[$__14];
return $__12.executeCommand.apply($__12, params);
}));
arrayEach(menuItems, (function(command) {
return $__12.commandExecutor.registerCommand(command.key, command);
}));
}));
},
disablePlugin: function() {
this.close();
if (this.menu) {
this.menu.destroy();
this.menu = null;
}
$traceurRuntime.superGet(this, $ContextMenu.prototype, "disablePlugin").call(this);
},
registerEvents: function() {
var $__12 = this;
this.eventManager.addEventListener(this.hot.rootElement, 'contextmenu', (function(event) {
return $__12.onContextMenu(event);
}));
},
open: function(event) {
if (!this.menu) {
return;
}
this.menu.open();
this.menu.setPosition({
top: parseInt(pageY(event), 10) - getWindowScrollTop(),
left: parseInt(pageX(event), 10) - getWindowScrollLeft()
});
this.menu.hotMenu.isHotTableEnv = this.hot.isHotTableEnv;
Handsontable.eventManager.isHotTableEnv = this.hot.isHotTableEnv;
},
close: function() {
if (!this.menu) {
return;
}
this.menu.close();
},
executeCommand: function() {
for (var params = [],
$__14 = 0; $__14 < arguments.length; $__14++)
params[$__14] = arguments[$__14];
this.commandExecutor.execute.apply(this.commandExecutor, params);
},
onContextMenu: function(event) {
var settings = this.hot.getSettings();
var showRowHeaders = settings.rowHeaders;
var showColHeaders = settings.colHeaders;
function isValidElement(element) {
return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';
}
var element = event.realTarget;
this.close();
event.preventDefault();
stopPropagation(event);
if (!(showRowHeaders || showColHeaders)) {
if (!isValidElement(element) && !(hasClass(element, 'current') && hasClass(element, 'wtBorder'))) {
return;
}
} else if (showRowHeaders && showColHeaders) {
var containsCornerHeader = element.parentNode.querySelectorAll('.cornerHeader').length > 0;
if (containsCornerHeader) {
return;
}
}
this.open(event);
},
onMenuAfterOpen: function() {
this.hot.runHooks('afterContextMenuShow', this);
},
onMenuAfterClose: function() {
this.hot.listen();
this.hot.runHooks('afterContextMenuHide', this);
},
destroy: function() {
this.close();
if (this.menu) {
this.menu.destroy();
}
$traceurRuntime.superGet(this, $ContextMenu.prototype, "destroy").call(this);
}
}, {get DEFAULT_ITEMS() {
return [ROW_ABOVE, ROW_BELOW, SEPARATOR, COLUMN_LEFT, COLUMN_RIGHT, SEPARATOR, REMOVE_ROW, REMOVE_COLUMN, SEPARATOR, UNDO, REDO, SEPARATOR, READ_ONLY, SEPARATOR, ALIGNMENT];
}}, BasePlugin);
ContextMenu.SEPARATOR = {name: SEPARATOR};
Handsontable.hooks.register('afterContextMenuDefaultOptions');
Handsontable.hooks.register('afterContextMenuShow');
Handsontable.hooks.register('afterContextMenuHide');
Handsontable.hooks.register('afterContextMenuExecute');
;
registerPlugin('contextMenu', ContextMenu);
//#
},{"_base":58,"commandExecutor":65,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"itemsFactory":68,"menu":69,"plugins":57,"predefinedItems":70}],67:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
Cursor: {get: function() {
return Cursor;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_helpers_47_dom_47_event__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
getWindowScrollLeft = $__0.getWindowScrollLeft,
getWindowScrollTop = $__0.getWindowScrollTop;
var $__1 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}),
pageX = $__1.pageX,
pageY = $__1.pageY;
var Cursor = function Cursor(object) {
var windowScrollTop = getWindowScrollTop();
var windowScrollLeft = getWindowScrollLeft();
var top,
topRelative;
var left,
leftRelative;
var cellHeight,
cellWidth;
this.type = this.getSourceType(object);
if (this.type === 'literal') {
top = parseInt(object.top, 10);
left = parseInt(object.left, 10);
cellHeight = object.height || 0;
cellWidth = object.width || 0;
topRelative = top;
leftRelative = left;
top = top + windowScrollTop;
left = left + windowScrollLeft;
} else if (this.type === 'event') {
top = parseInt(pageY(object), 10);
left = parseInt(pageX(object), 10);
cellHeight = object.target.clientHeight;
cellWidth = object.target.clientWidth;
topRelative = top - windowScrollTop;
leftRelative = left - windowScrollLeft;
}
this.top = top;
this.topRelative = topRelative;
this.left = left;
this.leftRelative = leftRelative;
this.scrollTop = windowScrollTop;
this.scrollLeft = windowScrollLeft;
this.cellHeight = cellHeight;
this.cellWidth = cellWidth;
};
($traceurRuntime.createClass)(Cursor, {
getSourceType: function(object) {
var type = 'literal';
if (object instanceof Event) {
type = 'event';
}
return type;
},
fitsAbove: function(element) {
return this.topRelative >= element.offsetHeight;
},
fitsBelow: function(element) {
var viewportHeight = arguments[1] !== (void 0) ? arguments[1] : window.innerHeight;
return this.topRelative + element.offsetHeight <= viewportHeight;
},
fitsOnRight: function(element) {
var viewportWidth = arguments[1] !== (void 0) ? arguments[1] : window.innerWidth;
return this.leftRelative + this.cellWidth + element.offsetWidth <= viewportWidth;
},
fitsOnLeft: function(element) {
return this.leftRelative >= element.offsetWidth;
}
}, {});
;
Handsontable.plugins.utils = Handsontable.plugins.utils || {};
Handsontable.plugins.utils.Cursor = Cursor;
//#
},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
ItemsFactory: {get: function() {
return ItemsFactory;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_object__,
$___46__46__47__46__46__47_helpers_47_array__,
$__predefinedItems__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}),
objectEach = $__0.objectEach,
isObject = $__0.isObject,
extend = $__0.extend;
var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach;
var $__2 = ($__predefinedItems__ = require("predefinedItems"), $__predefinedItems__ && $__predefinedItems__.__esModule && $__predefinedItems__ || {default: $__predefinedItems__}),
SEPARATOR = $__2.SEPARATOR,
ITEMS = $__2.ITEMS,
predefinedItems = $__2.predefinedItems;
var ItemsFactory = function ItemsFactory(hotInstance) {
var orderPattern = arguments[1] !== (void 0) ? arguments[1] : null;
this.hot = hotInstance;
this.predefinedItems = predefinedItems();
this.defaultOrderPattern = orderPattern;
};
($traceurRuntime.createClass)(ItemsFactory, {
setPredefinedItems: function(predefinedItems) {
var $__3 = this;
var items = {};
this.defaultOrderPattern.length = 0;
objectEach(predefinedItems, (function(value, key) {
var menuItemKey = '';
if (value.name === SEPARATOR) {
items[SEPARATOR] = value;
menuItemKey = SEPARATOR;
} else if (isNaN(parseInt(key, 10))) {
value.key = value.key === void 0 ? key : value.key;
items[key] = value;
menuItemKey = value.key;
} else {
items[value.key] = value;
menuItemKey = value.key;
}
$__3.defaultOrderPattern.push(menuItemKey);
}));
this.predefinedItems = items;
},
getVisibleItems: function() {
var pattern = arguments[0] !== (void 0) ? arguments[0] : null;
var $__3 = this;
var visibleItems = {};
objectEach(this.predefinedItems, (function(value, key) {
if (!value.hidden || value.hidden && !value.hidden.apply($__3.hot)) {
visibleItems[key] = value;
}
}));
return getItems(pattern, this.defaultOrderPattern, visibleItems);
},
getItems: function() {
var pattern = arguments[0] !== (void 0) ? arguments[0] : null;
return getItems(pattern, this.defaultOrderPattern, this.predefinedItems);
}
}, {});
function getItems() {
var pattern = arguments[0] !== (void 0) ? arguments[0] : null;
var defaultPattern = arguments[1] !== (void 0) ? arguments[1] : [];
var items = arguments[2] !== (void 0) ? arguments[2] : {};
var result = [];
if (pattern && pattern.items) {
pattern = pattern.items;
} else if (!Array.isArray(pattern)) {
pattern = defaultPattern;
}
if (isObject(pattern)) {
objectEach(pattern, (function(value, key) {
var item = items[typeof value === 'string' ? value : key];
if (!item) {
item = value;
}
if (isObject(value)) {
extend(item, value);
} else if (typeof item === 'string') {
item = {name: item};
}
if (item.key === void 0) {
item.key = key;
}
result.push(item);
}));
} else {
arrayEach(pattern, (function(name, key) {
var item = items[name];
if (!item && ITEMS.indexOf(name) >= 0) {
return;
}
if (!item) {
item = {
name: name,
key: key + ''
};
}
if (isObject(name)) {
extend(item, name);
}
if (item.key === void 0) {
item.key = key;
}
result.push(item);
}));
}
if (result[0].name === SEPARATOR) {
result.shift();
}
return result;
}
;
//#
},{"helpers/array":42,"helpers/object":50,"predefinedItems":70}],69:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
Menu: {get: function() {
return Menu;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_helpers_47_array__,
$__cursor__,
$___46__46__47__46__46__47_eventManager__,
$___46__46__47__46__46__47_helpers_47_object__,
$___46__46__47__46__46__47_helpers_47_function__,
$__utils__,
$___46__46__47__46__46__47_helpers_47_unicode__,
$___46__46__47__46__46__47_mixins_47_localHooks__,
$__predefinedItems__,
$___46__46__47__46__46__47_helpers_47_dom_47_event__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
empty = $__0.empty,
fastInnerHTML = $__0.fastInnerHTML,
getComputedStyle = $__0.getComputedStyle,
getScrollbarWidth = $__0.getScrollbarWidth,
getWindowScrollLeft = $__0.getWindowScrollLeft,
getWindowScrollTop = $__0.getWindowScrollTop,
hasClass = $__0.hasClass,
isChildOf = $__0.isChildOf,
removeClass = $__0.removeClass;
var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach;
var Cursor = ($__cursor__ = require("cursor"), $__cursor__ && $__cursor__.__esModule && $__cursor__ || {default: $__cursor__}).Cursor;
var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager;
var $__4 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}),
extend = $__4.extend,
isObject = $__4.isObject,
objectEach = $__4.objectEach,
mixin = $__4.mixin;
var debounce = ($___46__46__47__46__46__47_helpers_47_function__ = require("helpers/function"), $___46__46__47__46__46__47_helpers_47_function__ && $___46__46__47__46__46__47_helpers_47_function__.__esModule && $___46__46__47__46__46__47_helpers_47_function__ || {default: $___46__46__47__46__46__47_helpers_47_function__}).debounce;
var $__6 = ($__utils__ = require("utils"), $__utils__ && $__utils__.__esModule && $__utils__ || {default: $__utils__}),
isSeparator = $__6.isSeparator,
isDisabled = $__6.isDisabled,
isSelectionDisabled = $__6.isSelectionDisabled,
hasSubMenu = $__6.hasSubMenu,
normalizeSelection = $__6.normalizeSelection;
var KEY_CODES = ($___46__46__47__46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47__46__46__47_helpers_47_unicode__ && $___46__46__47__46__46__47_helpers_47_unicode__.__esModule && $___46__46__47__46__46__47_helpers_47_unicode__ || {default: $___46__46__47__46__46__47_helpers_47_unicode__}).KEY_CODES;
var localHooks = ($___46__46__47__46__46__47_mixins_47_localHooks__ = require("mixins/localHooks"), $___46__46__47__46__46__47_mixins_47_localHooks__ && $___46__46__47__46__46__47_mixins_47_localHooks__.__esModule && $___46__46__47__46__46__47_mixins_47_localHooks__ || {default: $___46__46__47__46__46__47_mixins_47_localHooks__}).localHooks;
var $__9 = ($__predefinedItems__ = require("predefinedItems"), $__predefinedItems__ && $__predefinedItems__.__esModule && $__predefinedItems__ || {default: $__predefinedItems__}),
SEPARATOR = $__9.SEPARATOR,
predefinedItems = $__9.predefinedItems;
var $__10 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}),
stopPropagation = $__10.stopPropagation,
stopImmediatePropagation = $__10.stopImmediatePropagation,
pageX = $__10.pageX,
pageY = $__10.pageY;
var Menu = function Menu(hotInstance) {
var options = arguments[1] !== (void 0) ? arguments[1] : {
parent: null,
name: null,
className: '',
keepInViewport: true
};
this.hot = hotInstance;
this.options = options;
this.eventManager = new EventManager(this);
this.container = this.createContainer(this.options.name);
this.hotMenu = null;
this.hotSubMenus = {};
this.parentMenu = this.options.parent || null;
this.menuItems = null;
this.origOutsideClickDeselects = null;
this.offset = {
above: 0,
below: 0,
left: 0,
right: 0
};
this._afterScrollCallback = null;
this.registerEvents();
};
var $Menu = Menu;
($traceurRuntime.createClass)(Menu, {
registerEvents: function() {
var $__11 = this;
this.eventManager.addEventListener(document.documentElement, 'mousedown', (function(event) {
return $__11.onDocumentMouseDown(event);
}));
},
setMenuItems: function(menuItems) {
this.menuItems = menuItems;
},
setOffset: function(area) {
var offset = arguments[1] !== (void 0) ? arguments[1] : 0;
this.offset[area] = offset;
},
isSubMenu: function() {
return this.parentMenu !== null;
},
open: function() {
var $__11 = this;
this.container.removeAttribute('style');
this.container.style.display = 'block';
var delayedOpenSubMenu = debounce((function(row) {
return $__11.openSubMenu(row);
}), 300);
var settings = {
data: this.menuItems,
colHeaders: false,
colWidths: [200],
autoRowSize: false,
readOnly: true,
copyPaste: false,
columns: [{
data: 'name',
renderer: (function(hot, TD, row, col, prop, value) {
return $__11.menuItemRenderer(hot, TD, row, col, prop, value);
})
}],
renderAllRows: true,
fragmentSelection: 'cell',
beforeKeyDown: (function(event) {
return $__11.onBeforeKeyDown(event);
}),
afterOnCellMouseOver: (function(event, coords, TD) {
if (!TD.textContent) {
return;
}
if ($__11.isAllSubMenusClosed()) {
delayedOpenSubMenu(coords.row);
} else {
$__11.openSubMenu(coords.row);
}
})
};
this.origOutsideClickDeselects = this.hot.getSettings().outsideClickDeselects;
this.hot.getSettings().outsideClickDeselects = false;
this.hotMenu = new Handsontable.Core(this.container, settings);
this.hotMenu.addHook('afterInit', (function() {
return $__11.onAfterInit();
}));
this.hotMenu.init();
this.hotMenu.listen();
this.blockMainTableCallbacks();
this.runLocalHooks('afterOpen');
},
close: function() {
var closeParent = arguments[0] !== (void 0) ? arguments[0] : false;
if (!this.isOpened()) {
return;
}
if (closeParent && this.parentMenu) {
this.parentMenu.close();
} else {
this.closeAllSubMenus();
this.container.style.display = 'none';
this.releaseMainTableCallbacks();
this.hotMenu.destroy();
this.hotMenu = null;
this.hot.getSettings().outsideClickDeselects = this.origOutsideClickDeselects;
this.runLocalHooks('afterClose');
}
},
openSubMenu: function(row) {
if (!this.hotMenu) {
return;
}
var cell = this.hotMenu.getCell(row, 0);
this.closeAllSubMenus();
if (!cell || !hasSubMenu(cell)) {
return false;
}
var dataItem = this.hotMenu.getSourceDataAtRow(row);
var subMenu = new $Menu(this.hot, {
parent: this,
name: dataItem.name,
className: this.options.className,
keepInViewport: true
});
subMenu.setMenuItems(dataItem.submenu.items);
subMenu.open();
subMenu.setPosition(cell.getBoundingClientRect());
this.hotSubMenus[dataItem.key] = subMenu;
return subMenu;
},
closeSubMenu: function(row) {
var dataItem = this.hotMenu.getSourceDataAtRow(row);
var menus = this.hotSubMenus[dataItem.key];
if (menus) {
menus.destroy();
delete this.hotSubMenus[dataItem.key];
}
},
closeAllSubMenus: function() {
var $__11 = this;
arrayEach(this.hotMenu.getData(), (function(value, row) {
return $__11.closeSubMenu(row);
}));
},
isAllSubMenusClosed: function() {
return Object.keys(this.hotSubMenus).length === 0;
},
destroy: function() {
this.clearLocalHooks();
this.close();
this.parentMenu = null;
this.eventManager.destroy();
},
isOpened: function() {
return this.hotMenu !== null;
},
executeCommand: function(event) {
if (!this.isOpened() || !this.hotMenu.getSelected()) {
return;
}
var selectedItem = this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);
this.runLocalHooks('select', selectedItem, event);
if (selectedItem.isCommand === false) {
return;
}
var selRange = this.hot.getSelectedRange();
var normalizedSelection = selRange ? normalizeSelection(selRange) : {};
this.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event);
if (this.isSubMenu()) {
this.parentMenu.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event);
}
this.close(true);
},
setPosition: function(coords) {
var cursor = new Cursor(coords);
if (this.options.keepInViewport) {
if (cursor.fitsBelow(this.container)) {
this.setPositionBelowCursor(cursor);
} else if (cursor.fitsAbove(this.container)) {
this.setPositionAboveCursor(cursor);
} else {
this.setPositionBelowCursor(cursor);
}
if (cursor.fitsOnRight(this.container)) {
this.setPositionOnRightOfCursor(cursor);
} else {
this.setPositionOnLeftOfCursor(cursor);
}
} else {
this.setPositionBelowCursor(cursor);
this.setPositionOnRightOfCursor(cursor);
}
},
setPositionAboveCursor: function(cursor) {
var top = this.offset.above + cursor.top - this.container.offsetHeight;
if (this.isSubMenu()) {
top = cursor.top + cursor.cellHeight - this.container.offsetHeight + 3;
}
this.container.style.top = top + 'px';
},
setPositionBelowCursor: function(cursor) {
var top = this.offset.below + cursor.top;
if (this.isSubMenu()) {
top = cursor.top - 1;
}
this.container.style.top = top + 'px';
},
setPositionOnRightOfCursor: function(cursor) {
var left;
if (this.isSubMenu()) {
left = 1 + cursor.left + cursor.cellWidth;
} else {
left = this.offset.right + 1 + cursor.left;
}
this.container.style.left = left + 'px';
},
setPositionOnLeftOfCursor: function(cursor) {
var left = this.offset.left + cursor.left - this.container.offsetWidth + getScrollbarWidth() + 4;
this.container.style.left = left + 'px';
},
selectFirstCell: function() {
var cell = this.hotMenu.getCell(0, 0);
if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) {
this.selectNextCell(0, 0);
} else {
this.hotMenu.selectCell(0, 0);
}
},
selectLastCell: function() {
var lastRow = this.hotMenu.countRows() - 1;
var cell = this.hotMenu.getCell(lastRow, 0);
if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) {
this.selectPrevCell(lastRow, 0);
} else {
this.hotMenu.selectCell(lastRow, 0);
}
},
selectNextCell: function(row, col) {
var nextRow = row + 1;
var cell = nextRow < this.hotMenu.countRows() ? this.hotMenu.getCell(nextRow, col) : null;
if (!cell) {
return;
}
if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) {
this.selectNextCell(nextRow, col);
} else {
this.hotMenu.selectCell(nextRow, col);
}
},
selectPrevCell: function(row, col) {
var prevRow = row - 1;
var cell = prevRow >= 0 ? this.hotMenu.getCell(prevRow, col) : null;
if (!cell) {
return;
}
if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) {
this.selectPrevCell(prevRow, col);
} else {
this.hotMenu.selectCell(prevRow, col);
}
},
menuItemRenderer: function(hot, TD, row, col, prop, value) {
var $__11 = this;
var item = hot.getSourceDataAtRow(row);
var wrapper = document.createElement('div');
var isSubMenu = (function(item) {
return item.hasOwnProperty('submenu');
});
var itemIsSeparator = (function(item) {
return new RegExp(SEPARATOR, 'i').test(item.name);
});
var itemIsDisabled = (function(item) {
return item.disabled === true || (typeof item.disabled == 'function' && item.disabled.call($__11.hot) === true);
});
var itemIsHidden = (function(item) {
return typeof item.hidden == 'function' && item.hidden.call($__11.hot) === true;
});
var itemIsSelectionDisabled = (function(item) {
return item.disableSelection;
});
var isHidden = itemIsHidden(item);
if (typeof value === 'function') {
value = value.call(this.hot);
}
empty(TD);
addClass(wrapper, 'htItemWrapper');
TD.appendChild(wrapper);
if (itemIsSeparator(item)) {
addClass(TD, 'htSeparator');
} else if (!isHidden && typeof item.renderer === 'function') {
addClass(TD, 'htCustomMenuRenderer');
TD.appendChild(item.renderer(hot, wrapper, row, col, prop, value));
} else {
fastInnerHTML(wrapper, value);
}
if (isHidden) {
if (TD.parentNode) {
addClass(TD.parentNode, 'htHidden');
}
} else if (itemIsDisabled(item)) {
addClass(TD, 'htDisabled');
this.eventManager.addEventListener(wrapper, 'mouseenter', (function() {
return hot.deselectCell();
}));
} else if (itemIsSelectionDisabled(item)) {
addClass(TD, 'htSelectionDisabled');
this.eventManager.addEventListener(wrapper, 'mouseenter', (function() {
return hot.deselectCell();
}));
} else if (isSubMenu(item)) {
addClass(TD, 'htSubmenu');
if (itemIsSelectionDisabled(item)) {
this.eventManager.addEventListener(wrapper, 'mouseenter', (function() {
return hot.deselectCell();
}));
} else {
this.eventManager.addEventListener(wrapper, 'mouseenter', (function() {
return hot.selectCell(row, col, void 0, void 0, void 0, false);
}));
}
} else {
removeClass(TD, 'htSubmenu');
removeClass(TD, 'htDisabled');
if (itemIsSelectionDisabled(item)) {
this.eventManager.addEventListener(wrapper, 'mouseenter', (function() {
return hot.deselectCell();
}));
} else {
this.eventManager.addEventListener(wrapper, 'mouseenter', (function() {
return hot.selectCell(row, col, void 0, void 0, void 0, false);
}));
}
}
},
createContainer: function() {
var name = arguments[0] !== (void 0) ? arguments[0] : null;
if (name) {
name = name.replace(/ /g, '_');
name = this.options.className + 'Sub_' + name;
}
var container;
if (name) {
container = document.querySelector('.' + this.options.className + '.' + name);
} else {
container = document.querySelector('.' + this.options.className);
}
if (!container) {
container = document.createElement('div');
addClass(container, 'htMenu ' + this.options.className);
if (name) {
addClass(container, name);
}
document.getElementsByTagName('body')[0].appendChild(container);
}
return container;
},
blockMainTableCallbacks: function() {
this._afterScrollCallback = function() {};
this.hot.addHook('afterScrollVertically', this._afterScrollCallback);
this.hot.addHook('afterScrollHorizontally', this._afterScrollCallback);
},
releaseMainTableCallbacks: function() {
if (this._afterScrollCallback) {
this.hot.removeHook('afterScrollVertically', this._afterScrollCallback);
this.hot.removeHook('afterScrollHorizontally', this._afterScrollCallback);
this._afterScrollCallback = null;
}
},
onBeforeKeyDown: function(event) {
var selection = this.hotMenu.getSelected();
var stopEvent = false;
switch (event.keyCode) {
case KEY_CODES.ESCAPE:
this.close();
stopEvent = true;
break;
case KEY_CODES.ENTER:
if (selection) {
if (this.hotMenu.getSourceDataAtRow(selection[0]).submenu) {
stopEvent = true;
} else {
this.executeCommand(event);
this.close(true);
}
}
break;
case KEY_CODES.ARROW_DOWN:
if (selection) {
this.selectNextCell(selection[0], selection[1]);
} else {
this.selectFirstCell();
}
stopEvent = true;
break;
case KEY_CODES.ARROW_UP:
if (selection) {
this.selectPrevCell(selection[0], selection[1]);
} else {
this.selectLastCell();
}
stopEvent = true;
break;
case KEY_CODES.ARROW_RIGHT:
if (selection) {
var menu = this.openSubMenu(selection[0]);
if (menu) {
menu.selectFirstCell();
}
}
stopEvent = true;
break;
case KEY_CODES.ARROW_LEFT:
if (selection && this.isSubMenu()) {
this.close();
if (this.parentMenu) {
this.parentMenu.hotMenu.listen();
}
stopEvent = true;
}
break;
}
if (stopEvent) {
event.preventDefault();
stopImmediatePropagation(event);
}
},
onAfterInit: function() {
var data = this.hotMenu.getSettings().data;
var hiderStyle = this.hotMenu.view.wt.wtTable.hider.style;
var holderStyle = this.hotMenu.view.wt.wtTable.holder.style;
var currentHiderWidth = parseInt(hiderStyle.width, 10);
var realHeight = 0;
arrayEach(data, (function(value) {
return realHeight += value.name === SEPARATOR ? 1 : 26;
}));
holderStyle.width = currentHiderWidth + 22 + 'px';
holderStyle.height = realHeight + 4 + 'px';
},
onDocumentMouseDown: function(event) {
if (!this.isOpened()) {
return;
}
if (this.container && isChildOf(event.target, this.container)) {
this.executeCommand(event);
}
if ((this.isAllSubMenusClosed() || this.isSubMenu()) && (!isChildOf(event.target, '.htMenu') && isChildOf(event.target, document))) {
this.close(true);
}
}
}, {});
mixin(Menu, localHooks);
;
//#
},{"cursor":67,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/object":50,"helpers/unicode":53,"mixins/localHooks":54,"predefinedItems":70,"utils":71}],70:[function(require,module,exports){
"use strict";
var $__4;
Object.defineProperties(exports, {
ROW_ABOVE: {get: function() {
return ROW_ABOVE;
}},
ROW_BELOW: {get: function() {
return ROW_BELOW;
}},
COLUMN_LEFT: {get: function() {
return COLUMN_LEFT;
}},
COLUMN_RIGHT: {get: function() {
return COLUMN_RIGHT;
}},
CLEAR_COLUMN: {get: function() {
return CLEAR_COLUMN;
}},
REMOVE_ROW: {get: function() {
return REMOVE_ROW;
}},
REMOVE_COLUMN: {get: function() {
return REMOVE_COLUMN;
}},
UNDO: {get: function() {
return UNDO;
}},
REDO: {get: function() {
return REDO;
}},
READ_ONLY: {get: function() {
return READ_ONLY;
}},
ALIGNMENT: {get: function() {
return ALIGNMENT;
}},
SEPARATOR: {get: function() {
return SEPARATOR;
}},
ITEMS: {get: function() {
return ITEMS;
}},
predefinedItems: {get: function() {
return predefinedItems;
}},
addItem: {get: function() {
return addItem;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_object__,
$___46__46__47__46__46__47_helpers_47_number__,
$__utils__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}),
objectEach = $__0.objectEach,
clone = $__0.clone;
var rangeEach = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}).rangeEach;
var $__2 = ($__utils__ = require("utils"), $__utils__ && $__utils__.__esModule && $__utils__ || {default: $__utils__}),
align = $__2.align,
getAlignmentClasses = $__2.getAlignmentClasses,
getValidSelection = $__2.getValidSelection,
checkSelectionConsistency = $__2.checkSelectionConsistency,
markLabelAsSelected = $__2.markLabelAsSelected;
var ROW_ABOVE = 'row_above';
var ROW_BELOW = 'row_below';
var COLUMN_LEFT = 'col_left';
var COLUMN_RIGHT = 'col_right';
var CLEAR_COLUMN = 'clear_column';
var REMOVE_ROW = 'remove_row';
var REMOVE_COLUMN = 'remove_col';
var UNDO = 'undo';
var REDO = 'redo';
var READ_ONLY = 'make_read_only';
var ALIGNMENT = 'alignment';
var SEPARATOR = '---------';
var ITEMS = [ROW_ABOVE, ROW_BELOW, COLUMN_LEFT, COLUMN_RIGHT, CLEAR_COLUMN, REMOVE_ROW, REMOVE_COLUMN, UNDO, REDO, READ_ONLY, ALIGNMENT, SEPARATOR];
function predefinedItems() {
var items = {};
objectEach(_predefinedItems, (function(value, key) {
return items[key] = clone(value);
}));
return items;
}
function addItem(key, item) {
if (ITEMS.indexOf(key) === -1) {
_predefinedItems[key] = item;
}
}
var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, {
value: {name: SEPARATOR},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__4, ROW_ABOVE, {
value: {
key: ROW_ABOVE,
name: 'Insert row above',
callback: function(key, selection) {
this.alter('insert_row', selection.start.row);
},
disabled: function() {
var selected = getValidSelection(this);
if (!selected || this.countRows() >= this.getSettings().maxRows) {
return true;
}
var rowCount = this.countRows();
var entireColumnSelection = [0, selected[1], rowCount - 1, selected[1]];
return (entireColumnSelection.join(',') === selected.join(',')) && rowCount > 1;
},
hidden: function() {
return !this.getSettings().allowInsertRow;
}
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__4, ROW_BELOW, {
value: {
key: ROW_BELOW,
name: 'Insert row below',
callback: function(key, selection) {
this.alter('insert_row', selection.end.row + 1);
},
disabled: function() {
var selected = getValidSelection(this);
if (!selected || this.countRows() >= this.getSettings().maxRows) {
return true;
}
var rowCount = this.countRows();
var entireColumnSelection = [0, selected[1], rowCount - 1, selected[1]];
return (entireColumnSelection.join(',') === selected.join(',')) && rowCount > 1;
},
hidden: function() {
return !this.getSettings().allowInsertRow;
}
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__4, COLUMN_LEFT, {
value: {
key: COLUMN_LEFT,
name: 'Insert column on the left',
callback: function(key, selection) {
this.alter('insert_col', selection.start.col);
},
disabled: function() {
var selected = getValidSelection(this);
if (!selected) {
return true;
}
if (!this.isColumnModificationAllowed()) {
return true;
}
var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1];
var rowSelected = entireRowSelection.join(',') == selected.join(',');
return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected;
},
hidden: function() {
return !this.getSettings().allowInsertColumn;
}
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__4, COLUMN_RIGHT, {
value: {
key: COLUMN_RIGHT,
name: 'Insert column on the right',
callback: function(key, selection) {
this.alter('insert_col', selection.end.col + 1);
},
disabled: function() {
var selected = getValidSelection(this);
if (!selected) {
return true;
}
if (!this.isColumnModificationAllowed()) {
return true;
}
var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1];
var rowSelected = entireRowSelection.join(',') == selected.join(',');
return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected;
},
hidden: function() {
return !this.getSettings().allowInsertColumn;
}
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__4, CLEAR_COLUMN, {
value: {
key: CLEAR_COLUMN,
name: 'Clear column',
callback: function(key, selection) {
var column = selection.start.col;
if (this.countRows()) {
this.populateFromArray(0, column, [[null]], Math.max(selection.start.row, selection.end.row), column);
}
},
disabled: function() {
var selected = getValidSelection(this);
if (!selected) {
return true;
}
var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1];
var rowSelected = entireRowSelection.join(',') == selected.join(',');
return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected;
}
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__4, REMOVE_ROW, {
value: {
key: REMOVE_ROW,
name: 'Remove row',
callback: function(key, selection) {
var amount = selection.end.row - selection.start.row + 1;
this.alter('remove_row', selection.start.row, amount);
},
disabled: function() {
var selected = getValidSelection(this);
if (!selected) {
return true;
}
var entireColumnSelection = [0, selected[1], this.countRows() - 1, selected[1]];
return entireColumnSelection.join(',') === selected.join(',');
},
hidden: function() {
return !this.getSettings().allowRemoveRow;
}
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__4, REMOVE_COLUMN, {
value: {
key: REMOVE_COLUMN,
name: 'Remove column',
callback: function(key, selection) {
var amount = selection.end.col - selection.start.col + 1;
this.alter('remove_col', selection.start.col, amount);
},
disabled: function() {
var selected = getValidSelection(this);
if (!selected) {
return true;
}
if (!this.isColumnModificationAllowed()) {
return true;
}
var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1];
var rowSelected = entireRowSelection.join(',') == selected.join(',');
return (selected[1] < 0 || rowSelected);
},
hidden: function() {
return !this.getSettings().allowRemoveColumn;
}
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__4, UNDO, {
value: {
key: UNDO,
name: 'Undo',
callback: function() {
this.undo();
},
disabled: function() {
return this.undoRedo && !this.undoRedo.isUndoAvailable();
}
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__4, REDO, {
value: {
key: REDO,
name: 'Redo',
callback: function() {
this.redo();
},
disabled: function() {
return this.undoRedo && !this.undoRedo.isRedoAvailable();
}
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__4, READ_ONLY, {
value: {
key: READ_ONLY,
name: function() {
var $__3 = this;
var label = 'Read only';
var atLeastOneReadOnly = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) {
return $__3.getCellMeta(row, col).readOnly;
}));
if (atLeastOneReadOnly) {
label = markLabelAsSelected(label);
}
return label;
},
callback: function() {
var $__3 = this;
var range = this.getSelectedRange();
var atLeastOneReadOnly = checkSelectionConsistency(range, (function(row, col) {
return $__3.getCellMeta(row, col).readOnly;
}));
range.forAll((function(row, col) {
$__3.getCellMeta(row, col).readOnly = atLeastOneReadOnly ? false : true;
}));
this.render();
},
disabled: function() {
return this.getSelectedRange() ? false : true;
}
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__4, ALIGNMENT, {
value: {
key: ALIGNMENT,
name: 'Alignment',
disabled: function() {
return this.getSelectedRange() ? false : true;
},
submenu: {items: [{
key: (ALIGNMENT + ":left"),
name: function() {
var $__3 = this;
var label = 'Left';
var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) {
var className = $__3.getCellMeta(row, col).className;
if (className && className.indexOf('htLeft') !== -1) {
return true;
}
}));
if (hasClass) {
label = markLabelAsSelected(label);
}
return label;
},
callback: function() {
var $__3 = this;
var range = this.getSelectedRange();
var stateBefore = getAlignmentClasses(range, (function(row, col) {
return $__3.getCellMeta(row, col).className;
}));
var type = 'horizontal';
var alignment = 'htLeft';
this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);
align(range, type, alignment, (function(row, col) {
return $__3.getCellMeta(row, col);
}));
this.render();
},
disabled: false
}, {
key: (ALIGNMENT + ":center"),
name: function() {
var $__3 = this;
var label = 'Center';
var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) {
var className = $__3.getCellMeta(row, col).className;
if (className && className.indexOf('htCenter') !== -1) {
return true;
}
}));
if (hasClass) {
label = markLabelAsSelected(label);
}
return label;
},
callback: function() {
var $__3 = this;
var range = this.getSelectedRange();
var stateBefore = getAlignmentClasses(range, (function(row, col) {
return $__3.getCellMeta(row, col).className;
}));
var type = 'horizontal';
var alignment = 'htCenter';
this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);
align(range, type, alignment, (function(row, col) {
return $__3.getCellMeta(row, col);
}));
this.render();
},
disabled: false
}, {
key: (ALIGNMENT + ":right"),
name: function() {
var $__3 = this;
var label = 'Right';
var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) {
var className = $__3.getCellMeta(row, col).className;
if (className && className.indexOf('htRight') !== -1) {
return true;
}
}));
if (hasClass) {
label = markLabelAsSelected(label);
}
return label;
},
callback: function() {
var $__3 = this;
var range = this.getSelectedRange();
var stateBefore = getAlignmentClasses(range, (function(row, col) {
return $__3.getCellMeta(row, col).className;
}));
var type = 'horizontal';
var alignment = 'htRight';
this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);
align(range, type, alignment, (function(row, col) {
return $__3.getCellMeta(row, col);
}));
this.render();
},
disabled: false
}, {
key: (ALIGNMENT + ":justify"),
name: function() {
var $__3 = this;
var label = 'Justify';
var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) {
var className = $__3.getCellMeta(row, col).className;
if (className && className.indexOf('htJustify') !== -1) {
return true;
}
}));
if (hasClass) {
label = markLabelAsSelected(label);
}
return label;
},
callback: function() {
var $__3 = this;
var range = this.getSelectedRange();
var stateBefore = getAlignmentClasses(range, (function(row, col) {
return $__3.getCellMeta(row, col).className;
}));
var type = 'horizontal';
var alignment = 'htJustify';
this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);
align(range, type, alignment, (function(row, col) {
return $__3.getCellMeta(row, col);
}));
this.render();
},
disabled: false
}, {name: SEPARATOR}, {
key: (ALIGNMENT + ":top"),
name: function() {
var $__3 = this;
var label = 'Top';
var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) {
var className = $__3.getCellMeta(row, col).className;
if (className && className.indexOf('htTop') !== -1) {
return true;
}
}));
if (hasClass) {
label = markLabelAsSelected(label);
}
return label;
},
callback: function() {
var $__3 = this;
var range = this.getSelectedRange();
var stateBefore = getAlignmentClasses(range, (function(row, col) {
return $__3.getCellMeta(row, col).className;
}));
var type = 'vertical';
var alignment = 'htTop';
this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);
align(range, type, alignment, (function(row, col) {
return $__3.getCellMeta(row, col);
}));
this.render();
},
disabled: false
}, {
key: (ALIGNMENT + ":middle"),
name: function() {
var $__3 = this;
var label = 'Middle';
var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) {
var className = $__3.getCellMeta(row, col).className;
if (className && className.indexOf('htMiddle') !== -1) {
return true;
}
}));
if (hasClass) {
label = markLabelAsSelected(label);
}
return label;
},
callback: function() {
var $__3 = this;
var range = this.getSelectedRange();
var stateBefore = getAlignmentClasses(range, (function(row, col) {
return $__3.getCellMeta(row, col).className;
}));
var type = 'vertical';
var alignment = 'htMiddle';
this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);
align(range, type, alignment, (function(row, col) {
return $__3.getCellMeta(row, col);
}));
this.render();
},
disabled: false
}, {
key: (ALIGNMENT + ":bottom"),
name: function() {
var $__3 = this;
var label = 'Bottom';
var hasClass = checkSelectionConsistency(this.getSelectedRange(), (function(row, col) {
var className = $__3.getCellMeta(row, col).className;
if (className && className.indexOf('htBottom') !== -1) {
return true;
}
}));
if (hasClass) {
label = markLabelAsSelected(label);
}
return label;
},
callback: function() {
var $__3 = this;
var range = this.getSelectedRange();
var stateBefore = getAlignmentClasses(range, (function(row, col) {
return $__3.getCellMeta(row, col).className;
}));
var type = 'vertical';
var alignment = 'htBottom';
this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);
align(range, type, alignment, (function(row, col) {
return $__3.getCellMeta(row, col);
}));
this.render();
},
disabled: false
}]}
},
configurable: true,
enumerable: true,
writable: true
}), $__4);
//#
},{"helpers/number":49,"helpers/object":50,"utils":71}],71:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
normalizeSelection: {get: function() {
return normalizeSelection;
}},
isSeparator: {get: function() {
return isSeparator;
}},
hasSubMenu: {get: function() {
return hasSubMenu;
}},
isDisabled: {get: function() {
return isDisabled;
}},
isSelectionDisabled: {get: function() {
return isSelectionDisabled;
}},
getValidSelection: {get: function() {
return getValidSelection;
}},
prepareVerticalAlignClass: {get: function() {
return prepareVerticalAlignClass;
}},
prepareHorizontalAlignClass: {get: function() {
return prepareHorizontalAlignClass;
}},
getAlignmentClasses: {get: function() {
return getAlignmentClasses;
}},
align: {get: function() {
return align;
}},
checkSelectionConsistency: {get: function() {
return checkSelectionConsistency;
}},
markLabelAsSelected: {get: function() {
return markLabelAsSelected;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__;
var hasClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).hasClass;
function normalizeSelection(selRange) {
return {
start: selRange.getTopLeftCorner(),
end: selRange.getBottomRightCorner()
};
}
function isSeparator(cell) {
return hasClass(cell, 'htSeparator');
}
function hasSubMenu(cell) {
return hasClass(cell, 'htSubmenu');
}
function isDisabled(cell) {
return hasClass(cell, 'htDisabled');
}
function isSelectionDisabled(cell) {
return hasClass(cell, 'htSelectionDisabled');
}
function getValidSelection(hot) {
var selected = hot.getSelected();
if (!selected) {
return null;
}
if (selected[0] < 0) {
return null;
}
return selected;
}
function prepareVerticalAlignClass(className, alignment) {
if (className.indexOf(alignment) != -1) {
return className;
}
className = className.replace('htTop', '').replace('htMiddle', '').replace('htBottom', '').replace(' ', '');
className += ' ' + alignment;
return className;
}
function prepareHorizontalAlignClass(className, alignment) {
if (className.indexOf(alignment) != -1) {
return className;
}
className = className.replace('htLeft', '').replace('htCenter', '').replace('htRight', '').replace('htJustify', '').replace(' ', '');
className += ' ' + alignment;
return className;
}
function getAlignmentClasses(range, callback) {
var classes = {};
for (var row = range.from.row; row <= range.to.row; row++) {
for (var col = range.from.col; col <= range.to.col; col++) {
if (!classes[row]) {
classes[row] = [];
}
classes[row][col] = callback(row, col);
}
}
return classes;
}
function align(range, type, alignment, cellDescriptor) {
if (range.from.row == range.to.row && range.from.col == range.to.col) {
applyAlignClassName(range.from.row, range.from.col, type, alignment, cellDescriptor);
} else {
for (var row = range.from.row; row <= range.to.row; row++) {
for (var col = range.from.col; col <= range.to.col; col++) {
applyAlignClassName(row, col, type, alignment, cellDescriptor);
}
}
}
}
function applyAlignClassName(row, col, type, alignment, cellDescriptor) {
var cellMeta = cellDescriptor(row, col);
var className = alignment;
if (cellMeta.className) {
if (type === 'vertical') {
className = prepareVerticalAlignClass(cellMeta.className, alignment);
} else {
className = prepareHorizontalAlignClass(cellMeta.className, alignment);
}
}
cellMeta.className = className;
}
function checkSelectionConsistency(range, comparator) {
var result = false;
if (range) {
range.forAll(function(row, col) {
if (comparator(row, col)) {
result = true;
return false;
}
});
}
return result;
}
function markLabelAsSelected(label) {
return '<span class="selected">' + String.fromCharCode(10003) + '</span>' + label;
}
//#
},{"helpers/dom/element":45}],72:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
ContextMenuCopyPaste: {get: function() {
return ContextMenuCopyPaste;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_helpers_47_array__,
$___46__46__47__46__46__47_eventManager__,
$___46__46__47__46__46__47_plugins__,
$___46__46__47__95_base__,
$__zeroclipboard__;
var removeClass = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).removeClass;
var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach;
var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default;
var ZeroClipboard = ($__zeroclipboard__ = require("zeroclipboard"), $__zeroclipboard__ && $__zeroclipboard__.__esModule && $__zeroclipboard__ || {default: $__zeroclipboard__}).default;
var ContextMenuCopyPaste = function ContextMenuCopyPaste(hotInstance) {
$traceurRuntime.superConstructor($ContextMenuCopyPaste).call(this, hotInstance);
this.eventManager = new EventManager(this);
this.swfPath = null;
this.outsideClickDeselectsCache = null;
};
var $ContextMenuCopyPaste = ContextMenuCopyPaste;
($traceurRuntime.createClass)(ContextMenuCopyPaste, {
isEnabled: function() {
return this.hot.getSettings().contextMenuCopyPaste;
},
enablePlugin: function() {
var $__6 = this;
if (this.enabled) {
return;
}
if (typeof this.hot.getSettings().contextMenuCopyPaste === 'object') {
this.swfPath = this.hot.getSettings().contextMenuCopyPaste.swfPath;
}
if (typeof ZeroClipboard === 'undefined') {
console.error('To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.');
}
try {
new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
} catch (exception) {
if (typeof navigator.mimeTypes['application/x-shockwave-flash'] == 'undefined') {
console.error('To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.');
}
}
if (this.swfPath) {
ZeroClipboard.config({swfPath: this.swfPath});
}
this.hot.addHook('afterContextMenuShow', (function() {
return $__6.onAfterContextMenuShow();
}));
this.hot.addHook('afterContextMenuDefaultOptions', (function(options) {
return $__6.onAfterContextMenuDefaultOptions(options);
}));
this.registerEvents();
$traceurRuntime.superGet(this, $ContextMenuCopyPaste.prototype, "enablePlugin").call(this);
},
disablePlugin: function() {
$traceurRuntime.superGet(this, $ContextMenuCopyPaste.prototype, "disablePlugin").call(this);
},
registerEvents: function() {
var $__6 = this;
this.eventManager.addEventListener(document, 'mouseenter', (function() {
return $__6.removeCurrentClass();
}));
this.eventManager.addEventListener(document, 'mouseleave', (function() {
return $__6.removeZeroClipboardClass();
}));
},
getCopyValue: function() {
this.hot.copyPaste.setCopyableText();
return this.hot.copyPaste.copyPasteInstance.elTextarea.value;
},
onAfterContextMenuDefaultOptions: function(defaultOptions) {
defaultOptions.items.unshift({
key: 'copy',
name: 'Copy'
}, {
key: 'paste',
name: 'Paste',
callback: function() {
this.copyPaste.triggerPaste();
}
}, Handsontable.plugins.ContextMenu.SEPARATOR);
},
onAfterContextMenuShow: function() {
var $__6 = this;
var contextMenu = this.hot.getPlugin('contextMenu');
var data = contextMenu.menu.hotMenu.getSourceData();
arrayEach(data, (function(item, index) {
if (item.key === 'copy') {
var zeroClipboardInstance = new ZeroClipboard(contextMenu.menu.hotMenu.getCell(index, 0));
zeroClipboardInstance.off();
zeroClipboardInstance.on('copy', (function(event) {
var clipboard = event.clipboardData;
clipboard.setData('text/plain', $__6.getCopyValue());
$__6.hot.getSettings().outsideClickDeselects = $__6.outsideClickDeselectsCache;
}));
return false;
}
}));
},
removeCurrentClass: function() {
var contextMenu = this.hot.getPlugin('contextMenu');
if (contextMenu.menu.isOpened()) {
var element = contextMenu.menu.hotMenu.rootElement.querySelector('td.current');
if (element) {
removeClass(element, 'current');
}
}
this.outsideClickDeselectsCache = this.hot.getSettings().outsideClickDeselects;
this.hot.getSettings().outsideClickDeselects = false;
},
removeZeroClipboardClass: function() {
var contextMenu = this.hot.getPlugin('contextMenu');
if (contextMenu.menu.isOpened()) {
var element = contextMenu.menu.hotMenu.rootElement.querySelector('td.zeroclipboard-is-hover');
if (element) {
removeClass(element, 'zeroclipboard-is-hover');
}
}
this.hot.getSettings().outsideClickDeselects = this.outsideClickDeselectsCache;
}
}, {}, BasePlugin);
;
registerPlugin('contextMenuCopyPaste', ContextMenuCopyPaste);
//#
},{"_base":58,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":57,"zeroclipboard":"zeroclipboard"}],73:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
CopyPastePlugin: {get: function() {
return CopyPastePlugin;
}},
__esModule: {value: true}
});
var $__copyPaste__,
$__SheetClip__,
$___46__46__47__46__46__47_helpers_47_unicode__,
$___46__46__47__46__46__47_helpers_47_array__,
$___46__46__47__46__46__47_helpers_47_number__,
$___46__46__47__46__46__47_helpers_47_dom_47_event__,
$___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_helpers_47_function__,
$___46__46__47__46__46__47_plugins__,
$___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__,
$___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__;
var copyPaste = ($__copyPaste__ = require("copyPaste"), $__copyPaste__ && $__copyPaste__.__esModule && $__copyPaste__ || {default: $__copyPaste__}).default;
var SheetClip = ($__SheetClip__ = require("SheetClip"), $__SheetClip__ && $__SheetClip__.__esModule && $__SheetClip__ || {default: $__SheetClip__}).default;
var $__2 = ($___46__46__47__46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47__46__46__47_helpers_47_unicode__ && $___46__46__47__46__46__47_helpers_47_unicode__.__esModule && $___46__46__47__46__46__47_helpers_47_unicode__ || {default: $___46__46__47__46__46__47_helpers_47_unicode__}),
KEY_CODES = $__2.KEY_CODES,
isCtrlKey = $__2.isCtrlKey;
var arrayEach = ($___46__46__47__46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47__46__46__47_helpers_47_array__ && $___46__46__47__46__46__47_helpers_47_array__.__esModule && $___46__46__47__46__46__47_helpers_47_array__ || {default: $___46__46__47__46__46__47_helpers_47_array__}).arrayEach;
var rangeEach = ($___46__46__47__46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47__46__46__47_helpers_47_number__ && $___46__46__47__46__46__47_helpers_47_number__.__esModule && $___46__46__47__46__46__47_helpers_47_number__ || {default: $___46__46__47__46__46__47_helpers_47_number__}).rangeEach;
var $__5 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}),
stopImmediatePropagation = $__5.stopImmediatePropagation,
isImmediatePropagationStopped = $__5.isImmediatePropagationStopped;
var getSelectionText = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}).getSelectionText;
var proxy = ($___46__46__47__46__46__47_helpers_47_function__ = require("helpers/function"), $___46__46__47__46__46__47_helpers_47_function__ && $___46__46__47__46__46__47_helpers_47_function__.__esModule && $___46__46__47__46__46__47_helpers_47_function__ || {default: $___46__46__47__46__46__47_helpers_47_function__}).proxy;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords;
var WalkontableCellRange = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange;
function CopyPastePlugin(instance) {
var _this = this;
this.copyPasteInstance = copyPaste();
this.copyPasteInstance.onCut(onCut);
this.copyPasteInstance.onPaste(onPaste);
this.onPaste = onPaste;
instance.addHook('beforeKeyDown', onBeforeKeyDown);
function onCut() {
if (!instance.isListening()) {
return;
}
instance.selection.empty();
}
function onPaste(str) {
var input,
inputArray,
selected,
coordsFrom,
coordsTo,
cellRange,
topLeftCorner,
bottomRightCorner,
areaStart,
areaEnd;
if (!instance.isListening() || !instance.selection.isSelected()) {
return;
}
input = str;
inputArray = SheetClip.parse(input);
selected = instance.getSelected();
coordsFrom = new WalkontableCellCoords(selected[0], selected[1]);
coordsTo = new WalkontableCellCoords(selected[2], selected[3]);
cellRange = new WalkontableCellRange(coordsFrom, coordsFrom, coordsTo);
topLeftCorner = cellRange.getTopLeftCorner();
bottomRightCorner = cellRange.getBottomRightCorner();
areaStart = topLeftCorner;
areaEnd = new WalkontableCellCoords(Math.max(bottomRightCorner.row, inputArray.length - 1 + topLeftCorner.row), Math.max(bottomRightCorner.col, inputArray[0].length - 1 + topLeftCorner.col));
var isSelRowAreaCoverInputValue = coordsTo.row - coordsFrom.row >= inputArray.length - 1;
var isSelColAreaCoverInputValue = coordsTo.col - coordsFrom.col >= inputArray[0].length - 1;
instance.addHookOnce('afterChange', (function(changes, source) {
var changesLength = changes ? changes.length : 0;
if (changesLength) {
var offset = {
row: 0,
col: 0
};
var highestColumnIndex = -1;
arrayEach(changes, (function(change, index) {
var nextChange = changesLength > index + 1 ? changes[index + 1] : null;
if (nextChange) {
if (!isSelRowAreaCoverInputValue) {
offset.row = offset.row + Math.max(nextChange[0] - change[0] - 1, 0);
}
if (!isSelColAreaCoverInputValue && change[1] > highestColumnIndex) {
highestColumnIndex = change[1];
offset.col = offset.col + Math.max(nextChange[1] - change[1] - 1, 0);
}
}
}));
instance.selectCell(areaStart.row, areaStart.col, areaEnd.row + offset.row, areaEnd.col + offset.col);
}
}));
instance.populateFromArray(areaStart.row, areaStart.col, inputArray, areaEnd.row, areaEnd.col, 'paste', instance.getSettings().pasteMode);
}
function onBeforeKeyDown(event) {
if (!instance.getSelected()) {
return;
}
if (instance.getActiveEditor() && instance.getActiveEditor().isOpened()) {
return;
}
if (isImmediatePropagationStopped(event)) {
return;
}
if (isCtrlKey(event.keyCode)) {
if (instance.getSettings().fragmentSelection && getSelectionText()) {
return;
}
_this.setCopyableText();
stopImmediatePropagation(event);
return;
}
var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;
if (event.keyCode == KEY_CODES.A && ctrlDown) {
instance._registerTimeout(setTimeout(proxy(_this.setCopyableText, _this), 0));
}
}
this.destroy = function() {
if (this.copyPasteInstance) {
this.copyPasteInstance.removeCallback(onCut);
this.copyPasteInstance.removeCallback(onPaste);
this.copyPasteInstance.destroy();
this.copyPasteInstance = null;
}
instance.removeHook('beforeKeyDown', onBeforeKeyDown);
};
instance.addHook('afterDestroy', proxy(this.destroy, this));
this.triggerPaste = proxy(this.copyPasteInstance.triggerPaste, this.copyPasteInstance);
this.triggerCut = proxy(this.copyPasteInstance.triggerCut, this.copyPasteInstance);
this.setCopyableText = function() {
var settings = instance.getSettings();
var copyRowsLimit = settings.copyRowsLimit;
var copyColsLimit = settings.copyColsLimit;
var selRange = instance.getSelectedRange();
var topLeft = selRange.getTopLeftCorner();
var bottomRight = selRange.getBottomRightCorner();
var startRow = topLeft.row;
var startCol = topLeft.col;
var endRow = bottomRight.row;
var endCol = bottomRight.col;
var finalEndRow = Math.min(endRow, startRow + copyRowsLimit - 1);
var finalEndCol = Math.min(endCol, startCol + copyColsLimit - 1);
var copyableRanges = [];
copyableRanges.push({
startRow: startRow,
startCol: startCol,
endRow: finalEndRow,
endCol: finalEndCol
});
copyableRanges = Handsontable.hooks.run(instance, 'modifyCopyableRange', copyableRanges);
var copyableData = this.getRangedCopyableData(copyableRanges);
instance.copyPaste.copyPasteInstance.copyable(copyableData);
if (endRow !== finalEndRow || endCol !== finalEndCol) {
Handsontable.hooks.run(instance, 'afterCopyLimit', endRow - startRow + 1, endCol - startCol + 1, copyRowsLimit, copyColsLimit);
}
};
this.getRangedCopyableData = function(ranges) {
var dataSet = [];
var copyableRows = [];
var copyableColumns = [];
arrayEach(ranges, (function(range) {
rangeEach(range.startRow, range.endRow, (function(row) {
if (copyableRows.indexOf(row) === -1) {
copyableRows.push(row);
}
}));
rangeEach(range.startCol, range.endCol, (function(column) {
if (copyableColumns.indexOf(column) === -1) {
copyableColumns.push(column);
}
}));
}));
arrayEach(copyableRows, (function(row) {
var rowSet = [];
arrayEach(copyableColumns, (function(column) {
rowSet.push(instance.getCopyableData(row, column));
}));
dataSet.push(rowSet);
}));
return SheetClip.stringify(dataSet);
};
}
function init() {
var instance = this,
pluginEnabled = instance.getSettings().copyPaste !== false;
if (pluginEnabled && !instance.copyPaste) {
instance.copyPaste = new CopyPastePlugin(instance);
} else if (!pluginEnabled && instance.copyPaste) {
instance.copyPaste.destroy();
instance.copyPaste = null;
}
}
Handsontable.hooks.add('afterInit', init);
Handsontable.hooks.add('afterUpdateSettings', init);
Handsontable.hooks.register('afterCopyLimit');
Handsontable.hooks.register('modifyCopyableRange');
;
//#
},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"SheetClip":"SheetClip","copyPaste":"copyPaste","helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":47,"helpers/number":49,"helpers/unicode":53,"plugins":57}],74:[function(require,module,exports){
"use strict";
var $___46__46__47__46__46__47_plugins__,
$___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__,
$___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var WalkontableCellRange = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange;
var WalkontableSelection = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__ = require("3rdparty/walkontable/src/selection"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_selection__}).WalkontableSelection;
function CustomBorders() {}
var instance;
var checkEnable = function(customBorders) {
if (typeof customBorders === 'boolean') {
if (customBorders === true) {
return true;
}
}
if (typeof customBorders === 'object') {
if (customBorders.length > 0) {
return true;
}
}
return false;
};
var init = function() {
if (checkEnable(this.getSettings().customBorders)) {
if (!this.customBorders) {
instance = this;
this.customBorders = new CustomBorders();
}
}
};
var getSettingIndex = function(className) {
for (var i = 0; i < instance.view.wt.selections.length; i++) {
if (instance.view.wt.selections[i].settings.className == className) {
return i;
}
}
return -1;
};
var insertBorderIntoSettings = function(border) {
var coordinates = {
row: border.row,
col: border.col
};
var selection = new WalkontableSelection(border, new WalkontableCellRange(coordinates, coordinates, coordinates));
var index = getSettingIndex(border.className);
if (index >= 0) {
instance.view.wt.selections[index] = selection;
} else {
instance.view.wt.selections.push(selection);
}
};
var prepareBorderFromCustomAdded = function(row, col, borderObj) {
var border = createEmptyBorders(row, col);
border = extendDefaultBorder(border, borderObj);
this.setCellMeta(row, col, 'borders', border);
insertBorderIntoSettings(border);
};
var prepareBorderFromCustomAddedRange = function(rowObj) {
var range = rowObj.range;
for (var row = range.from.row; row <= range.to.row; row++) {
for (var col = range.from.col; col <= range.to.col; col++) {
var border = createEmptyBorders(row, col);
var add = 0;
if (row == range.from.row) {
add++;
if (rowObj.hasOwnProperty('top')) {
border.top = rowObj.top;
}
}
if (row == range.to.row) {
add++;
if (rowObj.hasOwnProperty('bottom')) {
border.bottom = rowObj.bottom;
}
}
if (col == range.from.col) {
add++;
if (rowObj.hasOwnProperty('left')) {
border.left = rowObj.left;
}
}
if (col == range.to.col) {
add++;
if (rowObj.hasOwnProperty('right')) {
border.right = rowObj.right;
}
}
if (add > 0) {
this.setCellMeta(row, col, 'borders', border);
insertBorderIntoSettings(border);
}
}
}
};
var createClassName = function(row, col) {
return 'border_row' + row + 'col' + col;
};
var createDefaultCustomBorder = function() {
return {
width: 1,
color: '#000'
};
};
var createSingleEmptyBorder = function() {
return {hide: true};
};
var createDefaultHtBorder = function() {
return {
width: 1,
color: '#000',
cornerVisible: false
};
};
var createEmptyBorders = function(row, col) {
return {
className: createClassName(row, col),
border: createDefaultHtBorder(),
row: row,
col: col,
top: createSingleEmptyBorder(),
right: createSingleEmptyBorder(),
bottom: createSingleEmptyBorder(),
left: createSingleEmptyBorder()
};
};
var extendDefaultBorder = function(defaultBorder, customBorder) {
if (customBorder.hasOwnProperty('border')) {
defaultBorder.border = customBorder.border;
}
if (customBorder.hasOwnProperty('top')) {
defaultBorder.top = customBorder.top;
}
if (customBorder.hasOwnProperty('right')) {
defaultBorder.right = customBorder.right;
}
if (customBorder.hasOwnProperty('bottom')) {
defaultBorder.bottom = customBorder.bottom;
}
if (customBorder.hasOwnProperty('left')) {
defaultBorder.left = customBorder.left;
}
return defaultBorder;
};
var removeBordersFromDom = function(borderClassName) {
var borders = document.querySelectorAll('.' + borderClassName);
for (var i = 0; i < borders.length; i++) {
if (borders[i]) {
if (borders[i].nodeName != 'TD') {
var parent = borders[i].parentNode;
if (parent.parentNode) {
parent.parentNode.removeChild(parent);
}
}
}
}
};
var removeAllBorders = function(row, col) {
var borderClassName = createClassName(row, col);
removeBordersFromDom(borderClassName);
this.removeCellMeta(row, col, 'borders');
};
var setBorder = function(row, col, place, remove) {
var bordersMeta = this.getCellMeta(row, col).borders;
if (!bordersMeta || bordersMeta.border == undefined) {
bordersMeta = createEmptyBorders(row, col);
}
if (remove) {
bordersMeta[place] = createSingleEmptyBorder();
} else {
bordersMeta[place] = createDefaultCustomBorder();
}
this.setCellMeta(row, col, 'borders', bordersMeta);
var borderClassName = createClassName(row, col);
removeBordersFromDom(borderClassName);
insertBorderIntoSettings(bordersMeta);
this.render();
};
var prepareBorder = function(range, place, remove) {
if (range.from.row == range.to.row && range.from.col == range.to.col) {
if (place == 'noBorders') {
removeAllBorders.call(this, range.from.row, range.from.col);
} else {
setBorder.call(this, range.from.row, range.from.col, place, remove);
}
} else {
switch (place) {
case 'noBorders':
for (var column = range.from.col; column <= range.to.col; column++) {
for (var row = range.from.row; row <= range.to.row; row++) {
removeAllBorders.call(this, row, column);
}
}
break;
case 'top':
for (var topCol = range.from.col; topCol <= range.to.col; topCol++) {
setBorder.call(this, range.from.row, topCol, place, remove);
}
break;
case 'right':
for (var rowRight = range.from.row; rowRight <= range.to.row; rowRight++) {
setBorder.call(this, rowRight, range.to.col, place);
}
break;
case 'bottom':
for (var bottomCol = range.from.col; bottomCol <= range.to.col; bottomCol++) {
setBorder.call(this, range.to.row, bottomCol, place);
}
break;
case 'left':
for (var rowLeft = range.from.row; rowLeft <= range.to.row; rowLeft++) {
setBorder.call(this, rowLeft, range.from.col, place);
}
break;
}
}
};
var checkSelectionBorders = function(hot, direction) {
var atLeastOneHasBorder = false;
hot.getSelectedRange().forAll(function(r, c) {
var metaBorders = hot.getCellMeta(r, c).borders;
if (metaBorders) {
if (direction) {
if (!metaBorders[direction].hasOwnProperty('hide')) {
atLeastOneHasBorder = true;
return false;
}
} else {
atLeastOneHasBorder = true;
return false;
}
}
});
return atLeastOneHasBorder;
};
var markSelected = function(label) {
return '<span class="selected">' + String.fromCharCode(10003) + '</span>' + label;
};
var addBordersOptionsToContextMenu = function(defaultOptions) {
if (!this.getSettings().customBorders) {
return;
}
defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR);
defaultOptions.items.push({
key: 'borders',
name: 'Borders',
submenu: {items: [{
key: 'borders:top',
name: function() {
var label = 'Top';
var hasBorder = checkSelectionBorders(this, 'top');
if (hasBorder) {
label = markSelected(label);
}
return label;
},
callback: function() {
var hasBorder = checkSelectionBorders(this, 'top');
prepareBorder.call(this, this.getSelectedRange(), 'top', hasBorder);
},
disabled: false
}, {
key: 'borders:right',
name: function() {
var label = 'Right';
var hasBorder = checkSelectionBorders(this, 'right');
if (hasBorder) {
label = markSelected(label);
}
return label;
},
callback: function() {
var hasBorder = checkSelectionBorders(this, 'right');
prepareBorder.call(this, this.getSelectedRange(), 'right', hasBorder);
},
disabled: false
}, {
key: 'borders:bottom',
name: function() {
var label = 'Bottom';
var hasBorder = checkSelectionBorders(this, 'bottom');
if (hasBorder) {
label = markSelected(label);
}
return label;
},
callback: function() {
var hasBorder = checkSelectionBorders(this, 'bottom');
prepareBorder.call(this, this.getSelectedRange(), 'bottom', hasBorder);
},
disabled: false
}, {
key: 'borders:left',
name: function() {
var label = 'Left';
var hasBorder = checkSelectionBorders(this, 'left');
if (hasBorder) {
label = markSelected(label);
}
return label;
},
callback: function() {
var hasBorder = checkSelectionBorders(this, 'left');
prepareBorder.call(this, this.getSelectedRange(), 'left', hasBorder);
},
disabled: false
}, {
key: 'borders:no_borders',
name: 'Remove border(s)',
callback: function() {
prepareBorder.call(this, this.getSelectedRange(), 'noBorders');
},
disabled: function() {
return !checkSelectionBorders(this);
}
}]}
});
};
Handsontable.hooks.add('beforeInit', init);
Handsontable.hooks.add('afterContextMenuDefaultOptions', addBordersOptionsToContextMenu);
Handsontable.hooks.add('afterInit', function() {
var customBorders = this.getSettings().customBorders;
if (customBorders) {
for (var i = 0; i < customBorders.length; i++) {
if (customBorders[i].range) {
prepareBorderFromCustomAddedRange.call(this, customBorders[i]);
} else {
prepareBorderFromCustomAdded.call(this, customBorders[i].row, customBorders[i].col, customBorders[i]);
}
}
this.render();
this.view.wt.draw(true);
}
});
Handsontable.CustomBorders = CustomBorders;
//#
},{"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,"plugins":57}],75:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
DragToScroll: {get: function() {
return DragToScroll;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_eventManager__,
$___46__46__47__46__46__47_plugins__;
var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
;
Handsontable.plugins.DragToScroll = DragToScroll;
function DragToScroll() {
this.boundaries = null;
this.callback = null;
}
DragToScroll.prototype.setBoundaries = function(boundaries) {
this.boundaries = boundaries;
};
DragToScroll.prototype.setCallback = function(callback) {
this.callback = callback;
};
DragToScroll.prototype.check = function(x, y) {
var diffX = 0;
var diffY = 0;
if (y < this.boundaries.top) {
diffY = y - this.boundaries.top;
} else if (y > this.boundaries.bottom) {
diffY = y - this.boundaries.bottom;
}
if (x < this.boundaries.left) {
diffX = x - this.boundaries.left;
} else if (x > this.boundaries.right) {
diffX = x - this.boundaries.right;
}
this.callback(diffX, diffY);
};
var dragToScroll;
var instance;
var setupListening = function(instance) {
instance.dragToScrollListening = false;
var scrollHandler = instance.view.wt.wtTable.holder;
dragToScroll = new DragToScroll();
if (scrollHandler === window) {
return;
} else {
dragToScroll.setBoundaries(scrollHandler.getBoundingClientRect());
}
dragToScroll.setCallback(function(scrollX, scrollY) {
if (scrollX < 0) {
scrollHandler.scrollLeft -= 50;
} else if (scrollX > 0) {
scrollHandler.scrollLeft += 50;
}
if (scrollY < 0) {
scrollHandler.scrollTop -= 20;
} else if (scrollY > 0) {
scrollHandler.scrollTop += 20;
}
});
instance.dragToScrollListening = true;
};
Handsontable.hooks.add('afterInit', function() {
var instance = this;
var eventManager = eventManagerObject(this);
eventManager.addEventListener(document, 'mouseup', function() {
instance.dragToScrollListening = false;
});
eventManager.addEventListener(document, 'mousemove', function(event) {
if (instance.dragToScrollListening) {
dragToScroll.check(event.clientX, event.clientY);
}
});
});
Handsontable.hooks.add('afterDestroy', function() {
eventManagerObject(this).clear();
});
Handsontable.hooks.add('afterOnCellMouseDown', function() {
setupListening(this);
});
Handsontable.hooks.add('afterOnCellCornerMouseDown', function() {
setupListening(this);
});
Handsontable.plugins.DragToScroll = DragToScroll;
//#
},{"eventManager":41,"plugins":57}],76:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
ManualColumnFreeze: {get: function() {
return ManualColumnFreeze;
}},
__esModule: {value: true}
});
var $___46__46__47__95_base__,
$___46__46__47__46__46__47_plugins__;
var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var ManualColumnFreeze = function ManualColumnFreeze(hotInstance) {
$traceurRuntime.superConstructor($ManualColumnFreeze).call(this, hotInstance);
};
var $ManualColumnFreeze = ManualColumnFreeze;
($traceurRuntime.createClass)(ManualColumnFreeze, {
isEnabled: function() {
return !!this.hot.getSettings().manualColumnFreeze;
},
enablePlugin: function() {
var $__2 = this;
if (this.enabled) {
return;
}
this.addHook('modifyCol', (function(col) {
return $__2.onModifyCol(col);
}));
this.addHook('afterContextMenuDefaultOptions', (function(defaultOptions) {
return $__2.addContextMenuEntry(defaultOptions);
}));
$traceurRuntime.superGet(this, $ManualColumnFreeze.prototype, "enablePlugin").call(this);
},
disablePlugin: function() {
$traceurRuntime.superGet(this, $ManualColumnFreeze.prototype, "disablePlugin").call(this);
},
init: function() {
$traceurRuntime.superGet(this, $ManualColumnFreeze.prototype, "init").call(this);
if (typeof this.hot.manualColumnPositionsPluginUsages === 'undefined') {
this.hot.manualColumnPositionsPluginUsages = ['manualColumnFreeze'];
} else {
this.hot.manualColumnPositionsPluginUsages.push('manualColumnFreeze');
}
this.fixedColumnsCount = this.hot.getSettings().fixedColumnsLeft;
},
onModifyCol: function(column) {
if (this.hot.manualColumnPositionsPluginUsages.length > 1) {
return column;
}
return this.getModifiedColumnIndex(column);
},
getModifiedColumnIndex: function(column) {
return this.hot.manualColumnPositions[column];
},
addContextMenuEntry: function(defaultOptions) {
var _this = this;
defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR, {
key: 'freeze_column',
name: function() {
var selectedColumn = _this.hot.getSelected()[1];
if (selectedColumn > _this.fixedColumnsCount - 1) {
return 'Freeze this column';
} else {
return 'Unfreeze this column';
}
},
disabled: function() {
var selection = _this.hot.getSelected();
return selection[1] !== selection[3];
},
callback: function() {
var selectedColumn = _this.hot.getSelected()[1];
if (selectedColumn > _this.fixedColumnsCount - 1) {
_this.freezeColumn(selectedColumn);
} else {
_this.unfreezeColumn(selectedColumn);
}
}
});
},
freezeColumn: function(column) {
if (column <= this.fixedColumnsCount - 1) {
return;
}
var modifiedColumn = this.getModifiedColumnIndex(column) || column;
this.checkPositionData(modifiedColumn);
this.modifyColumnOrder(modifiedColumn, column, null, 'freeze');
this.addFixedColumn();
this.hot.view.wt.wtOverlays.leftOverlay.refresh();
this.hot.view.wt.wtOverlays.adjustElementsSize();
},
unfreezeColumn: function(column) {
if (column > this.fixedColumnsCount - 1) {
return;
}
var returnCol = this.getBestColumnReturnPosition(column);
var modifiedColumn = this.getModifiedColumnIndex(column) || column;
this.checkPositionData(modifiedColumn);
this.modifyColumnOrder(modifiedColumn, column, returnCol, 'unfreeze');
this.removeFixedColumn();
this.hot.view.wt.wtOverlays.leftOverlay.refresh();
this.hot.view.wt.wtOverlays.adjustElementsSize();
},
addFixedColumn: function() {
this.hot.updateSettings({fixedColumnsLeft: this.fixedColumnsCount + 1});
this.fixedColumnsCount++;
},
removeFixedColumn: function() {
this.hot.updateSettings({fixedColumnsLeft: this.fixedColumnsCount - 1});
this.fixedColumnsCount--;
},
checkPositionData: function(column) {
if (!this.hot.manualColumnPositions || this.hot.manualColumnPositions.length === 0) {
if (!this.hot.manualColumnPositions) {
this.hot.manualColumnPositions = [];
}
}
if (column) {
if (!this.hot.manualColumnPositions[column]) {
this.createPositionData(column + 1);
}
} else {
this.createPositionData(this.hot.countCols());
}
},
createPositionData: function(length) {
if (this.hot.manualColumnPositions.length < length) {
for (var i = this.hot.manualColumnPositions.length; i < length; i++) {
this.hot.manualColumnPositions[i] = i;
}
}
},
modifyColumnOrder: function(column, actualColumn, returnColumn, action) {
if (returnColumn == null) {
returnColumn = column;
}
if (action === 'freeze') {
this.hot.manualColumnPositions.splice(this.fixedColumnsCount, 0, this.hot.manualColumnPositions.splice(actualColumn, 1)[0]);
} else if (action === 'unfreeze') {
this.hot.manualColumnPositions.splice(returnColumn, 0, this.hot.manualColumnPositions.splice(actualColumn, 1)[0]);
}
},
getBestColumnReturnPosition: function(column) {
var i = this.fixedColumnsCount;
var j = this.getModifiedColumnIndex(i);
var initialCol = this.getModifiedColumnIndex(column);
while (j < initialCol) {
i++;
j = this.getModifiedColumnIndex(i);
}
return i - 1;
}
}, {}, BasePlugin);
;
registerPlugin('manualColumnFreeze', ManualColumnFreeze);
//#
},{"_base":58,"plugins":57}],77:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
ManualColumnMove: {get: function() {
return ManualColumnMove;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_eventManager__,
$___46__46__47__46__46__47_helpers_47_dom_47_event__,
$___46__46__47__46__46__47_plugins__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
hasClass = $__0.hasClass,
removeClass = $__0.removeClass;
var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager;
var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}),
pageX = $__2.pageX,
pageY = $__2.pageY;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
;
function ManualColumnMove() {
var startCol,
endCol,
startX,
startOffset,
currentCol,
instance,
currentTH,
handle = document.createElement('DIV'),
guide = document.createElement('DIV'),
eventManager = eventManagerObject(this);
handle.className = 'manualColumnMover';
guide.className = 'manualColumnMoverGuide';
var saveManualColumnPositions = function() {
var instance = this;
Handsontable.hooks.run(instance, 'persistentStateSave', 'manualColumnPositions', instance.manualColumnPositions);
};
var loadManualColumnPositions = function() {
var instance = this;
var storedState = {};
Handsontable.hooks.run(instance, 'persistentStateLoad', 'manualColumnPositions', storedState);
return storedState.value;
};
function setupHandlePosition(TH) {
instance = this;
currentTH = TH;
var col = this.view.wt.wtTable.getCoords(TH).col;
if (col >= 0) {
currentCol = col;
var box = currentTH.getBoundingClientRect();
startOffset = box.left;
handle.style.top = box.top + 'px';
handle.style.left = startOffset + 'px';
instance.rootElement.appendChild(handle);
}
}
function refreshHandlePosition(TH, delta) {
var box = TH.getBoundingClientRect();
var handleWidth = 6;
if (delta > 0) {
handle.style.left = (box.left + box.width - handleWidth) + 'px';
} else {
handle.style.left = box.left + 'px';
}
}
function setupGuidePosition() {
var instance = this;
addClass(handle, 'active');
addClass(guide, 'active');
var box = currentTH.getBoundingClientRect();
guide.style.width = box.width + 'px';
guide.style.height = instance.view.maximumVisibleElementHeight(0) + 'px';
guide.style.top = handle.style.top;
guide.style.left = startOffset + 'px';
instance.rootElement.appendChild(guide);
}
function refreshGuidePosition(diff) {
guide.style.left = startOffset + diff + 'px';
}
function hideHandleAndGuide() {
removeClass(handle, 'active');
removeClass(guide, 'active');
}
var checkColumnHeader = function(element) {
if (element != this.rootElement) {
var parent = element.parentNode;
if (parent.tagName === 'THEAD') {
return true;
}
return checkColumnHeader.call(this, parent);
}
return false;
};
var getTHFromTargetElement = function(element) {
if (element.tagName != 'TABLE') {
if (element.tagName == 'TH') {
return element;
} else {
return getTHFromTargetElement(element.parentNode);
}
}
return null;
};
var bindEvents = function() {
var instance = this;
var pressed;
eventManager.addEventListener(instance.rootElement, 'mouseover', function(e) {
if (checkColumnHeader.call(instance, e.target)) {
var th = getTHFromTargetElement(e.target);
if (th) {
if (pressed) {
var col = instance.view.wt.wtTable.getCoords(th).col;
if (col >= 0) {
endCol = col;
refreshHandlePosition(e.target, endCol - startCol);
}
} else {
setupHandlePosition.call(instance, th);
}
}
}
});
eventManager.addEventListener(instance.rootElement, 'mousedown', function(e) {
if (hasClass(e.target, 'manualColumnMover')) {
startX = pageX(e);
setupGuidePosition.call(instance);
pressed = instance;
startCol = currentCol;
endCol = currentCol;
}
});
eventManager.addEventListener(window, 'mousemove', function(e) {
if (pressed) {
refreshGuidePosition(pageX(e) - startX);
}
});
eventManager.addEventListener(window, 'mouseup', function(e) {
if (pressed) {
hideHandleAndGuide();
pressed = false;
createPositionData(instance.manualColumnPositions, instance.countCols());
instance.manualColumnPositions.splice(endCol, 0, instance.manualColumnPositions.splice(startCol, 1)[0]);
Handsontable.hooks.run(instance, 'beforeColumnMove', startCol, endCol);
instance.forceFullRender = true;
instance.view.render();
saveManualColumnPositions.call(instance);
Handsontable.hooks.run(instance, 'afterColumnMove', startCol, endCol);
setupHandlePosition.call(instance, currentTH);
}
});
instance.addHook('afterDestroy', unbindEvents);
};
var unbindEvents = function() {
eventManager.clear();
};
var createPositionData = function(positionArr, len) {
if (positionArr.length < len) {
for (var i = positionArr.length; i < len; i++) {
positionArr[i] = i;
}
}
};
this.beforeInit = function() {
this.manualColumnPositions = [];
};
this.init = function(source) {
var instance = this;
var manualColMoveEnabled = !!(this.getSettings().manualColumnMove);
if (manualColMoveEnabled) {
var initialManualColumnPositions = this.getSettings().manualColumnMove;
var loadedManualColumnPositions = loadManualColumnPositions.call(instance);
if (typeof loadedManualColumnPositions != 'undefined') {
this.manualColumnPositions = loadedManualColumnPositions;
} else if (Array.isArray(initialManualColumnPositions)) {
this.manualColumnPositions = initialManualColumnPositions;
} else if (!initialManualColumnPositions || this.manualColumnPositions === void 0) {
this.manualColumnPositions = [];
}
if (source === 'afterInit' || source === 'afterUpdateSettings' && eventManager.context.eventListeners.length === 0) {
if (typeof instance.manualColumnPositionsPluginUsages === 'undefined') {
instance.manualColumnPositionsPluginUsages = ['manualColumnMove'];
} else {
instance.manualColumnPositionsPluginUsages.push('manualColumnMove');
}
unbindEvents.call(this);
bindEvents.call(this);
if (this.manualColumnPositions && this.manualColumnPositions.length > 0) {
this.forceFullRender = true;
this.render();
}
}
} else {
var pluginUsagesIndex = instance.manualColumnPositionsPluginUsages ? instance.manualColumnPositionsPluginUsages.indexOf('manualColumnMove') : -1;
if (pluginUsagesIndex > -1) {
unbindEvents.call(this);
this.manualColumnPositions = [];
instance.manualColumnPositionsPluginUsages[pluginUsagesIndex] = void 0;
}
}
};
this.modifyCol = function(col) {
if (this.getSettings().manualColumnMove) {
if (typeof this.manualColumnPositions[col] === 'undefined') {
createPositionData(this.manualColumnPositions, col + 1);
}
return this.manualColumnPositions[col];
}
return col;
};
this.afterRemoveCol = function(index, amount) {
if (!this.getSettings().manualColumnMove) {
return;
}
var rmindx,
colpos = this.manualColumnPositions;
rmindx = colpos.splice(index, amount);
colpos = colpos.map(function(colpos) {
var i,
newpos = colpos;
for (i = 0; i < rmindx.length; i++) {
if (colpos > rmindx[i]) {
newpos--;
}
}
return newpos;
});
this.manualColumnPositions = colpos;
};
this.afterCreateCol = function(index, amount) {
if (!this.getSettings().manualColumnMove) {
return;
}
var colpos = this.manualColumnPositions;
if (!colpos.length) {
return;
}
var addindx = [];
for (var i = 0; i < amount; i++) {
addindx.push(index + i);
}
if (index >= colpos.length) {
colpos.concat(addindx);
} else {
colpos = colpos.map(function(colpos) {
return (colpos >= index) ? (colpos + amount) : colpos;
});
colpos.splice.apply(colpos, [index, 0].concat(addindx));
}
this.manualColumnPositions = colpos;
};
}
var htManualColumnMove = new ManualColumnMove();
Handsontable.hooks.add('beforeInit', htManualColumnMove.beforeInit);
Handsontable.hooks.add('afterInit', function() {
htManualColumnMove.init.call(this, 'afterInit');
});
Handsontable.hooks.add('afterUpdateSettings', function() {
htManualColumnMove.init.call(this, 'afterUpdateSettings');
});
Handsontable.hooks.add('modifyCol', htManualColumnMove.modifyCol);
Handsontable.hooks.add('afterRemoveCol', htManualColumnMove.afterRemoveCol);
Handsontable.hooks.add('afterCreateCol', htManualColumnMove.afterCreateCol);
Handsontable.hooks.register('beforeColumnMove');
Handsontable.hooks.register('afterColumnMove');
//#
},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],78:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
ManualColumnResize: {get: function() {
return ManualColumnResize;
}},
__esModule: {value: true}
});
var $___46__46__47__95_base_46_js__,
$___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_eventManager__,
$___46__46__47__46__46__47_helpers_47_dom_47_event__,
$___46__46__47__46__46__47_plugins__;
var BasePlugin = ($___46__46__47__95_base_46_js__ = require("_base.js"), $___46__46__47__95_base_46_js__ && $___46__46__47__95_base_46_js__.__esModule && $___46__46__47__95_base_46_js__ || {default: $___46__46__47__95_base_46_js__}).default;
var $__1 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__1.addClass,
hasClass = $__1.hasClass,
removeClass = $__1.removeClass;
var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager;
var $__3 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}),
pageX = $__3.pageX,
pageY = $__3.pageY;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var ManualColumnResize = function ManualColumnResize(hotInstance) {
$traceurRuntime.superConstructor($ManualColumnResize).call(this, hotInstance);
this.currentTH = null;
this.currentCol = null;
this.currentWidth = null;
this.newSize = null;
this.startY = null;
this.startWidth = null;
this.startOffset = null;
this.handle = document.createElement('DIV');
this.guide = document.createElement('DIV');
this.eventManager = eventManagerObject(this);
this.pressed = null;
this.dblclick = 0;
this.autoresizeTimeout = null;
this.manualColumnWidths = [];
addClass(this.handle, 'manualColumnResizer');
addClass(this.guide, 'manualColumnResizerGuide');
};
var $ManualColumnResize = ManualColumnResize;
($traceurRuntime.createClass)(ManualColumnResize, {
isEnabled: function() {
return this.hot.getSettings().manualColumnResize;
},
enablePlugin: function() {
var $__5 = this;
if (this.enabled) {
return;
}
this.manualColumnWidths = [];
var initialColumnWidth = this.hot.getSettings().manualColumnResize;
var loadedManualColumnWidths = this.loadManualColumnWidths();
this.addHook('modifyColWidth', (function(width, col) {
return $__5.onModifyColWidth(width, col);
}));
this.addHook('beforeStretchingColumnWidth', (function(stretchedWidth, column) {
return $__5.onBeforeStretchingColumnWidth(stretchedWidth, column);
}));
if (typeof loadedManualColumnWidths != 'undefined') {
this.manualColumnWidths = loadedManualColumnWidths;
} else if (Array.isArray(initialColumnWidth)) {
this.manualColumnWidths = initialColumnWidth;
} else {
this.manualColumnWidths = [];
}
Handsontable.hooks.register('beforeColumnResize');
Handsontable.hooks.register('afterColumnResize');
this.bindEvents();
$traceurRuntime.superGet(this, $ManualColumnResize.prototype, "enablePlugin").call(this);
},
updatePlugin: function() {
var initialColumnWidth = this.hot.getSettings().manualColumnResize;
if (Array.isArray(initialColumnWidth)) {
this.manualColumnWidths = initialColumnWidth;
} else if (!initialColumnWidth) {
this.manualColumnWidths = [];
}
},
disablePlugin: function() {
$traceurRuntime.superGet(this, $ManualColumnResize.prototype, "disablePlugin").call(this);
},
saveManualColumnWidths: function() {
this.hot.runHooks('persistentStateSave', 'manualColumnWidths', this.manualColumnWidths);
},
loadManualColumnWidths: function() {
var storedState = {};
this.hot.runHooks('persistentStateLoad', 'manualColumnWidths', storedState);
return storedState.value;
},
setupHandlePosition: function(TH) {
this.currentTH = TH;
var col = this.hot.view.wt.wtTable.getCoords(TH).col;
if (col >= 0) {
var box = this.currentTH.getBoundingClientRect();
this.currentCol = col;
this.startOffset = box.left - 6;
this.startWidth = parseInt(box.width, 10);
this.handle.style.top = box.top + 'px';
this.handle.style.left = this.startOffset + this.startWidth + 'px';
this.hot.rootElement.appendChild(this.handle);
}
},
refreshHandlePosition: function() {
this.handle.style.left = this.startOffset + this.currentWidth + 'px';
},
setupGuidePosition: function() {
addClass(this.handle, 'active');
addClass(this.guide, 'active');
this.guide.style.top = this.handle.style.top;
this.guide.style.left = this.handle.style.left;
this.guide.style.height = this.hot.view.maximumVisibleElementHeight(0) + 'px';
this.hot.rootElement.appendChild(this.guide);
},
refreshGuidePosition: function() {
this.guide.style.left = this.handle.style.left;
},
hideHandleAndGuide: function() {
removeClass(this.handle, 'active');
removeClass(this.guide, 'active');
},
checkIfColumnHeader: function(element) {
if (element != this.hot.rootElement) {
var parent = element.parentNode;
if (parent.tagName === 'THEAD') {
return true;
}
return this.checkIfColumnHeader(parent);
}
return false;
},
getTHFromTargetElement: function(element) {
if (element.tagName != 'TABLE') {
if (element.tagName == 'TH') {
return element;
} else {
return this.getTHFromTargetElement(element.parentNode);
}
}
return null;
},
onMouseOver: function(event) {
if (this.checkIfColumnHeader(event.target)) {
var th = this.getTHFromTargetElement(event.target);
if (!th) {
return;
}
var colspan = th.getAttribute('colspan');
if (th && (colspan === null || colspan === 1)) {
if (!this.pressed) {
this.setupHandlePosition(th);
}
}
}
},
afterMouseDownTimeout: function() {
if (this.dblclick >= 2) {
var hookNewSize = this.hot.runHooks('beforeColumnResize', this.currentCol, this.newSize, true);
if (hookNewSize !== void 0) {
this.newSize = hookNewSize;
}
if (this.hot.getSettings().stretchH === 'all') {
this.clearManualSize(this.currentCol);
} else {
this.setManualSize(this.currentCol, this.newSize);
}
this.hot.forceFullRender = true;
this.hot.view.render();
this.hot.view.wt.wtOverlays.adjustElementsSize(true);
this.hot.runHooks('afterColumnResize', this.currentCol, this.newSize, true);
}
this.dblclick = 0;
this.autoresizeTimeout = null;
},
onMouseDown: function(event) {
var $__5 = this;
if (hasClass(event.target, 'manualColumnResizer')) {
this.setupGuidePosition();
this.pressed = this.hot;
if (this.autoresizeTimeout === null) {
this.autoresizeTimeout = setTimeout((function() {
return $__5.afterMouseDownTimeout();
}), 500);
this.hot._registerTimeout(this.autoresizeTimeout);
}
this.dblclick++;
this.startX = pageX(event);
this.newSize = this.startWidth;
}
},
onMouseMove: function(event) {
if (this.pressed) {
this.currentWidth = this.startWidth + (pageX(event) - this.startX);
this.newSize = this.setManualSize(this.currentCol, this.currentWidth);
this.refreshHandlePosition();
this.refreshGuidePosition();
}
},
onMouseUp: function(event) {
if (this.pressed) {
this.hideHandleAndGuide();
this.pressed = false;
if (this.newSize != this.startWidth) {
this.hot.runHooks('beforeColumnResize', this.currentCol, this.newSize);
this.hot.forceFullRender = true;
this.hot.view.render();
this.hot.view.wt.wtOverlays.adjustElementsSize(true);
this.saveManualColumnWidths();
this.hot.runHooks('afterColumnResize', this.currentCol, this.newSize);
}
this.setupHandlePosition(this.currentTH);
}
},
bindEvents: function() {
var $__5 = this;
this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(e) {
return $__5.onMouseOver(e);
}));
this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(e) {
return $__5.onMouseDown(e);
}));
this.eventManager.addEventListener(window, 'mousemove', (function(e) {
return $__5.onMouseMove(e);
}));
this.eventManager.addEventListener(window, 'mouseup', (function(e) {
return $__5.onMouseUp(e);
}));
},
setManualSize: function(column, width) {
width = Math.max(width, 20);
column = this.hot.runHooks('modifyCol', column);
this.manualColumnWidths[column] = width;
return width;
},
clearManualSize: function(column) {
column = this.hot.runHooks('modifyCol', column);
this.manualColumnWidths[column] = void 0;
},
onModifyColWidth: function(width, column) {
if (this.enabled) {
column = this.hot.runHooks('modifyCol', column);
if (this.hot.getSettings().manualColumnResize && this.manualColumnWidths[column]) {
return this.manualColumnWidths[column];
}
}
return width;
},
onBeforeStretchingColumnWidth: function(stretchedWidth, column) {
var width = this.manualColumnWidths[column];
if (width === void 0) {
width = stretchedWidth;
}
return width;
}
}, {}, BasePlugin);
;
registerPlugin('manualColumnResize', ManualColumnResize);
//#
},{"_base.js":58,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],79:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
ManualRowMove: {get: function() {
return ManualRowMove;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_eventManager__,
$___46__46__47__46__46__47_helpers_47_dom_47_event__,
$___46__46__47__46__46__47_plugins__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
hasClass = $__0.hasClass,
removeClass = $__0.removeClass;
var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager;
var $__2 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}),
pageX = $__2.pageX,
pageY = $__2.pageY;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
;
function ManualRowMove() {
var startRow,
endRow,
startY,
startOffset,
currentRow,
currentTH,
handle = document.createElement('DIV'),
guide = document.createElement('DIV'),
eventManager = eventManagerObject(this);
handle.className = 'manualRowMover';
guide.className = 'manualRowMoverGuide';
var saveManualRowPositions = function() {
var instance = this;
Handsontable.hooks.run(instance, 'persistentStateSave', 'manualRowPositions', instance.manualRowPositions);
};
var loadManualRowPositions = function() {
var instance = this,
storedState = {};
Handsontable.hooks.run(instance, 'persistentStateLoad', 'manualRowPositions', storedState);
return storedState.value;
};
function setupHandlePosition(TH) {
var instance = this;
currentTH = TH;
var row = this.view.wt.wtTable.getCoords(TH).row;
if (row >= 0) {
currentRow = row;
var box = currentTH.getBoundingClientRect();
startOffset = box.top;
handle.style.top = startOffset + 'px';
handle.style.left = box.left + 'px';
instance.rootElement.appendChild(handle);
}
}
function refreshHandlePosition(TH, delta) {
var box = TH.getBoundingClientRect();
var handleHeight = 6;
if (delta > 0) {
handle.style.top = (box.top + box.height - handleHeight) + 'px';
} else {
handle.style.top = box.top + 'px';
}
}
function setupGuidePosition() {
var instance = this;
addClass(handle, 'active');
addClass(guide, 'active');
var box = currentTH.getBoundingClientRect();
guide.style.width = instance.view.maximumVisibleElementWidth(0) + 'px';
guide.style.height = box.height + 'px';
guide.style.top = startOffset + 'px';
guide.style.left = handle.style.left;
instance.rootElement.appendChild(guide);
}
function refreshGuidePosition(diff) {
guide.style.top = startOffset + diff + 'px';
}
function hideHandleAndGuide() {
removeClass(handle, 'active');
removeClass(guide, 'active');
}
var checkRowHeader = function(element) {
if (element != this.rootElement) {
var parent = element.parentNode;
if (parent.tagName == 'TBODY') {
return true;
}
return checkRowHeader.call(this, parent);
}
return false;
};
var getTHFromTargetElement = function(element) {
if (element.tagName != 'TABLE') {
if (element.tagName == 'TH') {
return element;
} else {
return getTHFromTargetElement(element.parentNode);
}
}
return null;
};
var bindEvents = function() {
var instance = this;
var pressed;
eventManager.addEventListener(instance.rootElement, 'mouseover', function(e) {
if (checkRowHeader.call(instance, e.target)) {
var th = getTHFromTargetElement(e.target);
if (th) {
if (pressed) {
endRow = instance.view.wt.wtTable.getCoords(th).row;
refreshHandlePosition(th, endRow - startRow);
} else {
setupHandlePosition.call(instance, th);
}
}
}
});
eventManager.addEventListener(instance.rootElement, 'mousedown', function(e) {
if (hasClass(e.target, 'manualRowMover')) {
startY = pageY(e);
setupGuidePosition.call(instance);
pressed = instance;
startRow = currentRow;
endRow = currentRow;
}
});
eventManager.addEventListener(window, 'mousemove', function(e) {
if (pressed) {
refreshGuidePosition(pageY(e) - startY);
}
});
eventManager.addEventListener(window, 'mouseup', function(e) {
if (pressed) {
hideHandleAndGuide();
pressed = false;
createPositionData(instance.manualRowPositions, instance.countRows());
instance.manualRowPositions.splice(endRow, 0, instance.manualRowPositions.splice(startRow, 1)[0]);
Handsontable.hooks.run(instance, 'beforeRowMove', startRow, endRow);
instance.forceFullRender = true;
instance.view.render();
saveManualRowPositions.call(instance);
Handsontable.hooks.run(instance, 'afterRowMove', startRow, endRow);
setupHandlePosition.call(instance, currentTH);
}
});
instance.addHook('afterDestroy', unbindEvents);
};
var unbindEvents = function() {
eventManager.clear();
};
var createPositionData = function(positionArr, len) {
if (positionArr.length < len) {
for (var i = positionArr.length; i < len; i++) {
positionArr[i] = i;
}
}
};
this.beforeInit = function() {
this.manualRowPositions = [];
};
this.init = function(source) {
var instance = this;
var manualRowMoveEnabled = !!(instance.getSettings().manualRowMove);
if (manualRowMoveEnabled) {
var initialManualRowPositions = instance.getSettings().manualRowMove;
var loadedManualRowPostions = loadManualRowPositions.call(instance);
if (typeof instance.manualRowPositionsPluginUsages === 'undefined') {
instance.manualRowPositionsPluginUsages = ['manualColumnMove'];
} else {
instance.manualRowPositionsPluginUsages.push('manualColumnMove');
}
if (typeof loadedManualRowPostions != 'undefined') {
this.manualRowPositions = loadedManualRowPostions;
} else if (Array.isArray(initialManualRowPositions)) {
this.manualRowPositions = initialManualRowPositions;
} else if (!initialManualRowPositions || this.manualRowPositions === void 0) {
this.manualRowPositions = [];
}
if (source === 'afterInit' || source === 'afterUpdateSettings' && eventManager.context.eventListeners.length === 0) {
unbindEvents.call(this);
bindEvents.call(this);
if (this.manualRowPositions && this.manualRowPositions.length > 0) {
instance.forceFullRender = true;
instance.render();
}
}
} else {
var pluginUsagesIndex = instance.manualRowPositionsPluginUsages ? instance.manualRowPositionsPluginUsages.indexOf('manualColumnMove') : -1;
if (pluginUsagesIndex > -1) {
unbindEvents.call(this);
instance.manualRowPositions = [];
instance.manualRowPositionsPluginUsages[pluginUsagesIndex] = void 0;
}
}
};
this.modifyRow = function(row) {
var instance = this;
if (instance.getSettings().manualRowMove) {
if (typeof instance.manualRowPositions[row] === 'undefined') {
createPositionData(this.manualRowPositions, row + 1);
}
return instance.manualRowPositions[row];
}
return row;
};
}
var htManualRowMove = new ManualRowMove();
Handsontable.hooks.add('beforeInit', htManualRowMove.beforeInit);
Handsontable.hooks.add('afterInit', function() {
htManualRowMove.init.call(this, 'afterInit');
});
Handsontable.hooks.add('afterUpdateSettings', function() {
htManualRowMove.init.call(this, 'afterUpdateSettings');
});
Handsontable.hooks.add('modifyRow', htManualRowMove.modifyRow);
Handsontable.hooks.register('beforeRowMove');
Handsontable.hooks.register('afterRowMove');
//#
},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],80:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
ManualRowResize: {get: function() {
return ManualRowResize;
}},
__esModule: {value: true}
});
var $___46__46__47__95_base_46_js__,
$___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_eventManager__,
$___46__46__47__46__46__47_helpers_47_dom_47_event__,
$___46__46__47__46__46__47_plugins__;
var BasePlugin = ($___46__46__47__95_base_46_js__ = require("_base.js"), $___46__46__47__95_base_46_js__ && $___46__46__47__95_base_46_js__.__esModule && $___46__46__47__95_base_46_js__ || {default: $___46__46__47__95_base_46_js__}).default;
var $__1 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__1.addClass,
hasClass = $__1.hasClass,
removeClass = $__1.removeClass;
var eventManagerObject = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).eventManager;
var $__3 = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}),
pageX = $__3.pageX,
pageY = $__3.pageY;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var ManualRowResize = function ManualRowResize(hotInstance) {
$traceurRuntime.superConstructor($ManualRowResize).call(this, hotInstance);
this.currentTH = null;
this.currentRow = null;
this.currentHeight = null;
this.newSize = null;
this.startY = null;
this.startHeight = null;
this.startOffset = null;
this.handle = document.createElement('DIV');
this.guide = document.createElement('DIV');
this.eventManager = eventManagerObject(this);
this.pressed = null;
this.dblclick = 0;
this.autoresizeTimeout = null;
this.manualRowHeights = [];
addClass(this.handle, 'manualRowResizer');
addClass(this.guide, 'manualRowResizerGuide');
};
var $ManualRowResize = ManualRowResize;
($traceurRuntime.createClass)(ManualRowResize, {
isEnabled: function() {
return this.hot.getSettings().manualRowResize;
},
enablePlugin: function() {
var $__5 = this;
if (this.enabled) {
return;
}
this.manualRowHeights = [];
var initialRowHeights = this.hot.getSettings().manualRowResize;
var loadedManualRowHeights = this.loadManualRowHeights();
if (typeof loadedManualRowHeights != 'undefined') {
this.manualRowHeights = loadedManualRowHeights;
} else if (Array.isArray(initialRowHeights)) {
this.manualRowHeights = initialRowHeights;
} else {
this.manualRowHeights = [];
}
this.addHook('modifyRowHeight', (function(height, row) {
return $__5.onModifyRowHeight(height, row);
}));
Handsontable.hooks.register('beforeRowResize');
Handsontable.hooks.register('afterRowResize');
this.bindEvents();
$traceurRuntime.superGet(this, $ManualRowResize.prototype, "enablePlugin").call(this);
},
updatePlugin: function() {
var initialRowHeights = this.hot.getSettings().manualRowResize;
if (Array.isArray(initialRowHeights)) {
this.manualRowHeights = initialRowHeights;
} else if (!initialRowHeights) {
this.manualRowHeights = [];
}
},
disablePlugin: function() {
$traceurRuntime.superGet(this, $ManualRowResize.prototype, "disablePlugin").call(this);
},
saveManualRowHeights: function() {
this.hot.runHooks('persistentStateSave', 'manualRowHeights', this.manualRowHeights);
},
loadManualRowHeights: function() {
var storedState = {};
this.hot.runHooks('persistentStateLoad', 'manualRowHeights', storedState);
return storedState.value;
},
setupHandlePosition: function(TH) {
this.currentTH = TH;
var row = this.hot.view.wt.wtTable.getCoords(TH).row;
if (row >= 0) {
var box = this.currentTH.getBoundingClientRect();
this.currentRow = row;
this.startOffset = box.top - 6;
this.startHeight = parseInt(box.height, 10);
this.handle.style.left = box.left + 'px';
this.handle.style.top = this.startOffset + this.startHeight + 'px';
this.hot.rootElement.appendChild(this.handle);
}
},
refreshHandlePosition: function() {
this.handle.style.top = this.startOffset + this.currentHeight + 'px';
},
setupGuidePosition: function() {
addClass(this.handle, 'active');
addClass(this.guide, 'active');
this.guide.style.top = this.handle.style.top;
this.guide.style.left = this.handle.style.left;
this.guide.style.width = this.hot.view.maximumVisibleElementWidth(0) + 'px';
this.hot.rootElement.appendChild(this.guide);
},
refreshGuidePosition: function() {
this.guide.style.top = this.handle.style.top;
},
hideHandleAndGuide: function() {
removeClass(this.handle, 'active');
removeClass(this.guide, 'active');
},
checkIfRowHeader: function(element) {
if (element != this.hot.rootElement) {
var parent = element.parentNode;
if (parent.tagName === 'TBODY') {
return true;
}
return this.checkIfRowHeader(parent);
}
return false;
},
getTHFromTargetElement: function(element) {
if (element.tagName != 'TABLE') {
if (element.tagName == 'TH') {
return element;
} else {
return this.getTHFromTargetElement(element.parentNode);
}
}
return null;
},
onMouseOver: function(event) {
if (this.checkIfRowHeader(event.target)) {
var th = this.getTHFromTargetElement(event.target);
if (th) {
if (!this.pressed) {
this.setupHandlePosition(th);
}
}
}
},
afterMouseDownTimeout: function() {
if (this.dblclick >= 2) {
var hookNewSize = this.hot.runHooks('beforeRowResize', this.currentRow, this.newSize, true);
if (hookNewSize !== void 0) {
this.newSize = hookNewSize;
}
this.setManualSize(this.currentRow, this.newSize);
this.hot.forceFullRender = true;
this.hot.view.render();
this.hot.view.wt.wtOverlays.adjustElementsSize(true);
this.hot.runHooks('afterRowResize', this.currentRow, this.newSize, true);
}
this.dblclick = 0;
this.autoresizeTimeout = null;
},
onMouseDown: function(event) {
var $__5 = this;
if (hasClass(event.target, 'manualRowResizer')) {
this.setupGuidePosition();
this.pressed = this.hot;
if (this.autoresizeTimeout == null) {
this.autoresizeTimeout = setTimeout((function() {
return $__5.afterMouseDownTimeout();
}), 500);
this.hot._registerTimeout(this.autoresizeTimeout);
}
this.dblclick++;
this.startY = pageY(event);
this.newSize = this.startHeight;
}
},
onMouseMove: function(event) {
if (this.pressed) {
this.currentHeight = this.startHeight + (pageY(event) - this.startY);
this.newSize = this.setManualSize(this.currentRow, this.currentHeight);
this.refreshHandlePosition();
this.refreshGuidePosition();
}
},
onMouseUp: function(event) {
if (this.pressed) {
this.hideHandleAndGuide();
this.pressed = false;
if (this.newSize != this.startHeight) {
this.hot.runHooks('beforeRowResize', this.currentRow, this.newSize);
this.hot.forceFullRender = true;
this.hot.view.render();
this.hot.view.wt.wtOverlays.adjustElementsSize(true);
this.saveManualRowHeights();
this.hot.runHooks('afterRowResize', this.currentRow, this.newSize);
}
this.setupHandlePosition(this.currentTH);
}
},
bindEvents: function() {
var $__5 = this;
this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(e) {
return $__5.onMouseOver(e);
}));
this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(e) {
return $__5.onMouseDown(e);
}));
this.eventManager.addEventListener(window, 'mousemove', (function(e) {
return $__5.onMouseMove(e);
}));
this.eventManager.addEventListener(window, 'mouseup', (function(e) {
return $__5.onMouseUp(e);
}));
},
setManualSize: function(row, height) {
row = this.hot.runHooks('modifyRow', row);
this.manualRowHeights[row] = height;
return height;
},
onModifyRowHeight: function(height, row) {
if (this.enabled) {
var autoRowSizePlugin = this.hot.getPlugin('autoRowSize');
var autoRowHeightResult = autoRowSizePlugin ? autoRowSizePlugin.heights[row] : null;
row = this.hot.runHooks('modifyRow', row);
var manualRowHeight = this.manualRowHeights[row];
if (manualRowHeight !== void 0 && (manualRowHeight === autoRowHeightResult || manualRowHeight > (height || 0))) {
return manualRowHeight;
}
}
return height;
}
}, {}, BasePlugin);
;
registerPlugin('manualRowResize', ManualRowResize);
//#
},{"_base.js":58,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],81:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
MergeCells: {get: function() {
return MergeCells;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_plugins__,
$___46__46__47__46__46__47_helpers_47_dom_47_event__,
$___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__,
$___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__,
$___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var stopImmediatePropagation = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation;
var WalkontableCellCoords = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords;
var WalkontableCellRange = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ = require("3rdparty/walkontable/src/cell/range"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_range__}).WalkontableCellRange;
var WalkontableTable = ($___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__ = require("3rdparty/walkontable/src/table"), $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__ && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__.__esModule && $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__ || {default: $___46__46__47__46__46__47_3rdparty_47_walkontable_47_src_47_table__}).WalkontableTable;
;
function CellInfoCollection() {
var collection = [];
collection.getInfo = function(row, col) {
for (var i = 0,
ilen = this.length; i < ilen; i++) {
if (this[i].row <= row && this[i].row + this[i].rowspan - 1 >= row && this[i].col <= col && this[i].col + this[i].colspan - 1 >= col) {
return this[i];
}
}
};
collection.setInfo = function(info) {
for (var i = 0,
ilen = this.length; i < ilen; i++) {
if (this[i].row === info.row && this[i].col === info.col) {
this[i] = info;
return;
}
}
this.push(info);
};
collection.removeInfo = function(row, col) {
for (var i = 0,
ilen = this.length; i < ilen; i++) {
if (this[i].row === row && this[i].col === col) {
this.splice(i, 1);
break;
}
}
};
return collection;
}
function MergeCells(mergeCellsSetting) {
this.mergedCellInfoCollection = new CellInfoCollection();
if (Array.isArray(mergeCellsSetting)) {
for (var i = 0,
ilen = mergeCellsSetting.length; i < ilen; i++) {
this.mergedCellInfoCollection.setInfo(mergeCellsSetting[i]);
}
}
}
MergeCells.prototype.canMergeRange = function(cellRange) {
return !cellRange.isSingle();
};
MergeCells.prototype.mergeRange = function(cellRange) {
if (!this.canMergeRange(cellRange)) {
return;
}
var topLeft = cellRange.getTopLeftCorner();
var bottomRight = cellRange.getBottomRightCorner();
var mergeParent = {};
mergeParent.row = topLeft.row;
mergeParent.col = topLeft.col;
mergeParent.rowspan = bottomRight.row - topLeft.row + 1;
mergeParent.colspan = bottomRight.col - topLeft.col + 1;
this.mergedCellInfoCollection.setInfo(mergeParent);
};
MergeCells.prototype.mergeOrUnmergeSelection = function(cellRange) {
var info = this.mergedCellInfoCollection.getInfo(cellRange.from.row, cellRange.from.col);
if (info) {
this.unmergeSelection(cellRange.from);
} else {
this.mergeSelection(cellRange);
}
};
MergeCells.prototype.mergeSelection = function(cellRange) {
this.mergeRange(cellRange);
};
MergeCells.prototype.unmergeSelection = function(cellRange) {
var info = this.mergedCellInfoCollection.getInfo(cellRange.row, cellRange.col);
this.mergedCellInfoCollection.removeInfo(info.row, info.col);
};
MergeCells.prototype.applySpanProperties = function(TD, row, col) {
var info = this.mergedCellInfoCollection.getInfo(row, col);
if (info) {
if (info.row === row && info.col === col) {
TD.setAttribute('rowspan', info.rowspan);
TD.setAttribute('colspan', info.colspan);
} else {
TD.removeAttribute('rowspan');
TD.removeAttribute('colspan');
TD.style.display = 'none';
}
} else {
TD.removeAttribute('rowspan');
TD.removeAttribute('colspan');
}
};
MergeCells.prototype.modifyTransform = function(hook, currentSelectedRange, delta) {
var sameRowspan = function(merged, coords) {
if (coords.row >= merged.row && coords.row <= (merged.row + merged.rowspan - 1)) {
return true;
}
return false;
},
sameColspan = function(merged, coords) {
if (coords.col >= merged.col && coords.col <= (merged.col + merged.colspan - 1)) {
return true;
}
return false;
},
getNextPosition = function(newDelta) {
return new WalkontableCellCoords(currentSelectedRange.to.row + newDelta.row, currentSelectedRange.to.col + newDelta.col);
};
var newDelta = {
row: delta.row,
col: delta.col
};
if (hook == 'modifyTransformStart') {
if (!this.lastDesiredCoords) {
this.lastDesiredCoords = new WalkontableCellCoords(null, null);
}
var currentPosition = new WalkontableCellCoords(currentSelectedRange.highlight.row, currentSelectedRange.highlight.col),
mergedParent = this.mergedCellInfoCollection.getInfo(currentPosition.row, currentPosition.col),
currentRangeContainsMerge;
for (var i = 0,
mergesLength = this.mergedCellInfoCollection.length; i < mergesLength; i++) {
var range = this.mergedCellInfoCollection[i];
range = new WalkontableCellCoords(range.row + range.rowspan - 1, range.col + range.colspan - 1);
if (currentSelectedRange.includes(range)) {
currentRangeContainsMerge = true;
break;
}
}
if (mergedParent) {
var mergeTopLeft = new WalkontableCellCoords(mergedParent.row, mergedParent.col),
mergeBottomRight = new WalkontableCellCoords(mergedParent.row + mergedParent.rowspan - 1, mergedParent.col + mergedParent.colspan - 1),
mergeRange = new WalkontableCellRange(mergeTopLeft, mergeTopLeft, mergeBottomRight);
if (!mergeRange.includes(this.lastDesiredCoords)) {
this.lastDesiredCoords = new WalkontableCellCoords(null, null);
}
newDelta.row = this.lastDesiredCoords.row ? this.lastDesiredCoords.row - currentPosition.row : newDelta.row;
newDelta.col = this.lastDesiredCoords.col ? this.lastDesiredCoords.col - currentPosition.col : newDelta.col;
if (delta.row > 0) {
newDelta.row = mergedParent.row + mergedParent.rowspan - 1 - currentPosition.row + delta.row;
} else if (delta.row < 0) {
newDelta.row = currentPosition.row - mergedParent.row + delta.row;
}
if (delta.col > 0) {
newDelta.col = mergedParent.col + mergedParent.colspan - 1 - currentPosition.col + delta.col;
} else if (delta.col < 0) {
newDelta.col = currentPosition.col - mergedParent.col + delta.col;
}
}
var nextPosition = new WalkontableCellCoords(currentSelectedRange.highlight.row + newDelta.row, currentSelectedRange.highlight.col + newDelta.col),
nextParentIsMerged = this.mergedCellInfoCollection.getInfo(nextPosition.row, nextPosition.col);
if (nextParentIsMerged) {
this.lastDesiredCoords = nextPosition;
newDelta = {
row: nextParentIsMerged.row - currentPosition.row,
col: nextParentIsMerged.col - currentPosition.col
};
}
} else if (hook == 'modifyTransformEnd') {
for (var i = 0,
mergesLength = this.mergedCellInfoCollection.length; i < mergesLength; i++) {
var currentMerge = this.mergedCellInfoCollection[i],
mergeTopLeft = new WalkontableCellCoords(currentMerge.row, currentMerge.col),
mergeBottomRight = new WalkontableCellCoords(currentMerge.row + currentMerge.rowspan - 1, currentMerge.col + currentMerge.colspan - 1),
mergedRange = new WalkontableCellRange(mergeTopLeft, mergeTopLeft, mergeBottomRight),
sharedBorders = currentSelectedRange.getBordersSharedWith(mergedRange);
if (mergedRange.isEqual(currentSelectedRange)) {
currentSelectedRange.setDirection('NW-SE');
} else if (sharedBorders.length > 0) {
var mergeHighlighted = (currentSelectedRange.highlight.isEqual(mergedRange.from));
if (sharedBorders.indexOf('top') > -1) {
if (currentSelectedRange.to.isSouthEastOf(mergedRange.from) && mergeHighlighted) {
currentSelectedRange.setDirection('NW-SE');
} else if (currentSelectedRange.to.isSouthWestOf(mergedRange.from) && mergeHighlighted) {
currentSelectedRange.setDirection('NE-SW');
}
} else if (sharedBorders.indexOf('bottom') > -1) {
if (currentSelectedRange.to.isNorthEastOf(mergedRange.from) && mergeHighlighted) {
currentSelectedRange.setDirection('SW-NE');
} else if (currentSelectedRange.to.isNorthWestOf(mergedRange.from) && mergeHighlighted) {
currentSelectedRange.setDirection('SE-NW');
}
}
}
var nextPosition = getNextPosition(newDelta),
withinRowspan = sameRowspan(currentMerge, nextPosition),
withinColspan = sameColspan(currentMerge, nextPosition);
if (currentSelectedRange.includesRange(mergedRange) && (mergedRange.includes(nextPosition) || withinRowspan || withinColspan)) {
if (withinRowspan) {
if (newDelta.row < 0) {
newDelta.row -= currentMerge.rowspan - 1;
} else if (newDelta.row > 0) {
newDelta.row += currentMerge.rowspan - 1;
}
}
if (withinColspan) {
if (newDelta.col < 0) {
newDelta.col -= currentMerge.colspan - 1;
} else if (newDelta.col > 0) {
newDelta.col += currentMerge.colspan - 1;
}
}
}
}
}
if (newDelta.row !== 0) {
delta.row = newDelta.row;
}
if (newDelta.col !== 0) {
delta.col = newDelta.col;
}
};
MergeCells.prototype.shiftCollection = function(direction, index, count) {
var shiftVector = [0, 0];
switch (direction) {
case 'right':
shiftVector[0] += 1;
break;
case 'left':
shiftVector[0] -= 1;
break;
case 'down':
shiftVector[1] += 1;
break;
case 'up':
shiftVector[1] -= 1;
break;
}
for (var i = 0; i < this.mergedCellInfoCollection.length; i++) {
var currentMerge = this.mergedCellInfoCollection[i];
if (direction === 'right' || direction === 'left') {
if (index <= currentMerge.col) {
currentMerge.col += shiftVector[0];
}
} else {
if (index <= currentMerge.row) {
currentMerge.row += shiftVector[1];
}
}
}
};
var beforeInit = function() {
var instance = this;
var mergeCellsSetting = instance.getSettings().mergeCells;
if (mergeCellsSetting) {
if (!instance.mergeCells) {
instance.mergeCells = new MergeCells(mergeCellsSetting);
}
}
};
var afterInit = function() {
var instance = this;
if (instance.mergeCells) {
instance.view.wt.wtTable.getCell = function(coords) {
if (instance.getSettings().mergeCells) {
var mergeParent = instance.mergeCells.mergedCellInfoCollection.getInfo(coords.row, coords.col);
if (mergeParent) {
coords = mergeParent;
}
}
return WalkontableTable.prototype.getCell.call(this, coords);
};
}
};
var afterUpdateSettings = function() {
var instance = this;
var mergeCellsSetting = instance.getSettings().mergeCells;
if (mergeCellsSetting) {
if (instance.mergeCells) {
instance.mergeCells.mergedCellInfoCollection = new CellInfoCollection();
if (Array.isArray(mergeCellsSetting)) {
for (var i = 0,
ilen = mergeCellsSetting.length; i < ilen; i++) {
instance.mergeCells.mergedCellInfoCollection.setInfo(mergeCellsSetting[i]);
}
}
} else {
instance.mergeCells = new MergeCells(mergeCellsSetting);
}
} else {
if (instance.mergeCells) {
instance.mergeCells.mergedCellInfoCollection = new CellInfoCollection();
}
}
};
var onBeforeKeyDown = function(event) {
if (!this.mergeCells) {
return;
}
var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;
if (ctrlDown) {
if (event.keyCode === 77) {
this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange());
this.render();
stopImmediatePropagation(event);
}
}
};
var addMergeActionsToContextMenu = function(defaultOptions) {
if (!this.getSettings().mergeCells) {
return;
}
defaultOptions.items.push(Handsontable.plugins.ContextMenu.SEPARATOR);
defaultOptions.items.push({
key: 'mergeCells',
name: function() {
var sel = this.getSelected();
var info = this.mergeCells.mergedCellInfoCollection.getInfo(sel[0], sel[1]);
if (info) {
return 'Unmerge cells';
} else {
return 'Merge cells';
}
},
callback: function() {
this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange());
this.render();
},
disabled: function() {
return false;
}
});
};
var afterRenderer = function(TD, row, col, prop, value, cellProperties) {
if (this.mergeCells) {
this.mergeCells.applySpanProperties(TD, row, col);
}
};
var modifyTransformFactory = function(hook) {
return function(delta) {
var mergeCellsSetting = this.getSettings().mergeCells;
if (mergeCellsSetting) {
var currentSelectedRange = this.getSelectedRange();
this.mergeCells.modifyTransform(hook, currentSelectedRange, delta);
if (hook === 'modifyTransformEnd') {
var totalRows = this.countRows();
var totalCols = this.countCols();
if (currentSelectedRange.from.row < 0) {
currentSelectedRange.from.row = 0;
} else if (currentSelectedRange.from.row > 0 && currentSelectedRange.from.row >= totalRows) {
currentSelectedRange.from.row = currentSelectedRange.from - 1;
}
if (currentSelectedRange.from.col < 0) {
currentSelectedRange.from.col = 0;
} else if (currentSelectedRange.from.col > 0 && currentSelectedRange.from.col >= totalCols) {
currentSelectedRange.from.col = totalCols - 1;
}
}
}
};
};
var beforeSetRangeEnd = function(coords) {
this.lastDesiredCoords = null;
var mergeCellsSetting = this.getSettings().mergeCells;
if (mergeCellsSetting) {
var selRange = this.getSelectedRange();
selRange.highlight = new WalkontableCellCoords(selRange.highlight.row, selRange.highlight.col);
selRange.to = coords;
var rangeExpanded = false;
do {
rangeExpanded = false;
for (var i = 0,
ilen = this.mergeCells.mergedCellInfoCollection.length; i < ilen; i++) {
var cellInfo = this.mergeCells.mergedCellInfoCollection[i];
var mergedCellTopLeft = new WalkontableCellCoords(cellInfo.row, cellInfo.col);
var mergedCellBottomRight = new WalkontableCellCoords(cellInfo.row + cellInfo.rowspan - 1, cellInfo.col + cellInfo.colspan - 1);
var mergedCellRange = new WalkontableCellRange(mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight);
if (selRange.expandByRange(mergedCellRange)) {
coords.row = selRange.to.row;
coords.col = selRange.to.col;
rangeExpanded = true;
}
}
} while (rangeExpanded);
}
};
var beforeDrawAreaBorders = function(corners, className) {
if (className && className == 'area') {
var mergeCellsSetting = this.getSettings().mergeCells;
if (mergeCellsSetting) {
var selRange = this.getSelectedRange();
var startRange = new WalkontableCellRange(selRange.from, selRange.from, selRange.from);
var stopRange = new WalkontableCellRange(selRange.to, selRange.to, selRange.to);
for (var i = 0,
ilen = this.mergeCells.mergedCellInfoCollection.length; i < ilen; i++) {
var cellInfo = this.mergeCells.mergedCellInfoCollection[i];
var mergedCellTopLeft = new WalkontableCellCoords(cellInfo.row, cellInfo.col);
var mergedCellBottomRight = new WalkontableCellCoords(cellInfo.row + cellInfo.rowspan - 1, cellInfo.col + cellInfo.colspan - 1);
var mergedCellRange = new WalkontableCellRange(mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight);
if (startRange.expandByRange(mergedCellRange)) {
corners[0] = startRange.from.row;
corners[1] = startRange.from.col;
}
if (stopRange.expandByRange(mergedCellRange)) {
corners[2] = stopRange.from.row;
corners[3] = stopRange.from.col;
}
}
}
}
};
var afterGetCellMeta = function(row, col, cellProperties) {
var mergeCellsSetting = this.getSettings().mergeCells;
if (mergeCellsSetting) {
var mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(row, col);
if (mergeParent && (mergeParent.row != row || mergeParent.col != col)) {
cellProperties.copyable = false;
}
}
};
var afterViewportRowCalculatorOverride = function(calc) {
var mergeCellsSetting = this.getSettings().mergeCells;
if (mergeCellsSetting) {
var colCount = this.countCols();
var mergeParent;
for (var c = 0; c < colCount; c++) {
mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(calc.startRow, c);
if (mergeParent) {
if (mergeParent.row < calc.startRow) {
calc.startRow = mergeParent.row;
return afterViewportRowCalculatorOverride.call(this, calc);
}
}
mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(calc.endRow, c);
if (mergeParent) {
var mergeEnd = mergeParent.row + mergeParent.rowspan - 1;
if (mergeEnd > calc.endRow) {
calc.endRow = mergeEnd;
return afterViewportRowCalculatorOverride.call(this, calc);
}
}
}
}
};
var afterViewportColumnCalculatorOverride = function(calc) {
var mergeCellsSetting = this.getSettings().mergeCells;
if (mergeCellsSetting) {
var rowCount = this.countRows();
var mergeParent;
for (var r = 0; r < rowCount; r++) {
mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(r, calc.startColumn);
if (mergeParent) {
if (mergeParent.col < calc.startColumn) {
calc.startColumn = mergeParent.col;
return afterViewportColumnCalculatorOverride.call(this, calc);
}
}
mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(r, calc.endColumn);
if (mergeParent) {
var mergeEnd = mergeParent.col + mergeParent.colspan - 1;
if (mergeEnd > calc.endColumn) {
calc.endColumn = mergeEnd;
return afterViewportColumnCalculatorOverride.call(this, calc);
}
}
}
}
};
var isMultipleSelection = function(isMultiple) {
if (isMultiple && this.mergeCells) {
var mergedCells = this.mergeCells.mergedCellInfoCollection,
selectionRange = this.getSelectedRange();
for (var group in mergedCells) {
if (selectionRange.highlight.row == mergedCells[group].row && selectionRange.highlight.col == mergedCells[group].col && selectionRange.to.row == mergedCells[group].row + mergedCells[group].rowspan - 1 && selectionRange.to.col == mergedCells[group].col + mergedCells[group].colspan - 1) {
return false;
}
}
}
return isMultiple;
};
function afterAutofillApplyValues(select, drag) {
var mergeCellsSetting = this.getSettings().mergeCells;
if (!mergeCellsSetting || this.selection.isMultiple()) {
return;
}
var info = this.mergeCells.mergedCellInfoCollection.getInfo(select[0], select[1]);
if (info) {
select[0] = info.row;
select[1] = info.col;
select[2] = info.row + info.rowspan - 1;
select[3] = info.col + info.colspan - 1;
}
}
function onAfterCreateCol(col, count) {
if (this.mergeCells) {
this.mergeCells.shiftCollection('right', col, count);
}
}
function onAfterRemoveCol(col, count) {
if (this.mergeCells) {
this.mergeCells.shiftCollection('left', col, count);
}
}
function onAfterCreateRow(row, count) {
if (this.mergeCells) {
this.mergeCells.shiftCollection('down', row, count);
}
}
function onAfterRemoveRow(row, count) {
if (this.mergeCells) {
this.mergeCells.shiftCollection('up', row, count);
}
}
Handsontable.hooks.add('beforeInit', beforeInit);
Handsontable.hooks.add('afterInit', afterInit);
Handsontable.hooks.add('afterUpdateSettings', afterUpdateSettings);
Handsontable.hooks.add('beforeKeyDown', onBeforeKeyDown);
Handsontable.hooks.add('modifyTransformStart', modifyTransformFactory('modifyTransformStart'));
Handsontable.hooks.add('modifyTransformEnd', modifyTransformFactory('modifyTransformEnd'));
Handsontable.hooks.add('beforeSetRangeEnd', beforeSetRangeEnd);
Handsontable.hooks.add('beforeDrawBorders', beforeDrawAreaBorders);
Handsontable.hooks.add('afterIsMultipleSelection', isMultipleSelection);
Handsontable.hooks.add('afterRenderer', afterRenderer);
Handsontable.hooks.add('afterContextMenuDefaultOptions', addMergeActionsToContextMenu);
Handsontable.hooks.add('afterGetCellMeta', afterGetCellMeta);
Handsontable.hooks.add('afterViewportRowCalculatorOverride', afterViewportRowCalculatorOverride);
Handsontable.hooks.add('afterViewportColumnCalculatorOverride', afterViewportColumnCalculatorOverride);
Handsontable.hooks.add('afterAutofillApplyValues', afterAutofillApplyValues);
Handsontable.hooks.add('afterCreateCol', onAfterCreateCol);
Handsontable.hooks.add('afterRemoveCol', onAfterRemoveCol);
Handsontable.hooks.add('afterCreateRow', onAfterCreateRow);
Handsontable.hooks.add('afterRemoveRow', onAfterRemoveRow);
Handsontable.MergeCells = MergeCells;
//#
},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,"plugins":57}],82:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
MultipleSelectionHandles: {get: function() {
return MultipleSelectionHandles;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__95_base__,
$___46__46__47__46__46__47_eventManager__,
$___46__46__47__46__46__47_plugins__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
getWindowScrollTop = $__0.getWindowScrollTop,
hasClass = $__0.hasClass,
getWindowScrollLeft = $__0.getWindowScrollLeft;
var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default;
var EventManager = ($___46__46__47__46__46__47_eventManager__ = require("eventManager"), $___46__46__47__46__46__47_eventManager__ && $___46__46__47__46__46__47_eventManager__.__esModule && $___46__46__47__46__46__47_eventManager__ || {default: $___46__46__47__46__46__47_eventManager__}).EventManager;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var MultipleSelectionHandles = function MultipleSelectionHandles(hotInstance) {
$traceurRuntime.superConstructor($MultipleSelectionHandles).call(this, hotInstance);
this.dragged = [];
this.eventManager = null;
this.lastSetCell = null;
};
var $MultipleSelectionHandles = MultipleSelectionHandles;
($traceurRuntime.createClass)(MultipleSelectionHandles, {
isEnabled: function() {
return Handsontable.mobileBrowser;
},
enablePlugin: function() {
if (this.enabled) {
return;
}
if (!this.eventManager) {
this.eventManager = new EventManager(this);
}
this.registerListeners();
$traceurRuntime.superGet(this, $MultipleSelectionHandles.prototype, "enablePlugin").call(this);
},
registerListeners: function() {
var _this = this;
function removeFromDragged(query) {
if (_this.dragged.length === 1) {
_this.dragged.splice(0, _this.dragged.length);
return true;
}
var entryPosition = _this.dragged.indexOf(query);
if (entryPosition == -1) {
return false;
} else if (entryPosition === 0) {
_this.dragged = _this.dragged.slice(0, 1);
} else if (entryPosition == 1) {
_this.dragged = _this.dragged.slice(-1);
}
}
this.eventManager.addEventListener(this.hot.rootElement, 'touchstart', function(event) {
var selectedRange;
if (hasClass(event.target, 'topLeftSelectionHandle-HitArea')) {
selectedRange = _this.hot.getSelectedRange();
_this.dragged.push('topLeft');
_this.touchStartRange = {
width: selectedRange.getWidth(),
height: selectedRange.getHeight(),
direction: selectedRange.getDirection()
};
event.preventDefault();
return false;
} else if (hasClass(event.target, 'bottomRightSelectionHandle-HitArea')) {
selectedRange = _this.hot.getSelectedRange();
_this.dragged.push('bottomRight');
_this.touchStartRange = {
width: selectedRange.getWidth(),
height: selectedRange.getHeight(),
direction: selectedRange.getDirection()
};
event.preventDefault();
return false;
}
});
this.eventManager.addEventListener(this.hot.rootElement, 'touchend', function(event) {
if (hasClass(event.target, 'topLeftSelectionHandle-HitArea')) {
removeFromDragged.call(_this, 'topLeft');
_this.touchStartRange = void 0;
event.preventDefault();
return false;
} else if (hasClass(event.target, 'bottomRightSelectionHandle-HitArea')) {
removeFromDragged.call(_this, 'bottomRight');
_this.touchStartRange = void 0;
event.preventDefault();
return false;
}
});
this.eventManager.addEventListener(this.hot.rootElement, 'touchmove', function(event) {
var scrollTop = getWindowScrollTop(),
scrollLeft = getWindowScrollLeft(),
endTarget,
targetCoords,
selectedRange,
rangeWidth,
rangeHeight,
rangeDirection,
newRangeCoords;
if (_this.dragged.length === 0) {
return;
}
endTarget = document.elementFromPoint(event.touches[0].screenX - scrollLeft, event.touches[0].screenY - scrollTop);
if (!endTarget || endTarget === _this.lastSetCell) {
return;
}
if (endTarget.nodeName == 'TD' || endTarget.nodeName == 'TH') {
targetCoords = _this.hot.getCoords(endTarget);
if (targetCoords.col == -1) {
targetCoords.col = 0;
}
selectedRange = _this.hot.getSelectedRange();
rangeWidth = selectedRange.getWidth();
rangeHeight = selectedRange.getHeight();
rangeDirection = selectedRange.getDirection();
if (rangeWidth == 1 && rangeHeight == 1) {
_this.hot.selection.setRangeEnd(targetCoords);
}
newRangeCoords = _this.getCurrentRangeCoords(selectedRange, targetCoords, _this.touchStartRange.direction, rangeDirection, _this.dragged[0]);
if (newRangeCoords.start !== null) {
_this.hot.selection.setRangeStart(newRangeCoords.start);
}
_this.hot.selection.setRangeEnd(newRangeCoords.end);
_this.lastSetCell = endTarget;
}
event.preventDefault();
});
},
getCurrentRangeCoords: function(selectedRange, currentTouch, touchStartDirection, currentDirection, draggedHandle) {
var topLeftCorner = selectedRange.getTopLeftCorner(),
bottomRightCorner = selectedRange.getBottomRightCorner(),
bottomLeftCorner = selectedRange.getBottomLeftCorner(),
topRightCorner = selectedRange.getTopRightCorner();
var newCoords = {
start: null,
end: null
};
switch (touchStartDirection) {
case 'NE-SW':
switch (currentDirection) {
case 'NE-SW':
case 'NW-SE':
if (draggedHandle == 'topLeft') {
newCoords = {
start: new WalkontableCellCoords(currentTouch.row, selectedRange.highlight.col),
end: new WalkontableCellCoords(bottomLeftCorner.row, currentTouch.col)
};
} else {
newCoords = {
start: new WalkontableCellCoords(selectedRange.highlight.row, currentTouch.col),
end: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col)
};
}
break;
case 'SE-NW':
if (draggedHandle == 'bottomRight') {
newCoords = {
start: new WalkontableCellCoords(bottomRightCorner.row, currentTouch.col),
end: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col)
};
}
break;
}
break;
case 'NW-SE':
switch (currentDirection) {
case 'NE-SW':
if (draggedHandle == 'topLeft') {
newCoords = {
start: currentTouch,
end: bottomLeftCorner
};
} else {
newCoords.end = currentTouch;
}
break;
case 'NW-SE':
if (draggedHandle == 'topLeft') {
newCoords = {
start: currentTouch,
end: bottomRightCorner
};
} else {
newCoords.end = currentTouch;
}
break;
case 'SE-NW':
if (draggedHandle == 'topLeft') {
newCoords = {
start: currentTouch,
end: topLeftCorner
};
} else {
newCoords.end = currentTouch;
}
break;
case 'SW-NE':
if (draggedHandle == 'topLeft') {
newCoords = {
start: currentTouch,
end: topRightCorner
};
} else {
newCoords.end = currentTouch;
}
break;
}
break;
case 'SW-NE':
switch (currentDirection) {
case 'NW-SE':
if (draggedHandle == 'bottomRight') {
newCoords = {
start: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col),
end: new WalkontableCellCoords(bottomLeftCorner.row, currentTouch.col)
};
} else {
newCoords = {
start: new WalkontableCellCoords(topLeftCorner.row, currentTouch.col),
end: new WalkontableCellCoords(currentTouch.row, bottomRightCorner.col)
};
}
break;
case 'SW-NE':
if (draggedHandle == 'topLeft') {
newCoords = {
start: new WalkontableCellCoords(selectedRange.highlight.row, currentTouch.col),
end: new WalkontableCellCoords(currentTouch.row, bottomRightCorner.col)
};
} else {
newCoords = {
start: new WalkontableCellCoords(currentTouch.row, topLeftCorner.col),
end: new WalkontableCellCoords(topLeftCorner.row, currentTouch.col)
};
}
break;
case 'SE-NW':
if (draggedHandle == 'bottomRight') {
newCoords = {
start: new WalkontableCellCoords(currentTouch.row, topRightCorner.col),
end: new WalkontableCellCoords(topLeftCorner.row, currentTouch.col)
};
} else if (draggedHandle == 'topLeft') {
newCoords = {
start: bottomLeftCorner,
end: currentTouch
};
}
break;
}
break;
case 'SE-NW':
switch (currentDirection) {
case 'NW-SE':
case 'NE-SW':
case 'SW-NE':
if (draggedHandle == 'topLeft') {
newCoords.end = currentTouch;
}
break;
case 'SE-NW':
if (draggedHandle == 'topLeft') {
newCoords.end = currentTouch;
} else {
newCoords = {
start: currentTouch,
end: topLeftCorner
};
}
break;
}
break;
}
return newCoords;
},
isDragged: function() {
return this.dragged.length > 0;
}
}, {}, BasePlugin);
;
registerPlugin('multipleSelectionHandles', MultipleSelectionHandles);
//#
},{"_base":58,"eventManager":41,"helpers/dom/element":45,"plugins":57}],83:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
ObserveChanges: {get: function() {
return ObserveChanges;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_plugins__,
$__jsonpatch__;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var jsonpatch = ($__jsonpatch__ = require("jsonpatch"), $__jsonpatch__ && $__jsonpatch__.__esModule && $__jsonpatch__ || {default: $__jsonpatch__}).default;
;
function ObserveChanges() {}
Handsontable.hooks.add('afterLoadData', init);
Handsontable.hooks.add('afterUpdateSettings', init);
Handsontable.hooks.register('afterChangesObserved');
function init() {
var instance = this;
var pluginEnabled = instance.getSettings().observeChanges;
if (pluginEnabled) {
if (instance.observer) {
destroy.call(instance);
}
createObserver.call(instance);
bindEvents.call(instance);
} else if (!pluginEnabled) {
destroy.call(instance);
}
}
function createObserver() {
var instance = this;
instance.observeChangesActive = true;
instance.pauseObservingChanges = function() {
instance.observeChangesActive = false;
};
instance.resumeObservingChanges = function() {
instance.observeChangesActive = true;
};
instance.observedData = instance.getSourceData();
instance.observer = jsonpatch.observe(instance.observedData, function(patches) {
if (instance.observeChangesActive) {
runHookForOperation.call(instance, patches);
instance.render();
}
instance.runHooks('afterChangesObserved');
});
}
function runHookForOperation(rawPatches) {
var instance = this;
var patches = cleanPatches(rawPatches);
for (var i = 0,
len = patches.length; i < len; i++) {
var patch = patches[i];
var parsedPath = parsePath(patch.path);
if (!parsedPath) {
return;
}
switch (patch.op) {
case 'add':
if (isNaN(parsedPath.col)) {
instance.runHooks('afterCreateRow', parsedPath.row);
} else {
instance.runHooks('afterCreateCol', parsedPath.col);
}
break;
case 'remove':
if (isNaN(parsedPath.col)) {
instance.runHooks('afterRemoveRow', parsedPath.row, 1);
} else {
instance.runHooks('afterRemoveCol', parsedPath.col, 1);
}
break;
case 'replace':
instance.runHooks('afterChange', [parsedPath.row, parsedPath.col, null, patch.value], 'external');
break;
}
}
function cleanPatches(rawPatches) {
var patches;
patches = removeLengthRelatedPatches(rawPatches);
patches = removeMultipleAddOrRemoveColPatches(patches);
return patches;
}
function removeMultipleAddOrRemoveColPatches(rawPatches) {
var newOrRemovedColumns = [];
return rawPatches.filter(function(patch) {
var parsedPath = parsePath(patch.path);
if (!parsedPath) {
return;
}
if (['add', 'remove'].indexOf(patch.op) != -1 && !isNaN(parsedPath.col)) {
if (newOrRemovedColumns.indexOf(parsedPath.col) !== -1) {
return false;
}
newOrRemovedColumns.push(parsedPath.col);
}
return true;
});
}
function removeLengthRelatedPatches(rawPatches) {
return rawPatches.filter(function(patch) {
return !/[/]length/ig.test(patch.path);
});
}
function parsePath(path) {
var match = path.match(/^\/(\d+)\/?(.*)?$/);
if (!match) {
return;
}
return {
row: parseInt(match[1], 10),
col: /^\d*$/.test(match[2]) ? parseInt(match[2], 10) : match[2]
};
}
}
function destroy() {
var instance = this;
if (instance.observer) {
destroyObserver.call(instance);
unbindEvents.call(instance);
}
}
function destroyObserver() {
var instance = this;
jsonpatch.unobserve(instance.observedData, instance.observer);
delete instance.observedData;
delete instance.observeChangesActive;
delete instance.pauseObservingChanges;
delete instance.resumeObservingChanges;
}
function bindEvents() {
var instance = this;
instance.addHook('afterDestroy', destroy);
instance.addHook('afterCreateRow', afterTableAlter);
instance.addHook('afterRemoveRow', afterTableAlter);
instance.addHook('afterCreateCol', afterTableAlter);
instance.addHook('afterRemoveCol', afterTableAlter);
instance.addHook('afterChange', function(changes, source) {
if (source != 'loadData') {
afterTableAlter.call(this);
}
});
}
function unbindEvents() {
var instance = this;
instance.removeHook('afterDestroy', destroy);
instance.removeHook('afterCreateRow', afterTableAlter);
instance.removeHook('afterRemoveRow', afterTableAlter);
instance.removeHook('afterCreateCol', afterTableAlter);
instance.removeHook('afterRemoveCol', afterTableAlter);
instance.removeHook('afterChange', afterTableAlter);
}
function afterTableAlter() {
var instance = this;
instance.pauseObservingChanges();
instance.addHookOnce('afterChangesObserved', function() {
instance.resumeObservingChanges();
});
}
//#
},{"jsonpatch":"jsonpatch","plugins":57}],84:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
HandsontablePersistentState: {get: function() {
return HandsontablePersistentState;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_plugins__;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
;
function Storage(prefix) {
var savedKeys;
var saveSavedKeys = function() {
window.localStorage[prefix + '__' + 'persistentStateKeys'] = JSON.stringify(savedKeys);
};
var loadSavedKeys = function() {
var keysJSON = window.localStorage[prefix + '__' + 'persistentStateKeys'];
var keys = typeof keysJSON == 'string' ? JSON.parse(keysJSON) : void 0;
savedKeys = keys ? keys : [];
};
var clearSavedKeys = function() {
savedKeys = [];
saveSavedKeys();
};
loadSavedKeys();
this.saveValue = function(key, value) {
window.localStorage[prefix + '_' + key] = JSON.stringify(value);
if (savedKeys.indexOf(key) == -1) {
savedKeys.push(key);
saveSavedKeys();
}
};
this.loadValue = function(key, defaultValue) {
key = typeof key === 'undefined' ? defaultValue : key;
var value = window.localStorage[prefix + '_' + key];
return typeof value == 'undefined' ? void 0 : JSON.parse(value);
};
this.reset = function(key) {
window.localStorage.removeItem(prefix + '_' + key);
};
this.resetAll = function() {
for (var index = 0; index < savedKeys.length; index++) {
window.localStorage.removeItem(prefix + '_' + savedKeys[index]);
}
clearSavedKeys();
};
}
function HandsontablePersistentState() {
var plugin = this;
this.init = function() {
var instance = this,
pluginSettings = instance.getSettings().persistentState;
plugin.enabled = !!(pluginSettings);
if (!plugin.enabled) {
removeHooks.call(instance);
return;
}
if (!instance.storage) {
instance.storage = new Storage(instance.rootElement.id);
}
instance.resetState = plugin.resetValue;
addHooks.call(instance);
};
this.saveValue = function(key, value) {
var instance = this;
instance.storage.saveValue(key, value);
};
this.loadValue = function(key, saveTo) {
var instance = this;
saveTo.value = instance.storage.loadValue(key);
};
this.resetValue = function(key) {
var instance = this;
if (typeof key === 'undefined') {
instance.storage.resetAll();
} else {
instance.storage.reset(key);
}
};
var hooks = {
persistentStateSave: plugin.saveValue,
persistentStateLoad: plugin.loadValue,
persistentStateReset: plugin.resetValue
};
for (var hookName in hooks) {
if (hooks.hasOwnProperty(hookName)) {
Handsontable.hooks.register(hookName);
}
}
function addHooks() {
var instance = this;
for (var hookName in hooks) {
if (hooks.hasOwnProperty(hookName)) {
instance.addHook(hookName, hooks[hookName]);
}
}
}
function removeHooks() {
var instance = this;
for (var hookName in hooks) {
if (hooks.hasOwnProperty(hookName)) {
instance.removeHook(hookName, hooks[hookName]);
}
}
}
}
var htPersistentState = new HandsontablePersistentState();
Handsontable.hooks.add('beforeInit', htPersistentState.init);
Handsontable.hooks.add('afterUpdateSettings', htPersistentState.init);
//#
},{"plugins":57}],85:[function(require,module,exports){
"use strict";
var $___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__46__46__47_renderers__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
removeClass = $__0.removeClass;
var $__1 = ($___46__46__47__46__46__47_renderers__ = require("renderers"), $___46__46__47__46__46__47_renderers__ && $___46__46__47__46__46__47_renderers__.__esModule && $___46__46__47__46__46__47_renderers__ || {default: $___46__46__47__46__46__47_renderers__}),
registerRenderer = $__1.registerRenderer,
getRenderer = $__1.getRenderer;
Handsontable.Search = function Search(instance) {
this.query = function(queryStr, callback, queryMethod) {
var rowCount = instance.countRows();
var colCount = instance.countCols();
var queryResult = [];
if (!callback) {
callback = Handsontable.Search.global.getDefaultCallback();
}
if (!queryMethod) {
queryMethod = Handsontable.Search.global.getDefaultQueryMethod();
}
for (var rowIndex = 0; rowIndex < rowCount; rowIndex++) {
for (var colIndex = 0; colIndex < colCount; colIndex++) {
var cellData = instance.getDataAtCell(rowIndex, colIndex);
var cellProperties = instance.getCellMeta(rowIndex, colIndex);
var cellCallback = cellProperties.search.callback || callback;
var cellQueryMethod = cellProperties.search.queryMethod || queryMethod;
var testResult = cellQueryMethod(queryStr, cellData);
if (testResult) {
var singleResult = {
row: rowIndex,
col: colIndex,
data: cellData
};
queryResult.push(singleResult);
}
if (cellCallback) {
cellCallback(instance, rowIndex, colIndex, cellData, testResult);
}
}
}
return queryResult;
};
};
Handsontable.Search.DEFAULT_CALLBACK = function(instance, row, col, data, testResult) {
instance.getCellMeta(row, col).isSearchResult = testResult;
};
Handsontable.Search.DEFAULT_QUERY_METHOD = function(query, value) {
if (typeof query == 'undefined' || query == null || !query.toLowerCase || query.length === 0) {
return false;
}
if (typeof value == 'undefined' || value == null) {
return false;
}
return value.toString().toLowerCase().indexOf(query.toLowerCase()) != -1;
};
Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS = 'htSearchResult';
Handsontable.Search.global = (function() {
var defaultCallback = Handsontable.Search.DEFAULT_CALLBACK;
var defaultQueryMethod = Handsontable.Search.DEFAULT_QUERY_METHOD;
var defaultSearchResultClass = Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;
return {
getDefaultCallback: function() {
return defaultCallback;
},
setDefaultCallback: function(newDefaultCallback) {
defaultCallback = newDefaultCallback;
},
getDefaultQueryMethod: function() {
return defaultQueryMethod;
},
setDefaultQueryMethod: function(newDefaultQueryMethod) {
defaultQueryMethod = newDefaultQueryMethod;
},
getDefaultSearchResultClass: function() {
return defaultSearchResultClass;
},
setDefaultSearchResultClass: function(newSearchResultClass) {
defaultSearchResultClass = newSearchResultClass;
}
};
})();
Handsontable.SearchCellDecorator = function(instance, TD, row, col, prop, value, cellProperties) {
var searchResultClass = (cellProperties.search !== null && typeof cellProperties.search == 'object' && cellProperties.search.searchResultClass) || Handsontable.Search.global.getDefaultSearchResultClass();
if (cellProperties.isSearchResult) {
addClass(TD, searchResultClass);
} else {
removeClass(TD, searchResultClass);
}
};
var originalBaseRenderer = getRenderer('base');
registerRenderer('base', function(instance, TD, row, col, prop, value, cellProperties) {
originalBaseRenderer.apply(this, arguments);
Handsontable.SearchCellDecorator.apply(this, arguments);
});
function init() {
var instance = this;
var pluginEnabled = !!instance.getSettings().search;
if (pluginEnabled) {
instance.search = new Handsontable.Search(instance);
} else {
delete instance.search;
}
}
Handsontable.hooks.add('afterInit', init);
Handsontable.hooks.add('afterUpdateSettings', init);
//#
},{"helpers/dom/element":45,"renderers":88}],86:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
TouchScroll: {get: function() {
return TouchScroll;
}},
__esModule: {value: true}
});
var $___46__46__47__46__46__47_helpers_47_dom_47_element__,
$___46__46__47__95_base__,
$___46__46__47__46__46__47_plugins__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47__46__46__47_helpers_47_dom_47_element__ && $___46__46__47__46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
removeClass = $__0.removeClass;
var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__95_base__ && $___46__46__47__95_base__.__esModule && $___46__46__47__95_base__ || {default: $___46__46__47__95_base__}).default;
var registerPlugin = ($___46__46__47__46__46__47_plugins__ = require("plugins"), $___46__46__47__46__46__47_plugins__ && $___46__46__47__46__46__47_plugins__.__esModule && $___46__46__47__46__46__47_plugins__ || {default: $___46__46__47__46__46__47_plugins__}).registerPlugin;
var TouchScroll = function TouchScroll(hotInstance) {
var $__3 = this;
$traceurRuntime.superConstructor($TouchScroll).call(this, hotInstance);
this.hot.addHook('afterInit', (function() {
return $__3.afterInit();
}));
this.hot.addHook('afterUpdateSettings', (function() {
return $__3.onAfterUpdateSettings();
}));
this.scrollbars = [];
this.clones = [];
};
var $TouchScroll = TouchScroll;
($traceurRuntime.createClass)(TouchScroll, {
afterInit: function() {
this.registerEvents();
this.onAfterUpdateSettings();
},
onAfterUpdateSettings: function() {
var _this = this;
this.hot.addHookOnce('afterRender', function() {
var wtOverlays = _this.hot.view.wt.wtOverlays;
_this.scrollbars = [];
_this.scrollbars.push(wtOverlays.topOverlay);
if (wtOverlays.bottomOverlay.clone) {
_this.scrollbars.push(wtOverlays.bottomOverlay);
}
_this.scrollbars.push(wtOverlays.leftOverlay);
if (wtOverlays.topLeftCornerOverlay) {
_this.scrollbars.push(wtOverlays.topLeftCornerOverlay);
}
if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) {
_this.scrollbars.push(wtOverlays.bottomLeftCornerOverlay);
}
_this.clones = [];
if (wtOverlays.topOverlay.needFullRender) {
_this.clones.push(wtOverlays.topOverlay.clone.wtTable.holder.parentNode);
}
if (wtOverlays.bottomOverlay.needFullRender) {
_this.clones.push(wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode);
}
if (wtOverlays.leftOverlay.needFullRender) {
_this.clones.push(wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);
}
if (wtOverlays.topLeftCornerOverlay) {
_this.clones.push(wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);
}
if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) {
_this.clones.push(wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);
}
});
},
registerEvents: function() {
var $__3 = this;
this.hot.addHook('beforeTouchScroll', (function() {
return $__3.onBeforeTouchScroll();
}));
this.hot.addHook('afterMomentumScroll', (function() {
return $__3.onAfterMomentumScroll();
}));
},
onBeforeTouchScroll: function() {
Handsontable.freezeOverlays = true;
for (var i = 0,
cloneCount = this.clones.length; i < cloneCount; i++) {
addClass(this.clones[i], 'hide-tween');
}
},
onAfterMomentumScroll: function() {
Handsontable.freezeOverlays = false;
var _that = this;
for (var i = 0,
cloneCount = this.clones.length; i < cloneCount; i++) {
removeClass(this.clones[i], 'hide-tween');
}
for (var i$__5 = 0,
cloneCount$__6 = this.clones.length; i$__5 < cloneCount$__6; i$__5++) {
addClass(this.clones[i$__5], 'show-tween');
}
setTimeout(function() {
for (var i = 0,
cloneCount = _that.clones.length; i < cloneCount; i++) {
removeClass(_that.clones[i], 'show-tween');
}
}, 400);
for (var i$__7 = 0,
cloneCount$__8 = this.scrollbars.length; i$__7 < cloneCount$__8; i$__7++) {
this.scrollbars[i$__7].refresh();
this.scrollbars[i$__7].resetFixedPosition();
}
this.hot.view.wt.wtOverlays.syncScrollWithMaster();
}
}, {}, BasePlugin);
;
registerPlugin('touchScroll', TouchScroll);
//#
},{"_base":58,"helpers/dom/element":45,"plugins":57}],87:[function(require,module,exports){
"use strict";
var $___46__46__47__46__46__47_helpers_47_object__,
$___46__46__47__46__46__47_helpers_47_dom_47_event__;
var $__0 = ($___46__46__47__46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47__46__46__47_helpers_47_object__ && $___46__46__47__46__46__47_helpers_47_object__.__esModule && $___46__46__47__46__46__47_helpers_47_object__ || {default: $___46__46__47__46__46__47_helpers_47_object__}),
inherit = $__0.inherit,
deepClone = $__0.deepClone;
var stopImmediatePropagation = ($___46__46__47__46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47__46__46__47_helpers_47_dom_47_event__ && $___46__46__47__46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47__46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47__46__46__47_helpers_47_dom_47_event__}).stopImmediatePropagation;
Handsontable.UndoRedo = function(instance) {
var plugin = this;
this.instance = instance;
this.doneActions = [];
this.undoneActions = [];
this.ignoreNewActions = false;
instance.addHook('afterChange', function(changes, origin) {
if (changes) {
var action = new Handsontable.UndoRedo.ChangeAction(changes);
plugin.done(action);
}
});
instance.addHook('afterCreateRow', function(index, amount, createdAutomatically) {
if (createdAutomatically) {
return;
}
var action = new Handsontable.UndoRedo.CreateRowAction(index, amount);
plugin.done(action);
});
instance.addHook('beforeRemoveRow', function(index, amount) {
var originalData = plugin.instance.getSourceData();
index = (originalData.length + index) % originalData.length;
var removedData = originalData.slice(index, index + amount);
var action = new Handsontable.UndoRedo.RemoveRowAction(index, removedData);
plugin.done(action);
});
instance.addHook('afterCreateCol', function(index, amount, createdAutomatically) {
if (createdAutomatically) {
return;
}
var action = new Handsontable.UndoRedo.CreateColumnAction(index, amount);
plugin.done(action);
});
instance.addHook('beforeRemoveCol', function(index, amount) {
var originalData = plugin.instance.getSourceData();
index = (plugin.instance.countCols() + index) % plugin.instance.countCols();
var removedData = [];
for (var i = 0,
len = originalData.length; i < len; i++) {
removedData[i] = originalData[i].slice(index, index + amount);
}
var headers;
if (Array.isArray(instance.getSettings().colHeaders)) {
headers = instance.getSettings().colHeaders.slice(index, index + removedData.length);
}
var action = new Handsontable.UndoRedo.RemoveColumnAction(index, removedData, headers);
plugin.done(action);
});
instance.addHook('beforeCellAlignment', function(stateBefore, range, type, alignment) {
var action = new Handsontable.UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment);
plugin.done(action);
});
};
Handsontable.UndoRedo.prototype.done = function(action) {
if (!this.ignoreNewActions) {
this.doneActions.push(action);
this.undoneActions.length = 0;
}
};
Handsontable.UndoRedo.prototype.undo = function() {
if (this.isUndoAvailable()) {
var action = this.doneActions.pop();
this.ignoreNewActions = true;
var that = this;
action.undo(this.instance, function() {
that.ignoreNewActions = false;
that.undoneActions.push(action);
});
}
};
Handsontable.UndoRedo.prototype.redo = function() {
if (this.isRedoAvailable()) {
var action = this.undoneActions.pop();
this.ignoreNewActions = true;
var that = this;
action.redo(this.instance, function() {
that.ignoreNewActions = false;
that.doneActions.push(action);
});
}
};
Handsontable.UndoRedo.prototype.isUndoAvailable = function() {
return this.doneActions.length > 0;
};
Handsontable.UndoRedo.prototype.isRedoAvailable = function() {
return this.undoneActions.length > 0;
};
Handsontable.UndoRedo.prototype.clear = function() {
this.doneActions.length = 0;
this.undoneActions.length = 0;
};
Handsontable.UndoRedo.Action = function() {};
Handsontable.UndoRedo.Action.prototype.undo = function() {};
Handsontable.UndoRedo.Action.prototype.redo = function() {};
Handsontable.UndoRedo.ChangeAction = function(changes) {
this.changes = changes;
};
inherit(Handsontable.UndoRedo.ChangeAction, Handsontable.UndoRedo.Action);
Handsontable.UndoRedo.ChangeAction.prototype.undo = function(instance, undoneCallback) {
var data = deepClone(this.changes),
emptyRowsAtTheEnd = instance.countEmptyRows(true),
emptyColsAtTheEnd = instance.countEmptyCols(true);
for (var i = 0,
len = data.length; i < len; i++) {
data[i].splice(3, 1);
}
instance.addHookOnce('afterChange', undoneCallback);
instance.setDataAtRowProp(data, null, null, 'undo');
for (var i = 0,
len = data.length; i < len; i++) {
if (instance.getSettings().minSpareRows && data[i][0] + 1 + instance.getSettings().minSpareRows === instance.countRows() && emptyRowsAtTheEnd == instance.getSettings().minSpareRows) {
instance.alter('remove_row', parseInt(data[i][0] + 1, 10), instance.getSettings().minSpareRows);
instance.undoRedo.doneActions.pop();
}
if (instance.getSettings().minSpareCols && data[i][1] + 1 + instance.getSettings().minSpareCols === instance.countCols() && emptyColsAtTheEnd == instance.getSettings().minSpareCols) {
instance.alter('remove_col', parseInt(data[i][1] + 1, 10), instance.getSettings().minSpareCols);
instance.undoRedo.doneActions.pop();
}
}
};
Handsontable.UndoRedo.ChangeAction.prototype.redo = function(instance, onFinishCallback) {
var data = deepClone(this.changes);
for (var i = 0,
len = data.length; i < len; i++) {
data[i].splice(2, 1);
}
instance.addHookOnce('afterChange', onFinishCallback);
instance.setDataAtRowProp(data, null, null, 'redo');
};
Handsontable.UndoRedo.CreateRowAction = function(index, amount) {
this.index = index;
this.amount = amount;
};
inherit(Handsontable.UndoRedo.CreateRowAction, Handsontable.UndoRedo.Action);
Handsontable.UndoRedo.CreateRowAction.prototype.undo = function(instance, undoneCallback) {
var rowCount = instance.countRows(),
minSpareRows = instance.getSettings().minSpareRows;
if (this.index >= rowCount && this.index - minSpareRows < rowCount) {
this.index -= minSpareRows;
}
instance.addHookOnce('afterRemoveRow', undoneCallback);
instance.alter('remove_row', this.index, this.amount);
};
Handsontable.UndoRedo.CreateRowAction.prototype.redo = function(instance, redoneCallback) {
instance.addHookOnce('afterCreateRow', redoneCallback);
instance.alter('insert_row', this.index + 1, this.amount);
};
Handsontable.UndoRedo.RemoveRowAction = function(index, data) {
this.index = index;
this.data = data;
};
inherit(Handsontable.UndoRedo.RemoveRowAction, Handsontable.UndoRedo.Action);
Handsontable.UndoRedo.RemoveRowAction.prototype.undo = function(instance, undoneCallback) {
var spliceArgs = [this.index, 0];
Array.prototype.push.apply(spliceArgs, this.data);
Array.prototype.splice.apply(instance.getSourceData(), spliceArgs);
instance.addHookOnce('afterRender', undoneCallback);
instance.render();
};
Handsontable.UndoRedo.RemoveRowAction.prototype.redo = function(instance, redoneCallback) {
instance.addHookOnce('afterRemoveRow', redoneCallback);
instance.alter('remove_row', this.index, this.data.length);
};
Handsontable.UndoRedo.CreateColumnAction = function(index, amount) {
this.index = index;
this.amount = amount;
};
inherit(Handsontable.UndoRedo.CreateColumnAction, Handsontable.UndoRedo.Action);
Handsontable.UndoRedo.CreateColumnAction.prototype.undo = function(instance, undoneCallback) {
instance.addHookOnce('afterRemoveCol', undoneCallback);
instance.alter('remove_col', this.index, this.amount);
};
Handsontable.UndoRedo.CreateColumnAction.prototype.redo = function(instance, redoneCallback) {
instance.addHookOnce('afterCreateCol', redoneCallback);
instance.alter('insert_col', this.index + 1, this.amount);
};
Handsontable.UndoRedo.CellAlignmentAction = function(stateBefore, range, type, alignment) {
this.stateBefore = stateBefore;
this.range = range;
this.type = type;
this.alignment = alignment;
};
Handsontable.UndoRedo.CellAlignmentAction.prototype.undo = function(instance, undoneCallback) {
if (!instance.getPlugin('contextMenu').isEnabled()) {
return;
}
for (var row = this.range.from.row; row <= this.range.to.row; row++) {
for (var col = this.range.from.col; col <= this.range.to.col; col++) {
instance.setCellMeta(row, col, 'className', this.stateBefore[row][col] || ' htLeft');
}
}
instance.addHookOnce('afterRender', undoneCallback);
instance.render();
};
Handsontable.UndoRedo.CellAlignmentAction.prototype.redo = function(instance, undoneCallback) {
if (!instance.getPlugin('contextMenu').isEnabled()) {
return;
}
instance.selectCell(this.range.from.row, this.range.from.col, this.range.to.row, this.range.to.col);
instance.getPlugin('contextMenu').executeCommand('alignment:' + this.alignment.replace('ht', '').toLowerCase());
instance.addHookOnce('afterRender', undoneCallback);
instance.render();
};
Handsontable.UndoRedo.RemoveColumnAction = function(index, data, headers) {
this.index = index;
this.data = data;
this.amount = this.data[0].length;
this.headers = headers;
};
inherit(Handsontable.UndoRedo.RemoveColumnAction, Handsontable.UndoRedo.Action);
Handsontable.UndoRedo.RemoveColumnAction.prototype.undo = function(instance, undoneCallback) {
var row,
spliceArgs;
for (var i = 0,
len = instance.getSourceData().length; i < len; i++) {
row = instance.getSourceDataAtRow(i);
spliceArgs = [this.index, 0];
Array.prototype.push.apply(spliceArgs, this.data[i]);
Array.prototype.splice.apply(row, spliceArgs);
}
if (typeof this.headers != 'undefined') {
spliceArgs = [this.index, 0];
Array.prototype.push.apply(spliceArgs, this.headers);
Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArgs);
}
instance.addHookOnce('afterRender', undoneCallback);
instance.render();
};
Handsontable.UndoRedo.RemoveColumnAction.prototype.redo = function(instance, redoneCallback) {
instance.addHookOnce('afterRemoveCol', redoneCallback);
instance.alter('remove_col', this.index, this.amount);
};
function init() {
var instance = this;
var pluginEnabled = typeof instance.getSettings().undo == 'undefined' || instance.getSettings().undo;
if (pluginEnabled) {
if (!instance.undoRedo) {
instance.undoRedo = new Handsontable.UndoRedo(instance);
exposeUndoRedoMethods(instance);
instance.addHook('beforeKeyDown', onBeforeKeyDown);
instance.addHook('afterChange', onAfterChange);
}
} else {
if (instance.undoRedo) {
delete instance.undoRedo;
removeExposedUndoRedoMethods(instance);
instance.removeHook('beforeKeyDown', onBeforeKeyDown);
instance.removeHook('afterChange', onAfterChange);
}
}
}
function onBeforeKeyDown(event) {
var instance = this;
var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;
if (ctrlDown) {
if (event.keyCode === 89 || (event.shiftKey && event.keyCode === 90)) {
instance.undoRedo.redo();
stopImmediatePropagation(event);
} else if (event.keyCode === 90) {
instance.undoRedo.undo();
stopImmediatePropagation(event);
}
}
}
function onAfterChange(changes, source) {
var instance = this;
if (source == 'loadData') {
return instance.undoRedo.clear();
}
}
function exposeUndoRedoMethods(instance) {
instance.undo = function() {
return instance.undoRedo.undo();
};
instance.redo = function() {
return instance.undoRedo.redo();
};
instance.isUndoAvailable = function() {
return instance.undoRedo.isUndoAvailable();
};
instance.isRedoAvailable = function() {
return instance.undoRedo.isRedoAvailable();
};
instance.clearUndo = function() {
return instance.undoRedo.clear();
};
}
function removeExposedUndoRedoMethods(instance) {
delete instance.undo;
delete instance.redo;
delete instance.isUndoAvailable;
delete instance.isRedoAvailable;
delete instance.clearUndo;
}
Handsontable.hooks.add('afterInit', init);
Handsontable.hooks.add('afterUpdateSettings', init);
//#
},{"helpers/dom/event":46,"helpers/object":50}],88:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
registerRenderer: {get: function() {
return registerRenderer;
}},
getRenderer: {get: function() {
return getRenderer;
}},
hasRenderer: {get: function() {
return hasRenderer;
}},
__esModule: {value: true}
});
var $__helpers_47_string__;
var toUpperCaseFirst = ($__helpers_47_string__ = require("helpers/string"), $__helpers_47_string__ && $__helpers_47_string__.__esModule && $__helpers_47_string__ || {default: $__helpers_47_string__}).toUpperCaseFirst;
var registeredRenderers = {};
Handsontable.renderers = Handsontable.renderers || {};
Handsontable.renderers.registerRenderer = registerRenderer;
Handsontable.renderers.getRenderer = getRenderer;
function registerRenderer(rendererName, rendererFunction) {
var registerName;
registeredRenderers[rendererName] = rendererFunction;
registerName = toUpperCaseFirst(rendererName) + 'Renderer';
Handsontable.renderers[registerName] = rendererFunction;
Handsontable[registerName] = rendererFunction;
}
function getRenderer(rendererName) {
if (typeof rendererName == 'function') {
return rendererName;
}
if (typeof rendererName != 'string') {
throw Error('Only strings and functions can be passed as "renderer" parameter');
}
if (!(rendererName in registeredRenderers)) {
throw Error('No editor registered under name "' + rendererName + '"');
}
return registeredRenderers[rendererName];
}
function hasRenderer(rendererName) {
return rendererName in registeredRenderers;
}
;
//#
},{"helpers/string":52}],89:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
cellDecorator: {get: function() {
return cellDecorator;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_renderers__;
var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
removeClass = $__0.removeClass;
var registerRenderer = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}).registerRenderer;
;
registerRenderer('base', cellDecorator);
Handsontable.renderers.cellDecorator = cellDecorator;
function cellDecorator(instance, TD, row, col, prop, value, cellProperties) {
if (cellProperties.className) {
if (TD.className) {
TD.className = TD.className + ' ' + cellProperties.className;
} else {
TD.className = cellProperties.className;
}
}
if (cellProperties.readOnly) {
addClass(TD, cellProperties.readOnlyCellClassName);
}
if (cellProperties.valid === false && cellProperties.invalidCellClassName) {
addClass(TD, cellProperties.invalidCellClassName);
} else {
removeClass(TD, cellProperties.invalidCellClassName);
}
if (cellProperties.wordWrap === false && cellProperties.noWordWrapClassName) {
addClass(TD, cellProperties.noWordWrapClassName);
}
if (!value && cellProperties.placeholder) {
addClass(TD, cellProperties.placeholderCellClassName);
}
}
//#
},{"helpers/dom/element":45,"renderers":88}],90:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
autocompleteRenderer: {get: function() {
return autocompleteRenderer;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_eventManager__,
$___46__46__47_renderers__,
$___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__;
var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
hasClass = $__0.hasClass,
empty = $__0.empty;
var eventManagerObject = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).eventManager;
var $__2 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}),
getRenderer = $__2.getRenderer,
registerRenderer = $__2.registerRenderer;
var WalkontableCellCoords = ($___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $___46__46__47_3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords;
var clonableWRAPPER = document.createElement('DIV');
clonableWRAPPER.className = 'htAutocompleteWrapper';
var clonableARROW = document.createElement('DIV');
clonableARROW.className = 'htAutocompleteArrow';
clonableARROW.appendChild(document.createTextNode(String.fromCharCode(9660)));
var wrapTdContentWithWrapper = function(TD, WRAPPER) {
WRAPPER.innerHTML = TD.innerHTML;
empty(TD);
TD.appendChild(WRAPPER);
};
function autocompleteRenderer(instance, TD, row, col, prop, value, cellProperties) {
var WRAPPER = clonableWRAPPER.cloneNode(true);
var ARROW = clonableARROW.cloneNode(true);
getRenderer('text')(instance, TD, row, col, prop, value, cellProperties);
TD.appendChild(ARROW);
addClass(TD, 'htAutocomplete');
if (!TD.firstChild) {
TD.appendChild(document.createTextNode(String.fromCharCode(160)));
}
if (!instance.acArrowListener) {
var eventManager = eventManagerObject(instance);
instance.acArrowListener = function(event) {
if (hasClass(event.target, 'htAutocompleteArrow')) {
instance.view.wt.getSetting('onCellDblClick', null, new WalkontableCellCoords(row, col), TD);
}
};
eventManager.addEventListener(instance.rootElement, 'mousedown', instance.acArrowListener);
instance.addHookOnce('afterDestroy', function() {
eventManager.destroy();
});
}
}
;
registerRenderer('autocomplete', autocompleteRenderer);
//#
},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"renderers":88}],91:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
checkboxRenderer: {get: function() {
return checkboxRenderer;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_helpers_47_string__,
$___46__46__47_eventManager__,
$___46__46__47_renderers__,
$___46__46__47_helpers_47_unicode__,
$___46__46__47_helpers_47_dom_47_event__;
var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}),
empty = $__0.empty,
addClass = $__0.addClass,
hasClass = $__0.hasClass;
var equalsIgnoreCase = ($___46__46__47_helpers_47_string__ = require("helpers/string"), $___46__46__47_helpers_47_string__ && $___46__46__47_helpers_47_string__.__esModule && $___46__46__47_helpers_47_string__ || {default: $___46__46__47_helpers_47_string__}).equalsIgnoreCase;
var EventManager = ($___46__46__47_eventManager__ = require("eventManager"), $___46__46__47_eventManager__ && $___46__46__47_eventManager__.__esModule && $___46__46__47_eventManager__ || {default: $___46__46__47_eventManager__}).EventManager;
var $__3 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}),
getRenderer = $__3.getRenderer,
registerRenderer = $__3.registerRenderer;
var KEY_CODES = ($___46__46__47_helpers_47_unicode__ = require("helpers/unicode"), $___46__46__47_helpers_47_unicode__ && $___46__46__47_helpers_47_unicode__.__esModule && $___46__46__47_helpers_47_unicode__ || {default: $___46__46__47_helpers_47_unicode__}).KEY_CODES;
var $__5 = ($___46__46__47_helpers_47_dom_47_event__ = require("helpers/dom/event"), $___46__46__47_helpers_47_dom_47_event__ && $___46__46__47_helpers_47_dom_47_event__.__esModule && $___46__46__47_helpers_47_dom_47_event__ || {default: $___46__46__47_helpers_47_dom_47_event__}),
stopPropagation = $__5.stopPropagation,
stopImmediatePropagation = $__5.stopImmediatePropagation,
isImmediatePropagationStopped = $__5.isImmediatePropagationStopped;
var isListeningKeyDownEvent = new WeakMap();
var BAD_VALUE_CLASS = 'htBadValue';
function checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) {
var eventManager = new EventManager(instance);
var input = createInput();
var labelOptions = cellProperties.label;
var badValue = false;
if (typeof cellProperties.checkedTemplate === 'undefined') {
cellProperties.checkedTemplate = true;
}
if (typeof cellProperties.uncheckedTemplate === 'undefined') {
cellProperties.uncheckedTemplate = false;
}
empty(TD);
if (value === cellProperties.checkedTemplate || equalsIgnoreCase(value, cellProperties.checkedTemplate)) {
input.checked = true;
} else if (value === cellProperties.uncheckedTemplate || equalsIgnoreCase(value, cellProperties.uncheckedTemplate)) {
input.checked = false;
} else if (value === null) {
addClass(input, 'noValue');
} else {
input.style.display = 'none';
addClass(input, BAD_VALUE_CLASS);
badValue = true;
}
if (!badValue && labelOptions) {
var labelText = '';
if (labelOptions.value) {
labelText = typeof labelOptions.value === 'function' ? labelOptions.value.call(this, row, col, prop, value) : labelOptions.value;
} else if (labelOptions.property) {
labelText = instance.getDataAtRowProp(row, labelOptions.property);
}
var label = createLabel(labelText);
if (labelOptions.position === 'before') {
label.appendChild(input);
} else {
label.insertBefore(input, label.firstChild);
}
input = label;
}
TD.appendChild(input);
if (badValue) {
TD.appendChild(document.createTextNode('#bad-value#'));
}
if (cellProperties.readOnly) {
eventManager.addEventListener(input, 'click', preventDefault);
} else {
eventManager.addEventListener(input, 'mousedown', stopPropagation);
eventManager.addEventListener(input, 'mouseup', stopPropagation);
eventManager.addEventListener(input, 'change', (function(event) {
instance.setDataAtRowProp(row, prop, event.target.checked ? cellProperties.checkedTemplate : cellProperties.uncheckedTemplate);
}));
}
if (!isListeningKeyDownEvent.has(instance)) {
isListeningKeyDownEvent.set(instance, true);
instance.addHook('beforeKeyDown', onBeforeKeyDown);
}
function onBeforeKeyDown(event) {
var allowedKeys = [KEY_CODES.SPACE, KEY_CODES.ENTER, KEY_CODES.DELETE, KEY_CODES.BACKSPACE];
if (allowedKeys.indexOf(event.keyCode) !== -1 && !isImmediatePropagationStopped(event)) {
eachSelectedCheckboxCell(function() {
stopImmediatePropagation(event);
event.preventDefault();
});
}
if (event.keyCode == KEY_CODES.SPACE || event.keyCode == KEY_CODES.ENTER) {
toggleSelected();
}
if (event.keyCode == KEY_CODES.DELETE || event.keyCode == KEY_CODES.BACKSPACE) {
toggleSelected(false);
}
}
function toggleSelected() {
var checked = arguments[0] !== (void 0) ? arguments[0] : null;
eachSelectedCheckboxCell(function(checkboxes) {
for (var i = 0,
len = checkboxes.length; i < len; i++) {
if (hasClass(checkboxes[i], BAD_VALUE_CLASS) && checked === null) {
return;
}
toggleCheckbox(checkboxes[i], checked);
}
});
}
function toggleCheckbox(checkbox) {
var checked = arguments[1] !== (void 0) ? arguments[1] : null;
if (checked === null) {
checkbox.checked = !checkbox.checked;
} else {
checkbox.checked = checked;
}
eventManager.fireEvent(checkbox, 'change');
}
function eachSelectedCheckboxCell(callback) {
var selRange = instance.getSelectedRange();
var topLeft = selRange.getTopLeftCorner();
var bottomRight = selRange.getBottomRightCorner();
for (var row = topLeft.row; row <= bottomRight.row; row++) {
for (var col = topLeft.col; col <= bottomRight.col; col++) {
var cell = instance.getCell(row, col);
var cellProperties$__6 = instance.getCellMeta(row, col);
var checkboxes = cell.querySelectorAll('input[type=checkbox]');
if (checkboxes.length > 0 && !cellProperties$__6.readOnly) {
callback(checkboxes);
}
}
}
}
}
;
registerRenderer('checkbox', checkboxRenderer);
function createInput() {
var input = document.createElement('input');
input.className = 'htCheckboxRendererInput';
input.type = 'checkbox';
input.setAttribute('autocomplete', 'off');
return input.cloneNode(false);
}
function createLabel(text) {
var label = document.createElement('label');
label.className = 'htCheckboxRendererLabel';
label.appendChild(document.createTextNode(text));
return label.cloneNode(true);
}
function preventDefault(event) {
event.preventDefault();
}
//#
},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,"renderers":88}],92:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
htmlRenderer: {get: function() {
return htmlRenderer;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_renderers__;
var fastInnerHTML = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).fastInnerHTML;
var $__1 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}),
getRenderer = $__1.getRenderer,
registerRenderer = $__1.registerRenderer;
function htmlRenderer(instance, TD, row, col, prop, value, cellProperties) {
getRenderer('base').apply(this, arguments);
if (value === null || value === void 0) {
value = '';
}
fastInnerHTML(TD, value);
}
;
registerRenderer('html', htmlRenderer);
//#
},{"helpers/dom/element":45,"renderers":88}],93:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
numericRenderer: {get: function() {
return numericRenderer;
}},
__esModule: {value: true}
});
var $__numeral__,
$___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_renderers__,
$___46__46__47_helpers_47_number__;
var numeral = ($__numeral__ = require("numeral"), $__numeral__ && $__numeral__.__esModule && $__numeral__ || {default: $__numeral__}).default;
var addClass = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).addClass;
var $__2 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}),
getRenderer = $__2.getRenderer,
registerRenderer = $__2.registerRenderer;
var isNumeric = ($___46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47_helpers_47_number__ && $___46__46__47_helpers_47_number__.__esModule && $___46__46__47_helpers_47_number__ || {default: $___46__46__47_helpers_47_number__}).isNumeric;
function numericRenderer(instance, TD, row, col, prop, value, cellProperties) {
if (isNumeric(value)) {
if (typeof cellProperties.language !== 'undefined') {
numeral.language(cellProperties.language);
}
value = numeral(value).format(cellProperties.format || '0');
addClass(TD, 'htNumeric');
}
getRenderer('text')(instance, TD, row, col, prop, value, cellProperties);
}
;
registerRenderer('numeric', numericRenderer);
//#
},{"helpers/dom/element":45,"helpers/number":49,"numeral":"numeral","renderers":88}],94:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
passwordRenderer: {get: function() {
return passwordRenderer;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_renderers__;
var fastInnerHTML = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}).fastInnerHTML;
var $__1 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}),
getRenderer = $__1.getRenderer,
registerRenderer = $__1.registerRenderer;
function passwordRenderer(instance, TD, row, col, prop, value, cellProperties) {
getRenderer('text').apply(this, arguments);
value = TD.innerHTML;
var hash;
var hashLength = cellProperties.hashLength || value.length;
var hashSymbol = cellProperties.hashSymbol || '*';
for (hash = ''; hash.split(hashSymbol).length - 1 < hashLength; hash += hashSymbol) {}
fastInnerHTML(TD, hash);
}
;
registerRenderer('password', passwordRenderer);
//#
},{"helpers/dom/element":45,"renderers":88}],95:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
textRenderer: {get: function() {
return textRenderer;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_helpers_47_mixed__,
$___46__46__47_renderers__;
var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}),
empty = $__0.empty,
fastInnerText = $__0.fastInnerText;
var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify;
var $__2 = ($___46__46__47_renderers__ = require("renderers"), $___46__46__47_renderers__ && $___46__46__47_renderers__.__esModule && $___46__46__47_renderers__ || {default: $___46__46__47_renderers__}),
getRenderer = $__2.getRenderer,
registerRenderer = $__2.registerRenderer;
function textRenderer(instance, TD, row, col, prop, value, cellProperties) {
getRenderer('base').apply(this, arguments);
if (!value && cellProperties.placeholder) {
value = cellProperties.placeholder;
}
var escaped = stringify(value);
if (!instance.getSettings().trimWhitespace) {
escaped = escaped.replace(/ /g, String.fromCharCode(160));
}
if (cellProperties.rendererTemplate) {
empty(TD);
var TEMPLATE = document.createElement('TEMPLATE');
TEMPLATE.setAttribute('bind', '{{}}');
TEMPLATE.innerHTML = cellProperties.rendererTemplate;
HTMLTemplateElement.decorate(TEMPLATE);
TEMPLATE.model = instance.getSourceDataAtRow(row);
TD.appendChild(TEMPLATE);
} else {
fastInnerText(TD, escaped);
}
}
;
registerRenderer('text', textRenderer);
//#
},{"helpers/dom/element":45,"helpers/mixed":48,"renderers":88}],96:[function(require,module,exports){
"use strict";
(function(global) {
'use strict';
if (global.$traceurRuntime) {
return;
}
var $Object = Object;
var $TypeError = TypeError;
var $create = $Object.create;
var $defineProperties = $Object.defineProperties;
var $defineProperty = $Object.defineProperty;
var $freeze = $Object.freeze;
var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor;
var $getOwnPropertyNames = $Object.getOwnPropertyNames;
var $keys = $Object.keys;
var $hasOwnProperty = $Object.prototype.hasOwnProperty;
var $preventExtensions = Object.preventExtensions;
var $seal = Object.seal;
var $isExtensible = Object.isExtensible;
function nonEnum(value) {
return {
configurable: true,
enumerable: false,
value: value,
writable: true
};
}
var method = nonEnum;
var counter = 0;
function newUniqueString() {
return '__$' + Math.floor(Math.random() * 1e9) + '$' + ++counter + '$__';
}
var symbolInternalProperty = newUniqueString();
var symbolDescriptionProperty = newUniqueString();
var symbolDataProperty = newUniqueString();
var symbolValues = $create(null);
var privateNames = $create(null);
function isPrivateName(s) {
return privateNames[s];
}
function createPrivateName() {
var s = newUniqueString();
privateNames[s] = true;
return s;
}
function isShimSymbol(symbol) {
return typeof symbol === 'object' && symbol instanceof SymbolValue;
}
function typeOf(v) {
if (isShimSymbol(v))
return 'symbol';
return typeof v;
}
function Symbol(description) {
var value = new SymbolValue(description);
if (!(this instanceof Symbol))
return value;
throw new TypeError('Symbol cannot be new\'ed');
}
$defineProperty(Symbol.prototype, 'constructor', nonEnum(Symbol));
$defineProperty(Symbol.prototype, 'toString', method(function() {
var symbolValue = this[symbolDataProperty];
if (!getOption('symbols'))
return symbolValue[symbolInternalProperty];
if (!symbolValue)
throw TypeError('Conversion from symbol to string');
var desc = symbolValue[symbolDescriptionProperty];
if (desc === undefined)
desc = '';
return 'Symbol(' + desc + ')';
}));
$defineProperty(Symbol.prototype, 'valueOf', method(function() {
var symbolValue = this[symbolDataProperty];
if (!symbolValue)
throw TypeError('Conversion from symbol to string');
if (!getOption('symbols'))
return symbolValue[symbolInternalProperty];
return symbolValue;
}));
function SymbolValue(description) {
var key = newUniqueString();
$defineProperty(this, symbolDataProperty, {value: this});
$defineProperty(this, symbolInternalProperty, {value: key});
$defineProperty(this, symbolDescriptionProperty, {value: description});
freeze(this);
symbolValues[key] = this;
}
$defineProperty(SymbolValue.prototype, 'constructor', nonEnum(Symbol));
$defineProperty(SymbolValue.prototype, 'toString', {
value: Symbol.prototype.toString,
enumerable: false
});
$defineProperty(SymbolValue.prototype, 'valueOf', {
value: Symbol.prototype.valueOf,
enumerable: false
});
var hashProperty = createPrivateName();
var hashPropertyDescriptor = {value: undefined};
var hashObjectProperties = {
hash: {value: undefined},
self: {value: undefined}
};
var hashCounter = 0;
function getOwnHashObject(object) {
var hashObject = object[hashProperty];
if (hashObject && hashObject.self === object)
return hashObject;
if ($isExtensible(object)) {
hashObjectProperties.hash.value = hashCounter++;
hashObjectProperties.self.value = object;
hashPropertyDescriptor.value = $create(null, hashObjectProperties);
$defineProperty(object, hashProperty, hashPropertyDescriptor);
return hashPropertyDescriptor.value;
}
return undefined;
}
function freeze(object) {
getOwnHashObject(object);
return $freeze.apply(this, arguments);
}
function preventExtensions(object) {
getOwnHashObject(object);
return $preventExtensions.apply(this, arguments);
}
function seal(object) {
getOwnHashObject(object);
return $seal.apply(this, arguments);
}
freeze(SymbolValue.prototype);
function isSymbolString(s) {
return symbolValues[s] || privateNames[s];
}
function toProperty(name) {
if (isShimSymbol(name))
return name[symbolInternalProperty];
return name;
}
function removeSymbolKeys(array) {
var rv = [];
for (var i = 0; i < array.length; i++) {
if (!isSymbolString(array[i])) {
rv.push(array[i]);
}
}
return rv;
}
function getOwnPropertyNames(object) {
return removeSymbolKeys($getOwnPropertyNames(object));
}
function keys(object) {
return removeSymbolKeys($keys(object));
}
function getOwnPropertySymbols(object) {
var rv = [];
var names = $getOwnPropertyNames(object);
for (var i = 0; i < names.length; i++) {
var symbol = symbolValues[names[i]];
if (symbol) {
rv.push(symbol);
}
}
return rv;
}
function getOwnPropertyDescriptor(object, name) {
return $getOwnPropertyDescriptor(object, toProperty(name));
}
function hasOwnProperty(name) {
return $hasOwnProperty.call(this, toProperty(name));
}
function getOption(name) {
return global.traceur && global.traceur.options[name];
}
function defineProperty(object, name, descriptor) {
if (isShimSymbol(name)) {
name = name[symbolInternalProperty];
}
$defineProperty(object, name, descriptor);
return object;
}
function polyfillObject(Object) {
$defineProperty(Object, 'defineProperty', {value: defineProperty});
$defineProperty(Object, 'getOwnPropertyNames', {value: getOwnPropertyNames});
$defineProperty(Object, 'getOwnPropertyDescriptor', {value: getOwnPropertyDescriptor});
$defineProperty(Object.prototype, 'hasOwnProperty', {value: hasOwnProperty});
$defineProperty(Object, 'freeze', {value: freeze});
$defineProperty(Object, 'preventExtensions', {value: preventExtensions});
$defineProperty(Object, 'seal', {value: seal});
$defineProperty(Object, 'keys', {value: keys});
}
function exportStar(object) {
for (var i = 1; i < arguments.length; i++) {
var names = $getOwnPropertyNames(arguments[i]);
for (var j = 0; j < names.length; j++) {
var name = names[j];
if (isSymbolString(name))
continue;
(function(mod, name) {
$defineProperty(object, name, {
get: function() {
return mod[name];
},
enumerable: true
});
})(arguments[i], names[j]);
}
}
return object;
}
function isObject(x) {
return x != null && (typeof x === 'object' || typeof x === 'function');
}
function toObject(x) {
if (x == null)
throw $TypeError();
return $Object(x);
}
function checkObjectCoercible(argument) {
if (argument == null) {
throw new TypeError('Value cannot be converted to an Object');
}
return argument;
}
function polyfillSymbol(global, Symbol) {
if (!global.Symbol) {
global.Symbol = Symbol;
Object.getOwnPropertySymbols = getOwnPropertySymbols;
}
if (!global.Symbol.iterator) {
global.Symbol.iterator = Symbol('Symbol.iterator');
}
}
function setupGlobals(global) {
polyfillSymbol(global, Symbol);
global.Reflect = global.Reflect || {};
global.Reflect.global = global.Reflect.global || global;
polyfillObject(global.Object);
}
setupGlobals(global);
global.$traceurRuntime = {
checkObjectCoercible: checkObjectCoercible,
createPrivateName: createPrivateName,
defineProperties: $defineProperties,
defineProperty: $defineProperty,
exportStar: exportStar,
getOwnHashObject: getOwnHashObject,
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
getOwnPropertyNames: $getOwnPropertyNames,
isObject: isObject,
isPrivateName: isPrivateName,
isSymbolString: isSymbolString,
keys: $keys,
setupGlobals: setupGlobals,
toObject: toObject,
toProperty: toProperty,
typeof: typeOf
};
})(window);
(function() {
'use strict';
var $toProperty = $traceurRuntime.toProperty;
function spread() {
var rv = [],
j = 0,
iterResult;
for (var i = 0; i < arguments.length; i++) {
var valueToSpread = $traceurRuntime.checkObjectCoercible(arguments[i]);
if (typeof valueToSpread[$toProperty(Symbol.iterator)] !== 'function') {
throw new TypeError('Cannot spread non-iterable object.');
}
var iter = valueToSpread[$toProperty(Symbol.iterator)]();
while (!(iterResult = iter.next()).done) {
rv[j++] = iterResult.value;
}
}
return rv;
}
$traceurRuntime.spread = spread;
})();
(function() {
'use strict';
var $Object = Object;
var $TypeError = TypeError;
var $create = $Object.create;
var $defineProperties = $traceurRuntime.defineProperties;
var $defineProperty = $traceurRuntime.defineProperty;
var $getOwnPropertyDescriptor = $traceurRuntime.getOwnPropertyDescriptor;
var $getPrototypeOf = Object.getPrototypeOf;
var $toProperty = $traceurRuntime.toProperty;
var $__0 = Object,
getOwnPropertyNames = $__0.getOwnPropertyNames,
getOwnPropertySymbols = $__0.getOwnPropertySymbols;
function superDescriptor(homeObject, name) {
var proto = $getPrototypeOf(homeObject);
do {
var result = $getOwnPropertyDescriptor(proto, name);
if (result)
return result;
proto = $getPrototypeOf(proto);
} while (proto);
return undefined;
}
function superConstructor(ctor) {
return ctor.__proto__;
}
function superCall(self, homeObject, name, args) {
return superGet(self, homeObject, name).apply(self, args);
}
function superGet(self, homeObject, name) {
var descriptor = superDescriptor(homeObject, name);
if (descriptor) {
if (!descriptor.get)
return descriptor.value;
return descriptor.get.call(self);
}
return undefined;
}
function superSet(self, homeObject, name, value) {
var descriptor = superDescriptor(homeObject, name);
if (descriptor && descriptor.set) {
descriptor.set.call(self, value);
return value;
}
throw $TypeError(("super has no setter '" + name + "'."));
}
function getDescriptors(object) {
var descriptors = {};
var names = getOwnPropertyNames(object);
for (var i = 0; i < names.length; i++) {
var name = names[i];
descriptors[name] = $getOwnPropertyDescriptor(object, name);
}
var symbols = getOwnPropertySymbols(object);
for (var i = 0; i < symbols.length; i++) {
var symbol = symbols[i];
descriptors[$toProperty(symbol)] = $getOwnPropertyDescriptor(object, $toProperty(symbol));
}
return descriptors;
}
function createClass(ctor, object, staticObject, superClass) {
$defineProperty(object, 'constructor', {
value: ctor,
configurable: true,
enumerable: false,
writable: true
});
if (arguments.length > 3) {
if (typeof superClass === 'function')
ctor.__proto__ = superClass;
ctor.prototype = $create(getProtoParent(superClass), getDescriptors(object));
} else {
ctor.prototype = object;
}
$defineProperty(ctor, 'prototype', {
configurable: false,
writable: false
});
return $defineProperties(ctor, getDescriptors(staticObject));
}
function getProtoParent(superClass) {
if (typeof superClass === 'function') {
var prototype = superClass.prototype;
if ($Object(prototype) === prototype || prototype === null)
return superClass.prototype;
throw new $TypeError('super prototype must be an Object or null');
}
if (superClass === null)
return null;
throw new $TypeError(("Super expression must either be null or a function, not " + typeof superClass + "."));
}
function defaultSuperCall(self, homeObject, args) {
if ($getPrototypeOf(homeObject) !== null)
superCall(self, homeObject, 'constructor', args);
}
$traceurRuntime.createClass = createClass;
$traceurRuntime.defaultSuperCall = defaultSuperCall;
$traceurRuntime.superCall = superCall;
$traceurRuntime.superConstructor = superConstructor;
$traceurRuntime.superGet = superGet;
$traceurRuntime.superSet = superSet;
})();
//#
},{}],97:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
TableView: {get: function() {
return TableView;
}},
__esModule: {value: true}
});
var $__helpers_47_dom_47_element__,
$__eventManager__,
$__helpers_47_dom_47_event__,
$__3rdparty_47_walkontable_47_src_47_cell_47_coords__,
$__3rdparty_47_walkontable_47_src_47_selection__,
$__3rdparty_47_walkontable_47_src_47_core__;
var $__0 = ($__helpers_47_dom_47_element__ = require("helpers/dom/element"), $__helpers_47_dom_47_element__ && $__helpers_47_dom_47_element__.__esModule && $__helpers_47_dom_47_element__ || {default: $__helpers_47_dom_47_element__}),
addClass = $__0.addClass,
empty = $__0.empty,
fastInnerHTML = $__0.fastInnerHTML,
fastInnerText = $__0.fastInnerText,
getScrollbarWidth = $__0.getScrollbarWidth,
hasClass = $__0.hasClass,
isChildOf = $__0.isChildOf,
isInput = $__0.isInput,
isOutsideInput = $__0.isOutsideInput;
var eventManagerObject = ($__eventManager__ = require("eventManager"), $__eventManager__ && $__eventManager__.__esModule && $__eventManager__ || {default: $__eventManager__}).eventManager;
var $__2 = ($__helpers_47_dom_47_event__ = require("helpers/dom/event"), $__helpers_47_dom_47_event__ && $__helpers_47_dom_47_event__.__esModule && $__helpers_47_dom_47_event__ || {default: $__helpers_47_dom_47_event__}),
stopPropagation = $__2.stopPropagation,
isImmediatePropagationStopped = $__2.isImmediatePropagationStopped;
var WalkontableCellCoords = ($__3rdparty_47_walkontable_47_src_47_cell_47_coords__ = require("3rdparty/walkontable/src/cell/coords"), $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__.__esModule && $__3rdparty_47_walkontable_47_src_47_cell_47_coords__ || {default: $__3rdparty_47_walkontable_47_src_47_cell_47_coords__}).WalkontableCellCoords;
var WalkontableSelection = ($__3rdparty_47_walkontable_47_src_47_selection__ = require("3rdparty/walkontable/src/selection"), $__3rdparty_47_walkontable_47_src_47_selection__ && $__3rdparty_47_walkontable_47_src_47_selection__.__esModule && $__3rdparty_47_walkontable_47_src_47_selection__ || {default: $__3rdparty_47_walkontable_47_src_47_selection__}).WalkontableSelection;
var Walkontable = ($__3rdparty_47_walkontable_47_src_47_core__ = require("3rdparty/walkontable/src/core"), $__3rdparty_47_walkontable_47_src_47_core__ && $__3rdparty_47_walkontable_47_src_47_core__.__esModule && $__3rdparty_47_walkontable_47_src_47_core__ || {default: $__3rdparty_47_walkontable_47_src_47_core__}).Walkontable;
Handsontable.TableView = TableView;
function TableView(instance) {
var $__6 = this;
var that = this;
this.eventManager = eventManagerObject(instance);
this.instance = instance;
this.settings = instance.getSettings();
this.selectionMouseDown = false;
var originalStyle = instance.rootElement.getAttribute('style');
if (originalStyle) {
instance.rootElement.setAttribute('data-originalstyle', originalStyle);
}
addClass(instance.rootElement, 'handsontable');
var table = document.createElement('TABLE');
addClass(table, 'htCore');
if (instance.getSettings().tableClassName) {
addClass(table, instance.getSettings().tableClassName);
}
this.THEAD = document.createElement('THEAD');
table.appendChild(this.THEAD);
this.TBODY = document.createElement('TBODY');
table.appendChild(this.TBODY);
instance.table = table;
instance.container.insertBefore(table, instance.container.firstChild);
this.eventManager.addEventListener(instance.rootElement, 'mousedown', function(event) {
this.selectionMouseDown = true;
if (!that.isTextSelectionAllowed(event.target)) {
clearTextSelection();
event.preventDefault();
window.focus();
}
});
this.eventManager.addEventListener(instance.rootElement, 'mouseup', function(event) {
this.selectionMouseDown = false;
});
this.eventManager.addEventListener(instance.rootElement, 'mousemove', function(event) {
if (this.selectionMouseDown && !that.isTextSelectionAllowed(event.target)) {
clearTextSelection();
event.preventDefault();
}
});
this.eventManager.addEventListener(document.documentElement, 'keyup', function(event) {
if (instance.selection.isInProgress() && !event.shiftKey) {
instance.selection.finish();
}
});
var isMouseDown;
this.isMouseDown = function() {
return isMouseDown;
};
this.eventManager.addEventListener(document.documentElement, 'mouseup', function(event) {
if (instance.selection.isInProgress() && event.which === 1) {
instance.selection.finish();
}
isMouseDown = false;
if (isOutsideInput(document.activeElement)) {
instance.unlisten();
}
});
this.eventManager.addEventListener(document.documentElement, 'mousedown', function(event) {
var next = event.target;
var eventX = event.x || event.clientX;
var eventY = event.y || event.clientY;
if (isMouseDown || !instance.rootElement) {
return;
}
if (next === instance.view.wt.wtTable.holder) {
var scrollbarWidth = getScrollbarWidth();
if (document.elementFromPoint(eventX + scrollbarWidth, eventY) !== instance.view.wt.wtTable.holder || document.elementFromPoint(eventX, eventY + scrollbarWidth) !== instance.view.wt.wtTable.holder) {
return;
}
} else {
while (next !== document.documentElement) {
if (next === null) {
if (event.isTargetWebComponent) {
break;
}
return;
}
if (next === instance.rootElement) {
return;
}
next = next.parentNode;
}
}
if (that.settings.outsideClickDeselects) {
instance.deselectCell();
} else {
instance.destroyEditor();
}
});
this.eventManager.addEventListener(table, 'selectstart', function(event) {
if (that.settings.fragmentSelection || isInput(event.target)) {
return;
}
event.preventDefault();
});
var clearTextSelection = function() {
if (window.getSelection) {
if (window.getSelection().empty) {
window.getSelection().empty();
} else if (window.getSelection().removeAllRanges) {
window.getSelection().removeAllRanges();
}
} else if (document.selection) {
document.selection.empty();
}
};
var selections = [new WalkontableSelection({
className: 'current',
border: {
width: 2,
color: '#5292F7',
cornerVisible: function() {
return that.settings.fillHandle && !that.isCellEdited() && !instance.selection.isMultiple();
},
multipleSelectionHandlesVisible: function() {
return !that.isCellEdited() && !instance.selection.isMultiple();
}
}
}), new WalkontableSelection({
className: 'area',
border: {
width: 1,
color: '#89AFF9',
cornerVisible: function() {
return that.settings.fillHandle && !that.isCellEdited() && instance.selection.isMultiple();
},
multipleSelectionHandlesVisible: function() {
return !that.isCellEdited() && instance.selection.isMultiple();
}
}
}), new WalkontableSelection({
className: 'highlight',
highlightRowClassName: that.settings.currentRowClassName,
highlightColumnClassName: that.settings.currentColClassName
}), new WalkontableSelection({
className: 'fill',
border: {
width: 1,
color: 'red'
}
})];
selections.current = selections[0];
selections.area = selections[1];
selections.highlight = selections[2];
selections.fill = selections[3];
var walkontableConfig = {
debug: function() {
return that.settings.debug;
},
externalRowCalculator: this.instance.getPlugin('autoRowSize') && this.instance.getPlugin('autoRowSize').isEnabled(),
table: table,
preventOverflow: (function() {
return $__6.settings.preventOverflow;
}),
stretchH: this.settings.stretchH,
data: instance.getDataAtCell,
totalRows: (function() {
return instance.countRows();
}),
totalColumns: (function() {
return instance.countCols();
}),
fixedColumnsLeft: function() {
return that.settings.fixedColumnsLeft;
},
fixedRowsTop: function() {
return that.settings.fixedRowsTop;
},
fixedRowsBottom: function() {
return that.settings.fixedRowsBottom;
},
minSpareRows: function() {
return that.settings.minSpareRows;
},
renderAllRows: that.settings.renderAllRows,
rowHeaders: function() {
var headerRenderers = [];
if (instance.hasRowHeaders()) {
headerRenderers.push(function(row, TH) {
that.appendRowHeader(row, TH);
});
}
Handsontable.hooks.run(instance, 'afterGetRowHeaderRenderers', headerRenderers);
return headerRenderers;
},
columnHeaders: function() {
var headerRenderers = [];
if (instance.hasColHeaders()) {
headerRenderers.push(function(column, TH) {
that.appendColHeader(column, TH);
});
}
Handsontable.hooks.run(instance, 'afterGetColumnHeaderRenderers', headerRenderers);
return headerRenderers;
},
columnWidth: instance.getColWidth,
rowHeight: instance.getRowHeight,
cellRenderer: function(row, col, TD) {
var prop = that.instance.colToProp(col),
cellProperties = that.instance.getCellMeta(row, col),
renderer = that.instance.getCellRenderer(cellProperties);
var value = that.instance.getDataAtRowProp(row, prop);
renderer(that.instance, TD, row, col, prop, value, cellProperties);
Handsontable.hooks.run(that.instance, 'afterRenderer', TD, row, col, prop, value, cellProperties);
},
selections: selections,
hideBorderOnMouseDownOver: function() {
return that.settings.fragmentSelection;
},
onCellMouseDown: function(event, coords, TD, wt) {
var colspanOffset;
var TR = TD.parentNode;
var THEAD = TR.parentNode;
var headerLevel;
var headerColspan;
instance.listen();
that.activeWt = wt;
isMouseDown = true;
Handsontable.hooks.run(instance, 'beforeOnCellMouseDown', event, coords, TD);
instance.selection.setSelectedHeaders(false, false);
if (!isImmediatePropagationStopped(event)) {
if (event.button === 2 && instance.selection.inInSelection(coords)) {
var nothing = 1;
} else if (event.shiftKey) {
if (coords.row >= 0 && coords.col >= 0) {
instance.selection.setRangeEnd(coords);
}
} else {
if ((coords.row < 0 || coords.col < 0) && (coords.row >= 0 || coords.col >= 0)) {
if (coords.row < 0) {
headerLevel = THEAD.childNodes.length - Array.prototype.indexOf.call(THEAD.childNodes, TR) - 1;
headerColspan = instance.getHeaderColspan(coords.col, headerLevel);
instance.selection.setSelectedHeaders(false, true);
instance.selectCell(0, coords.col, instance.countRows() - 1, coords.col + Math.max(0, headerColspan - 1));
}
if (coords.col < 0) {
instance.selection.setSelectedHeaders(true, false);
instance.selectCell(coords.row, 0, coords.row, instance.countCols() - 1);
}
} else {
coords.row = coords.row < 0 ? 0 : coords.row;
coords.col = coords.col < 0 ? 0 : coords.col;
instance.selection.setRangeStart(coords);
}
}
Handsontable.hooks.run(instance, 'afterOnCellMouseDown', event, coords, TD);
that.activeWt = that.wt;
}
},
onCellMouseOver: function(event, coords, TD, wt) {
that.activeWt = wt;
if (coords.row >= 0 && coords.col >= 0) {
if (isMouseDown) {
instance.selection.setRangeEnd(coords);
}
} else {
if (isMouseDown) {
if (coords.row < 0) {
if (instance.selection.selectedHeader.cols) {
instance.selection.setRangeEnd(new WalkontableCellCoords(instance.countRows() - 1, coords.col));
instance.selection.setSelectedHeaders(false, true);
} else {
instance.selection.setRangeEnd(new WalkontableCellCoords(coords.row, coords.col));
}
}
if (coords.col < 0) {
if (instance.selection.selectedHeader.rows) {
instance.selection.setRangeEnd(new WalkontableCellCoords(coords.row, instance.countCols() - 1));
instance.selection.setSelectedHeaders(true, false);
} else {
instance.selection.setRangeEnd(new WalkontableCellCoords(coords.row, coords.col));
}
}
}
}
Handsontable.hooks.run(instance, 'afterOnCellMouseOver', event, coords, TD);
that.activeWt = that.wt;
},
onCellCornerMouseDown: function(event) {
event.preventDefault();
Handsontable.hooks.run(instance, 'afterOnCellCornerMouseDown', event);
},
beforeDraw: function(force) {
that.beforeRender(force);
},
onDraw: function(force) {
that.onDraw(force);
},
onScrollVertically: function() {
instance.runHooks('afterScrollVertically');
},
onScrollHorizontally: function() {
instance.runHooks('afterScrollHorizontally');
},
onBeforeDrawBorders: function(corners, borderClassName) {
instance.runHooks('beforeDrawBorders', corners, borderClassName);
},
onBeforeTouchScroll: function() {
instance.runHooks('beforeTouchScroll');
},
onAfterMomentumScroll: function() {
instance.runHooks('afterMomentumScroll');
},
onBeforeStretchingColumnWidth: function(stretchedWidth, column) {
return instance.runHooks('beforeStretchingColumnWidth', stretchedWidth, column);
},
viewportRowCalculatorOverride: function(calc) {
var rows = instance.countRows();
var viewportOffset = that.settings.viewportRowRenderingOffset;
if (viewportOffset === 'auto' && that.settings.fixedRowsTop) {
viewportOffset = 10;
}
if (typeof viewportOffset === 'number') {
calc.startRow = Math.max(calc.startRow - viewportOffset, 0);
calc.endRow = Math.min(calc.endRow + viewportOffset, rows - 1);
}
if (viewportOffset === 'auto') {
var center = calc.startRow + calc.endRow - calc.startRow;
var offset = Math.ceil(center / rows * 12);
calc.startRow = Math.max(calc.startRow - offset, 0);
calc.endRow = Math.min(calc.endRow + offset, rows - 1);
}
instance.runHooks('afterViewportRowCalculatorOverride', calc);
},
viewportColumnCalculatorOverride: function(calc) {
var cols = instance.countCols();
var viewportOffset = that.settings.viewportColumnRenderingOffset;
if (viewportOffset === 'auto' && that.settings.fixedColumnsLeft) {
viewportOffset = 10;
}
if (typeof viewportOffset === 'number') {
calc.startColumn = Math.max(calc.startColumn - viewportOffset, 0);
calc.endColumn = Math.min(calc.endColumn + viewportOffset, cols - 1);
}
if (viewportOffset === 'auto') {
var center = calc.startColumn + calc.endColumn - calc.startColumn;
var offset = Math.ceil(center / cols * 12);
calc.startRow = Math.max(calc.startColumn - offset, 0);
calc.endColumn = Math.min(calc.endColumn + offset, cols - 1);
}
instance.runHooks('afterViewportColumnCalculatorOverride', calc);
},
rowHeaderWidth: function() {
return that.settings.rowHeaderWidth;
},
columnHeaderHeight: function() {
return that.settings.columnHeaderHeight;
}
};
Handsontable.hooks.run(instance, 'beforeInitWalkontable', walkontableConfig);
this.wt = new Walkontable(walkontableConfig);
this.activeWt = this.wt;
this.eventManager.addEventListener(that.wt.wtTable.spreader, 'mousedown', function(event) {
if (event.target === that.wt.wtTable.spreader && event.which === 3) {
stopPropagation(event);
}
});
this.eventManager.addEventListener(that.wt.wtTable.spreader, 'contextmenu', function(event) {
if (event.target === that.wt.wtTable.spreader && event.which === 3) {
stopPropagation(event);
}
});
this.eventManager.addEventListener(document.documentElement, 'click', function() {
if (that.settings.observeDOMVisibility) {
if (that.wt.drawInterrupted) {
that.instance.forceFullRender = true;
that.render();
}
}
});
}
TableView.prototype.isTextSelectionAllowed = function(el) {
if (isInput(el)) {
return true;
}
var isChildOfTableBody = isChildOf(el, this.instance.view.wt.wtTable.spreader);
if (this.settings.fragmentSelection === true && isChildOfTableBody) {
return true;
}
if (this.settings.fragmentSelection === 'cell' && this.isSelectedOnlyCell() && isChildOfTableBody) {
return true;
}
return false;
};
TableView.prototype.isSelectedOnlyCell = function() {
var $__7 = this.instance.getSelected() || [],
row = $__7[0],
col = $__7[1],
rowEnd = $__7[2],
colEnd = $__7[3];
return row !== void 0 && row === rowEnd && col === colEnd;
};
TableView.prototype.isCellEdited = function() {
var activeEditor = this.instance.getActiveEditor();
return activeEditor && activeEditor.isOpened();
};
TableView.prototype.beforeRender = function(force) {
if (force) {
Handsontable.hooks.run(this.instance, 'beforeRender', this.instance.forceFullRender);
}
};
TableView.prototype.onDraw = function(force) {
if (force) {
Handsontable.hooks.run(this.instance, 'afterRender', this.instance.forceFullRender);
}
};
TableView.prototype.render = function() {
this.wt.draw(!this.instance.forceFullRender);
this.instance.forceFullRender = false;
this.instance.renderCall = false;
};
TableView.prototype.getCellAtCoords = function(coords, topmost) {
var td = this.wt.getCell(coords, topmost);
if (td < 0) {
return null;
} else {
return td;
}
};
TableView.prototype.scrollViewport = function(coords) {
this.wt.scrollViewport(coords);
};
TableView.prototype.appendRowHeader = function(row, TH) {
if (TH.firstChild) {
var container = TH.firstChild;
if (!hasClass(container, 'relative')) {
empty(TH);
this.appendRowHeader(row, TH);
return;
}
this.updateCellHeader(container.querySelector('.rowHeader'), row, this.instance.getRowHeader);
} else {
var div = document.createElement('div');
var span = document.createElement('span');
div.className = 'relative';
span.className = 'rowHeader';
this.updateCellHeader(span, row, this.instance.getRowHeader);
div.appendChild(span);
TH.appendChild(div);
}
Handsontable.hooks.run(this.instance, 'afterGetRowHeader', row, TH);
};
TableView.prototype.appendColHeader = function(col, TH) {
if (TH.firstChild) {
var container = TH.firstChild;
if (hasClass(container, 'relative')) {
this.updateCellHeader(container.querySelector('.colHeader'), col, this.instance.getColHeader);
} else {
empty(TH);
this.appendColHeader(col, TH);
}
} else {
var div = document.createElement('div');
var span = document.createElement('span');
div.className = 'relative';
span.className = 'colHeader';
this.updateCellHeader(span, col, this.instance.getColHeader);
div.appendChild(span);
TH.appendChild(div);
}
Handsontable.hooks.run(this.instance, 'afterGetColHeader', col, TH);
};
TableView.prototype.updateCellHeader = function(element, index, content) {
if (index > -1) {
fastInnerHTML(element, content(index));
} else {
fastInnerText(element, String.fromCharCode(160));
addClass(element, 'cornerHeader');
}
};
TableView.prototype.maximumVisibleElementWidth = function(leftOffset) {
var workspaceWidth = this.wt.wtViewport.getWorkspaceWidth();
var maxWidth = workspaceWidth - leftOffset;
return maxWidth > 0 ? maxWidth : 0;
};
TableView.prototype.maximumVisibleElementHeight = function(topOffset) {
var workspaceHeight = this.wt.wtViewport.getWorkspaceHeight();
var maxHeight = workspaceHeight - topOffset;
return maxHeight > 0 ? maxHeight : 0;
};
TableView.prototype.mainViewIsActive = function() {
return this.wt === this.activeWt;
};
TableView.prototype.destroy = function() {
this.wt.destroy();
this.eventManager.destroy();
};
;
//#
},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/core":7,"3rdparty/walkontable/src/selection":18,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46}],98:[function(require,module,exports){
"use strict";
Object.defineProperties(exports, {
GhostTable: {get: function() {
return GhostTable;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_helpers_47_array__,
$___46__46__47_helpers_47_object__,
$___46__46__47_helpers_47_number__,
$___46__46__47_helpers_47_mixed__;
var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
outerHeight = $__0.outerHeight,
outerWidth = $__0.outerWidth;
var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach;
var objectEach = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).objectEach;
var rangeEach = ($___46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47_helpers_47_number__ && $___46__46__47_helpers_47_number__.__esModule && $___46__46__47_helpers_47_number__ || {default: $___46__46__47_helpers_47_number__}).rangeEach;
var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify;
var GhostTable = function GhostTable(hotInstance) {
this.hot = hotInstance;
this.container = null;
this.injected = false;
this.rows = [];
this.columns = [];
this.samples = null;
};
($traceurRuntime.createClass)(GhostTable, {
addRow: function(row, samples) {
if (this.columns.length) {
throw new Error('Doesn\'t support multi-dimensional table');
}
if (!this.rows.length) {
this.container = this.createContainer(this.hot.rootElement.className);
}
var rowObject = {row: row};
this.rows.push(rowObject);
this.samples = samples;
this.table = this.createTable(this.hot.table.className);
this.table.colGroup.appendChild(this.createColGroupsCol());
this.table.tr.appendChild(this.createRow(row));
this.container.container.appendChild(this.table.fragment);
rowObject.table = this.table.table;
},
addColumn: function(column, samples) {
if (this.rows.length) {
throw new Error('Doesn\'t support multi-dimensional table');
}
if (!this.columns.length) {
this.container = this.createContainer(this.hot.rootElement.className);
}
var columnObject = {col: column};
this.columns.push(columnObject);
this.samples = samples;
this.table = this.createTable(this.hot.table.className);
if (this.hot.getColHeader(column) !== null) {
this.hot.view.appendColHeader(column, this.table.th);
}
this.table.tBody.appendChild(this.createCol(column));
this.container.container.appendChild(this.table.fragment);
columnObject.table = this.table.table;
},
getHeights: function(callback) {
if (!this.injected) {
this.injectTable();
}
arrayEach(this.rows, (function(row) {
callback(row.row, outerHeight(row.table) - 1);
}));
},
getWidths: function(callback) {
if (!this.injected) {
this.injectTable();
}
arrayEach(this.columns, (function(column) {
callback(column.col, outerWidth(column.table));
}));
},
createColGroupsCol: function() {
var $__5 = this;
var d = document;
var fragment = d.createDocumentFragment();
fragment.appendChild(this.createColElement(-1));
this.samples.forEach((function(sample) {
arrayEach(sample.strings, (function(string) {
fragment.appendChild($__5.createColElement(string.col));
}));
}));
return fragment;
},
createRow: function(row) {
var $__5 = this;
var d = document;
var fragment = d.createDocumentFragment();
var th = d.createElement('th');
if (this.hot.getRowHeader(row) !== null) {
this.hot.view.appendRowHeader(row, th);
}
fragment.appendChild(th);
this.samples.forEach((function(sample) {
arrayEach(sample.strings, (function(string) {
var column = string.col;
var cellProperties = $__5.hot.getCellMeta(row, column);
cellProperties.col = column;
cellProperties.row = row;
var renderer = $__5.hot.getCellRenderer(cellProperties);
var td = d.createElement('td');
renderer($__5.hot, td, row, column, $__5.hot.colToProp(column), string.value, cellProperties);
fragment.appendChild(td);
}));
}));
return fragment;
},
createCol: function(column) {
var $__5 = this;
var d = document;
var fragment = d.createDocumentFragment();
this.samples.forEach((function(sample) {
arrayEach(sample.strings, (function(string) {
var row = string.row;
var cellProperties = $__5.hot.getCellMeta(row, column);
cellProperties.col = column;
cellProperties.row = row;
var renderer = $__5.hot.getCellRenderer(cellProperties);
var td = d.createElement('td');
var tr = d.createElement('tr');
renderer($__5.hot, td, row, column, $__5.hot.colToProp(column), string.value, cellProperties);
tr.appendChild(td);
fragment.appendChild(tr);
}));
}));
return fragment;
},
clean: function() {
this.rows.length = 0;
this.columns.length = 0;
if (this.samples) {
this.samples.clear();
}
this.samples = null;
this.removeTable();
},
injectTable: function() {
var parent = arguments[0] !== (void 0) ? arguments[0] : null;
if (!this.injected) {
(parent || this.hot.rootElement).appendChild(this.container.fragment);
this.injected = true;
}
},
removeTable: function() {
if (this.injected && this.container.container.parentNode) {
this.container.container.parentNode.removeChild(this.container.container);
this.container = null;
this.injected = false;
}
},
createColElement: function(column) {
var d = document;
var col = d.createElement('col');
col.style.width = this.hot.view.wt.wtTable.getStretchedColumnWidth(column) + 'px';
return col;
},
createTable: function() {
var className = arguments[0] !== (void 0) ? arguments[0] : '';
var d = document;
var fragment = d.createDocumentFragment();
var table = d.createElement('table');
var tHead = d.createElement('thead');
var tBody = d.createElement('tbody');
var colGroup = d.createElement('colgroup');
var tr = d.createElement('tr');
var th = d.createElement('th');
if (this.isVertical()) {
table.appendChild(colGroup);
}
if (this.isHorizontal()) {
tr.appendChild(th);
tHead.appendChild(tr);
table.style.tableLayout = 'auto';
table.style.width = 'auto';
}
table.appendChild(tHead);
if (this.isVertical()) {
tBody.appendChild(tr);
}
table.appendChild(tBody);
addClass(table, className);
fragment.appendChild(table);
return {
fragment: fragment,
table: table,
tHead: tHead,
tBody: tBody,
colGroup: colGroup,
tr: tr,
th: th
};
},
createContainer: function() {
var className = arguments[0] !== (void 0) ? arguments[0] : '';
var d = document;
var fragment = d.createDocumentFragment();
var container = d.createElement('div');
className = 'htGhostTable htAutoSize ' + className.trim();
addClass(container, className);
fragment.appendChild(container);
return {
fragment: fragment,
container: container
};
},
isVertical: function() {
return this.rows.length && !this.columns.length ? true : false;
},
isHorizontal: function() {
return this.columns.length && !this.rows.length ? true : false;
}
}, {});
;
Handsontable.utils = Handsontable.utils || {};
Handsontable.utils.GhostTable = GhostTable;
//#
},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],99:[function(require,module,exports){
"use strict";
var $__7;
Object.defineProperties(exports, {
SamplesGenerator: {get: function() {
return SamplesGenerator;
}},
__esModule: {value: true}
});
var $___46__46__47_helpers_47_dom_47_element__,
$___46__46__47_helpers_47_array__,
$___46__46__47_helpers_47_object__,
$___46__46__47_helpers_47_number__,
$___46__46__47_helpers_47_mixed__;
var $__0 = ($___46__46__47_helpers_47_dom_47_element__ = require("helpers/dom/element"), $___46__46__47_helpers_47_dom_47_element__ && $___46__46__47_helpers_47_dom_47_element__.__esModule && $___46__46__47_helpers_47_dom_47_element__ || {default: $___46__46__47_helpers_47_dom_47_element__}),
addClass = $__0.addClass,
outerHeight = $__0.outerHeight,
outerWidth = $__0.outerWidth;
var arrayEach = ($___46__46__47_helpers_47_array__ = require("helpers/array"), $___46__46__47_helpers_47_array__ && $___46__46__47_helpers_47_array__.__esModule && $___46__46__47_helpers_47_array__ || {default: $___46__46__47_helpers_47_array__}).arrayEach;
var objectEach = ($___46__46__47_helpers_47_object__ = require("helpers/object"), $___46__46__47_helpers_47_object__ && $___46__46__47_helpers_47_object__.__esModule && $___46__46__47_helpers_47_object__ || {default: $___46__46__47_helpers_47_object__}).objectEach;
var rangeEach = ($___46__46__47_helpers_47_number__ = require("helpers/number"), $___46__46__47_helpers_47_number__ && $___46__46__47_helpers_47_number__.__esModule && $___46__46__47_helpers_47_number__ || {default: $___46__46__47_helpers_47_number__}).rangeEach;
var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify;
var SamplesGenerator = function SamplesGenerator(dataFactory) {
this.samples = null;
this.dataFactory = dataFactory;
this.customSampleCount = null;
};
var $SamplesGenerator = SamplesGenerator;
($traceurRuntime.createClass)(SamplesGenerator, ($__7 = {}, Object.defineProperty($__7, "getSampleCount", {
value: function() {
if (this.customSampleCount) {
return this.customSampleCount;
}
return $SamplesGenerator.SAMPLE_COUNT;
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__7, "generateRowSamples", {
value: function(rowRange, colRange) {
return this.generateSamples('row', colRange, rowRange);
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__7, "generateColumnSamples", {
value: function(colRange, rowRange) {
return this.generateSamples('col', rowRange, colRange);
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__7, "generateSamples", {
value: function(type, range, specifierRange) {
var $__5 = this;
var samples = new Map();
if (typeof specifierRange === 'number') {
specifierRange = {
from: specifierRange,
to: specifierRange
};
}
rangeEach(specifierRange.from, specifierRange.to, (function(index) {
var sample = $__5.generateSample(type, range, index);
samples.set(index, sample);
}));
return samples;
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__7, "generateSample", {
value: function(type, range, specifierValue) {
var $__5 = this;
var samples = new Map();
var sampledValues = [];
rangeEach(range.from, range.to, (function(index) {
var $__7;
var value;
if (type === 'row') {
value = $__5.dataFactory(specifierValue, index);
} else if (type === 'col') {
value = $__5.dataFactory(index, specifierValue);
} else {
throw new Error('Unsupported sample type');
}
if (!Array.isArray(value)) {
value = stringify(value);
}
var len = value.length;
if (!samples.has(len)) {
samples.set(len, {
needed: $__5.getSampleCount(),
strings: []
});
}
var sample = samples.get(len);
if (sample.needed) {
var duplicate = sampledValues.indexOf(value) > -1;
if (!duplicate) {
var computedKey = type === 'row' ? 'col' : 'row';
sample.strings.push(($__7 = {}, Object.defineProperty($__7, "value", {
value: value,
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__7, computedKey, {
value: index,
configurable: true,
enumerable: true,
writable: true
}), $__7));
sampledValues.push(value);
sample.needed--;
}
}
}));
return samples;
},
configurable: true,
enumerable: true,
writable: true
}), $__7), {get SAMPLE_COUNT() {
return 3;
}});
;
Handsontable.utils = Handsontable.utils || {};
Handsontable.utils.SamplesGenerator = SamplesGenerator;
//#
},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],100:[function(require,module,exports){
"use strict";
var $___46__46__47_helpers_47_mixed__;
var stringify = ($___46__46__47_helpers_47_mixed__ = require("helpers/mixed"), $___46__46__47_helpers_47_mixed__ && $___46__46__47_helpers_47_mixed__.__esModule && $___46__46__47_helpers_47_mixed__ || {default: $___46__46__47_helpers_47_mixed__}).stringify;
Handsontable.AutocompleteValidator = function(value, callback) {
if (this.strict && this.source) {
if (typeof this.source === 'function') {
this.source(value, process(value, callback));
} else {
process(value, callback)(this.source);
}
} else {
callback(true);
}
};
function process(value, callback) {
var originalVal = value;
var lowercaseVal = typeof originalVal === 'string' ? originalVal.toLowerCase() : null;
return function(source) {
var found = false;
for (var s = 0,
slen = source.length; s < slen; s++) {
if (originalVal === source[s]) {
found = true;
break;
} else if (lowercaseVal === stringify(source[s]).toLowerCase()) {
found = true;
break;
}
}
callback(found);
};
}
//#
},{"helpers/mixed":48}],101:[function(require,module,exports){
"use strict";
var $__moment__,
$___46__46__47_editors__;
var moment = ($__moment__ = require("moment"), $__moment__ && $__moment__.__esModule && $__moment__ || {default: $__moment__}).default;
var getEditor = ($___46__46__47_editors__ = require("editors"), $___46__46__47_editors__ && $___46__46__47_editors__.__esModule && $___46__46__47_editors__ || {default: $___46__46__47_editors__}).getEditor;
Handsontable.DateValidator = function(value, callback) {
var valid = true;
var dateEditor = getEditor('date', this.instance);
if (value === null) {
value = '';
}
var isValidDate = moment(new Date(value)).isValid();
var isValidFormat = moment(value, this.dateFormat || dateEditor.defaultDateFormat, true).isValid();
if (!isValidDate) {
valid = false;
}
if (!isValidDate && isValidFormat) {
valid = true;
}
if (isValidDate && !isValidFormat) {
if (this.correctFormat === true) {
var correctedValue = correctFormat(value, this.dateFormat);
this.instance.setDataAtCell(this.row, this.col, correctedValue, 'dateValidator');
valid = true;
} else {
valid = false;
}
}
callback(valid);
};
var correctFormat = function correctFormat(value, dateFormat) {
var date = moment(new Date(value));
var year = date.format('YYYY');
var yearNow = moment().format('YYYY');
if (year.substr(0, 2) !== yearNow.substr(0, 2)) {
if (!value.match(new RegExp(year))) {
date.year(year.replace(year.substr(0, 2), yearNow.substr(0, 2)));
}
} else if (year.length > 4) {
date.year((date.year() + '').substr(0, 4));
}
return date.format(dateFormat);
};
//#
},{"editors":29,"moment":"moment"}],102:[function(require,module,exports){
"use strict";
Handsontable.NumericValidator = function(value, callback) {
if (value === null) {
value = '';
}
callback(/^-?\d*(\.|\,)?\d*$/.test(value));
};
//#
},{}],"SheetClip":[function(require,module,exports){
"use strict";
(function(global) {
"use strict";
function countQuotes(str) {
return str.split('"').length - 1;
}
var SheetClip = {
parse: function(str) {
var r,
rLen,
rows,
arr = [],
a = 0,
c,
cLen,
multiline,
last;
rows = str.split('\n');
if (rows.length > 1 && rows[rows.length - 1] === '') {
rows.pop();
}
for (r = 0, rLen = rows.length; r < rLen; r += 1) {
rows[r] = rows[r].split('\t');
for (c = 0, cLen = rows[r].length; c < cLen; c += 1) {
if (!arr[a]) {
arr[a] = [];
}
if (multiline && c === 0) {
last = arr[a].length - 1;
arr[a][last] = arr[a][last] + '\n' + rows[r][0];
if (multiline && (countQuotes(rows[r][0]) & 1)) {
multiline = false;
arr[a][last] = arr[a][last].substring(0, arr[a][last].length - 1).replace(/""/g, '"');
}
} else {
if (c === cLen - 1 && rows[r][c].indexOf('"') === 0 && (countQuotes(rows[r][c]) & 1)) {
arr[a].push(rows[r][c].substring(1).replace(/""/g, '"'));
multiline = true;
} else {
arr[a].push(rows[r][c].replace(/""/g, '"'));
multiline = false;
}
}
}
if (!multiline) {
a += 1;
}
}
return arr;
},
stringify: function(arr) {
var r,
rLen,
c,
cLen,
str = '',
val;
for (r = 0, rLen = arr.length; r < rLen; r += 1) {
cLen = arr[r].length;
for (c = 0; c < cLen; c += 1) {
if (c > 0) {
str += '\t';
}
val = arr[r][c];
if (typeof val === 'string') {
if (val.indexOf('\n') > -1) {
str += '"' + val.replace(/"/g, '""') + '"';
} else {
str += val;
}
} else if (val === null || val === void 0) {
str += '';
} else {
str += val;
}
}
str += '\n';
}
return str;
}
};
if (typeof exports !== 'undefined') {
exports.parse = SheetClip.parse;
exports.stringify = SheetClip.stringify;
} else {
global.SheetClip = SheetClip;
}
}(window));
//#
},{}],"autoResize":[function(require,module,exports){
"use strict";
function autoResize() {
var defaults = {
minHeight: 200,
maxHeight: 300,
minWidth: 100,
maxWidth: 300
},
el,
body = document.body,
text = document.createTextNode(''),
span = document.createElement('SPAN'),
observe = function(element, event, handler) {
if (window.attachEvent) {
element.attachEvent('on' + event, handler);
} else {
element.addEventListener(event, handler, false);
}
},
unObserve = function(element, event, handler) {
if (window.removeEventListener) {
element.removeEventListener(event, handler, false);
} else {
element.detachEvent('on' + event, handler);
}
},
resize = function(newChar) {
var width,
scrollHeight;
if (!newChar) {
newChar = "";
} else if (!/^[a-zA-Z \.,\\\/\|0-9]$/.test(newChar)) {
newChar = ".";
}
if (text.textContent !== void 0) {
text.textContent = el.value + newChar;
} else {
text.data = el.value + newChar;
}
span.style.fontSize = Handsontable.Dom.getComputedStyle(el).fontSize;
span.style.fontFamily = Handsontable.Dom.getComputedStyle(el).fontFamily;
span.style.whiteSpace = "pre";
body.appendChild(span);
width = span.clientWidth + 2;
body.removeChild(span);
el.style.height = defaults.minHeight + 'px';
if (defaults.minWidth > width) {
el.style.width = defaults.minWidth + 'px';
} else if (width > defaults.maxWidth) {
el.style.width = defaults.maxWidth + 'px';
} else {
el.style.width = width + 'px';
}
scrollHeight = el.scrollHeight ? el.scrollHeight - 1 : 0;
if (defaults.minHeight > scrollHeight) {
el.style.height = defaults.minHeight + 'px';
} else if (defaults.maxHeight < scrollHeight) {
el.style.height = defaults.maxHeight + 'px';
el.style.overflowY = 'visible';
} else {
el.style.height = scrollHeight + 'px';
}
},
delayedResize = function() {
window.setTimeout(resize, 0);
},
extendDefaults = function(config) {
if (config && config.minHeight) {
if (config.minHeight == 'inherit') {
defaults.minHeight = el.clientHeight;
} else {
var minHeight = parseInt(config.minHeight);
if (!isNaN(minHeight)) {
defaults.minHeight = minHeight;
}
}
}
if (config && config.maxHeight) {
if (config.maxHeight == 'inherit') {
defaults.maxHeight = el.clientHeight;
} else {
var maxHeight = parseInt(config.maxHeight);
if (!isNaN(maxHeight)) {
defaults.maxHeight = maxHeight;
}
}
}
if (config && config.minWidth) {
if (config.minWidth == 'inherit') {
defaults.minWidth = el.clientWidth;
} else {
var minWidth = parseInt(config.minWidth);
if (!isNaN(minWidth)) {
defaults.minWidth = minWidth;
}
}
}
if (config && config.maxWidth) {
if (config.maxWidth == 'inherit') {
defaults.maxWidth = el.clientWidth;
} else {
var maxWidth = parseInt(config.maxWidth);
if (!isNaN(maxWidth)) {
defaults.maxWidth = maxWidth;
}
}
}
if (!span.firstChild) {
span.className = "autoResize";
span.style.display = 'inline-block';
span.appendChild(text);
}
},
init = function(el_, config, doObserve) {
el = el_;
extendDefaults(config);
if (el.nodeName == 'TEXTAREA') {
el.style.resize = 'none';
el.style.overflowY = '';
el.style.height = defaults.minHeight + 'px';
el.style.minWidth = defaults.minWidth + 'px';
el.style.maxWidth = defaults.maxWidth + 'px';
el.style.overflowY = 'hidden';
}
if (doObserve) {
observe(el, 'change', resize);
observe(el, 'cut', delayedResize);
observe(el, 'paste', delayedResize);
observe(el, 'drop', delayedResize);
observe(el, 'keydown', delayedResize);
}
resize();
};
return {
init: function(el_, config, doObserve) {
init(el_, config, doObserve);
},
unObserve: function() {
unObserve(el, 'change', resize);
unObserve(el, 'cut', delayedResize);
unObserve(el, 'paste', delayedResize);
unObserve(el, 'drop', delayedResize);
unObserve(el, 'keydown', delayedResize);
},
resize: resize
};
}
if (typeof exports !== 'undefined') {
module.exports = autoResize;
}
//#
},{}],"copyPaste":[function(require,module,exports){
"use strict";
var instance;
function copyPaste() {
if (!instance) {
instance = new CopyPasteClass();
} else if (instance.hasBeenDestroyed()) {
instance.init();
}
instance.refCounter++;
return instance;
}
if (typeof exports !== 'undefined') {
module.exports = copyPaste;
}
function CopyPasteClass() {
this.refCounter = 0;
this.init();
}
CopyPasteClass.prototype.init = function() {
var style,
parent;
this.copyCallbacks = [];
this.cutCallbacks = [];
this.pasteCallbacks = [];
parent = document.body;
if (document.getElementById('CopyPasteDiv')) {
this.elDiv = document.getElementById('CopyPasteDiv');
this.elTextarea = this.elDiv.firstChild;
} else {
this.elDiv = document.createElement('div');
this.elDiv.id = 'CopyPasteDiv';
style = this.elDiv.style;
style.position = 'fixed';
style.top = '-10000px';
style.left = '-10000px';
parent.appendChild(this.elDiv);
this.elTextarea = document.createElement('textarea');
this.elTextarea.className = 'copyPaste';
this.elTextarea.onpaste = function(event) {
var clipboardContents,
temp;
if ('WebkitAppearance' in document.documentElement.style) {
clipboardContents = event.clipboardData.getData("Text");
if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) {
temp = clipboardContents.split('\n');
if (temp[temp.length - 1] === '') {
temp.pop();
}
clipboardContents = temp.join('\n');
}
this.value = clipboardContents;
return false;
}
};
style = this.elTextarea.style;
style.width = '10000px';
style.height = '10000px';
style.overflow = 'hidden';
this.elDiv.appendChild(this.elTextarea);
if (typeof style.opacity !== 'undefined') {
style.opacity = 0;
}
}
this.onKeyDownRef = this.onKeyDown.bind(this);
document.documentElement.addEventListener('keydown', this.onKeyDownRef, false);
};
CopyPasteClass.prototype.onKeyDown = function(event) {
var _this = this,
isCtrlDown = false;
function isActiveElementEditable() {
var element = document.activeElement;
if (element.shadowRoot && element.shadowRoot.activeElement) {
element = element.shadowRoot.activeElement;
}
return ['INPUT', 'SELECT', 'TEXTAREA'].indexOf(element.nodeName) > -1 || element.contentEditable === 'true';
}
if (event.metaKey) {
isCtrlDown = true;
} else if (event.ctrlKey && navigator.userAgent.indexOf('Mac') === -1) {
isCtrlDown = true;
}
if (isCtrlDown) {
if (document.activeElement !== this.elTextarea && (this.getSelectionText() !== '' || isActiveElementEditable())) {
return;
}
this.selectNodeText(this.elTextarea);
setTimeout(function() {
if (document.activeElement !== _this.elTextarea) {
_this.selectNodeText(_this.elTextarea);
}
}, 0);
}
if (isCtrlDown && (event.keyCode === 67 || event.keyCode === 86 || event.keyCode === 88)) {
if (event.keyCode === 88) {
setTimeout(function() {
_this.triggerCut(event);
}, 0);
} else if (event.keyCode === 86) {
setTimeout(function() {
_this.triggerPaste(event);
}, 0);
}
}
};
CopyPasteClass.prototype.selectNodeText = function(element) {
if (element) {
element.select();
}
};
CopyPasteClass.prototype.getSelectionText = function() {
var text = '';
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type !== 'Control') {
text = document.selection.createRange().text;
}
return text;
};
CopyPasteClass.prototype.copyable = function(string) {
if (typeof string !== 'string' && string.toString === void 0) {
throw new Error('copyable requires string parameter');
}
this.elTextarea.value = string;
this.selectNodeText(this.elTextarea);
};
CopyPasteClass.prototype.onCut = function(callback) {
this.cutCallbacks.push(callback);
};
CopyPasteClass.prototype.onPaste = function(callback) {
this.pasteCallbacks.push(callback);
};
CopyPasteClass.prototype.removeCallback = function(callback) {
var i,
len;
for (i = 0, len = this.copyCallbacks.length; i < len; i++) {
if (this.copyCallbacks[i] === callback) {
this.copyCallbacks.splice(i, 1);
return true;
}
}
for (i = 0, len = this.cutCallbacks.length; i < len; i++) {
if (this.cutCallbacks[i] === callback) {
this.cutCallbacks.splice(i, 1);
return true;
}
}
for (i = 0, len = this.pasteCallbacks.length; i < len; i++) {
if (this.pasteCallbacks[i] === callback) {
this.pasteCallbacks.splice(i, 1);
return true;
}
}
return false;
};
CopyPasteClass.prototype.triggerCut = function(event) {
var _this = this;
if (_this.cutCallbacks) {
setTimeout(function() {
for (var i = 0,
len = _this.cutCallbacks.length; i < len; i++) {
_this.cutCallbacks[i](event);
}
}, 50);
}
};
CopyPasteClass.prototype.triggerPaste = function(event, string) {
var _this = this;
if (_this.pasteCallbacks) {
setTimeout(function() {
var val = string || _this.elTextarea.value;
for (var i = 0,
len = _this.pasteCallbacks.length; i < len; i++) {
_this.pasteCallbacks[i](val, event);
}
}, 50);
}
};
CopyPasteClass.prototype.destroy = function() {
if (!this.hasBeenDestroyed() && --this.refCounter === 0) {
if (this.elDiv && this.elDiv.parentNode) {
this.elDiv.parentNode.removeChild(this.elDiv);
this.elDiv = null;
this.elTextarea = null;
}
document.documentElement.removeEventListener('keydown', this.onKeyDownRef);
this.onKeyDownRef = null;
}
};
CopyPasteClass.prototype.hasBeenDestroyed = function() {
return !this.refCounter;
};
//#
},{}],"es6collections":[function(require,module,exports){
"use strict";
(function(exports) {
'use strict';
var i;
var defineProperty = Object.defineProperty,
is = function(a, b) {
return isNaN(a) ? isNaN(b) : a === b;
};
if (typeof WeakMap == 'undefined') {
exports.WeakMap = createCollection({
'delete': sharedDelete,
clear: sharedClear,
get: sharedGet,
has: mapHas,
set: sharedSet
}, true);
}
if (typeof Map == 'undefined') {
exports.Map = createCollection({
'delete': sharedDelete,
has: mapHas,
get: sharedGet,
set: sharedSet,
keys: sharedKeys,
values: sharedValues,
entries: mapEntries,
forEach: sharedForEach,
clear: sharedClear
});
}
if (typeof Set == 'undefined') {
exports.Set = createCollection({
has: setHas,
add: sharedAdd,
'delete': sharedDelete,
clear: sharedClear,
keys: sharedValues,
values: sharedValues,
entries: setEntries,
forEach: sharedForEach
});
}
if (typeof WeakSet == 'undefined') {
exports.WeakSet = createCollection({
'delete': sharedDelete,
add: sharedAdd,
clear: sharedClear,
has: setHas
}, true);
}
function createCollection(proto, objectOnly) {
function Collection(a) {
if (!this || this.constructor !== Collection)
return new Collection(a);
this._keys = [];
this._values = [];
this._itp = [];
this.objectOnly = objectOnly;
if (a)
init.call(this, a);
}
if (!objectOnly) {
defineProperty(proto, 'size', {get: sharedSize});
}
proto.constructor = Collection;
Collection.prototype = proto;
return Collection;
}
function init(a) {
var i;
if (this.add)
a.forEach(this.add, this);
else
a.forEach(function(a) {
this.set(a[0], a[1]);
}, this);
}
function sharedDelete(key) {
if (this.has(key)) {
this._keys.splice(i, 1);
this._values.splice(i, 1);
this._itp.forEach(function(p) {
if (i < p[0])
p[0]--;
});
}
return -1 < i;
}
;
function sharedGet(key) {
return this.has(key) ? this._values[i] : undefined;
}
function has(list, key) {
if (this.objectOnly && key !== Object(key))
throw new TypeError("Invalid value used as weak collection key");
if (key != key || key === 0)
for (i = list.length; i-- && !is(list[i], key); ) {}
else
i = list.indexOf(key);
return -1 < i;
}
function setHas(value) {
return has.call(this, this._values, value);
}
function mapHas(value) {
return has.call(this, this._keys, value);
}
function sharedSet(key, value) {
this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value;
return this;
}
function sharedAdd(value) {
if (!this.has(value))
this._values.push(value);
return this;
}
function sharedClear() {
this._values.length = 0;
}
function sharedKeys() {
return sharedIterator(this._itp, this._keys);
}
function sharedValues() {
return sharedIterator(this._itp, this._values);
}
function mapEntries() {
return sharedIterator(this._itp, this._keys, this._values);
}
function setEntries() {
return sharedIterator(this._itp, this._values, this._values);
}
function sharedIterator(itp, array, array2) {
var p = [0],
done = false;
itp.push(p);
return {next: function() {
var v,
k = p[0];
if (!done && k < array.length) {
v = array2 ? [array[k], array2[k]] : array[k];
p[0]++;
} else {
done = true;
itp.splice(itp.indexOf(p), 1);
}
return {
done: done,
value: v
};
}};
}
function sharedSize() {
return this._values.length;
}
function sharedForEach(callback, context) {
var it = this.entries();
for (; ; ) {
var r = it.next();
if (r.done)
break;
callback.call(context, r.value[1], r.value[0], this);
}
}
})(typeof exports != 'undefined' && typeof global != 'undefined' ? global : window);
//#
},{}],"jsonpatch":[function(require,module,exports){
"use strict";
var jsonpatch;
(function(jsonpatch) {
var objOps = {
add: function(obj, key) {
obj[key] = this.value;
return true;
},
remove: function(obj, key) {
delete obj[key];
return true;
},
replace: function(obj, key) {
obj[key] = this.value;
return true;
},
move: function(obj, key, tree) {
var temp = {
op: "_get",
path: this.from
};
apply(tree, [temp]);
apply(tree, [{
op: "remove",
path: this.from
}]);
apply(tree, [{
op: "add",
path: this.path,
value: temp.value
}]);
return true;
},
copy: function(obj, key, tree) {
var temp = {
op: "_get",
path: this.from
};
apply(tree, [temp]);
apply(tree, [{
op: "add",
path: this.path,
value: temp.value
}]);
return true;
},
test: function(obj, key) {
return (JSON.stringify(obj[key]) === JSON.stringify(this.value));
},
_get: function(obj, key) {
this.value = obj[key];
}
};
var arrOps = {
add: function(arr, i) {
arr.splice(i, 0, this.value);
return true;
},
remove: function(arr, i) {
arr.splice(i, 1);
return true;
},
replace: function(arr, i) {
arr[i] = this.value;
return true;
},
move: objOps.move,
copy: objOps.copy,
test: objOps.test,
_get: objOps._get
};
var observeOps = {
add: function(patches, path) {
var patch = {
op: "add",
path: path + escapePathComponent(this.name),
value: this.object[this.name]
};
patches.push(patch);
},
'delete': function(patches, path) {
var patch = {
op: "remove",
path: path + escapePathComponent(this.name)
};
patches.push(patch);
},
update: function(patches, path) {
var patch = {
op: "replace",
path: path + escapePathComponent(this.name),
value: this.object[this.name]
};
patches.push(patch);
}
};
function escapePathComponent(str) {
if (str.indexOf('/') === -1 && str.indexOf('~') === -1) {
return str;
}
return str.replace(/~/g, '~0').replace(/\//g, '~1');
}
function _getPathRecursive(root, obj) {
var found;
for (var key in root) {
if (root.hasOwnProperty(key)) {
if (root[key] === obj) {
return escapePathComponent(key) + '/';
} else if (typeof root[key] === 'object') {
found = _getPathRecursive(root[key], obj);
if (found != '') {
return escapePathComponent(key) + '/' + found;
}
}
}
}
return '';
}
function getPath(root, obj) {
if (root === obj) {
return '/';
}
var path = _getPathRecursive(root, obj);
if (path === '') {
throw new Error("Object not found in root");
}
return '/' + path;
}
var beforeDict = [];
jsonpatch.intervals;
var Mirror = (function() {
function Mirror(obj) {
this.observers = [];
this.obj = obj;
}
return Mirror;
})();
var ObserverInfo = (function() {
function ObserverInfo(callback, observer) {
this.callback = callback;
this.observer = observer;
}
return ObserverInfo;
})();
function getMirror(obj) {
for (var i = 0,
ilen = beforeDict.length; i < ilen; i++) {
if (beforeDict[i].obj === obj) {
return beforeDict[i];
}
}
}
function removeMirror(obj) {
for (var i = 0,
ilen = beforeDict.length; i < ilen; i++) {
if (beforeDict[i] === obj) {
beforeDict.splice(i, 1);
}
}
}
function getObserverFromMirror(mirror, callback) {
for (var j = 0,
jlen = mirror.observers.length; j < jlen; j++) {
if (mirror.observers[j].callback === callback) {
return mirror.observers[j].observer;
}
}
}
function removeObserverFromMirror(mirror, observer) {
for (var j = 0,
jlen = mirror.observers.length; j < jlen; j++) {
if (mirror.observers[j].observer === observer) {
mirror.observers.splice(j, 1);
if (!mirror.observers.length) {
removeMirror(mirror);
}
return;
}
}
}
function unobserve(root, observer) {
generate(observer);
if (Object.observe) {
_unobserve(observer, root);
} else {
clearTimeout(observer.next);
}
var mirror = getMirror(root);
removeObserverFromMirror(mirror, observer);
}
jsonpatch.unobserve = unobserve;
function observe(obj, callback) {
var patches = [];
var root = obj;
var observer;
var mirror = getMirror(obj);
if (!mirror) {
mirror = new Mirror(obj);
beforeDict.push(mirror);
} else {
observer = getObserverFromMirror(mirror, callback);
}
if (observer) {
return observer;
}
if (Object.observe) {
observer = function(arr) {
_unobserve(observer, obj);
_observe(observer, obj);
var a = 0,
alen = arr.length;
while (a < alen) {
if (!(arr[a].name === 'length' && _isArray(arr[a].object)) && !(arr[a].name === '__Jasmine_been_here_before__')) {
var type = arr[a].type;
switch (type) {
case 'new':
type = 'add';
break;
case 'deleted':
type = 'delete';
break;
case 'updated':
type = 'update';
break;
}
observeOps[type].call(arr[a], patches, getPath(root, arr[a].object));
}
a++;
}
if (patches) {
if (callback) {
callback(patches);
}
}
observer.patches = patches;
patches = [];
};
} else {
observer = {};
mirror.value = JSON.parse(JSON.stringify(obj));
if (callback) {
observer.callback = callback;
observer.next = null;
var intervals = this.intervals || [100, 1000, 10000, 60000];
var currentInterval = 0;
var dirtyCheck = function() {
generate(observer);
};
var fastCheck = function() {
clearTimeout(observer.next);
observer.next = setTimeout(function() {
dirtyCheck();
currentInterval = 0;
observer.next = setTimeout(slowCheck, intervals[currentInterval++]);
}, 0);
};
var slowCheck = function() {
dirtyCheck();
if (currentInterval == intervals.length) {
currentInterval = intervals.length - 1;
}
observer.next = setTimeout(slowCheck, intervals[currentInterval++]);
};
if (typeof window !== 'undefined') {
if (window.addEventListener) {
window.addEventListener('mousedown', fastCheck);
window.addEventListener('mouseup', fastCheck);
window.addEventListener('keydown', fastCheck);
} else {
window.attachEvent('onmousedown', fastCheck);
window.attachEvent('onmouseup', fastCheck);
window.attachEvent('onkeydown', fastCheck);
}
}
observer.next = setTimeout(slowCheck, intervals[currentInterval++]);
}
}
observer.patches = patches;
observer.object = obj;
mirror.observers.push(new ObserverInfo(callback, observer));
return _observe(observer, obj);
}
jsonpatch.observe = observe;
function _observe(observer, obj) {
if (Object.observe) {
Object.observe(obj, observer);
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
var v = obj[key];
if (v && typeof(v) === "object") {
_observe(observer, v);
}
}
}
}
return observer;
}
function _unobserve(observer, obj) {
if (Object.observe) {
Object.unobserve(obj, observer);
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
var v = obj[key];
if (v && typeof(v) === "object") {
_unobserve(observer, v);
}
}
}
}
return observer;
}
function generate(observer) {
if (Object.observe) {
Object.deliverChangeRecords(observer);
} else {
var mirror;
for (var i = 0,
ilen = beforeDict.length; i < ilen; i++) {
if (beforeDict[i].obj === observer.object) {
mirror = beforeDict[i];
break;
}
}
if (mirror) {
_generate(mirror.value, observer.object, observer.patches, "");
}
}
var temp = observer.patches;
if (temp.length > 0) {
observer.patches = [];
if (observer.callback) {
observer.callback(temp);
}
}
return temp;
}
jsonpatch.generate = generate;
var _objectKeys;
if (Object.keys) {
_objectKeys = Object.keys;
} else {
_objectKeys = function(obj) {
var keys = [];
for (var o in obj) {
if (obj.hasOwnProperty(o)) {
keys.push(o);
}
}
return keys;
};
}
function _generate(mirror, obj, patches, path) {
var newKeys = _objectKeys(obj);
var oldKeys = _objectKeys(mirror);
var changed = false;
var deleted = false;
for (var t = oldKeys.length - 1; t >= 0; t--) {
var key = oldKeys[t];
var oldVal = mirror[key];
if (obj.hasOwnProperty(key)) {
var newVal = obj[key];
if (oldVal instanceof Object) {
_generate(oldVal, newVal, patches, path + "/" + escapePathComponent(key));
} else {
if (oldVal != newVal) {
changed = true;
patches.push({
op: "replace",
path: path + "/" + escapePathComponent(key),
value: newVal
});
mirror[key] = newVal;
}
}
} else {
patches.push({
op: "remove",
path: path + "/" + escapePathComponent(key)
});
delete mirror[key];
deleted = true;
}
}
if (!deleted && newKeys.length == oldKeys.length) {
return;
}
for (var t = 0; t < newKeys.length; t++) {
var key = newKeys[t];
if (!mirror.hasOwnProperty(key)) {
patches.push({
op: "add",
path: path + "/" + escapePathComponent(key),
value: obj[key]
});
mirror[key] = JSON.parse(JSON.stringify(obj[key]));
}
}
}
var _isArray;
if (Array.isArray) {
_isArray = Array.isArray;
} else {
_isArray = function(obj) {
return obj.push && typeof obj.length === 'number';
};
}
function apply(tree, patches) {
var result = false,
p = 0,
plen = patches.length,
patch;
while (p < plen) {
patch = patches[p];
var keys = patch.path.split('/');
var obj = tree;
var t = 1;
var len = keys.length;
while (true) {
if (_isArray(obj)) {
var index = parseInt(keys[t], 10);
t++;
if (t >= len) {
result = arrOps[patch.op].call(patch, obj, index, tree);
break;
}
obj = obj[index];
} else {
var key = keys[t];
if (key.indexOf('~') != -1) {
key = key.replace(/~1/g, '/').replace(/~0/g, '~');
}
t++;
if (t >= len) {
result = objOps[patch.op].call(patch, obj, key, tree);
break;
}
obj = obj[key];
}
}
p++;
}
return result;
}
jsonpatch.apply = apply;
})(jsonpatch || (jsonpatch = {}));
if (typeof exports !== "undefined") {
exports.apply = jsonpatch.apply;
exports.observe = jsonpatch.observe;
exports.unobserve = jsonpatch.unobserve;
exports.generate = jsonpatch.generate;
}
//#
},{}],"moment":[function(require,module,exports){
//! moment.js
//! version : 2.10.6
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.moment = factory()
}(this, function () { 'use strict';
var hookCallback;
function utils_hooks__hooks () {
return hookCallback.apply(null, arguments);
}
// This is done to register the method called with moment()
// without creating circular dependencies.
function setHookCallback (callback) {
hookCallback = callback;
}
function isArray(input) {
return Object.prototype.toString.call(input) === '[object Array]';
}
function isDate(input) {
return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
}
function map(arr, fn) {
var res = [], i;
for (i = 0; i < arr.length; ++i) {
res.push(fn(arr[i], i));
}
return res;
}
function hasOwnProp(a, b) {
return Object.prototype.hasOwnProperty.call(a, b);
}
function extend(a, b) {
for (var i in b) {
if (hasOwnProp(b, i)) {
a[i] = b[i];
}
}
if (hasOwnProp(b, 'toString')) {
a.toString = b.toString;
}
if (hasOwnProp(b, 'valueOf')) {
a.valueOf = b.valueOf;
}
return a;
}
function create_utc__createUTC (input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, true).utc();
}
function defaultParsingFlags() {
// We need to deep clone this object.
return {
empty : false,
unusedTokens : [],
unusedInput : [],
overflow : -2,
charsLeftOver : 0,
nullInput : false,
invalidMonth : null,
invalidFormat : false,
userInvalidated : false,
iso : false
};
}
function getParsingFlags(m) {
if (m._pf == null) {
m._pf = defaultParsingFlags();
}
return m._pf;
}
function valid__isValid(m) {
if (m._isValid == null) {
var flags = getParsingFlags(m);
m._isValid = !isNaN(m._d.getTime()) &&
flags.overflow < 0 &&
!flags.empty &&
!flags.invalidMonth &&
!flags.invalidWeekday &&
!flags.nullInput &&
!flags.invalidFormat &&
!flags.userInvalidated;
if (m._strict) {
m._isValid = m._isValid &&
flags.charsLeftOver === 0 &&
flags.unusedTokens.length === 0 &&
flags.bigHour === undefined;
}
}
return m._isValid;
}
function valid__createInvalid (flags) {
var m = create_utc__createUTC(NaN);
if (flags != null) {
extend(getParsingFlags(m), flags);
}
else {
getParsingFlags(m).userInvalidated = true;
}
return m;
}
var momentProperties = utils_hooks__hooks.momentProperties = [];
function copyConfig(to, from) {
var i, prop, val;
if (typeof from._isAMomentObject !== 'undefined') {
to._isAMomentObject = from._isAMomentObject;
}
if (typeof from._i !== 'undefined') {
to._i = from._i;
}
if (typeof from._f !== 'undefined') {
to._f = from._f;
}
if (typeof from._l !== 'undefined') {
to._l = from._l;
}
if (typeof from._strict !== 'undefined') {
to._strict = from._strict;
}
if (typeof from._tzm !== 'undefined') {
to._tzm = from._tzm;
}
if (typeof from._isUTC !== 'undefined') {
to._isUTC = from._isUTC;
}
if (typeof from._offset !== 'undefined') {
to._offset = from._offset;
}
if (typeof from._pf !== 'undefined') {
to._pf = getParsingFlags(from);
}
if (typeof from._locale !== 'undefined') {
to._locale = from._locale;
}
if (momentProperties.length > 0) {
for (i in momentProperties) {
prop = momentProperties[i];
val = from[prop];
if (typeof val !== 'undefined') {
to[prop] = val;
}
}
}
return to;
}
var updateInProgress = false;
// Moment prototype object
function Moment(config) {
copyConfig(this, config);
this._d = new Date(config._d != null ? config._d.getTime() : NaN);
// Prevent infinite loop in case updateOffset creates new moment
// objects.
if (updateInProgress === false) {
updateInProgress = true;
utils_hooks__hooks.updateOffset(this);
updateInProgress = false;
}
}
function isMoment (obj) {
return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
}
function absFloor (number) {
if (number < 0) {
return Math.ceil(number);
} else {
return Math.floor(number);
}
}
function toInt(argumentForCoercion) {
var coercedNumber = +argumentForCoercion,
value = 0;
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
value = absFloor(coercedNumber);
}
return value;
}
function compareArrays(array1, array2, dontConvert) {
var len = Math.min(array1.length, array2.length),
lengthDiff = Math.abs(array1.length - array2.length),
diffs = 0,
i;
for (i = 0; i < len; i++) {
if ((dontConvert && array1[i] !== array2[i]) ||
(!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
diffs++;
}
}
return diffs + lengthDiff;
}
function Locale() {
}
var locales = {};
var globalLocale;
function normalizeLocale(key) {
return key ? key.toLowerCase().replace('_', '-') : key;
}
// pick the locale from the array
// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
function chooseLocale(names) {
var i = 0, j, next, locale, split;
while (i < names.length) {
split = normalizeLocale(names[i]).split('-');
j = split.length;
next = normalizeLocale(names[i + 1]);
next = next ? next.split('-') : null;
while (j > 0) {
locale = loadLocale(split.slice(0, j).join('-'));
if (locale) {
return locale;
}
if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
//the next array item is better than a shallower substring of this one
break;
}
j--;
}
i++;
}
return null;
}
function loadLocale(name) {
var oldLocale = null;
// TODO: Find a better way to register and load all the locales in Node
if (!locales[name] && typeof module !== 'undefined' &&
module && module.exports) {
try {
oldLocale = globalLocale._abbr;
require('./locale/' + name);
// because defineLocale currently also sets the global locale, we
// want to undo that for lazy loaded locales
locale_locales__getSetGlobalLocale(oldLocale);
} catch (e) { }
}
return locales[name];
}
// This function will load locale and then set the global locale. If
// no arguments are passed in, it will simply return the current global
// locale key.
function locale_locales__getSetGlobalLocale (key, values) {
var data;
if (key) {
if (typeof values === 'undefined') {
data = locale_locales__getLocale(key);
}
else {
data = defineLocale(key, values);
}
if (data) {
// moment.duration._locale = moment._locale = data;
globalLocale = data;
}
}
return globalLocale._abbr;
}
function defineLocale (name, values) {
if (values !== null) {
values.abbr = name;
locales[name] = locales[name] || new Locale();
locales[name].set(values);
// backwards compat for now: also set the locale
locale_locales__getSetGlobalLocale(name);
return locales[name];
} else {
// useful for testing
delete locales[name];
return null;
}
}
// returns locale data
function locale_locales__getLocale (key) {
var locale;
if (key && key._locale && key._locale._abbr) {
key = key._locale._abbr;
}
if (!key) {
return globalLocale;
}
if (!isArray(key)) {
//short-circuit everything else
locale = loadLocale(key);
if (locale) {
return locale;
}
key = [key];
}
return chooseLocale(key);
}
var aliases = {};
function addUnitAlias (unit, shorthand) {
var lowerCase = unit.toLowerCase();
aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
}
function normalizeUnits(units) {
return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
}
function normalizeObjectUnits(inputObject) {
var normalizedInput = {},
normalizedProp,
prop;
for (prop in inputObject) {
if (hasOwnProp(inputObject, prop)) {
normalizedProp = normalizeUnits(prop);
if (normalizedProp) {
normalizedInput[normalizedProp] = inputObject[prop];
}
}
}
return normalizedInput;
}
function makeGetSet (unit, keepTime) {
return function (value) {
if (value != null) {
get_set__set(this, unit, value);
utils_hooks__hooks.updateOffset(this, keepTime);
return this;
} else {
return get_set__get(this, unit);
}
};
}
function get_set__get (mom, unit) {
return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]();
}
function get_set__set (mom, unit, value) {
return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
}
// MOMENTS
function getSet (units, value) {
var unit;
if (typeof units === 'object') {
for (unit in units) {
this.set(unit, units[unit]);
}
} else {
units = normalizeUnits(units);
if (typeof this[units] === 'function') {
return this[units](value);
}
}
return this;
}
function zeroFill(number, targetLength, forceSign) {
var absNumber = '' + Math.abs(number),
zerosToFill = targetLength - absNumber.length,
sign = number >= 0;
return (sign ? (forceSign ? '+' : '') : '-') +
Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
}
var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
var formatFunctions = {};
var formatTokenFunctions = {};
// token: 'M'
// padded: ['MM', 2]
// ordinal: 'Mo'
// callback: function () { this.month() + 1 }
function addFormatToken (token, padded, ordinal, callback) {
var func = callback;
if (typeof callback === 'string') {
func = function () {
return this[callback]();
};
}
if (token) {
formatTokenFunctions[token] = func;
}
if (padded) {
formatTokenFunctions[padded[0]] = function () {
return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
};
}
if (ordinal) {
formatTokenFunctions[ordinal] = function () {
return this.localeData().ordinal(func.apply(this, arguments), token);
};
}
}
function removeFormattingTokens(input) {
if (input.match(/\[[\s\S]/)) {
return input.replace(/^\[|\]$/g, '');
}
return input.replace(/\\/g, '');
}
function makeFormatFunction(format) {
var array = format.match(formattingTokens), i, length;
for (i = 0, length = array.length; i < length; i++) {
if (formatTokenFunctions[array[i]]) {
array[i] = formatTokenFunctions[array[i]];
} else {
array[i] = removeFormattingTokens(array[i]);
}
}
return function (mom) {
var output = '';
for (i = 0; i < length; i++) {
output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
}
return output;
};
}
// format date using native date object
function formatMoment(m, format) {
if (!m.isValid()) {
return m.localeData().invalidDate();
}
format = expandFormat(format, m.localeData());
formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
return formatFunctions[format](m);
}
function expandFormat(format, locale) {
var i = 5;
function replaceLongDateFormatTokens(input) {
return locale.longDateFormat(input) || input;
}
localFormattingTokens.lastIndex = 0;
while (i >= 0 && localFormattingTokens.test(format)) {
format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
localFormattingTokens.lastIndex = 0;
i -= 1;
}
return format;
}
var match1 = /\d/; // 0 - 9
var match2 = /\d\d/; // 00 - 99
var match3 = /\d{3}/; // 000 - 999
var match4 = /\d{4}/; // 0000 - 9999
var match6 = /[+-]?\d{6}/; // -999999 - 999999
var match1to2 = /\d\d?/; // 0 - 99
var match1to3 = /\d{1,3}/; // 0 - 999
var match1to4 = /\d{1,4}/; // 0 - 9999
var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
var matchUnsigned = /\d+/; // 0 - inf
var matchSigned = /[+-]?\d+/; // -inf - inf
var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
// any word (or two) characters or numbers including two/three word month in arabic.
var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
var regexes = {};
function isFunction (sth) {
// https://github.com/moment/moment/issues/2325
return typeof sth === 'function' &&
Object.prototype.toString.call(sth) === '[object Function]';
}
function addRegexToken (token, regex, strictRegex) {
regexes[token] = isFunction(regex) ? regex : function (isStrict) {
return (isStrict && strictRegex) ? strictRegex : regex;
};
}
function getParseRegexForToken (token, config) {
if (!hasOwnProp(regexes, token)) {
return new RegExp(unescapeFormat(token));
}
return regexes[token](config._strict, config._locale);
}
// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
function unescapeFormat(s) {
return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
return p1 || p2 || p3 || p4;
}).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
}
var tokens = {};
function addParseToken (token, callback) {
var i, func = callback;
if (typeof token === 'string') {
token = [token];
}
if (typeof callback === 'number') {
func = function (input, array) {
array[callback] = toInt(input);
};
}
for (i = 0; i < token.length; i++) {
tokens[token[i]] = func;
}
}
function addWeekParseToken (token, callback) {
addParseToken(token, function (input, array, config, token) {
config._w = config._w || {};
callback(input, config._w, config, token);
});
}
function addTimeToArrayFromToken(token, input, config) {
if (input != null && hasOwnProp(tokens, token)) {
tokens[token](input, config._a, config, token);
}
}
var YEAR = 0;
var MONTH = 1;
var DATE = 2;
var HOUR = 3;
var MINUTE = 4;
var SECOND = 5;
var MILLISECOND = 6;
function daysInMonth(year, month) {
return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
}
// FORMATTING
addFormatToken('M', ['MM', 2], 'Mo', function () {
return this.month() + 1;
});
addFormatToken('MMM', 0, 0, function (format) {
return this.localeData().monthsShort(this, format);
});
addFormatToken('MMMM', 0, 0, function (format) {
return this.localeData().months(this, format);
});
// ALIASES
addUnitAlias('month', 'M');
// PARSING
addRegexToken('M', match1to2);
addRegexToken('MM', match1to2, match2);
addRegexToken('MMM', matchWord);
addRegexToken('MMMM', matchWord);
addParseToken(['M', 'MM'], function (input, array) {
array[MONTH] = toInt(input) - 1;
});
addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
var month = config._locale.monthsParse(input, token, config._strict);
// if we didn't find a month name, mark the date as invalid.
if (month != null) {
array[MONTH] = month;
} else {
getParsingFlags(config).invalidMonth = input;
}
});
// LOCALES
var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
function localeMonths (m) {
return this._months[m.month()];
}
var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
function localeMonthsShort (m) {
return this._monthsShort[m.month()];
}
function localeMonthsParse (monthName, format, strict) {
var i, mom, regex;
if (!this._monthsParse) {
this._monthsParse = [];
this._longMonthsParse = [];
this._shortMonthsParse = [];
}
for (i = 0; i < 12; i++) {
// make the regex if we don't have it already
mom = create_utc__createUTC([2000, i]);
if (strict && !this._longMonthsParse[i]) {
this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
}
if (!strict && !this._monthsParse[i]) {
regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
}
// test the regex
if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
return i;
} else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
return i;
} else if (!strict && this._monthsParse[i].test(monthName)) {
return i;
}
}
}
// MOMENTS
function setMonth (mom, value) {
var dayOfMonth;
// TODO: Move this out of here!
if (typeof value === 'string') {
value = mom.localeData().monthsParse(value);
// TODO: Another silent failure?
if (typeof value !== 'number') {
return mom;
}
}
dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
return mom;
}
function getSetMonth (value) {
if (value != null) {
setMonth(this, value);
utils_hooks__hooks.updateOffset(this, true);
return this;
} else {
return get_set__get(this, 'Month');
}
}
function getDaysInMonth () {
return daysInMonth(this.year(), this.month());
}
function checkOverflow (m) {
var overflow;
var a = m._a;
if (a && getParsingFlags(m).overflow === -2) {
overflow =
a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
-1;
if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
overflow = DATE;
}
getParsingFlags(m).overflow = overflow;
}
return m;
}
function warn(msg) {
if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {
console.warn('Deprecation warning: ' + msg);
}
}
function deprecate(msg, fn) {
var firstTime = true;
return extend(function () {
if (firstTime) {
warn(msg + '\n' + (new Error()).stack);
firstTime = false;
}
return fn.apply(this, arguments);
}, fn);
}
var deprecations = {};
function deprecateSimple(name, msg) {
if (!deprecations[name]) {
warn(msg);
deprecations[name] = true;
}
}
utils_hooks__hooks.suppressDeprecationWarnings = false;
var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
var isoDates = [
['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/],
['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/],
['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/],
['GGGG-[W]WW', /\d{4}-W\d{2}/],
['YYYY-DDD', /\d{4}-\d{3}/]
];
// iso time formats and regexes
var isoTimes = [
['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/],
['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/],
['HH:mm', /(T| )\d\d:\d\d/],
['HH', /(T| )\d\d/]
];
var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
// date from iso format
function configFromISO(config) {
var i, l,
string = config._i,
match = from_string__isoRegex.exec(string);
if (match) {
getParsingFlags(config).iso = true;
for (i = 0, l = isoDates.length; i < l; i++) {
if (isoDates[i][1].exec(string)) {
config._f = isoDates[i][0];
break;
}
}
for (i = 0, l = isoTimes.length; i < l; i++) {
if (isoTimes[i][1].exec(string)) {
// match[6] should be 'T' or space
config._f += (match[6] || ' ') + isoTimes[i][0];
break;
}
}
if (string.match(matchOffset)) {
config._f += 'Z';
}
configFromStringAndFormat(config);
} else {
config._isValid = false;
}
}
// date from iso format or fallback
function configFromString(config) {
var matched = aspNetJsonRegex.exec(config._i);
if (matched !== null) {
config._d = new Date(+matched[1]);
return;
}
configFromISO(config);
if (config._isValid === false) {
delete config._isValid;
utils_hooks__hooks.createFromInputFallback(config);
}
}
utils_hooks__hooks.createFromInputFallback = deprecate(
'moment construction falls back to js Date. This is ' +
'discouraged and will be removed in upcoming major ' +
'release. Please refer to ' +
'https://github.com/moment/moment/issues/1407 for more info.',
function (config) {
config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
}
);
function createDate (y, m, d, h, M, s, ms) {
//can't just apply() to create a date:
//http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
var date = new Date(y, m, d, h, M, s, ms);
//the date constructor doesn't accept years < 1970
if (y < 1970) {
date.setFullYear(y);
}
return date;
}
function createUTCDate (y) {
var date = new Date(Date.UTC.apply(null, arguments));
if (y < 1970) {
date.setUTCFullYear(y);
}
return date;
}
addFormatToken(0, ['YY', 2], 0, function () {
return this.year() % 100;
});
addFormatToken(0, ['YYYY', 4], 0, 'year');
addFormatToken(0, ['YYYYY', 5], 0, 'year');
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
// ALIASES
addUnitAlias('year', 'y');
// PARSING
addRegexToken('Y', matchSigned);
addRegexToken('YY', match1to2, match2);
addRegexToken('YYYY', match1to4, match4);
addRegexToken('YYYYY', match1to6, match6);
addRegexToken('YYYYYY', match1to6, match6);
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
addParseToken('YYYY', function (input, array) {
array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);
});
addParseToken('YY', function (input, array) {
array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);
});
// HELPERS
function daysInYear(year) {
return isLeapYear(year) ? 366 : 365;
}
function isLeapYear(year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
}
// HOOKS
utils_hooks__hooks.parseTwoDigitYear = function (input) {
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
};
// MOMENTS
var getSetYear = makeGetSet('FullYear', false);
function getIsLeapYear () {
return isLeapYear(this.year());
}
addFormatToken('w', ['ww', 2], 'wo', 'week');
addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
// ALIASES
addUnitAlias('week', 'w');
addUnitAlias('isoWeek', 'W');
// PARSING
addRegexToken('w', match1to2);
addRegexToken('ww', match1to2, match2);
addRegexToken('W', match1to2);
addRegexToken('WW', match1to2, match2);
addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
week[token.substr(0, 1)] = toInt(input);
});
// HELPERS
// firstDayOfWeek 0 = sun, 6 = sat
// the day of the week that starts the week
// (usually sunday or monday)
// firstDayOfWeekOfYear 0 = sun, 6 = sat
// the first week is the week that contains the first
// of this day of the week
// (eg. ISO weeks use thursday (4))
function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {
var end = firstDayOfWeekOfYear - firstDayOfWeek,
daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),
adjustedMoment;
if (daysToDayOfWeek > end) {
daysToDayOfWeek -= 7;
}
if (daysToDayOfWeek < end - 7) {
daysToDayOfWeek += 7;
}
adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd');
return {
week: Math.ceil(adjustedMoment.dayOfYear() / 7),
year: adjustedMoment.year()
};
}
// LOCALES
function localeWeek (mom) {
return weekOfYear(mom, this._week.dow, this._week.doy).week;
}
var defaultLocaleWeek = {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
};
function localeFirstDayOfWeek () {
return this._week.dow;
}
function localeFirstDayOfYear () {
return this._week.doy;
}
// MOMENTS
function getSetWeek (input) {
var week = this.localeData().week(this);
return input == null ? week : this.add((input - week) * 7, 'd');
}
function getSetISOWeek (input) {
var week = weekOfYear(this, 1, 4).week;
return input == null ? week : this.add((input - week) * 7, 'd');
}
addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
// ALIASES
addUnitAlias('dayOfYear', 'DDD');
// PARSING
addRegexToken('DDD', match1to3);
addRegexToken('DDDD', match3);
addParseToken(['DDD', 'DDDD'], function (input, array, config) {
config._dayOfYear = toInt(input);
});
// HELPERS
//http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {
var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear;
if (d < firstDayOfWeek) {
d += 7;
}
weekday = weekday != null ? 1 * weekday : firstDayOfWeek;
dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday;
return {
year: dayOfYear > 0 ? year : year - 1,
dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear
};
}
// MOMENTS
function getSetDayOfYear (input) {
var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
}
// Pick the first defined of two or three arguments.
function defaults(a, b, c) {
if (a != null) {
return a;
}
if (b != null) {
return b;
}
return c;
}
function currentDateArray(config) {
var now = new Date();
if (config._useUTC) {
return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()];
}
return [now.getFullYear(), now.getMonth(), now.getDate()];
}
// convert an array to a date.
// the array should mirror the parameters below
// note: all values past the year are optional and will default to the lowest possible value.
// [year, month, day , hour, minute, second, millisecond]
function configFromArray (config) {
var i, date, input = [], currentDate, yearToUse;
if (config._d) {
return;
}
currentDate = currentDateArray(config);
//compute day of the year from weeks and weekdays
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
dayOfYearFromWeekInfo(config);
}
//if the day of the year is set, figure out what it is
if (config._dayOfYear) {
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
if (config._dayOfYear > daysInYear(yearToUse)) {
getParsingFlags(config)._overflowDayOfYear = true;
}
date = createUTCDate(yearToUse, 0, config._dayOfYear);
config._a[MONTH] = date.getUTCMonth();
config._a[DATE] = date.getUTCDate();
}
// Default to current date.
// * if no year, month, day of month are given, default to today
// * if day of month is given, default month and year
// * if month is given, default only year
// * if year is given, don't default anything
for (i = 0; i < 3 && config._a[i] == null; ++i) {
config._a[i] = input[i] = currentDate[i];
}
// Zero out whatever was not defaulted, including time
for (; i < 7; i++) {
config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
}
// Check for 24:00:00.000
if (config._a[HOUR] === 24 &&
config._a[MINUTE] === 0 &&
config._a[SECOND] === 0 &&
config._a[MILLISECOND] === 0) {
config._nextDay = true;
config._a[HOUR] = 0;
}
config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
// Apply timezone offset from input. The actual utcOffset can be changed
// with parseZone.
if (config._tzm != null) {
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
}
if (config._nextDay) {
config._a[HOUR] = 24;
}
}
function dayOfYearFromWeekInfo(config) {
var w, weekYear, week, weekday, dow, doy, temp;
w = config._w;
if (w.GG != null || w.W != null || w.E != null) {
dow = 1;
doy = 4;
// TODO: We need to take the current isoWeekYear, but that depends on
// how we interpret now (local, utc, fixed offset). So create
// a now version of current config (take local/utc/offset flags, and
// create now).
weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);
week = defaults(w.W, 1);
weekday = defaults(w.E, 1);
} else {
dow = config._locale._week.dow;
doy = config._locale._week.doy;
weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);
week = defaults(w.w, 1);
if (w.d != null) {
// weekday -- low day numbers are considered next week
weekday = w.d;
if (weekday < dow) {
++week;
}
} else if (w.e != null) {
// local weekday -- counting starts from begining of week
weekday = w.e + dow;
} else {
// default to begining of week
weekday = dow;
}
}
temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow);
config._a[YEAR] = temp.year;
config._dayOfYear = temp.dayOfYear;
}
utils_hooks__hooks.ISO_8601 = function () {};
// date from string and format string
function configFromStringAndFormat(config) {
// TODO: Move this to another part of the creation flow to prevent circular deps
if (config._f === utils_hooks__hooks.ISO_8601) {
configFromISO(config);
return;
}
config._a = [];
getParsingFlags(config).empty = true;
// This array is used to make a Date, either with `new Date` or `Date.UTC`
var string = '' + config._i,
i, parsedInput, tokens, token, skipped,
stringLength = string.length,
totalParsedInputLength = 0;
tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
for (i = 0; i < tokens.length; i++) {
token = tokens[i];
parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
if (parsedInput) {
skipped = string.substr(0, string.indexOf(parsedInput));
if (skipped.length > 0) {
getParsingFlags(config).unusedInput.push(skipped);
}
string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
totalParsedInputLength += parsedInput.length;
}
// don't parse if it's not a known token
if (formatTokenFunctions[token]) {
if (parsedInput) {
getParsingFlags(config).empty = false;
}
else {
getParsingFlags(config).unusedTokens.push(token);
}
addTimeToArrayFromToken(token, parsedInput, config);
}
else if (config._strict && !parsedInput) {
getParsingFlags(config).unusedTokens.push(token);
}
}
// add remaining unparsed input length to the string
getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
if (string.length > 0) {
getParsingFlags(config).unusedInput.push(string);
}
// clear _12h flag if hour is <= 12
if (getParsingFlags(config).bigHour === true &&
config._a[HOUR] <= 12 &&
config._a[HOUR] > 0) {
getParsingFlags(config).bigHour = undefined;
}
// handle meridiem
config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
configFromArray(config);
checkOverflow(config);
}
function meridiemFixWrap (locale, hour, meridiem) {
var isPm;
if (meridiem == null) {
// nothing to do
return hour;
}
if (locale.meridiemHour != null) {
return locale.meridiemHour(hour, meridiem);
} else if (locale.isPM != null) {
// Fallback
isPm = locale.isPM(meridiem);
if (isPm && hour < 12) {
hour += 12;
}
if (!isPm && hour === 12) {
hour = 0;
}
return hour;
} else {
// this is not supposed to happen
return hour;
}
}
function configFromStringAndArray(config) {
var tempConfig,
bestMoment,
scoreToBeat,
i,
currentScore;
if (config._f.length === 0) {
getParsingFlags(config).invalidFormat = true;
config._d = new Date(NaN);
return;
}
for (i = 0; i < config._f.length; i++) {
currentScore = 0;
tempConfig = copyConfig({}, config);
if (config._useUTC != null) {
tempConfig._useUTC = config._useUTC;
}
tempConfig._f = config._f[i];
configFromStringAndFormat(tempConfig);
if (!valid__isValid(tempConfig)) {
continue;
}
// if there is any input that was not parsed add a penalty for that format
currentScore += getParsingFlags(tempConfig).charsLeftOver;
//or tokens
currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
getParsingFlags(tempConfig).score = currentScore;
if (scoreToBeat == null || currentScore < scoreToBeat) {
scoreToBeat = currentScore;
bestMoment = tempConfig;
}
}
extend(config, bestMoment || tempConfig);
}
function configFromObject(config) {
if (config._d) {
return;
}
var i = normalizeObjectUnits(config._i);
config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond];
configFromArray(config);
}
function createFromConfig (config) {
var res = new Moment(checkOverflow(prepareConfig(config)));
if (res._nextDay) {
// Adding is smart enough around DST
res.add(1, 'd');
res._nextDay = undefined;
}
return res;
}
function prepareConfig (config) {
var input = config._i,
format = config._f;
config._locale = config._locale || locale_locales__getLocale(config._l);
if (input === null || (format === undefined && input === '')) {
return valid__createInvalid({nullInput: true});
}
if (typeof input === 'string') {
config._i = input = config._locale.preparse(input);
}
if (isMoment(input)) {
return new Moment(checkOverflow(input));
} else if (isArray(format)) {
configFromStringAndArray(config);
} else if (format) {
configFromStringAndFormat(config);
} else if (isDate(input)) {
config._d = input;
} else {
configFromInput(config);
}
return config;
}
function configFromInput(config) {
var input = config._i;
if (input === undefined) {
config._d = new Date();
} else if (isDate(input)) {
config._d = new Date(+input);
} else if (typeof input === 'string') {
configFromString(config);
} else if (isArray(input)) {
config._a = map(input.slice(0), function (obj) {
return parseInt(obj, 10);
});
configFromArray(config);
} else if (typeof(input) === 'object') {
configFromObject(config);
} else if (typeof(input) === 'number') {
// from milliseconds
config._d = new Date(input);
} else {
utils_hooks__hooks.createFromInputFallback(config);
}
}
function createLocalOrUTC (input, format, locale, strict, isUTC) {
var c = {};
if (typeof(locale) === 'boolean') {
strict = locale;
locale = undefined;
}
// object construction must be done this way.
// https://github.com/moment/moment/issues/1423
c._isAMomentObject = true;
c._useUTC = c._isUTC = isUTC;
c._l = locale;
c._i = input;
c._f = format;
c._strict = strict;
return createFromConfig(c);
}
function local__createLocal (input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, false);
}
var prototypeMin = deprecate(
'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',
function () {
var other = local__createLocal.apply(null, arguments);
return other < this ? this : other;
}
);
var prototypeMax = deprecate(
'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',
function () {
var other = local__createLocal.apply(null, arguments);
return other > this ? this : other;
}
);
// Pick a moment m from moments so that m[fn](other) is true for all
// other. This relies on the function fn to be transitive.
//
// moments should either be an array of moment objects or an array, whose
// first element is an array of moment objects.
function pickBy(fn, moments) {
var res, i;
if (moments.length === 1 && isArray(moments[0])) {
moments = moments[0];
}
if (!moments.length) {
return local__createLocal();
}
res = moments[0];
for (i = 1; i < moments.length; ++i) {
if (!moments[i].isValid() || moments[i][fn](res)) {
res = moments[i];
}
}
return res;
}
// TODO: Use [].sort instead?
function min () {
var args = [].slice.call(arguments, 0);
return pickBy('isBefore', args);
}
function max () {
var args = [].slice.call(arguments, 0);
return pickBy('isAfter', args);
}
function Duration (duration) {
var normalizedInput = normalizeObjectUnits(duration),
years = normalizedInput.year || 0,
quarters = normalizedInput.quarter || 0,
months = normalizedInput.month || 0,
weeks = normalizedInput.week || 0,
days = normalizedInput.day || 0,
hours = normalizedInput.hour || 0,
minutes = normalizedInput.minute || 0,
seconds = normalizedInput.second || 0,
milliseconds = normalizedInput.millisecond || 0;
// representation for dateAddRemove
this._milliseconds = +milliseconds +
seconds * 1e3 + // 1000
minutes * 6e4 + // 1000 * 60
hours * 36e5; // 1000 * 60 * 60
// Because of dateAddRemove treats 24 hours as different from a
// day when working around DST, we need to store them separately
this._days = +days +
weeks * 7;
// It is impossible translate months into days without knowing
// which months you are are talking about, so we have to store
// it separately.
this._months = +months +
quarters * 3 +
years * 12;
this._data = {};
this._locale = locale_locales__getLocale();
this._bubble();
}
function isDuration (obj) {
return obj instanceof Duration;
}
function offset (token, separator) {
addFormatToken(token, 0, 0, function () {
var offset = this.utcOffset();
var sign = '+';
if (offset < 0) {
offset = -offset;
sign = '-';
}
return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
});
}
offset('Z', ':');
offset('ZZ', '');
// PARSING
addRegexToken('Z', matchOffset);
addRegexToken('ZZ', matchOffset);
addParseToken(['Z', 'ZZ'], function (input, array, config) {
config._useUTC = true;
config._tzm = offsetFromString(input);
});
// HELPERS
// timezone chunker
// '+10:00' > ['10', '00']
// '-1530' > ['-15', '30']
var chunkOffset = /([\+\-]|\d\d)/gi;
function offsetFromString(string) {
var matches = ((string || '').match(matchOffset) || []);
var chunk = matches[matches.length - 1] || [];
var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
var minutes = +(parts[1] * 60) + toInt(parts[2]);
return parts[0] === '+' ? minutes : -minutes;
}
// Return a moment from input, that is local/utc/zone equivalent to model.
function cloneWithOffset(input, model) {
var res, diff;
if (model._isUTC) {
res = model.clone();
diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);
// Use low-level api, because this fn is low-level api.
res._d.setTime(+res._d + diff);
utils_hooks__hooks.updateOffset(res, false);
return res;
} else {
return local__createLocal(input).local();
}
}
function getDateOffset (m) {
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
// https://github.com/moment/moment/pull/1871
return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
}
// HOOKS
// This function will be called whenever a moment is mutated.
// It is intended to keep the offset in sync with the timezone.
utils_hooks__hooks.updateOffset = function () {};
// MOMENTS
// keepLocalTime = true means only change the timezone, without
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
// +0200, so we adjust the time as needed, to be valid.
//
// Keeping the time actually adds/subtracts (one hour)
// from the actual represented time. That is why we call updateOffset
// a second time. In case it wants us to change the offset again
// _changeInProgress == true case, then we have to adjust, because
// there is no such time in the given timezone.
function getSetOffset (input, keepLocalTime) {
var offset = this._offset || 0,
localAdjust;
if (input != null) {
if (typeof input === 'string') {
input = offsetFromString(input);
}
if (Math.abs(input) < 16) {
input = input * 60;
}
if (!this._isUTC && keepLocalTime) {
localAdjust = getDateOffset(this);
}
this._offset = input;
this._isUTC = true;
if (localAdjust != null) {
this.add(localAdjust, 'm');
}
if (offset !== input) {
if (!keepLocalTime || this._changeInProgress) {
add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
} else if (!this._changeInProgress) {
this._changeInProgress = true;
utils_hooks__hooks.updateOffset(this, true);
this._changeInProgress = null;
}
}
return this;
} else {
return this._isUTC ? offset : getDateOffset(this);
}
}
function getSetZone (input, keepLocalTime) {
if (input != null) {
if (typeof input !== 'string') {
input = -input;
}
this.utcOffset(input, keepLocalTime);
return this;
} else {
return -this.utcOffset();
}
}
function setOffsetToUTC (keepLocalTime) {
return this.utcOffset(0, keepLocalTime);
}
function setOffsetToLocal (keepLocalTime) {
if (this._isUTC) {
this.utcOffset(0, keepLocalTime);
this._isUTC = false;
if (keepLocalTime) {
this.subtract(getDateOffset(this), 'm');
}
}
return this;
}
function setOffsetToParsedOffset () {
if (this._tzm) {
this.utcOffset(this._tzm);
} else if (typeof this._i === 'string') {
this.utcOffset(offsetFromString(this._i));
}
return this;
}
function hasAlignedHourOffset (input) {
input = input ? local__createLocal(input).utcOffset() : 0;
return (this.utcOffset() - input) % 60 === 0;
}
function isDaylightSavingTime () {
return (
this.utcOffset() > this.clone().month(0).utcOffset() ||
this.utcOffset() > this.clone().month(5).utcOffset()
);
}
function isDaylightSavingTimeShifted () {
if (typeof this._isDSTShifted !== 'undefined') {
return this._isDSTShifted;
}
var c = {};
copyConfig(c, this);
c = prepareConfig(c);
if (c._a) {
var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);
this._isDSTShifted = this.isValid() &&
compareArrays(c._a, other.toArray()) > 0;
} else {
this._isDSTShifted = false;
}
return this._isDSTShifted;
}
function isLocal () {
return !this._isUTC;
}
function isUtcOffset () {
return this._isUTC;
}
function isUtc () {
return this._isUTC && this._offset === 0;
}
var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/;
// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;
function create__createDuration (input, key) {
var duration = input,
// matching against regexp is expensive, do it on demand
match = null,
sign,
ret,
diffRes;
if (isDuration(input)) {
duration = {
ms : input._milliseconds,
d : input._days,
M : input._months
};
} else if (typeof input === 'number') {
duration = {};
if (key) {
duration[key] = input;
} else {
duration.milliseconds = input;
}
} else if (!!(match = aspNetRegex.exec(input))) {
sign = (match[1] === '-') ? -1 : 1;
duration = {
y : 0,
d : toInt(match[DATE]) * sign,
h : toInt(match[HOUR]) * sign,
m : toInt(match[MINUTE]) * sign,
s : toInt(match[SECOND]) * sign,
ms : toInt(match[MILLISECOND]) * sign
};
} else if (!!(match = create__isoRegex.exec(input))) {
sign = (match[1] === '-') ? -1 : 1;
duration = {
y : parseIso(match[2], sign),
M : parseIso(match[3], sign),
d : parseIso(match[4], sign),
h : parseIso(match[5], sign),
m : parseIso(match[6], sign),
s : parseIso(match[7], sign),
w : parseIso(match[8], sign)
};
} else if (duration == null) {// checks for null or undefined
duration = {};
} else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));
duration = {};
duration.ms = diffRes.milliseconds;
duration.M = diffRes.months;
}
ret = new Duration(duration);
if (isDuration(input) && hasOwnProp(input, '_locale')) {
ret._locale = input._locale;
}
return ret;
}
create__createDuration.fn = Duration.prototype;
function parseIso (inp, sign) {
// We'd normally use ~~inp for this, but unfortunately it also
// converts floats to ints.
// inp may be undefined, so careful calling replace on it.
var res = inp && parseFloat(inp.replace(',', '.'));
// apply sign while we're at it
return (isNaN(res) ? 0 : res) * sign;
}
function positiveMomentsDifference(base, other) {
var res = {milliseconds: 0, months: 0};
res.months = other.month() - base.month() +
(other.year() - base.year()) * 12;
if (base.clone().add(res.months, 'M').isAfter(other)) {
--res.months;
}
res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
return res;
}
function momentsDifference(base, other) {
var res;
other = cloneWithOffset(other, base);
if (base.isBefore(other)) {
res = positiveMomentsDifference(base, other);
} else {
res = positiveMomentsDifference(other, base);
res.milliseconds = -res.milliseconds;
res.months = -res.months;
}
return res;
}
function createAdder(direction, name) {
return function (val, period) {
var dur, tmp;
//invert the arguments, but complain about it
if (period !== null && !isNaN(+period)) {
deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');
tmp = val; val = period; period = tmp;
}
val = typeof val === 'string' ? +val : val;
dur = create__createDuration(val, period);
add_subtract__addSubtract(this, dur, direction);
return this;
};
}
function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {
var milliseconds = duration._milliseconds,
days = duration._days,
months = duration._months;
updateOffset = updateOffset == null ? true : updateOffset;
if (milliseconds) {
mom._d.setTime(+mom._d + milliseconds * isAdding);
}
if (days) {
get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);
}
if (months) {
setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);
}
if (updateOffset) {
utils_hooks__hooks.updateOffset(mom, days || months);
}
}
var add_subtract__add = createAdder(1, 'add');
var add_subtract__subtract = createAdder(-1, 'subtract');
function moment_calendar__calendar (time, formats) {
// We want to compare the start of today, vs this.
// Getting start-of-today depends on whether we're local/utc/offset or not.
var now = time || local__createLocal(),
sod = cloneWithOffset(now, this).startOf('day'),
diff = this.diff(sod, 'days', true),
format = diff < -6 ? 'sameElse' :
diff < -1 ? 'lastWeek' :
diff < 0 ? 'lastDay' :
diff < 1 ? 'sameDay' :
diff < 2 ? 'nextDay' :
diff < 7 ? 'nextWeek' : 'sameElse';
return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now)));
}
function clone () {
return new Moment(this);
}
function isAfter (input, units) {
var inputMs;
units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
if (units === 'millisecond') {
input = isMoment(input) ? input : local__createLocal(input);
return +this > +input;
} else {
inputMs = isMoment(input) ? +input : +local__createLocal(input);
return inputMs < +this.clone().startOf(units);
}
}
function isBefore (input, units) {
var inputMs;
units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
if (units === 'millisecond') {
input = isMoment(input) ? input : local__createLocal(input);
return +this < +input;
} else {
inputMs = isMoment(input) ? +input : +local__createLocal(input);
return +this.clone().endOf(units) < inputMs;
}
}
function isBetween (from, to, units) {
return this.isAfter(from, units) && this.isBefore(to, units);
}
function isSame (input, units) {
var inputMs;
units = normalizeUnits(units || 'millisecond');
if (units === 'millisecond') {
input = isMoment(input) ? input : local__createLocal(input);
return +this === +input;
} else {
inputMs = +local__createLocal(input);
return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units));
}
}
function diff (input, units, asFloat) {
var that = cloneWithOffset(input, this),
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4,
delta, output;
units = normalizeUnits(units);
if (units === 'year' || units === 'month' || units === 'quarter') {
output = monthDiff(this, that);
if (units === 'quarter') {
output = output / 3;
} else if (units === 'year') {
output = output / 12;
}
} else {
delta = this - that;
output = units === 'second' ? delta / 1e3 : // 1000
units === 'minute' ? delta / 6e4 : // 1000 * 60
units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
delta;
}
return asFloat ? output : absFloor(output);
}
function monthDiff (a, b) {
// difference in months
var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
// b is in (anchor - 1 month, anchor + 1 month)
anchor = a.clone().add(wholeMonthDiff, 'months'),
anchor2, adjust;
if (b - anchor < 0) {
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
// linear across the month
adjust = (b - anchor) / (anchor - anchor2);
} else {
anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
// linear across the month
adjust = (b - anchor) / (anchor2 - anchor);
}
return -(wholeMonthDiff + adjust);
}
utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
function toString () {
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
}
function moment_format__toISOString () {
var m = this.clone().utc();
if (0 < m.year() && m.year() <= 9999) {
if ('function' === typeof Date.prototype.toISOString) {
// native implementation is ~50x faster, use it when we can
return this.toDate().toISOString();
} else {
return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
}
} else {
return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
}
}
function format (inputString) {
var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat);
return this.localeData().postformat(output);
}
function from (time, withoutSuffix) {
if (!this.isValid()) {
return this.localeData().invalidDate();
}
return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
}
function fromNow (withoutSuffix) {
return this.from(local__createLocal(), withoutSuffix);
}
function to (time, withoutSuffix) {
if (!this.isValid()) {
return this.localeData().invalidDate();
}
return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
}
function toNow (withoutSuffix) {
return this.to(local__createLocal(), withoutSuffix);
}
function locale (key) {
var newLocaleData;
if (key === undefined) {
return this._locale._abbr;
} else {
newLocaleData = locale_locales__getLocale(key);
if (newLocaleData != null) {
this._locale = newLocaleData;
}
return this;
}
}
var lang = deprecate(
'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
function (key) {
if (key === undefined) {
return this.localeData();
} else {
return this.locale(key);
}
}
);
function localeData () {
return this._locale;
}
function startOf (units) {
units = normalizeUnits(units);
// the following switch intentionally omits break keywords
// to utilize falling through the cases.
switch (units) {
case 'year':
this.month(0);
/* falls through */
case 'quarter':
case 'month':
this.date(1);
/* falls through */
case 'week':
case 'isoWeek':
case 'day':
this.hours(0);
/* falls through */
case 'hour':
this.minutes(0);
/* falls through */
case 'minute':
this.seconds(0);
/* falls through */
case 'second':
this.milliseconds(0);
}
// weeks are a special case
if (units === 'week') {
this.weekday(0);
}
if (units === 'isoWeek') {
this.isoWeekday(1);
}
// quarters are also special
if (units === 'quarter') {
this.month(Math.floor(this.month() / 3) * 3);
}
return this;
}
function endOf (units) {
units = normalizeUnits(units);
if (units === undefined || units === 'millisecond') {
return this;
}
return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
}
function to_type__valueOf () {
return +this._d - ((this._offset || 0) * 60000);
}
function unix () {
return Math.floor(+this / 1000);
}
function toDate () {
return this._offset ? new Date(+this) : this._d;
}
function toArray () {
var m = this;
return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
}
function toObject () {
var m = this;
return {
years: m.year(),
months: m.month(),
date: m.date(),
hours: m.hours(),
minutes: m.minutes(),
seconds: m.seconds(),
milliseconds: m.milliseconds()
};
}
function moment_valid__isValid () {
return valid__isValid(this);
}
function parsingFlags () {
return extend({}, getParsingFlags(this));
}
function invalidAt () {
return getParsingFlags(this).overflow;
}
addFormatToken(0, ['gg', 2], 0, function () {
return this.weekYear() % 100;
});
addFormatToken(0, ['GG', 2], 0, function () {
return this.isoWeekYear() % 100;
});
function addWeekYearFormatToken (token, getter) {
addFormatToken(0, [token, token.length], 0, getter);
}
addWeekYearFormatToken('gggg', 'weekYear');
addWeekYearFormatToken('ggggg', 'weekYear');
addWeekYearFormatToken('GGGG', 'isoWeekYear');
addWeekYearFormatToken('GGGGG', 'isoWeekYear');
// ALIASES
addUnitAlias('weekYear', 'gg');
addUnitAlias('isoWeekYear', 'GG');
// PARSING
addRegexToken('G', matchSigned);
addRegexToken('g', matchSigned);
addRegexToken('GG', match1to2, match2);
addRegexToken('gg', match1to2, match2);
addRegexToken('GGGG', match1to4, match4);
addRegexToken('gggg', match1to4, match4);
addRegexToken('GGGGG', match1to6, match6);
addRegexToken('ggggg', match1to6, match6);
addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
week[token.substr(0, 2)] = toInt(input);
});
addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
week[token] = utils_hooks__hooks.parseTwoDigitYear(input);
});
// HELPERS
function weeksInYear(year, dow, doy) {
return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week;
}
// MOMENTS
function getSetWeekYear (input) {
var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;
return input == null ? year : this.add((input - year), 'y');
}
function getSetISOWeekYear (input) {
var year = weekOfYear(this, 1, 4).year;
return input == null ? year : this.add((input - year), 'y');
}
function getISOWeeksInYear () {
return weeksInYear(this.year(), 1, 4);
}
function getWeeksInYear () {
var weekInfo = this.localeData()._week;
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
}
addFormatToken('Q', 0, 0, 'quarter');
// ALIASES
addUnitAlias('quarter', 'Q');
// PARSING
addRegexToken('Q', match1);
addParseToken('Q', function (input, array) {
array[MONTH] = (toInt(input) - 1) * 3;
});
// MOMENTS
function getSetQuarter (input) {
return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
}
addFormatToken('D', ['DD', 2], 'Do', 'date');
// ALIASES
addUnitAlias('date', 'D');
// PARSING
addRegexToken('D', match1to2);
addRegexToken('DD', match1to2, match2);
addRegexToken('Do', function (isStrict, locale) {
return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
});
addParseToken(['D', 'DD'], DATE);
addParseToken('Do', function (input, array) {
array[DATE] = toInt(input.match(match1to2)[0], 10);
});
// MOMENTS
var getSetDayOfMonth = makeGetSet('Date', true);
addFormatToken('d', 0, 'do', 'day');
addFormatToken('dd', 0, 0, function (format) {
return this.localeData().weekdaysMin(this, format);
});
addFormatToken('ddd', 0, 0, function (format) {
return this.localeData().weekdaysShort(this, format);
});
addFormatToken('dddd', 0, 0, function (format) {
return this.localeData().weekdays(this, format);
});
addFormatToken('e', 0, 0, 'weekday');
addFormatToken('E', 0, 0, 'isoWeekday');
// ALIASES
addUnitAlias('day', 'd');
addUnitAlias('weekday', 'e');
addUnitAlias('isoWeekday', 'E');
// PARSING
addRegexToken('d', match1to2);
addRegexToken('e', match1to2);
addRegexToken('E', match1to2);
addRegexToken('dd', matchWord);
addRegexToken('ddd', matchWord);
addRegexToken('dddd', matchWord);
addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) {
var weekday = config._locale.weekdaysParse(input);
// if we didn't get a weekday name, mark the date as invalid
if (weekday != null) {
week.d = weekday;
} else {
getParsingFlags(config).invalidWeekday = input;
}
});
addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
week[token] = toInt(input);
});
// HELPERS
function parseWeekday(input, locale) {
if (typeof input !== 'string') {
return input;
}
if (!isNaN(input)) {
return parseInt(input, 10);
}
input = locale.weekdaysParse(input);
if (typeof input === 'number') {
return input;
}
return null;
}
// LOCALES
var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
function localeWeekdays (m) {
return this._weekdays[m.day()];
}
var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
function localeWeekdaysShort (m) {
return this._weekdaysShort[m.day()];
}
var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
function localeWeekdaysMin (m) {
return this._weekdaysMin[m.day()];
}
function localeWeekdaysParse (weekdayName) {
var i, mom, regex;
this._weekdaysParse = this._weekdaysParse || [];
for (i = 0; i < 7; i++) {
// make the regex if we don't have it already
if (!this._weekdaysParse[i]) {
mom = local__createLocal([2000, 1]).day(i);
regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
}
// test the regex
if (this._weekdaysParse[i].test(weekdayName)) {
return i;
}
}
}
// MOMENTS
function getSetDayOfWeek (input) {
var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
if (input != null) {
input = parseWeekday(input, this.localeData());
return this.add(input - day, 'd');
} else {
return day;
}
}
function getSetLocaleDayOfWeek (input) {
var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
return input == null ? weekday : this.add(input - weekday, 'd');
}
function getSetISODayOfWeek (input) {
// behaves the same as moment#day except
// as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
// as a setter, sunday should belong to the previous week.
return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);
}
addFormatToken('H', ['HH', 2], 0, 'hour');
addFormatToken('h', ['hh', 2], 0, function () {
return this.hours() % 12 || 12;
});
function meridiem (token, lowercase) {
addFormatToken(token, 0, 0, function () {
return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
});
}
meridiem('a', true);
meridiem('A', false);
// ALIASES
addUnitAlias('hour', 'h');
// PARSING
function matchMeridiem (isStrict, locale) {
return locale._meridiemParse;
}
addRegexToken('a', matchMeridiem);
addRegexToken('A', matchMeridiem);
addRegexToken('H', match1to2);
addRegexToken('h', match1to2);
addRegexToken('HH', match1to2, match2);
addRegexToken('hh', match1to2, match2);
addParseToken(['H', 'HH'], HOUR);
addParseToken(['a', 'A'], function (input, array, config) {
config._isPm = config._locale.isPM(input);
config._meridiem = input;
});
addParseToken(['h', 'hh'], function (input, array, config) {
array[HOUR] = toInt(input);
getParsingFlags(config).bigHour = true;
});
// LOCALES
function localeIsPM (input) {
// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
// Using charAt should be more compatible.
return ((input + '').toLowerCase().charAt(0) === 'p');
}
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
function localeMeridiem (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'pm' : 'PM';
} else {
return isLower ? 'am' : 'AM';
}
}
// MOMENTS
// Setting the hour should keep the time, because the user explicitly
// specified which hour he wants. So trying to maintain the same hour (in
// a new timezone) makes sense. Adding/subtracting hours does not follow
// this rule.
var getSetHour = makeGetSet('Hours', true);
addFormatToken('m', ['mm', 2], 0, 'minute');
// ALIASES
addUnitAlias('minute', 'm');
// PARSING
addRegexToken('m', match1to2);
addRegexToken('mm', match1to2, match2);
addParseToken(['m', 'mm'], MINUTE);
// MOMENTS
var getSetMinute = makeGetSet('Minutes', false);
addFormatToken('s', ['ss', 2], 0, 'second');
// ALIASES
addUnitAlias('second', 's');
// PARSING
addRegexToken('s', match1to2);
addRegexToken('ss', match1to2, match2);
addParseToken(['s', 'ss'], SECOND);
// MOMENTS
var getSetSecond = makeGetSet('Seconds', false);
addFormatToken('S', 0, 0, function () {
return ~~(this.millisecond() / 100);
});
addFormatToken(0, ['SS', 2], 0, function () {
return ~~(this.millisecond() / 10);
});
addFormatToken(0, ['SSS', 3], 0, 'millisecond');
addFormatToken(0, ['SSSS', 4], 0, function () {
return this.millisecond() * 10;
});
addFormatToken(0, ['SSSSS', 5], 0, function () {
return this.millisecond() * 100;
});
addFormatToken(0, ['SSSSSS', 6], 0, function () {
return this.millisecond() * 1000;
});
addFormatToken(0, ['SSSSSSS', 7], 0, function () {
return this.millisecond() * 10000;
});
addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
return this.millisecond() * 100000;
});
addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
return this.millisecond() * 1000000;
});
// ALIASES
addUnitAlias('millisecond', 'ms');
// PARSING
addRegexToken('S', match1to3, match1);
addRegexToken('SS', match1to3, match2);
addRegexToken('SSS', match1to3, match3);
var token;
for (token = 'SSSS'; token.length <= 9; token += 'S') {
addRegexToken(token, matchUnsigned);
}
function parseMs(input, array) {
array[MILLISECOND] = toInt(('0.' + input) * 1000);
}
for (token = 'S'; token.length <= 9; token += 'S') {
addParseToken(token, parseMs);
}
// MOMENTS
var getSetMillisecond = makeGetSet('Milliseconds', false);
addFormatToken('z', 0, 0, 'zoneAbbr');
addFormatToken('zz', 0, 0, 'zoneName');
// MOMENTS
function getZoneAbbr () {
return this._isUTC ? 'UTC' : '';
}
function getZoneName () {
return this._isUTC ? 'Coordinated Universal Time' : '';
}
var momentPrototype__proto = Moment.prototype;
momentPrototype__proto.add = add_subtract__add;
momentPrototype__proto.calendar = moment_calendar__calendar;
momentPrototype__proto.clone = clone;
momentPrototype__proto.diff = diff;
momentPrototype__proto.endOf = endOf;
momentPrototype__proto.format = format;
momentPrototype__proto.from = from;
momentPrototype__proto.fromNow = fromNow;
momentPrototype__proto.to = to;
momentPrototype__proto.toNow = toNow;
momentPrototype__proto.get = getSet;
momentPrototype__proto.invalidAt = invalidAt;
momentPrototype__proto.isAfter = isAfter;
momentPrototype__proto.isBefore = isBefore;
momentPrototype__proto.isBetween = isBetween;
momentPrototype__proto.isSame = isSame;
momentPrototype__proto.isValid = moment_valid__isValid;
momentPrototype__proto.lang = lang;
momentPrototype__proto.locale = locale;
momentPrototype__proto.localeData = localeData;
momentPrototype__proto.max = prototypeMax;
momentPrototype__proto.min = prototypeMin;
momentPrototype__proto.parsingFlags = parsingFlags;
momentPrototype__proto.set = getSet;
momentPrototype__proto.startOf = startOf;
momentPrototype__proto.subtract = add_subtract__subtract;
momentPrototype__proto.toArray = toArray;
momentPrototype__proto.toObject = toObject;
momentPrototype__proto.toDate = toDate;
momentPrototype__proto.toISOString = moment_format__toISOString;
momentPrototype__proto.toJSON = moment_format__toISOString;
momentPrototype__proto.toString = toString;
momentPrototype__proto.unix = unix;
momentPrototype__proto.valueOf = to_type__valueOf;
// Year
momentPrototype__proto.year = getSetYear;
momentPrototype__proto.isLeapYear = getIsLeapYear;
// Week Year
momentPrototype__proto.weekYear = getSetWeekYear;
momentPrototype__proto.isoWeekYear = getSetISOWeekYear;
// Quarter
momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;
// Month
momentPrototype__proto.month = getSetMonth;
momentPrototype__proto.daysInMonth = getDaysInMonth;
// Week
momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;
momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;
momentPrototype__proto.weeksInYear = getWeeksInYear;
momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;
// Day
momentPrototype__proto.date = getSetDayOfMonth;
momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;
momentPrototype__proto.weekday = getSetLocaleDayOfWeek;
momentPrototype__proto.isoWeekday = getSetISODayOfWeek;
momentPrototype__proto.dayOfYear = getSetDayOfYear;
// Hour
momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;
// Minute
momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;
// Second
momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;
// Millisecond
momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;
// Offset
momentPrototype__proto.utcOffset = getSetOffset;
momentPrototype__proto.utc = setOffsetToUTC;
momentPrototype__proto.local = setOffsetToLocal;
momentPrototype__proto.parseZone = setOffsetToParsedOffset;
momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;
momentPrototype__proto.isDST = isDaylightSavingTime;
momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted;
momentPrototype__proto.isLocal = isLocal;
momentPrototype__proto.isUtcOffset = isUtcOffset;
momentPrototype__proto.isUtc = isUtc;
momentPrototype__proto.isUTC = isUtc;
// Timezone
momentPrototype__proto.zoneAbbr = getZoneAbbr;
momentPrototype__proto.zoneName = getZoneName;
// Deprecations
momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);
var momentPrototype = momentPrototype__proto;
function moment__createUnix (input) {
return local__createLocal(input * 1000);
}
function moment__createInZone () {
return local__createLocal.apply(null, arguments).parseZone();
}
var defaultCalendar = {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[Last] dddd [at] LT',
sameElse : 'L'
};
function locale_calendar__calendar (key, mom, now) {
var output = this._calendar[key];
return typeof output === 'function' ? output.call(mom, now) : output;
}
var defaultLongDateFormat = {
LTS : 'h:mm:ss A',
LT : 'h:mm A',
L : 'MM/DD/YYYY',
LL : 'MMMM D, YYYY',
LLL : 'MMMM D, YYYY h:mm A',
LLLL : 'dddd, MMMM D, YYYY h:mm A'
};
function longDateFormat (key) {
var format = this._longDateFormat[key],
formatUpper = this._longDateFormat[key.toUpperCase()];
if (format || !formatUpper) {
return format;
}
this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
return val.slice(1);
});
return this._longDateFormat[key];
}
var defaultInvalidDate = 'Invalid date';
function invalidDate () {
return this._invalidDate;
}
var defaultOrdinal = '%d';
var defaultOrdinalParse = /\d{1,2}/;
function ordinal (number) {
return this._ordinal.replace('%d', number);
}
function preParsePostFormat (string) {
return string;
}
var defaultRelativeTime = {
future : 'in %s',
past : '%s ago',
s : 'a few seconds',
m : 'a minute',
mm : '%d minutes',
h : 'an hour',
hh : '%d hours',
d : 'a day',
dd : '%d days',
M : 'a month',
MM : '%d months',
y : 'a year',
yy : '%d years'
};
function relative__relativeTime (number, withoutSuffix, string, isFuture) {
var output = this._relativeTime[string];
return (typeof output === 'function') ?
output(number, withoutSuffix, string, isFuture) :
output.replace(/%d/i, number);
}
function pastFuture (diff, output) {
var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
return typeof format === 'function' ? format(output) : format.replace(/%s/i, output);
}
function locale_set__set (config) {
var prop, i;
for (i in config) {
prop = config[i];
if (typeof prop === 'function') {
this[i] = prop;
} else {
this['_' + i] = prop;
}
}
// Lenient ordinal parsing accepts just a number in addition to
// number + (possibly) stuff coming from _ordinalParseLenient.
this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
}
var prototype__proto = Locale.prototype;
prototype__proto._calendar = defaultCalendar;
prototype__proto.calendar = locale_calendar__calendar;
prototype__proto._longDateFormat = defaultLongDateFormat;
prototype__proto.longDateFormat = longDateFormat;
prototype__proto._invalidDate = defaultInvalidDate;
prototype__proto.invalidDate = invalidDate;
prototype__proto._ordinal = defaultOrdinal;
prototype__proto.ordinal = ordinal;
prototype__proto._ordinalParse = defaultOrdinalParse;
prototype__proto.preparse = preParsePostFormat;
prototype__proto.postformat = preParsePostFormat;
prototype__proto._relativeTime = defaultRelativeTime;
prototype__proto.relativeTime = relative__relativeTime;
prototype__proto.pastFuture = pastFuture;
prototype__proto.set = locale_set__set;
// Month
prototype__proto.months = localeMonths;
prototype__proto._months = defaultLocaleMonths;
prototype__proto.monthsShort = localeMonthsShort;
prototype__proto._monthsShort = defaultLocaleMonthsShort;
prototype__proto.monthsParse = localeMonthsParse;
// Week
prototype__proto.week = localeWeek;
prototype__proto._week = defaultLocaleWeek;
prototype__proto.firstDayOfYear = localeFirstDayOfYear;
prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;
// Day of Week
prototype__proto.weekdays = localeWeekdays;
prototype__proto._weekdays = defaultLocaleWeekdays;
prototype__proto.weekdaysMin = localeWeekdaysMin;
prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin;
prototype__proto.weekdaysShort = localeWeekdaysShort;
prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort;
prototype__proto.weekdaysParse = localeWeekdaysParse;
// Hours
prototype__proto.isPM = localeIsPM;
prototype__proto._meridiemParse = defaultLocaleMeridiemParse;
prototype__proto.meridiem = localeMeridiem;
function lists__get (format, index, field, setter) {
var locale = locale_locales__getLocale();
var utc = create_utc__createUTC().set(setter, index);
return locale[field](utc, format);
}
function list (format, index, field, count, setter) {
if (typeof format === 'number') {
index = format;
format = undefined;
}
format = format || '';
if (index != null) {
return lists__get(format, index, field, setter);
}
var i;
var out = [];
for (i = 0; i < count; i++) {
out[i] = lists__get(format, i, field, setter);
}
return out;
}
function lists__listMonths (format, index) {
return list(format, index, 'months', 12, 'month');
}
function lists__listMonthsShort (format, index) {
return list(format, index, 'monthsShort', 12, 'month');
}
function lists__listWeekdays (format, index) {
return list(format, index, 'weekdays', 7, 'day');
}
function lists__listWeekdaysShort (format, index) {
return list(format, index, 'weekdaysShort', 7, 'day');
}
function lists__listWeekdaysMin (format, index) {
return list(format, index, 'weekdaysMin', 7, 'day');
}
locale_locales__getSetGlobalLocale('en', {
ordinalParse: /\d{1,2}(th|st|nd|rd)/,
ordinal : function (number) {
var b = number % 10,
output = (toInt(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
}
});
// Side effect imports
utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);
utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);
var mathAbs = Math.abs;
function duration_abs__abs () {
var data = this._data;
this._milliseconds = mathAbs(this._milliseconds);
this._days = mathAbs(this._days);
this._months = mathAbs(this._months);
data.milliseconds = mathAbs(data.milliseconds);
data.seconds = mathAbs(data.seconds);
data.minutes = mathAbs(data.minutes);
data.hours = mathAbs(data.hours);
data.months = mathAbs(data.months);
data.years = mathAbs(data.years);
return this;
}
function duration_add_subtract__addSubtract (duration, input, value, direction) {
var other = create__createDuration(input, value);
duration._milliseconds += direction * other._milliseconds;
duration._days += direction * other._days;
duration._months += direction * other._months;
return duration._bubble();
}
// supports only 2.0-style add(1, 's') or add(duration)
function duration_add_subtract__add (input, value) {
return duration_add_subtract__addSubtract(this, input, value, 1);
}
// supports only 2.0-style subtract(1, 's') or subtract(duration)
function duration_add_subtract__subtract (input, value) {
return duration_add_subtract__addSubtract(this, input, value, -1);
}
function absCeil (number) {
if (number < 0) {
return Math.floor(number);
} else {
return Math.ceil(number);
}
}
function bubble () {
var milliseconds = this._milliseconds;
var days = this._days;
var months = this._months;
var data = this._data;
var seconds, minutes, hours, years, monthsFromDays;
// if we have a mix of positive and negative values, bubble down first
// check: https://github.com/moment/moment/issues/2166
if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
(milliseconds <= 0 && days <= 0 && months <= 0))) {
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
days = 0;
months = 0;
}
// The following code bubbles up values, see the tests for
// examples of what that means.
data.milliseconds = milliseconds % 1000;
seconds = absFloor(milliseconds / 1000);
data.seconds = seconds % 60;
minutes = absFloor(seconds / 60);
data.minutes = minutes % 60;
hours = absFloor(minutes / 60);
data.hours = hours % 24;
days += absFloor(hours / 24);
// convert days to months
monthsFromDays = absFloor(daysToMonths(days));
months += monthsFromDays;
days -= absCeil(monthsToDays(monthsFromDays));
// 12 months -> 1 year
years = absFloor(months / 12);
months %= 12;
data.days = days;
data.months = months;
data.years = years;
return this;
}
function daysToMonths (days) {
// 400 years have 146097 days (taking into account leap year rules)
// 400 years have 12 months === 4800
return days * 4800 / 146097;
}
function monthsToDays (months) {
// the reverse of daysToMonths
return months * 146097 / 4800;
}
function as (units) {
var days;
var months;
var milliseconds = this._milliseconds;
units = normalizeUnits(units);
if (units === 'month' || units === 'year') {
days = this._days + milliseconds / 864e5;
months = this._months + daysToMonths(days);
return units === 'month' ? months : months / 12;
} else {
// handle milliseconds separately because of floating point math errors (issue #1867)
days = this._days + Math.round(monthsToDays(this._months));
switch (units) {
case 'week' : return days / 7 + milliseconds / 6048e5;
case 'day' : return days + milliseconds / 864e5;
case 'hour' : return days * 24 + milliseconds / 36e5;
case 'minute' : return days * 1440 + milliseconds / 6e4;
case 'second' : return days * 86400 + milliseconds / 1000;
// Math.floor prevents floating point math errors here
case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
default: throw new Error('Unknown unit ' + units);
}
}
}
// TODO: Use this.as('ms')?
function duration_as__valueOf () {
return (
this._milliseconds +
this._days * 864e5 +
(this._months % 12) * 2592e6 +
toInt(this._months / 12) * 31536e6
);
}
function makeAs (alias) {
return function () {
return this.as(alias);
};
}
var asMilliseconds = makeAs('ms');
var asSeconds = makeAs('s');
var asMinutes = makeAs('m');
var asHours = makeAs('h');
var asDays = makeAs('d');
var asWeeks = makeAs('w');
var asMonths = makeAs('M');
var asYears = makeAs('y');
function duration_get__get (units) {
units = normalizeUnits(units);
return this[units + 's']();
}
function makeGetter(name) {
return function () {
return this._data[name];
};
}
var milliseconds = makeGetter('milliseconds');
var seconds = makeGetter('seconds');
var minutes = makeGetter('minutes');
var hours = makeGetter('hours');
var days = makeGetter('days');
var months = makeGetter('months');
var years = makeGetter('years');
function weeks () {
return absFloor(this.days() / 7);
}
var round = Math.round;
var thresholds = {
s: 45, // seconds to minute
m: 45, // minutes to hour
h: 22, // hours to day
d: 26, // days to month
M: 11 // months to year
};
// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
}
function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {
var duration = create__createDuration(posNegDuration).abs();
var seconds = round(duration.as('s'));
var minutes = round(duration.as('m'));
var hours = round(duration.as('h'));
var days = round(duration.as('d'));
var months = round(duration.as('M'));
var years = round(duration.as('y'));
var a = seconds < thresholds.s && ['s', seconds] ||
minutes === 1 && ['m'] ||
minutes < thresholds.m && ['mm', minutes] ||
hours === 1 && ['h'] ||
hours < thresholds.h && ['hh', hours] ||
days === 1 && ['d'] ||
days < thresholds.d && ['dd', days] ||
months === 1 && ['M'] ||
months < thresholds.M && ['MM', months] ||
years === 1 && ['y'] || ['yy', years];
a[2] = withoutSuffix;
a[3] = +posNegDuration > 0;
a[4] = locale;
return substituteTimeAgo.apply(null, a);
}
// This function allows you to set a threshold for relative time strings
function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {
if (thresholds[threshold] === undefined) {
return false;
}
if (limit === undefined) {
return thresholds[threshold];
}
thresholds[threshold] = limit;
return true;
}
function humanize (withSuffix) {
var locale = this.localeData();
var output = duration_humanize__relativeTime(this, !withSuffix, locale);
if (withSuffix) {
output = locale.pastFuture(+this, output);
}
return locale.postformat(output);
}
var iso_string__abs = Math.abs;
function iso_string__toISOString() {
// for ISO strings we do not use the normal bubbling rules:
// * milliseconds bubble up until they become hours
// * days do not bubble at all
// * months bubble up until they become years
// This is because there is no context-free conversion between hours and days
// (think of clock changes)
// and also not between days and months (28-31 days per month)
var seconds = iso_string__abs(this._milliseconds) / 1000;
var days = iso_string__abs(this._days);
var months = iso_string__abs(this._months);
var minutes, hours, years;
// 3600 seconds -> 60 minutes -> 1 hour
minutes = absFloor(seconds / 60);
hours = absFloor(minutes / 60);
seconds %= 60;
minutes %= 60;
// 12 months -> 1 year
years = absFloor(months / 12);
months %= 12;
// inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
var Y = years;
var M = months;
var D = days;
var h = hours;
var m = minutes;
var s = seconds;
var total = this.asSeconds();
if (!total) {
// this is the same as C#'s (Noda) and python (isodate)...
// but not other JS (goog.date)
return 'P0D';
}
return (total < 0 ? '-' : '') +
'P' +
(Y ? Y + 'Y' : '') +
(M ? M + 'M' : '') +
(D ? D + 'D' : '') +
((h || m || s) ? 'T' : '') +
(h ? h + 'H' : '') +
(m ? m + 'M' : '') +
(s ? s + 'S' : '');
}
var duration_prototype__proto = Duration.prototype;
duration_prototype__proto.abs = duration_abs__abs;
duration_prototype__proto.add = duration_add_subtract__add;
duration_prototype__proto.subtract = duration_add_subtract__subtract;
duration_prototype__proto.as = as;
duration_prototype__proto.asMilliseconds = asMilliseconds;
duration_prototype__proto.asSeconds = asSeconds;
duration_prototype__proto.asMinutes = asMinutes;
duration_prototype__proto.asHours = asHours;
duration_prototype__proto.asDays = asDays;
duration_prototype__proto.asWeeks = asWeeks;
duration_prototype__proto.asMonths = asMonths;
duration_prototype__proto.asYears = asYears;
duration_prototype__proto.valueOf = duration_as__valueOf;
duration_prototype__proto._bubble = bubble;
duration_prototype__proto.get = duration_get__get;
duration_prototype__proto.milliseconds = milliseconds;
duration_prototype__proto.seconds = seconds;
duration_prototype__proto.minutes = minutes;
duration_prototype__proto.hours = hours;
duration_prototype__proto.days = days;
duration_prototype__proto.weeks = weeks;
duration_prototype__proto.months = months;
duration_prototype__proto.years = years;
duration_prototype__proto.humanize = humanize;
duration_prototype__proto.toISOString = iso_string__toISOString;
duration_prototype__proto.toString = iso_string__toISOString;
duration_prototype__proto.toJSON = iso_string__toISOString;
duration_prototype__proto.locale = locale;
duration_prototype__proto.localeData = localeData;
// Deprecations
duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);
duration_prototype__proto.lang = lang;
// Side effect imports
addFormatToken('X', 0, 0, 'unix');
addFormatToken('x', 0, 0, 'valueOf');
// PARSING
addRegexToken('x', matchSigned);
addRegexToken('X', matchTimestamp);
addParseToken('X', function (input, array, config) {
config._d = new Date(parseFloat(input, 10) * 1000);
});
addParseToken('x', function (input, array, config) {
config._d = new Date(toInt(input));
});
// Side effect imports
utils_hooks__hooks.version = '2.10.6';
setHookCallback(local__createLocal);
utils_hooks__hooks.fn = momentPrototype;
utils_hooks__hooks.min = min;
utils_hooks__hooks.max = max;
utils_hooks__hooks.utc = create_utc__createUTC;
utils_hooks__hooks.unix = moment__createUnix;
utils_hooks__hooks.months = lists__listMonths;
utils_hooks__hooks.isDate = isDate;
utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;
utils_hooks__hooks.invalid = valid__createInvalid;
utils_hooks__hooks.duration = create__createDuration;
utils_hooks__hooks.isMoment = isMoment;
utils_hooks__hooks.weekdays = lists__listWeekdays;
utils_hooks__hooks.parseZone = moment__createInZone;
utils_hooks__hooks.localeData = locale_locales__getLocale;
utils_hooks__hooks.isDuration = isDuration;
utils_hooks__hooks.monthsShort = lists__listMonthsShort;
utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;
utils_hooks__hooks.defineLocale = defineLocale;
utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;
utils_hooks__hooks.normalizeUnits = normalizeUnits;
utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;
var _moment = utils_hooks__hooks;
return _moment;
}));
},{}],"numeral":[function(require,module,exports){
"use strict";
(function() {
var numeral,
VERSION = '1.5.3',
languages = {},
currentLanguage = 'en',
zeroFormat = null,
defaultFormat = '0,0',
hasModule = (typeof module !== 'undefined' && module.exports);
function Numeral(number) {
this._value = number;
}
function toFixed(value, precision, roundingFunction, optionals) {
var power = Math.pow(10, precision),
optionalsRegExp,
output;
output = (roundingFunction(value * power) / power).toFixed(precision);
if (optionals) {
optionalsRegExp = new RegExp('0{1,' + optionals + '}$');
output = output.replace(optionalsRegExp, '');
}
return output;
}
function formatNumeral(n, format, roundingFunction) {
var output;
if (format.indexOf('$') > -1) {
output = formatCurrency(n, format, roundingFunction);
} else if (format.indexOf('%') > -1) {
output = formatPercentage(n, format, roundingFunction);
} else if (format.indexOf(':') > -1) {
output = formatTime(n, format);
} else {
output = formatNumber(n._value, format, roundingFunction);
}
return output;
}
function unformatNumeral(n, string) {
var stringOriginal = string,
thousandRegExp,
millionRegExp,
billionRegExp,
trillionRegExp,
suffixes = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
bytesMultiplier = false,
power;
if (string.indexOf(':') > -1) {
n._value = unformatTime(string);
} else {
if (string === zeroFormat) {
n._value = 0;
} else {
if (languages[currentLanguage].delimiters.decimal !== '.') {
string = string.replace(/\./g, '').replace(languages[currentLanguage].delimiters.decimal, '.');
}
thousandRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.thousand + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
millionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.million + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
billionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.billion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
trillionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.trillion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
for (power = 0; power <= suffixes.length; power++) {
bytesMultiplier = (string.indexOf(suffixes[power]) > -1) ? Math.pow(1024, power + 1) : false;
if (bytesMultiplier) {
break;
}
}
n._value = ((bytesMultiplier) ? bytesMultiplier : 1) * ((stringOriginal.match(thousandRegExp)) ? Math.pow(10, 3) : 1) * ((stringOriginal.match(millionRegExp)) ? Math.pow(10, 6) : 1) * ((stringOriginal.match(billionRegExp)) ? Math.pow(10, 9) : 1) * ((stringOriginal.match(trillionRegExp)) ? Math.pow(10, 12) : 1) * ((string.indexOf('%') > -1) ? 0.01 : 1) * (((string.split('-').length + Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2) ? 1 : -1) * Number(string.replace(/[^0-9\.]+/g, ''));
n._value = (bytesMultiplier) ? Math.ceil(n._value) : n._value;
}
}
return n._value;
}
function formatCurrency(n, format, roundingFunction) {
var symbolIndex = format.indexOf('$'),
openParenIndex = format.indexOf('('),
minusSignIndex = format.indexOf('-'),
space = '',
spliceIndex,
output;
if (format.indexOf(' $') > -1) {
space = ' ';
format = format.replace(' $', '');
} else if (format.indexOf('$ ') > -1) {
space = ' ';
format = format.replace('$ ', '');
} else {
format = format.replace('$', '');
}
output = formatNumber(n._value, format, roundingFunction);
if (symbolIndex <= 1) {
if (output.indexOf('(') > -1 || output.indexOf('-') > -1) {
output = output.split('');
spliceIndex = 1;
if (symbolIndex < openParenIndex || symbolIndex < minusSignIndex) {
spliceIndex = 0;
}
output.splice(spliceIndex, 0, languages[currentLanguage].currency.symbol + space);
output = output.join('');
} else {
output = languages[currentLanguage].currency.symbol + space + output;
}
} else {
if (output.indexOf(')') > -1) {
output = output.split('');
output.splice(-1, 0, space + languages[currentLanguage].currency.symbol);
output = output.join('');
} else {
output = output + space + languages[currentLanguage].currency.symbol;
}
}
return output;
}
function formatPercentage(n, format, roundingFunction) {
var space = '',
output,
value = n._value * 100;
if (format.indexOf(' %') > -1) {
space = ' ';
format = format.replace(' %', '');
} else {
format = format.replace('%', '');
}
output = formatNumber(value, format, roundingFunction);
if (output.indexOf(')') > -1) {
output = output.split('');
output.splice(-1, 0, space + '%');
output = output.join('');
} else {
output = output + space + '%';
}
return output;
}
function formatTime(n) {
var hours = Math.floor(n._value / 60 / 60),
minutes = Math.floor((n._value - (hours * 60 * 60)) / 60),
seconds = Math.round(n._value - (hours * 60 * 60) - (minutes * 60));
return hours + ':' + ((minutes < 10) ? '0' + minutes : minutes) + ':' + ((seconds < 10) ? '0' + seconds : seconds);
}
function unformatTime(string) {
var timeArray = string.split(':'),
seconds = 0;
if (timeArray.length === 3) {
seconds = seconds + (Number(timeArray[0]) * 60 * 60);
seconds = seconds + (Number(timeArray[1]) * 60);
seconds = seconds + Number(timeArray[2]);
} else if (timeArray.length === 2) {
seconds = seconds + (Number(timeArray[0]) * 60);
seconds = seconds + Number(timeArray[1]);
}
return Number(seconds);
}
function formatNumber(value, format, roundingFunction) {
var negP = false,
signed = false,
optDec = false,
abbr = '',
abbrK = false,
abbrM = false,
abbrB = false,
abbrT = false,
abbrForce = false,
bytes = '',
ord = '',
abs = Math.abs(value),
suffixes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
min,
max,
power,
w,
precision,
thousands,
d = '',
neg = false;
if (value === 0 && zeroFormat !== null) {
return zeroFormat;
} else {
if (format.indexOf('(') > -1) {
negP = true;
format = format.slice(1, -1);
} else if (format.indexOf('+') > -1) {
signed = true;
format = format.replace(/\+/g, '');
}
if (format.indexOf('a') > -1) {
abbrK = format.indexOf('aK') >= 0;
abbrM = format.indexOf('aM') >= 0;
abbrB = format.indexOf('aB') >= 0;
abbrT = format.indexOf('aT') >= 0;
abbrForce = abbrK || abbrM || abbrB || abbrT;
if (format.indexOf(' a') > -1) {
abbr = ' ';
format = format.replace(' a', '');
} else {
format = format.replace('a', '');
}
if (abs >= Math.pow(10, 12) && !abbrForce || abbrT) {
abbr = abbr + languages[currentLanguage].abbreviations.trillion;
value = value / Math.pow(10, 12);
} else if (abs < Math.pow(10, 12) && abs >= Math.pow(10, 9) && !abbrForce || abbrB) {
abbr = abbr + languages[currentLanguage].abbreviations.billion;
value = value / Math.pow(10, 9);
} else if (abs < Math.pow(10, 9) && abs >= Math.pow(10, 6) && !abbrForce || abbrM) {
abbr = abbr + languages[currentLanguage].abbreviations.million;
value = value / Math.pow(10, 6);
} else if (abs < Math.pow(10, 6) && abs >= Math.pow(10, 3) && !abbrForce || abbrK) {
abbr = abbr + languages[currentLanguage].abbreviations.thousand;
value = value / Math.pow(10, 3);
}
}
if (format.indexOf('b') > -1) {
if (format.indexOf(' b') > -1) {
bytes = ' ';
format = format.replace(' b', '');
} else {
format = format.replace('b', '');
}
for (power = 0; power <= suffixes.length; power++) {
min = Math.pow(1024, power);
max = Math.pow(1024, power + 1);
if (value >= min && value < max) {
bytes = bytes + suffixes[power];
if (min > 0) {
value = value / min;
}
break;
}
}
}
if (format.indexOf('o') > -1) {
if (format.indexOf(' o') > -1) {
ord = ' ';
format = format.replace(' o', '');
} else {
format = format.replace('o', '');
}
ord = ord + languages[currentLanguage].ordinal(value);
}
if (format.indexOf('[.]') > -1) {
optDec = true;
format = format.replace('[.]', '.');
}
w = value.toString().split('.')[0];
precision = format.split('.')[1];
thousands = format.indexOf(',');
if (precision) {
if (precision.indexOf('[') > -1) {
precision = precision.replace(']', '');
precision = precision.split('[');
d = toFixed(value, (precision[0].length + precision[1].length), roundingFunction, precision[1].length);
} else {
d = toFixed(value, precision.length, roundingFunction);
}
w = d.split('.')[0];
if (d.split('.')[1].length) {
d = languages[currentLanguage].delimiters.decimal + d.split('.')[1];
} else {
d = '';
}
if (optDec && Number(d.slice(1)) === 0) {
d = '';
}
} else {
w = toFixed(value, null, roundingFunction);
}
if (w.indexOf('-') > -1) {
w = w.slice(1);
neg = true;
}
if (thousands > -1) {
w = w.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' + languages[currentLanguage].delimiters.thousands);
}
if (format.indexOf('.') === 0) {
w = '';
}
return ((negP && neg) ? '(' : '') + ((!negP && neg) ? '-' : '') + ((!neg && signed) ? '+' : '') + w + d + ((ord) ? ord : '') + ((abbr) ? abbr : '') + ((bytes) ? bytes : '') + ((negP && neg) ? ')' : '');
}
}
numeral = function(input) {
if (numeral.isNumeral(input)) {
input = input.value();
} else if (input === 0 || typeof input === 'undefined') {
input = 0;
} else if (!Number(input)) {
input = numeral.fn.unformat(input);
}
return new Numeral(Number(input));
};
numeral.version = VERSION;
numeral.isNumeral = function(obj) {
return obj instanceof Numeral;
};
numeral.language = function(key, values) {
if (!key) {
return currentLanguage;
}
if (key && !values) {
if (!languages[key]) {
throw new Error('Unknown language : ' + key);
}
currentLanguage = key;
}
if (values || !languages[key]) {
loadLanguage(key, values);
}
return numeral;
};
numeral.languageData = function(key) {
if (!key) {
return languages[currentLanguage];
}
if (!languages[key]) {
throw new Error('Unknown language : ' + key);
}
return languages[key];
};
numeral.language('en', {
delimiters: {
thousands: ',',
decimal: '.'
},
abbreviations: {
thousand: 'k',
million: 'm',
billion: 'b',
trillion: 't'
},
ordinal: function(number) {
var b = number % 10;
return (~~(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th';
},
currency: {symbol: '$'}
});
numeral.zeroFormat = function(format) {
zeroFormat = typeof(format) === 'string' ? format : null;
};
numeral.defaultFormat = function(format) {
defaultFormat = typeof(format) === 'string' ? format : '0.0';
};
numeral.validate = function(val, culture) {
var _decimalSep,
_thousandSep,
_currSymbol,
_valArray,
_abbrObj,
_thousandRegEx,
languageData,
temp;
if (typeof val !== 'string') {
val += '';
if (console.warn) {
console.warn('Numeral.js: Value is not string. It has been co-erced to: ', val);
}
}
val = val.trim();
if (val === '') {
return false;
}
val = val.replace(/^[+-]?/, '');
try {
languageData = numeral.languageData(culture);
} catch (e) {
languageData = numeral.languageData(numeral.language());
}
_currSymbol = languageData.currency.symbol;
_abbrObj = languageData.abbreviations;
_decimalSep = languageData.delimiters.decimal;
if (languageData.delimiters.thousands === '.') {
_thousandSep = '\\.';
} else {
_thousandSep = languageData.delimiters.thousands;
}
temp = val.match(/^[^\d\.\,]+/);
if (temp !== null) {
val = val.substr(1);
if (temp[0] !== _currSymbol) {
return false;
}
}
temp = val.match(/[^\d]+$/);
if (temp !== null) {
val = val.slice(0, -1);
if (temp[0] !== _abbrObj.thousand && temp[0] !== _abbrObj.million && temp[0] !== _abbrObj.billion && temp[0] !== _abbrObj.trillion) {
return false;
}
}
if (!!val.match(/^\d+$/)) {
return true;
}
_thousandRegEx = new RegExp(_thousandSep + '{2}');
if (!val.match(/[^\d.,]/g)) {
_valArray = val.split(_decimalSep);
if (_valArray.length > 2) {
return false;
} else {
if (_valArray.length < 2) {
return (!!_valArray[0].match(/^\d+.*\d$/) && !_valArray[0].match(_thousandRegEx));
} else {
if (_valArray[0] === '') {
return (!_valArray[0].match(_thousandRegEx) && !!_valArray[1].match(/^\d+$/));
} else if (_valArray[0].length === 1) {
return (!!_valArray[0].match(/^\d+$/) && !_valArray[0].match(_thousandRegEx) && !!_valArray[1].match(/^\d+$/));
} else {
return (!!_valArray[0].match(/^\d+.*\d$/) && !_valArray[0].match(_thousandRegEx) && !!_valArray[1].match(/^\d+$/));
}
}
}
}
return false;
};
function loadLanguage(key, values) {
languages[key] = values;
}
if ('function' !== typeof Array.prototype.reduce) {
Array.prototype.reduce = function(callback, opt_initialValue) {
'use strict';
if (null === this || 'undefined' === typeof this) {
throw new TypeError('Array.prototype.reduce called on null or undefined');
}
if ('function' !== typeof callback) {
throw new TypeError(callback + ' is not a function');
}
var index,
value,
length = this.length >>> 0,
isValueSet = false;
if (1 < arguments.length) {
value = opt_initialValue;
isValueSet = true;
}
for (index = 0; length > index; ++index) {
if (this.hasOwnProperty(index)) {
if (isValueSet) {
value = callback(value, this[index], index, this);
} else {
value = this[index];
isValueSet = true;
}
}
}
if (!isValueSet) {
throw new TypeError('Reduce of empty array with no initial value');
}
return value;
};
}
function multiplier(x) {
var parts = x.toString().split('.');
if (parts.length < 2) {
return 1;
}
return Math.pow(10, parts[1].length);
}
function correctionFactor() {
var args = Array.prototype.slice.call(arguments);
return args.reduce(function(prev, next) {
var mp = multiplier(prev),
mn = multiplier(next);
return mp > mn ? mp : mn;
}, -Infinity);
}
numeral.fn = Numeral.prototype = {
clone: function() {
return numeral(this);
},
format: function(inputString, roundingFunction) {
return formatNumeral(this, inputString ? inputString : defaultFormat, (roundingFunction !== undefined) ? roundingFunction : Math.round);
},
unformat: function(inputString) {
if (Object.prototype.toString.call(inputString) === '[object Number]') {
return inputString;
}
return unformatNumeral(this, inputString ? inputString : defaultFormat);
},
value: function() {
return this._value;
},
valueOf: function() {
return this._value;
},
set: function(value) {
this._value = Number(value);
return this;
},
add: function(value) {
var corrFactor = correctionFactor.call(null, this._value, value);
function cback(accum, curr, currI, O) {
return accum + corrFactor * curr;
}
this._value = [this._value, value].reduce(cback, 0) / corrFactor;
return this;
},
subtract: function(value) {
var corrFactor = correctionFactor.call(null, this._value, value);
function cback(accum, curr, currI, O) {
return accum - corrFactor * curr;
}
this._value = [value].reduce(cback, this._value * corrFactor) / corrFactor;
return this;
},
multiply: function(value) {
function cback(accum, curr, currI, O) {
var corrFactor = correctionFactor(accum, curr);
return (accum * corrFactor) * (curr * corrFactor) / (corrFactor * corrFactor);
}
this._value = [this._value, value].reduce(cback, 1);
return this;
},
divide: function(value) {
function cback(accum, curr, currI, O) {
var corrFactor = correctionFactor(accum, curr);
return (accum * corrFactor) / (curr * corrFactor);
}
this._value = [this._value, value].reduce(cback);
return this;
},
difference: function(value) {
return Math.abs(numeral(this._value).subtract(value).value());
}
};
if (hasModule) {
module.exports = numeral;
}
if (typeof ender === 'undefined') {
this['numeral'] = numeral;
}
if (typeof define === 'function' && define.amd) {
define([], function() {
return numeral;
});
}
}).call(window);
//#
},{}],"pikaday":[function(require,module,exports){
/*!
* Pikaday
*
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
*/
(function (root, factory)
{
'use strict';
var moment;
if (typeof exports === 'object') {
// CommonJS module
// Load moment.js as an optional dependency
try { moment = require('moment'); } catch (e) {}
module.exports = factory(moment);
} else if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(function (req)
{
// Load moment.js as an optional dependency
var id = 'moment';
try { moment = req(id); } catch (e) {}
return factory(moment);
});
} else {
root.Pikaday = factory(root.moment);
}
}(this, function (moment)
{
'use strict';
/**
* feature detection and helper functions
*/
var hasMoment = typeof moment === 'function',
hasEventListeners = !!window.addEventListener,
document = window.document,
sto = window.setTimeout,
addEvent = function(el, e, callback, capture)
{
if (hasEventListeners) {
el.addEventListener(e, callback, !!capture);
} else {
el.attachEvent('on' + e, callback);
}
},
removeEvent = function(el, e, callback, capture)
{
if (hasEventListeners) {
el.removeEventListener(e, callback, !!capture);
} else {
el.detachEvent('on' + e, callback);
}
},
fireEvent = function(el, eventName, data)
{
var ev;
if (document.createEvent) {
ev = document.createEvent('HTMLEvents');
ev.initEvent(eventName, true, false);
ev = extend(ev, data);
el.dispatchEvent(ev);
} else if (document.createEventObject) {
ev = document.createEventObject();
ev = extend(ev, data);
el.fireEvent('on' + eventName, ev);
}
},
trim = function(str)
{
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,'');
},
hasClass = function(el, cn)
{
return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;
},
addClass = function(el, cn)
{
if (!hasClass(el, cn)) {
el.className = (el.className === '') ? cn : el.className + ' ' + cn;
}
},
removeClass = function(el, cn)
{
el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' '));
},
isArray = function(obj)
{
return (/Array/).test(Object.prototype.toString.call(obj));
},
isDate = function(obj)
{
return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());
},
isWeekend = function(date)
{
var day = date.getDay();
return day === 0 || day === 6;
},
isLeapYear = function(year)
{
// solution by Matti Virkkunen: http://stackoverflow.com/a/4881951
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
},
getDaysInMonth = function(year, month)
{
return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
},
setToStartOfDay = function(date)
{
if (isDate(date)) date.setHours(0,0,0,0);
},
compareDates = function(a,b)
{
// weak date comparison (use setToStartOfDay(date) to ensure correct result)
return a.getTime() === b.getTime();
},
extend = function(to, from, overwrite)
{
var prop, hasProp;
for (prop in from) {
hasProp = to[prop] !== undefined;
if (hasProp && typeof from[prop] === 'object' && from[prop] !== null && from[prop].nodeName === undefined) {
if (isDate(from[prop])) {
if (overwrite) {
to[prop] = new Date(from[prop].getTime());
}
}
else if (isArray(from[prop])) {
if (overwrite) {
to[prop] = from[prop].slice(0);
}
} else {
to[prop] = extend({}, from[prop], overwrite);
}
} else if (overwrite || !hasProp) {
to[prop] = from[prop];
}
}
return to;
},
adjustCalendar = function(calendar) {
if (calendar.month < 0) {
calendar.year -= Math.ceil(Math.abs(calendar.month)/12);
calendar.month += 12;
}
if (calendar.month > 11) {
calendar.year += Math.floor(Math.abs(calendar.month)/12);
calendar.month -= 12;
}
return calendar;
},
/**
* defaults and localisation
*/
defaults = {
// bind the picker to a form field
field: null,
// automatically show/hide the picker on `field` focus (default `true` if `field` is set)
bound: undefined,
// position of the datepicker, relative to the field (default to bottom & left)
// ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position)
position: 'bottom left',
// automatically fit in the viewport even if it means repositioning from the position option
reposition: true,
// the default output format for `.toString()` and `field` value
format: 'YYYY-MM-DD',
// the initial date to view when first opened
defaultDate: null,
// make the `defaultDate` the initial selected value
setDefaultDate: false,
// first day of week (0: Sunday, 1: Monday etc)
firstDay: 0,
// the minimum/earliest date that can be selected
minDate: null,
// the maximum/latest date that can be selected
maxDate: null,
// number of years either side, or array of upper/lower range
yearRange: 10,
// show week numbers at head of row
showWeekNumber: false,
// used internally (don't config outside)
minYear: 0,
maxYear: 9999,
minMonth: undefined,
maxMonth: undefined,
startRange: null,
endRange: null,
isRTL: false,
// Additional text to append to the year in the calendar title
yearSuffix: '',
// Render the month after year in the calendar title
showMonthAfterYear: false,
// how many months are visible
numberOfMonths: 1,
// when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`)
// only used for the first display or when a selected date is not visible
mainCalendar: 'left',
// Specify a DOM element to render the calendar in
container: undefined,
// internationalization
i18n: {
previousMonth : 'Previous Month',
nextMonth : 'Next Month',
months : ['January','February','March','April','May','June','July','August','September','October','November','December'],
weekdays : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
},
// Theme Classname
theme: null,
// callback function
onSelect: null,
onOpen: null,
onClose: null,
onDraw: null
},
/**
* templating functions to abstract HTML rendering
*/
renderDayName = function(opts, day, abbr)
{
day += opts.firstDay;
while (day >= 7) {
day -= 7;
}
return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
},
renderDay = function(opts)
{
if (opts.isEmpty) {
return '<td class="is-empty"></td>';
}
var arr = [];
if (opts.isDisabled) {
arr.push('is-disabled');
}
if (opts.isToday) {
arr.push('is-today');
}
if (opts.isSelected) {
arr.push('is-selected');
}
if (opts.isInRange) {
arr.push('is-inrange');
}
if (opts.isStartRange) {
arr.push('is-startrange');
}
if (opts.isEndRange) {
arr.push('is-endrange');
}
return '<td data-day="' + opts.day + '" class="' + arr.join(' ') + '">' +
'<button class="pika-button pika-day" type="button" ' +
'data-pika-year="' + opts.year + '" data-pika-month="' + opts.month + '" data-pika-day="' + opts.day + '">' +
opts.day +
'</button>' +
'</td>';
},
renderWeek = function (d, m, y) {
// Lifted from http://javascript.about.com/library/blweekyear.htm, lightly modified.
var onejan = new Date(y, 0, 1),
weekNum = Math.ceil((((new Date(y, m, d) - onejan) / 86400000) + onejan.getDay()+1)/7);
return '<td class="pika-week">' + weekNum + '</td>';
},
renderRow = function(days, isRTL)
{
return '<tr>' + (isRTL ? days.reverse() : days).join('') + '</tr>';
},
renderBody = function(rows)
{
return '<tbody>' + rows.join('') + '</tbody>';
},
renderHead = function(opts)
{
var i, arr = [];
if (opts.showWeekNumber) {
arr.push('<th></th>');
}
for (i = 0; i < 7; i++) {
arr.push('<th scope="col"><abbr title="' + renderDayName(opts, i) + '">' + renderDayName(opts, i, true) + '</abbr></th>');
}
return '<thead>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</thead>';
},
renderTitle = function(instance, c, year, month, refYear)
{
var i, j, arr,
opts = instance._o,
isMinYear = year === opts.minYear,
isMaxYear = year === opts.maxYear,
html = '<div class="pika-title">',
monthHtml,
yearHtml,
prev = true,
next = true;
for (arr = [], i = 0; i < 12; i++) {
arr.push('<option value="' + (year === refYear ? i - c : 12 + i - c) + '"' +
(i === month ? ' selected': '') +
((isMinYear && i < opts.minMonth) || (isMaxYear && i > opts.maxMonth) ? 'disabled' : '') + '>' +
opts.i18n.months[i] + '</option>');
}
monthHtml = '<div class="pika-label">' + opts.i18n.months[month] + '<select class="pika-select pika-select-month" tabindex="-1">' + arr.join('') + '</select></div>';
if (isArray(opts.yearRange)) {
i = opts.yearRange[0];
j = opts.yearRange[1] + 1;
} else {
i = year - opts.yearRange;
j = 1 + year + opts.yearRange;
}
for (arr = []; i < j && i <= opts.maxYear; i++) {
if (i >= opts.minYear) {
arr.push('<option value="' + i + '"' + (i === year ? ' selected': '') + '>' + (i) + '</option>');
}
}
yearHtml = '<div class="pika-label">' + year + opts.yearSuffix + '<select class="pika-select pika-select-year" tabindex="-1">' + arr.join('') + '</select></div>';
if (opts.showMonthAfterYear) {
html += yearHtml + monthHtml;
} else {
html += monthHtml + yearHtml;
}
if (isMinYear && (month === 0 || opts.minMonth >= month)) {
prev = false;
}
if (isMaxYear && (month === 11 || opts.maxMonth <= month)) {
next = false;
}
if (c === 0) {
html += '<button class="pika-prev' + (prev ? '' : ' is-disabled') + '" type="button">' + opts.i18n.previousMonth + '</button>';
}
if (c === (instance._o.numberOfMonths - 1) ) {
html += '<button class="pika-next' + (next ? '' : ' is-disabled') + '" type="button">' + opts.i18n.nextMonth + '</button>';
}
return html += '</div>';
},
renderTable = function(opts, data)
{
return '<table cellpadding="0" cellspacing="0" class="pika-table">' + renderHead(opts) + renderBody(data) + '</table>';
},
/**
* Pikaday constructor
*/
Pikaday = function(options)
{
var self = this,
opts = self.config(options);
self._onMouseDown = function(e)
{
if (!self._v) {
return;
}
e = e || window.event;
var target = e.target || e.srcElement;
if (!target) {
return;
}
if (!hasClass(target, 'is-disabled')) {
if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty')) {
self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day')));
if (opts.bound) {
sto(function() {
self.hide();
if (opts.field) {
opts.field.blur();
}
}, 100);
}
}
else if (hasClass(target, 'pika-prev')) {
self.prevMonth();
}
else if (hasClass(target, 'pika-next')) {
self.nextMonth();
}
}
if (!hasClass(target, 'pika-select')) {
// if this is touch event prevent mouse events emulation
if (e.preventDefault) {
e.preventDefault();
} else {
e.returnValue = false;
return false;
}
} else {
self._c = true;
}
};
self._onChange = function(e)
{
e = e || window.event;
var target = e.target || e.srcElement;
if (!target) {
return;
}
if (hasClass(target, 'pika-select-month')) {
self.gotoMonth(target.value);
}
else if (hasClass(target, 'pika-select-year')) {
self.gotoYear(target.value);
}
};
self._onInputChange = function(e)
{
var date;
if (e.firedBy === self) {
return;
}
if (hasMoment) {
date = moment(opts.field.value, opts.format);
date = (date && date.isValid()) ? date.toDate() : null;
}
else {
date = new Date(Date.parse(opts.field.value));
}
if (isDate(date)) {
self.setDate(date);
}
if (!self._v) {
self.show();
}
};
self._onInputFocus = function()
{
self.show();
};
self._onInputClick = function()
{
self.show();
};
self._onInputBlur = function()
{
// IE allows pika div to gain focus; catch blur the input field
var pEl = document.activeElement;
do {
if (hasClass(pEl, 'pika-single')) {
return;
}
}
while ((pEl = pEl.parentNode));
if (!self._c) {
self._b = sto(function() {
self.hide();
}, 50);
}
self._c = false;
};
self._onClick = function(e)
{
e = e || window.event;
var target = e.target || e.srcElement,
pEl = target;
if (!target) {
return;
}
if (!hasEventListeners && hasClass(target, 'pika-select')) {
if (!target.onchange) {
target.setAttribute('onchange', 'return;');
addEvent(target, 'change', self._onChange);
}
}
do {
if (hasClass(pEl, 'pika-single') || pEl === opts.trigger) {
return;
}
}
while ((pEl = pEl.parentNode));
if (self._v && target !== opts.trigger && pEl !== opts.trigger) {
self.hide();
}
};
self.el = document.createElement('div');
self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : '');
addEvent(self.el, 'mousedown', self._onMouseDown, true);
addEvent(self.el, 'touchend', self._onMouseDown, true);
addEvent(self.el, 'change', self._onChange);
if (opts.field) {
if (opts.container) {
opts.container.appendChild(self.el);
} else if (opts.bound) {
document.body.appendChild(self.el);
} else {
opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling);
}
addEvent(opts.field, 'change', self._onInputChange);
if (!opts.defaultDate) {
if (hasMoment && opts.field.value) {
opts.defaultDate = moment(opts.field.value, opts.format).toDate();
} else {
opts.defaultDate = new Date(Date.parse(opts.field.value));
}
opts.setDefaultDate = true;
}
}
var defDate = opts.defaultDate;
if (isDate(defDate)) {
if (opts.setDefaultDate) {
self.setDate(defDate, true);
} else {
self.gotoDate(defDate);
}
} else {
self.gotoDate(new Date());
}
if (opts.bound) {
this.hide();
self.el.className += ' is-bound';
addEvent(opts.trigger, 'click', self._onInputClick);
addEvent(opts.trigger, 'focus', self._onInputFocus);
addEvent(opts.trigger, 'blur', self._onInputBlur);
} else {
this.show();
}
};
/**
* public Pikaday API
*/
Pikaday.prototype = {
/**
* configure functionality
*/
config: function(options)
{
if (!this._o) {
this._o = extend({}, defaults, true);
}
var opts = extend(this._o, options, true);
opts.isRTL = !!opts.isRTL;
opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;
opts.theme = (typeof opts.theme) === 'string' && opts.theme ? opts.theme : null;
opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);
opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field;
opts.disableWeekends = !!opts.disableWeekends;
opts.disableDayFn = (typeof opts.disableDayFn) === 'function' ? opts.disableDayFn : null;
var nom = parseInt(opts.numberOfMonths, 10) || 1;
opts.numberOfMonths = nom > 4 ? 4 : nom;
if (!isDate(opts.minDate)) {
opts.minDate = false;
}
if (!isDate(opts.maxDate)) {
opts.maxDate = false;
}
if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) {
opts.maxDate = opts.minDate = false;
}
if (opts.minDate) {
this.setMinDate(opts.minDate);
}
if (opts.maxDate) {
this.setMaxDate(opts.maxDate);
}
if (isArray(opts.yearRange)) {
var fallback = new Date().getFullYear() - 10;
opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback;
opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback;
} else {
opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange;
if (opts.yearRange > 100) {
opts.yearRange = 100;
}
}
return opts;
},
/**
* return a formatted string of the current selection (using Moment.js if available)
*/
toString: function(format)
{
return !isDate(this._d) ? '' : hasMoment ? moment(this._d).format(format || this._o.format) : this._d.toDateString();
},
/**
* return a Moment.js object of the current selection (if available)
*/
getMoment: function()
{
return hasMoment ? moment(this._d) : null;
},
/**
* set the current selection from a Moment.js object (if available)
*/
setMoment: function(date, preventOnSelect)
{
if (hasMoment && moment.isMoment(date)) {
this.setDate(date.toDate(), preventOnSelect);
}
},
/**
* return a Date object of the current selection
*/
getDate: function()
{
return isDate(this._d) ? new Date(this._d.getTime()) : null;
},
/**
* set the current selection
*/
setDate: function(date, preventOnSelect)
{
if (!date) {
this._d = null;
if (this._o.field) {
this._o.field.value = '';
fireEvent(this._o.field, 'change', { firedBy: this });
}
return this.draw();
}
if (typeof date === 'string') {
date = new Date(Date.parse(date));
}
if (!isDate(date)) {
return;
}
var min = this._o.minDate,
max = this._o.maxDate;
if (isDate(min) && date < min) {
date = min;
} else if (isDate(max) && date > max) {
date = max;
}
this._d = new Date(date.getTime());
setToStartOfDay(this._d);
this.gotoDate(this._d);
if (this._o.field) {
this._o.field.value = this.toString();
fireEvent(this._o.field, 'change', { firedBy: this });
}
if (!preventOnSelect && typeof this._o.onSelect === 'function') {
this._o.onSelect.call(this, this.getDate());
}
},
/**
* change view to a specific date
*/
gotoDate: function(date)
{
var newCalendar = true;
if (!isDate(date)) {
return;
}
if (this.calendars) {
var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1),
lastVisibleDate = new Date(this.calendars[this.calendars.length-1].year, this.calendars[this.calendars.length-1].month, 1),
visibleDate = date.getTime();
// get the end of the month
lastVisibleDate.setMonth(lastVisibleDate.getMonth()+1);
lastVisibleDate.setDate(lastVisibleDate.getDate()-1);
newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate);
}
if (newCalendar) {
this.calendars = [{
month: date.getMonth(),
year: date.getFullYear()
}];
if (this._o.mainCalendar === 'right') {
this.calendars[0].month += 1 - this._o.numberOfMonths;
}
}
this.adjustCalendars();
},
adjustCalendars: function() {
this.calendars[0] = adjustCalendar(this.calendars[0]);
for (var c = 1; c < this._o.numberOfMonths; c++) {
this.calendars[c] = adjustCalendar({
month: this.calendars[0].month + c,
year: this.calendars[0].year
});
}
this.draw();
},
gotoToday: function()
{
this.gotoDate(new Date());
},
/**
* change view to a specific month (zero-index, e.g. 0: January)
*/
gotoMonth: function(month)
{
if (!isNaN(month)) {
this.calendars[0].month = parseInt(month, 10);
this.adjustCalendars();
}
},
nextMonth: function()
{
this.calendars[0].month++;
this.adjustCalendars();
},
prevMonth: function()
{
this.calendars[0].month--;
this.adjustCalendars();
},
/**
* change view to a specific full year (e.g. "2012")
*/
gotoYear: function(year)
{
if (!isNaN(year)) {
this.calendars[0].year = parseInt(year, 10);
this.adjustCalendars();
}
},
/**
* change the minDate
*/
setMinDate: function(value)
{
setToStartOfDay(value);
this._o.minDate = value;
this._o.minYear = value.getFullYear();
this._o.minMonth = value.getMonth();
this.draw();
},
/**
* change the maxDate
*/
setMaxDate: function(value)
{
setToStartOfDay(value);
this._o.maxDate = value;
this._o.maxYear = value.getFullYear();
this._o.maxMonth = value.getMonth();
this.draw();
},
setStartRange: function(value)
{
this._o.startRange = value;
},
setEndRange: function(value)
{
this._o.endRange = value;
},
/**
* refresh the HTML
*/
draw: function(force)
{
if (!this._v && !force) {
return;
}
var opts = this._o,
minYear = opts.minYear,
maxYear = opts.maxYear,
minMonth = opts.minMonth,
maxMonth = opts.maxMonth,
html = '';
if (this._y <= minYear) {
this._y = minYear;
if (!isNaN(minMonth) && this._m < minMonth) {
this._m = minMonth;
}
}
if (this._y >= maxYear) {
this._y = maxYear;
if (!isNaN(maxMonth) && this._m > maxMonth) {
this._m = maxMonth;
}
}
for (var c = 0; c < opts.numberOfMonths; c++) {
html += '<div class="pika-lendar">' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year) + this.render(this.calendars[c].year, this.calendars[c].month) + '</div>';
}
this.el.innerHTML = html;
if (opts.bound) {
if(opts.field.type !== 'hidden') {
sto(function() {
opts.trigger.focus();
}, 1);
}
}
if (typeof this._o.onDraw === 'function') {
var self = this;
sto(function() {
self._o.onDraw.call(self);
}, 0);
}
},
adjustPosition: function()
{
var field, pEl, width, height, viewportWidth, viewportHeight, scrollTop, left, top, clientRect;
if (this._o.container) return;
this.el.style.position = 'absolute';
field = this._o.trigger;
pEl = field;
width = this.el.offsetWidth;
height = this.el.offsetHeight;
viewportWidth = window.innerWidth || document.documentElement.clientWidth;
viewportHeight = window.innerHeight || document.documentElement.clientHeight;
scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
if (typeof field.getBoundingClientRect === 'function') {
clientRect = field.getBoundingClientRect();
left = clientRect.left + window.pageXOffset;
top = clientRect.bottom + window.pageYOffset;
} else {
left = pEl.offsetLeft;
top = pEl.offsetTop + pEl.offsetHeight;
while((pEl = pEl.offsetParent)) {
left += pEl.offsetLeft;
top += pEl.offsetTop;
}
}
// default position is bottom & left
if ((this._o.reposition && left + width > viewportWidth) ||
(
this._o.position.indexOf('right') > -1 &&
left - width + field.offsetWidth > 0
)
) {
left = left - width + field.offsetWidth;
}
if ((this._o.reposition && top + height > viewportHeight + scrollTop) ||
(
this._o.position.indexOf('top') > -1 &&
top - height - field.offsetHeight > 0
)
) {
top = top - height - field.offsetHeight;
}
this.el.style.left = left + 'px';
this.el.style.top = top + 'px';
},
/**
* render HTML for a particular month
*/
render: function(year, month)
{
var opts = this._o,
now = new Date(),
days = getDaysInMonth(year, month),
before = new Date(year, month, 1).getDay(),
data = [],
row = [];
setToStartOfDay(now);
if (opts.firstDay > 0) {
before -= opts.firstDay;
if (before < 0) {
before += 7;
}
}
var cells = days + before,
after = cells;
while(after > 7) {
after -= 7;
}
cells += 7 - after;
for (var i = 0, r = 0; i < cells; i++)
{
var day = new Date(year, month, 1 + (i - before)),
isSelected = isDate(this._d) ? compareDates(day, this._d) : false,
isToday = compareDates(day, now),
isEmpty = i < before || i >= (days + before),
isStartRange = opts.startRange && compareDates(opts.startRange, day),
isEndRange = opts.endRange && compareDates(opts.endRange, day),
isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange,
isDisabled = (opts.minDate && day < opts.minDate) ||
(opts.maxDate && day > opts.maxDate) ||
(opts.disableWeekends && isWeekend(day)) ||
(opts.disableDayFn && opts.disableDayFn(day)),
dayConfig = {
day: 1 + (i - before),
month: month,
year: year,
isSelected: isSelected,
isToday: isToday,
isDisabled: isDisabled,
isEmpty: isEmpty,
isStartRange: isStartRange,
isEndRange: isEndRange,
isInRange: isInRange
};
row.push(renderDay(dayConfig));
if (++r === 7) {
if (opts.showWeekNumber) {
row.unshift(renderWeek(i - before, month, year));
}
data.push(renderRow(row, opts.isRTL));
row = [];
r = 0;
}
}
return renderTable(opts, data);
},
isVisible: function()
{
return this._v;
},
show: function()
{
if (!this._v) {
removeClass(this.el, 'is-hidden');
this._v = true;
this.draw();
if (this._o.bound) {
addEvent(document, 'click', this._onClick);
this.adjustPosition();
}
if (typeof this._o.onOpen === 'function') {
this._o.onOpen.call(this);
}
}
},
hide: function()
{
var v = this._v;
if (v !== false) {
if (this._o.bound) {
removeEvent(document, 'click', this._onClick);
}
this.el.style.position = 'static'; // reset
this.el.style.left = 'auto';
this.el.style.top = 'auto';
addClass(this.el, 'is-hidden');
this._v = false;
if (v !== undefined && typeof this._o.onClose === 'function') {
this._o.onClose.call(this);
}
}
},
/**
* GAME OVER
*/
destroy: function()
{
this.hide();
removeEvent(this.el, 'mousedown', this._onMouseDown, true);
removeEvent(this.el, 'touchend', this._onMouseDown, true);
removeEvent(this.el, 'change', this._onChange);
if (this._o.field) {
removeEvent(this._o.field, 'change', this._onInputChange);
if (this._o.bound) {
removeEvent(this._o.trigger, 'click', this._onInputClick);
removeEvent(this._o.trigger, 'focus', this._onInputFocus);
removeEvent(this._o.trigger, 'blur', this._onInputBlur);
}
}
if (this.el.parentNode) {
this.el.parentNode.removeChild(this.el);
}
}
};
return Pikaday;
}));
},{"moment":"moment"}],"zeroclipboard":[function(require,module,exports){
/*!
* ZeroClipboard
* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
* Copyright (c) 2009-2014 Jon Rohan, James M. Greene
* Licensed MIT
* http://zeroclipboard.org/
* v2.2.0
*/
(function(window, undefined) {
"use strict";
/**
* Store references to critically important global functions that may be
* overridden on certain web pages.
*/
var _window = window, _document = _window.document, _navigator = _window.navigator, _setTimeout = _window.setTimeout, _clearTimeout = _window.clearTimeout, _setInterval = _window.setInterval, _clearInterval = _window.clearInterval, _getComputedStyle = _window.getComputedStyle, _encodeURIComponent = _window.encodeURIComponent, _ActiveXObject = _window.ActiveXObject, _Error = _window.Error, _parseInt = _window.Number.parseInt || _window.parseInt, _parseFloat = _window.Number.parseFloat || _window.parseFloat, _isNaN = _window.Number.isNaN || _window.isNaN, _now = _window.Date.now, _keys = _window.Object.keys, _defineProperty = _window.Object.defineProperty, _hasOwn = _window.Object.prototype.hasOwnProperty, _slice = _window.Array.prototype.slice, _unwrap = function() {
var unwrapper = function(el) {
return el;
};
if (typeof _window.wrap === "function" && typeof _window.unwrap === "function") {
try {
var div = _document.createElement("div");
var unwrappedDiv = _window.unwrap(div);
if (div.nodeType === 1 && unwrappedDiv && unwrappedDiv.nodeType === 1) {
unwrapper = _window.unwrap;
}
} catch (e) {}
}
return unwrapper;
}();
/**
* Convert an `arguments` object into an Array.
*
* @returns The arguments as an Array
* @private
*/
var _args = function(argumentsObj) {
return _slice.call(argumentsObj, 0);
};
/**
* Shallow-copy the owned, enumerable properties of one object over to another, similar to jQuery's `$.extend`.
*
* @returns The target object, augmented
* @private
*/
var _extend = function() {
var i, len, arg, prop, src, copy, args = _args(arguments), target = args[0] || {};
for (i = 1, len = args.length; i < len; i++) {
if ((arg = args[i]) != null) {
for (prop in arg) {
if (_hasOwn.call(arg, prop)) {
src = target[prop];
copy = arg[prop];
if (target !== copy && copy !== undefined) {
target[prop] = copy;
}
}
}
}
}
return target;
};
/**
* Return a deep copy of the source object or array.
*
* @returns Object or Array
* @private
*/
var _deepCopy = function(source) {
var copy, i, len, prop;
if (typeof source !== "object" || source == null || typeof source.nodeType === "number") {
copy = source;
} else if (typeof source.length === "number") {
copy = [];
for (i = 0, len = source.length; i < len; i++) {
if (_hasOwn.call(source, i)) {
copy[i] = _deepCopy(source[i]);
}
}
} else {
copy = {};
for (prop in source) {
if (_hasOwn.call(source, prop)) {
copy[prop] = _deepCopy(source[prop]);
}
}
}
return copy;
};
/**
* Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to keep.
* The inverse of `_omit`, mostly. The big difference is that these properties do NOT need to be enumerable to
* be kept.
*
* @returns A new filtered object.
* @private
*/
var _pick = function(obj, keys) {
var newObj = {};
for (var i = 0, len = keys.length; i < len; i++) {
if (keys[i] in obj) {
newObj[keys[i]] = obj[keys[i]];
}
}
return newObj;
};
/**
* Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to omit.
* The inverse of `_pick`.
*
* @returns A new filtered object.
* @private
*/
var _omit = function(obj, keys) {
var newObj = {};
for (var prop in obj) {
if (keys.indexOf(prop) === -1) {
newObj[prop] = obj[prop];
}
}
return newObj;
};
/**
* Remove all owned, enumerable properties from an object.
*
* @returns The original object without its owned, enumerable properties.
* @private
*/
var _deleteOwnProperties = function(obj) {
if (obj) {
for (var prop in obj) {
if (_hasOwn.call(obj, prop)) {
delete obj[prop];
}
}
}
return obj;
};
/**
* Determine if an element is contained within another element.
*
* @returns Boolean
* @private
*/
var _containedBy = function(el, ancestorEl) {
if (el && el.nodeType === 1 && el.ownerDocument && ancestorEl && (ancestorEl.nodeType === 1 && ancestorEl.ownerDocument && ancestorEl.ownerDocument === el.ownerDocument || ancestorEl.nodeType === 9 && !ancestorEl.ownerDocument && ancestorEl === el.ownerDocument)) {
do {
if (el === ancestorEl) {
return true;
}
el = el.parentNode;
} while (el);
}
return false;
};
/**
* Get the URL path's parent directory.
*
* @returns String or `undefined`
* @private
*/
var _getDirPathOfUrl = function(url) {
var dir;
if (typeof url === "string" && url) {
dir = url.split("#")[0].split("?")[0];
dir = url.slice(0, url.lastIndexOf("/") + 1);
}
return dir;
};
/**
* Get the current script's URL by throwing an `Error` and analyzing it.
*
* @returns String or `undefined`
* @private
*/
var _getCurrentScriptUrlFromErrorStack = function(stack) {
var url, matches;
if (typeof stack === "string" && stack) {
matches = stack.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/);
if (matches && matches[1]) {
url = matches[1];
} else {
matches = stack.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/);
if (matches && matches[1]) {
url = matches[1];
}
}
}
return url;
};
/**
* Get the current script's URL by throwing an `Error` and analyzing it.
*
* @returns String or `undefined`
* @private
*/
var _getCurrentScriptUrlFromError = function() {
var url, err;
try {
throw new _Error();
} catch (e) {
err = e;
}
if (err) {
url = err.sourceURL || err.fileName || _getCurrentScriptUrlFromErrorStack(err.stack);
}
return url;
};
/**
* Get the current script's URL.
*
* @returns String or `undefined`
* @private
*/
var _getCurrentScriptUrl = function() {
var jsPath, scripts, i;
if (_document.currentScript && (jsPath = _document.currentScript.src)) {
return jsPath;
}
scripts = _document.getElementsByTagName("script");
if (scripts.length === 1) {
return scripts[0].src || undefined;
}
if ("readyState" in scripts[0]) {
for (i = scripts.length; i--; ) {
if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) {
return jsPath;
}
}
}
if (_document.readyState === "loading" && (jsPath = scripts[scripts.length - 1].src)) {
return jsPath;
}
if (jsPath = _getCurrentScriptUrlFromError()) {
return jsPath;
}
return undefined;
};
/**
* Get the unanimous parent directory of ALL script tags.
* If any script tags are either (a) inline or (b) from differing parent
* directories, this method must return `undefined`.
*
* @returns String or `undefined`
* @private
*/
var _getUnanimousScriptParentDir = function() {
var i, jsDir, jsPath, scripts = _document.getElementsByTagName("script");
for (i = scripts.length; i--; ) {
if (!(jsPath = scripts[i].src)) {
jsDir = null;
break;
}
jsPath = _getDirPathOfUrl(jsPath);
if (jsDir == null) {
jsDir = jsPath;
} else if (jsDir !== jsPath) {
jsDir = null;
break;
}
}
return jsDir || undefined;
};
/**
* Get the presumed location of the "ZeroClipboard.swf" file, based on the location
* of the executing JavaScript file (e.g. "ZeroClipboard.js", etc.).
*
* @returns String
* @private
*/
var _getDefaultSwfPath = function() {
var jsDir = _getDirPathOfUrl(_getCurrentScriptUrl()) || _getUnanimousScriptParentDir() || "";
return jsDir + "ZeroClipboard.swf";
};
/**
* Keep track of if the page is framed (in an `iframe`). This can never change.
* @private
*/
var _pageIsFramed = function() {
return window.opener == null && (!!window.top && window != window.top || !!window.parent && window != window.parent);
}();
/**
* Keep track of the state of the Flash object.
* @private
*/
var _flashState = {
bridge: null,
version: "0.0.0",
pluginType: "unknown",
disabled: null,
outdated: null,
sandboxed: null,
unavailable: null,
degraded: null,
deactivated: null,
overdue: null,
ready: null
};
/**
* The minimum Flash Player version required to use ZeroClipboard completely.
* @readonly
* @private
*/
var _minimumFlashVersion = "11.0.0";
/**
* The ZeroClipboard library version number, as reported by Flash, at the time the SWF was compiled.
*/
var _zcSwfVersion;
/**
* Keep track of all event listener registrations.
* @private
*/
var _handlers = {};
/**
* Keep track of the currently activated element.
* @private
*/
var _currentElement;
/**
* Keep track of the element that was activated when a `copy` process started.
* @private
*/
var _copyTarget;
/**
* Keep track of data for the pending clipboard transaction.
* @private
*/
var _clipData = {};
/**
* Keep track of data formats for the pending clipboard transaction.
* @private
*/
var _clipDataFormatMap = null;
/**
* Keep track of the Flash availability check timeout.
* @private
*/
var _flashCheckTimeout = 0;
/**
* Keep track of SWF network errors interval polling.
* @private
*/
var _swfFallbackCheckInterval = 0;
/**
* The `message` store for events
* @private
*/
var _eventMessages = {
ready: "Flash communication is established",
error: {
"flash-disabled": "Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.",
"flash-outdated": "Flash is too outdated to support ZeroClipboard",
"flash-sandboxed": "Attempting to run Flash in a sandboxed iframe, which is impossible",
"flash-unavailable": "Flash is unable to communicate bidirectionally with JavaScript",
"flash-degraded": "Flash is unable to preserve data fidelity when communicating with JavaScript",
"flash-deactivated": "Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.",
"flash-overdue": "Flash communication was established but NOT within the acceptable time limit",
"version-mismatch": "ZeroClipboard JS version number does not match ZeroClipboard SWF version number",
"clipboard-error": "At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard",
"config-mismatch": "ZeroClipboard configuration does not match Flash's reality",
"swf-not-found": "The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity"
}
};
/**
* The `name`s of `error` events that can only occur is Flash has at least
* been able to load the SWF successfully.
* @private
*/
var _errorsThatOnlyOccurAfterFlashLoads = [ "flash-unavailable", "flash-degraded", "flash-overdue", "version-mismatch", "config-mismatch", "clipboard-error" ];
/**
* The `name`s of `error` events that should likely result in the `_flashState`
* variable's property values being updated.
* @private
*/
var _flashStateErrorNames = [ "flash-disabled", "flash-outdated", "flash-sandboxed", "flash-unavailable", "flash-degraded", "flash-deactivated", "flash-overdue" ];
/**
* A RegExp to match the `name` property of `error` events related to Flash.
* @private
*/
var _flashStateErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.map(function(errorName) {
return errorName.replace(/^flash-/, "");
}).join("|") + ")$");
/**
* A RegExp to match the `name` property of `error` events related to Flash,
* which is enabled.
* @private
*/
var _flashStateEnabledErrorNameMatchingRegex = new RegExp("^flash-(" + _flashStateErrorNames.slice(1).map(function(errorName) {
return errorName.replace(/^flash-/, "");
}).join("|") + ")$");
/**
* ZeroClipboard configuration defaults for the Core module.
* @private
*/
var _globalConfig = {
swfPath: _getDefaultSwfPath(),
trustedDomains: window.location.host ? [ window.location.host ] : [],
cacheBust: true,
forceEnhancedClipboard: false,
flashLoadTimeout: 3e4,
autoActivate: true,
bubbleEvents: true,
containerId: "global-zeroclipboard-html-bridge",
containerClass: "global-zeroclipboard-container",
swfObjectId: "global-zeroclipboard-flash-bridge",
hoverClass: "zeroclipboard-is-hover",
activeClass: "zeroclipboard-is-active",
forceHandCursor: false,
title: null,
zIndex: 999999999
};
/**
* The underlying implementation of `ZeroClipboard.config`.
* @private
*/
var _config = function(options) {
if (typeof options === "object" && options !== null) {
for (var prop in options) {
if (_hasOwn.call(options, prop)) {
if (/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(prop)) {
_globalConfig[prop] = options[prop];
} else if (_flashState.bridge == null) {
if (prop === "containerId" || prop === "swfObjectId") {
if (_isValidHtml4Id(options[prop])) {
_globalConfig[prop] = options[prop];
} else {
throw new Error("The specified `" + prop + "` value is not valid as an HTML4 Element ID");
}
} else {
_globalConfig[prop] = options[prop];
}
}
}
}
}
if (typeof options === "string" && options) {
if (_hasOwn.call(_globalConfig, options)) {
return _globalConfig[options];
}
return;
}
return _deepCopy(_globalConfig);
};
/**
* The underlying implementation of `ZeroClipboard.state`.
* @private
*/
var _state = function() {
_detectSandbox();
return {
browser: _pick(_navigator, [ "userAgent", "platform", "appName" ]),
flash: _omit(_flashState, [ "bridge" ]),
zeroclipboard: {
version: ZeroClipboard.version,
config: ZeroClipboard.config()
}
};
};
/**
* The underlying implementation of `ZeroClipboard.isFlashUnusable`.
* @private
*/
var _isFlashUnusable = function() {
return !!(_flashState.disabled || _flashState.outdated || _flashState.sandboxed || _flashState.unavailable || _flashState.degraded || _flashState.deactivated);
};
/**
* The underlying implementation of `ZeroClipboard.on`.
* @private
*/
var _on = function(eventType, listener) {
var i, len, events, added = {};
if (typeof eventType === "string" && eventType) {
events = eventType.toLowerCase().split(/\s+/);
} else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
for (i in eventType) {
if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
ZeroClipboard.on(i, eventType[i]);
}
}
}
if (events && events.length) {
for (i = 0, len = events.length; i < len; i++) {
eventType = events[i].replace(/^on/, "");
added[eventType] = true;
if (!_handlers[eventType]) {
_handlers[eventType] = [];
}
_handlers[eventType].push(listener);
}
if (added.ready && _flashState.ready) {
ZeroClipboard.emit({
type: "ready"
});
}
if (added.error) {
for (i = 0, len = _flashStateErrorNames.length; i < len; i++) {
if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, "")] === true) {
ZeroClipboard.emit({
type: "error",
name: _flashStateErrorNames[i]
});
break;
}
}
if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) {
ZeroClipboard.emit({
type: "error",
name: "version-mismatch",
jsVersion: ZeroClipboard.version,
swfVersion: _zcSwfVersion
});
}
}
}
return ZeroClipboard;
};
/**
* The underlying implementation of `ZeroClipboard.off`.
* @private
*/
var _off = function(eventType, listener) {
var i, len, foundIndex, events, perEventHandlers;
if (arguments.length === 0) {
events = _keys(_handlers);
} else if (typeof eventType === "string" && eventType) {
events = eventType.split(/\s+/);
} else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
for (i in eventType) {
if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
ZeroClipboard.off(i, eventType[i]);
}
}
}
if (events && events.length) {
for (i = 0, len = events.length; i < len; i++) {
eventType = events[i].toLowerCase().replace(/^on/, "");
perEventHandlers = _handlers[eventType];
if (perEventHandlers && perEventHandlers.length) {
if (listener) {
foundIndex = perEventHandlers.indexOf(listener);
while (foundIndex !== -1) {
perEventHandlers.splice(foundIndex, 1);
foundIndex = perEventHandlers.indexOf(listener, foundIndex);
}
} else {
perEventHandlers.length = 0;
}
}
}
}
return ZeroClipboard;
};
/**
* The underlying implementation of `ZeroClipboard.handlers`.
* @private
*/
var _listeners = function(eventType) {
var copy;
if (typeof eventType === "string" && eventType) {
copy = _deepCopy(_handlers[eventType]) || null;
} else {
copy = _deepCopy(_handlers);
}
return copy;
};
/**
* The underlying implementation of `ZeroClipboard.emit`.
* @private
*/
var _emit = function(event) {
var eventCopy, returnVal, tmp;
event = _createEvent(event);
if (!event) {
return;
}
if (_preprocessEvent(event)) {
return;
}
if (event.type === "ready" && _flashState.overdue === true) {
return ZeroClipboard.emit({
type: "error",
name: "flash-overdue"
});
}
eventCopy = _extend({}, event);
_dispatchCallbacks.call(this, eventCopy);
if (event.type === "copy") {
tmp = _mapClipDataToFlash(_clipData);
returnVal = tmp.data;
_clipDataFormatMap = tmp.formatMap;
}
return returnVal;
};
/**
* The underlying implementation of `ZeroClipboard.create`.
* @private
*/
var _create = function() {
var previousState = _flashState.sandboxed;
_detectSandbox();
if (typeof _flashState.ready !== "boolean") {
_flashState.ready = false;
}
if (_flashState.sandboxed !== previousState && _flashState.sandboxed === true) {
_flashState.ready = false;
ZeroClipboard.emit({
type: "error",
name: "flash-sandboxed"
});
} else if (!ZeroClipboard.isFlashUnusable() && _flashState.bridge === null) {
var maxWait = _globalConfig.flashLoadTimeout;
if (typeof maxWait === "number" && maxWait >= 0) {
_flashCheckTimeout = _setTimeout(function() {
if (typeof _flashState.deactivated !== "boolean") {
_flashState.deactivated = true;
}
if (_flashState.deactivated === true) {
ZeroClipboard.emit({
type: "error",
name: "flash-deactivated"
});
}
}, maxWait);
}
_flashState.overdue = false;
_embedSwf();
}
};
/**
* The underlying implementation of `ZeroClipboard.destroy`.
* @private
*/
var _destroy = function() {
ZeroClipboard.clearData();
ZeroClipboard.blur();
ZeroClipboard.emit("destroy");
_unembedSwf();
ZeroClipboard.off();
};
/**
* The underlying implementation of `ZeroClipboard.setData`.
* @private
*/
var _setData = function(format, data) {
var dataObj;
if (typeof format === "object" && format && typeof data === "undefined") {
dataObj = format;
ZeroClipboard.clearData();
} else if (typeof format === "string" && format) {
dataObj = {};
dataObj[format] = data;
} else {
return;
}
for (var dataFormat in dataObj) {
if (typeof dataFormat === "string" && dataFormat && _hasOwn.call(dataObj, dataFormat) && typeof dataObj[dataFormat] === "string" && dataObj[dataFormat]) {
_clipData[dataFormat] = dataObj[dataFormat];
}
}
};
/**
* The underlying implementation of `ZeroClipboard.clearData`.
* @private
*/
var _clearData = function(format) {
if (typeof format === "undefined") {
_deleteOwnProperties(_clipData);
_clipDataFormatMap = null;
} else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
delete _clipData[format];
}
};
/**
* The underlying implementation of `ZeroClipboard.getData`.
* @private
*/
var _getData = function(format) {
if (typeof format === "undefined") {
return _deepCopy(_clipData);
} else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
return _clipData[format];
}
};
/**
* The underlying implementation of `ZeroClipboard.focus`/`ZeroClipboard.activate`.
* @private
*/
var _focus = function(element) {
if (!(element && element.nodeType === 1)) {
return;
}
if (_currentElement) {
_removeClass(_currentElement, _globalConfig.activeClass);
if (_currentElement !== element) {
_removeClass(_currentElement, _globalConfig.hoverClass);
}
}
_currentElement = element;
_addClass(element, _globalConfig.hoverClass);
var newTitle = element.getAttribute("title") || _globalConfig.title;
if (typeof newTitle === "string" && newTitle) {
var htmlBridge = _getHtmlBridge(_flashState.bridge);
if (htmlBridge) {
htmlBridge.setAttribute("title", newTitle);
}
}
var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer";
_setHandCursor(useHandCursor);
_reposition();
};
/**
* The underlying implementation of `ZeroClipboard.blur`/`ZeroClipboard.deactivate`.
* @private
*/
var _blur = function() {
var htmlBridge = _getHtmlBridge(_flashState.bridge);
if (htmlBridge) {
htmlBridge.removeAttribute("title");
htmlBridge.style.left = "0px";
htmlBridge.style.top = "-9999px";
htmlBridge.style.width = "1px";
htmlBridge.style.height = "1px";
}
if (_currentElement) {
_removeClass(_currentElement, _globalConfig.hoverClass);
_removeClass(_currentElement, _globalConfig.activeClass);
_currentElement = null;
}
};
/**
* The underlying implementation of `ZeroClipboard.activeElement`.
* @private
*/
var _activeElement = function() {
return _currentElement || null;
};
/**
* Check if a value is a valid HTML4 `ID` or `Name` token.
* @private
*/
var _isValidHtml4Id = function(id) {
return typeof id === "string" && id && /^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(id);
};
/**
* Create or update an `event` object, based on the `eventType`.
* @private
*/
var _createEvent = function(event) {
var eventType;
if (typeof event === "string" && event) {
eventType = event;
event = {};
} else if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
eventType = event.type;
}
if (!eventType) {
return;
}
eventType = eventType.toLowerCase();
if (!event.target && (/^(copy|aftercopy|_click)$/.test(eventType) || eventType === "error" && event.name === "clipboard-error")) {
event.target = _copyTarget;
}
_extend(event, {
type: eventType,
target: event.target || _currentElement || null,
relatedTarget: event.relatedTarget || null,
currentTarget: _flashState && _flashState.bridge || null,
timeStamp: event.timeStamp || _now() || null
});
var msg = _eventMessages[event.type];
if (event.type === "error" && event.name && msg) {
msg = msg[event.name];
}
if (msg) {
event.message = msg;
}
if (event.type === "ready") {
_extend(event, {
target: null,
version: _flashState.version
});
}
if (event.type === "error") {
if (_flashStateErrorNameMatchingRegex.test(event.name)) {
_extend(event, {
target: null,
minimumVersion: _minimumFlashVersion
});
}
if (_flashStateEnabledErrorNameMatchingRegex.test(event.name)) {
_extend(event, {
version: _flashState.version
});
}
}
if (event.type === "copy") {
event.clipboardData = {
setData: ZeroClipboard.setData,
clearData: ZeroClipboard.clearData
};
}
if (event.type === "aftercopy") {
event = _mapClipResultsFromFlash(event, _clipDataFormatMap);
}
if (event.target && !event.relatedTarget) {
event.relatedTarget = _getRelatedTarget(event.target);
}
return _addMouseData(event);
};
/**
* Get a relatedTarget from the target's `data-clipboard-target` attribute
* @private
*/
var _getRelatedTarget = function(targetEl) {
var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute("data-clipboard-target");
return relatedTargetId ? _document.getElementById(relatedTargetId) : null;
};
/**
* Add element and position data to `MouseEvent` instances
* @private
*/
var _addMouseData = function(event) {
if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
var srcElement = event.target;
var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined;
var toElement = event.type === "_mouseout" && event.relatedTarget ? event.relatedTarget : undefined;
var pos = _getElementPosition(srcElement);
var screenLeft = _window.screenLeft || _window.screenX || 0;
var screenTop = _window.screenTop || _window.screenY || 0;
var scrollLeft = _document.body.scrollLeft + _document.documentElement.scrollLeft;
var scrollTop = _document.body.scrollTop + _document.documentElement.scrollTop;
var pageX = pos.left + (typeof event._stageX === "number" ? event._stageX : 0);
var pageY = pos.top + (typeof event._stageY === "number" ? event._stageY : 0);
var clientX = pageX - scrollLeft;
var clientY = pageY - scrollTop;
var screenX = screenLeft + clientX;
var screenY = screenTop + clientY;
var moveX = typeof event.movementX === "number" ? event.movementX : 0;
var moveY = typeof event.movementY === "number" ? event.movementY : 0;
delete event._stageX;
delete event._stageY;
_extend(event, {
srcElement: srcElement,
fromElement: fromElement,
toElement: toElement,
screenX: screenX,
screenY: screenY,
pageX: pageX,
pageY: pageY,
clientX: clientX,
clientY: clientY,
x: clientX,
y: clientY,
movementX: moveX,
movementY: moveY,
offsetX: 0,
offsetY: 0,
layerX: 0,
layerY: 0
});
}
return event;
};
/**
* Determine if an event's registered handlers should be execute synchronously or asynchronously.
*
* @returns {boolean}
* @private
*/
var _shouldPerformAsync = function(event) {
var eventType = event && typeof event.type === "string" && event.type || "";
return !/^(?:(?:before)?copy|destroy)$/.test(eventType);
};
/**
* Control if a callback should be executed asynchronously or not.
*
* @returns `undefined`
* @private
*/
var _dispatchCallback = function(func, context, args, async) {
if (async) {
_setTimeout(function() {
func.apply(context, args);
}, 0);
} else {
func.apply(context, args);
}
};
/**
* Handle the actual dispatching of events to client instances.
*
* @returns `undefined`
* @private
*/
var _dispatchCallbacks = function(event) {
if (!(typeof event === "object" && event && event.type)) {
return;
}
var async = _shouldPerformAsync(event);
var wildcardTypeHandlers = _handlers["*"] || [];
var specificTypeHandlers = _handlers[event.type] || [];
var handlers = wildcardTypeHandlers.concat(specificTypeHandlers);
if (handlers && handlers.length) {
var i, len, func, context, eventCopy, originalContext = this;
for (i = 0, len = handlers.length; i < len; i++) {
func = handlers[i];
context = originalContext;
if (typeof func === "string" && typeof _window[func] === "function") {
func = _window[func];
}
if (typeof func === "object" && func && typeof func.handleEvent === "function") {
context = func;
func = func.handleEvent;
}
if (typeof func === "function") {
eventCopy = _extend({}, event);
_dispatchCallback(func, context, [ eventCopy ], async);
}
}
}
return this;
};
/**
* Check an `error` event's `name` property to see if Flash has
* already loaded, which rules out possible `iframe` sandboxing.
* @private
*/
var _getSandboxStatusFromErrorEvent = function(event) {
var isSandboxed = null;
if (_pageIsFramed === false || event && event.type === "error" && event.name && _errorsThatOnlyOccurAfterFlashLoads.indexOf(event.name) !== -1) {
isSandboxed = false;
}
return isSandboxed;
};
/**
* Preprocess any special behaviors, reactions, or state changes after receiving this event.
* Executes only once per event emitted, NOT once per client.
* @private
*/
var _preprocessEvent = function(event) {
var element = event.target || _currentElement || null;
var sourceIsSwf = event._source === "swf";
delete event._source;
switch (event.type) {
case "error":
var isSandboxed = event.name === "flash-sandboxed" || _getSandboxStatusFromErrorEvent(event);
if (typeof isSandboxed === "boolean") {
_flashState.sandboxed = isSandboxed;
}
if (_flashStateErrorNames.indexOf(event.name) !== -1) {
_extend(_flashState, {
disabled: event.name === "flash-disabled",
outdated: event.name === "flash-outdated",
unavailable: event.name === "flash-unavailable",
degraded: event.name === "flash-degraded",
deactivated: event.name === "flash-deactivated",
overdue: event.name === "flash-overdue",
ready: false
});
} else if (event.name === "version-mismatch") {
_zcSwfVersion = event.swfVersion;
_extend(_flashState, {
disabled: false,
outdated: false,
unavailable: false,
degraded: false,
deactivated: false,
overdue: false,
ready: false
});
}
_clearTimeoutsAndPolling();
break;
case "ready":
_zcSwfVersion = event.swfVersion;
var wasDeactivated = _flashState.deactivated === true;
_extend(_flashState, {
disabled: false,
outdated: false,
sandboxed: false,
unavailable: false,
degraded: false,
deactivated: false,
overdue: wasDeactivated,
ready: !wasDeactivated
});
_clearTimeoutsAndPolling();
break;
case "beforecopy":
_copyTarget = element;
break;
case "copy":
var textContent, htmlContent, targetEl = event.relatedTarget;
if (!(_clipData["text/html"] || _clipData["text/plain"]) && targetEl && (htmlContent = targetEl.value || targetEl.outerHTML || targetEl.innerHTML) && (textContent = targetEl.value || targetEl.textContent || targetEl.innerText)) {
event.clipboardData.clearData();
event.clipboardData.setData("text/plain", textContent);
if (htmlContent !== textContent) {
event.clipboardData.setData("text/html", htmlContent);
}
} else if (!_clipData["text/plain"] && event.target && (textContent = event.target.getAttribute("data-clipboard-text"))) {
event.clipboardData.clearData();
event.clipboardData.setData("text/plain", textContent);
}
break;
case "aftercopy":
_queueEmitClipboardErrors(event);
ZeroClipboard.clearData();
if (element && element !== _safeActiveElement() && element.focus) {
element.focus();
}
break;
case "_mouseover":
ZeroClipboard.focus(element);
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {
_fireMouseEvent(_extend({}, event, {
type: "mouseenter",
bubbles: false,
cancelable: false
}));
}
_fireMouseEvent(_extend({}, event, {
type: "mouseover"
}));
}
break;
case "_mouseout":
ZeroClipboard.blur();
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {
_fireMouseEvent(_extend({}, event, {
type: "mouseleave",
bubbles: false,
cancelable: false
}));
}
_fireMouseEvent(_extend({}, event, {
type: "mouseout"
}));
}
break;
case "_mousedown":
_addClass(element, _globalConfig.activeClass);
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: event.type.slice(1)
}));
}
break;
case "_mouseup":
_removeClass(element, _globalConfig.activeClass);
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: event.type.slice(1)
}));
}
break;
case "_click":
_copyTarget = null;
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: event.type.slice(1)
}));
}
break;
case "_mousemove":
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: event.type.slice(1)
}));
}
break;
}
if (/^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
return true;
}
};
/**
* Check an "aftercopy" event for clipboard errors and emit a corresponding "error" event.
* @private
*/
var _queueEmitClipboardErrors = function(aftercopyEvent) {
if (aftercopyEvent.errors && aftercopyEvent.errors.length > 0) {
var errorEvent = _deepCopy(aftercopyEvent);
_extend(errorEvent, {
type: "error",
name: "clipboard-error"
});
delete errorEvent.success;
_setTimeout(function() {
ZeroClipboard.emit(errorEvent);
}, 0);
}
};
/**
* Dispatch a synthetic MouseEvent.
*
* @returns `undefined`
* @private
*/
var _fireMouseEvent = function(event) {
if (!(event && typeof event.type === "string" && event)) {
return;
}
var e, target = event.target || null, doc = target && target.ownerDocument || _document, defaults = {
view: doc.defaultView || _window,
canBubble: true,
cancelable: true,
detail: event.type === "click" ? 1 : 0,
button: typeof event.which === "number" ? event.which - 1 : typeof event.button === "number" ? event.button : doc.createEvent ? 0 : 1
}, args = _extend(defaults, event);
if (!target) {
return;
}
if (doc.createEvent && target.dispatchEvent) {
args = [ args.type, args.canBubble, args.cancelable, args.view, args.detail, args.screenX, args.screenY, args.clientX, args.clientY, args.ctrlKey, args.altKey, args.shiftKey, args.metaKey, args.button, args.relatedTarget ];
e = doc.createEvent("MouseEvents");
if (e.initMouseEvent) {
e.initMouseEvent.apply(e, args);
e._source = "js";
target.dispatchEvent(e);
}
}
};
/**
* Continuously poll the DOM until either:
* (a) the fallback content becomes visible, or
* (b) we receive an event from SWF (handled elsewhere)
*
* IMPORTANT:
* This is NOT a necessary check but it can result in significantly faster
* detection of bad `swfPath` configuration and/or network/server issues [in
* supported browsers] than waiting for the entire `flashLoadTimeout` duration
* to elapse before detecting that the SWF cannot be loaded. The detection
* duration can be anywhere from 10-30 times faster [in supported browsers] by
* using this approach.
*
* @returns `undefined`
* @private
*/
var _watchForSwfFallbackContent = function() {
var maxWait = _globalConfig.flashLoadTimeout;
if (typeof maxWait === "number" && maxWait >= 0) {
var pollWait = Math.min(1e3, maxWait / 10);
var fallbackContentId = _globalConfig.swfObjectId + "_fallbackContent";
_swfFallbackCheckInterval = _setInterval(function() {
var el = _document.getElementById(fallbackContentId);
if (_isElementVisible(el)) {
_clearTimeoutsAndPolling();
_flashState.deactivated = null;
ZeroClipboard.emit({
type: "error",
name: "swf-not-found"
});
}
}, pollWait);
}
};
/**
* Create the HTML bridge element to embed the Flash object into.
* @private
*/
var _createHtmlBridge = function() {
var container = _document.createElement("div");
container.id = _globalConfig.containerId;
container.className = _globalConfig.containerClass;
container.style.position = "absolute";
container.style.left = "0px";
container.style.top = "-9999px";
container.style.width = "1px";
container.style.height = "1px";
container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex);
return container;
};
/**
* Get the HTML element container that wraps the Flash bridge object/element.
* @private
*/
var _getHtmlBridge = function(flashBridge) {
var htmlBridge = flashBridge && flashBridge.parentNode;
while (htmlBridge && htmlBridge.nodeName === "OBJECT" && htmlBridge.parentNode) {
htmlBridge = htmlBridge.parentNode;
}
return htmlBridge || null;
};
/**
* Create the SWF object.
*
* @returns The SWF object reference.
* @private
*/
var _embedSwf = function() {
var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge);
if (!flashBridge) {
var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig);
var allowNetworking = allowScriptAccess === "never" ? "none" : "all";
var flashvars = _vars(_extend({
jsVersion: ZeroClipboard.version
}, _globalConfig));
var swfUrl = _globalConfig.swfPath + _cacheBust(_globalConfig.swfPath, _globalConfig);
container = _createHtmlBridge();
var divToBeReplaced = _document.createElement("div");
container.appendChild(divToBeReplaced);
_document.body.appendChild(container);
var tmpDiv = _document.createElement("div");
var usingActiveX = _flashState.pluginType === "activex";
tmpDiv.innerHTML = '<object id="' + _globalConfig.swfObjectId + '" name="' + _globalConfig.swfObjectId + '" ' + 'width="100%" height="100%" ' + (usingActiveX ? 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"' : 'type="application/x-shockwave-flash" data="' + swfUrl + '"') + ">" + (usingActiveX ? '<param name="movie" value="' + swfUrl + '"/>' : "") + '<param name="allowScriptAccess" value="' + allowScriptAccess + '"/>' + '<param name="allowNetworking" value="' + allowNetworking + '"/>' + '<param name="menu" value="false"/>' + '<param name="wmode" value="transparent"/>' + '<param name="flashvars" value="' + flashvars + '"/>' + '<div id="' + _globalConfig.swfObjectId + '_fallbackContent"> </div>' + "</object>";
flashBridge = tmpDiv.firstChild;
tmpDiv = null;
_unwrap(flashBridge).ZeroClipboard = ZeroClipboard;
container.replaceChild(flashBridge, divToBeReplaced);
_watchForSwfFallbackContent();
}
if (!flashBridge) {
flashBridge = _document[_globalConfig.swfObjectId];
if (flashBridge && (len = flashBridge.length)) {
flashBridge = flashBridge[len - 1];
}
if (!flashBridge && container) {
flashBridge = container.firstChild;
}
}
_flashState.bridge = flashBridge || null;
return flashBridge;
};
/**
* Destroy the SWF object.
* @private
*/
var _unembedSwf = function() {
var flashBridge = _flashState.bridge;
if (flashBridge) {
var htmlBridge = _getHtmlBridge(flashBridge);
if (htmlBridge) {
if (_flashState.pluginType === "activex" && "readyState" in flashBridge) {
flashBridge.style.display = "none";
(function removeSwfFromIE() {
if (flashBridge.readyState === 4) {
for (var prop in flashBridge) {
if (typeof flashBridge[prop] === "function") {
flashBridge[prop] = null;
}
}
if (flashBridge.parentNode) {
flashBridge.parentNode.removeChild(flashBridge);
}
if (htmlBridge.parentNode) {
htmlBridge.parentNode.removeChild(htmlBridge);
}
} else {
_setTimeout(removeSwfFromIE, 10);
}
})();
} else {
if (flashBridge.parentNode) {
flashBridge.parentNode.removeChild(flashBridge);
}
if (htmlBridge.parentNode) {
htmlBridge.parentNode.removeChild(htmlBridge);
}
}
}
_clearTimeoutsAndPolling();
_flashState.ready = null;
_flashState.bridge = null;
_flashState.deactivated = null;
_zcSwfVersion = undefined;
}
};
/**
* Map the data format names of the "clipData" to Flash-friendly names.
*
* @returns A new transformed object.
* @private
*/
var _mapClipDataToFlash = function(clipData) {
var newClipData = {}, formatMap = {};
if (!(typeof clipData === "object" && clipData)) {
return;
}
for (var dataFormat in clipData) {
if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === "string" && clipData[dataFormat]) {
switch (dataFormat.toLowerCase()) {
case "text/plain":
case "text":
case "air:text":
case "flash:text":
newClipData.text = clipData[dataFormat];
formatMap.text = dataFormat;
break;
case "text/html":
case "html":
case "air:html":
case "flash:html":
newClipData.html = clipData[dataFormat];
formatMap.html = dataFormat;
break;
case "application/rtf":
case "text/rtf":
case "rtf":
case "richtext":
case "air:rtf":
case "flash:rtf":
newClipData.rtf = clipData[dataFormat];
formatMap.rtf = dataFormat;
break;
default:
break;
}
}
}
return {
data: newClipData,
formatMap: formatMap
};
};
/**
* Map the data format names from Flash-friendly names back to their original "clipData" names (via a format mapping).
*
* @returns A new transformed object.
* @private
*/
var _mapClipResultsFromFlash = function(clipResults, formatMap) {
if (!(typeof clipResults === "object" && clipResults && typeof formatMap === "object" && formatMap)) {
return clipResults;
}
var newResults = {};
for (var prop in clipResults) {
if (_hasOwn.call(clipResults, prop)) {
if (prop === "errors") {
newResults[prop] = clipResults[prop] ? clipResults[prop].slice() : [];
for (var i = 0, len = newResults[prop].length; i < len; i++) {
newResults[prop][i].format = formatMap[newResults[prop][i].format];
}
} else if (prop !== "success" && prop !== "data") {
newResults[prop] = clipResults[prop];
} else {
newResults[prop] = {};
var tmpHash = clipResults[prop];
for (var dataFormat in tmpHash) {
if (dataFormat && _hasOwn.call(tmpHash, dataFormat) && _hasOwn.call(formatMap, dataFormat)) {
newResults[prop][formatMap[dataFormat]] = tmpHash[dataFormat];
}
}
}
}
}
return newResults;
};
/**
* Will look at a path, and will create a "?noCache={time}" or "&noCache={time}"
* query param string to return. Does NOT append that string to the original path.
* This is useful because ExternalInterface often breaks when a Flash SWF is cached.
*
* @returns The `noCache` query param with necessary "?"/"&" prefix.
* @private
*/
var _cacheBust = function(path, options) {
var cacheBust = options == null || options && options.cacheBust === true;
if (cacheBust) {
return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + _now();
} else {
return "";
}
};
/**
* Creates a query string for the FlashVars param.
* Does NOT include the cache-busting query param.
*
* @returns FlashVars query string
* @private
*/
var _vars = function(options) {
var i, len, domain, domains, str = "", trustedOriginsExpanded = [];
if (options.trustedDomains) {
if (typeof options.trustedDomains === "string") {
domains = [ options.trustedDomains ];
} else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
domains = options.trustedDomains;
}
}
if (domains && domains.length) {
for (i = 0, len = domains.length; i < len; i++) {
if (_hasOwn.call(domains, i) && domains[i] && typeof domains[i] === "string") {
domain = _extractDomain(domains[i]);
if (!domain) {
continue;
}
if (domain === "*") {
trustedOriginsExpanded.length = 0;
trustedOriginsExpanded.push(domain);
break;
}
trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, _window.location.protocol + "//" + domain ]);
}
}
}
if (trustedOriginsExpanded.length) {
str += "trustedOrigins=" + _encodeURIComponent(trustedOriginsExpanded.join(","));
}
if (options.forceEnhancedClipboard === true) {
str += (str ? "&" : "") + "forceEnhancedClipboard=true";
}
if (typeof options.swfObjectId === "string" && options.swfObjectId) {
str += (str ? "&" : "") + "swfObjectId=" + _encodeURIComponent(options.swfObjectId);
}
if (typeof options.jsVersion === "string" && options.jsVersion) {
str += (str ? "&" : "") + "jsVersion=" + _encodeURIComponent(options.jsVersion);
}
return str;
};
/**
* Extract the domain (e.g. "github.com") from an origin (e.g. "https://github.com") or
* URL (e.g. "https://github.com/zeroclipboard/zeroclipboard/").
*
* @returns the domain
* @private
*/
var _extractDomain = function(originOrUrl) {
if (originOrUrl == null || originOrUrl === "") {
return null;
}
originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, "");
if (originOrUrl === "") {
return null;
}
var protocolIndex = originOrUrl.indexOf("//");
originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2);
var pathIndex = originOrUrl.indexOf("/");
originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex);
if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") {
return null;
}
return originOrUrl || null;
};
/**
* Set `allowScriptAccess` based on `trustedDomains` and `window.location.host` vs. `swfPath`.
*
* @returns The appropriate script access level.
* @private
*/
var _determineScriptAccess = function() {
var _extractAllDomains = function(origins) {
var i, len, tmp, resultsArray = [];
if (typeof origins === "string") {
origins = [ origins ];
}
if (!(typeof origins === "object" && origins && typeof origins.length === "number")) {
return resultsArray;
}
for (i = 0, len = origins.length; i < len; i++) {
if (_hasOwn.call(origins, i) && (tmp = _extractDomain(origins[i]))) {
if (tmp === "*") {
resultsArray.length = 0;
resultsArray.push("*");
break;
}
if (resultsArray.indexOf(tmp) === -1) {
resultsArray.push(tmp);
}
}
}
return resultsArray;
};
return function(currentDomain, configOptions) {
var swfDomain = _extractDomain(configOptions.swfPath);
if (swfDomain === null) {
swfDomain = currentDomain;
}
var trustedDomains = _extractAllDomains(configOptions.trustedDomains);
var len = trustedDomains.length;
if (len > 0) {
if (len === 1 && trustedDomains[0] === "*") {
return "always";
}
if (trustedDomains.indexOf(currentDomain) !== -1) {
if (len === 1 && currentDomain === swfDomain) {
return "sameDomain";
}
return "always";
}
}
return "never";
};
}();
/**
* Get the currently active/focused DOM element.
*
* @returns the currently active/focused element, or `null`
* @private
*/
var _safeActiveElement = function() {
try {
return _document.activeElement;
} catch (err) {
return null;
}
};
/**
* Add a class to an element, if it doesn't already have it.
*
* @returns The element, with its new class added.
* @private
*/
var _addClass = function(element, value) {
var c, cl, className, classNames = [];
if (typeof value === "string" && value) {
classNames = value.split(/\s+/);
}
if (element && element.nodeType === 1 && classNames.length > 0) {
if (element.classList) {
for (c = 0, cl = classNames.length; c < cl; c++) {
element.classList.add(classNames[c]);
}
} else if (element.hasOwnProperty("className")) {
className = " " + element.className + " ";
for (c = 0, cl = classNames.length; c < cl; c++) {
if (className.indexOf(" " + classNames[c] + " ") === -1) {
className += classNames[c] + " ";
}
}
element.className = className.replace(/^\s+|\s+$/g, "");
}
}
return element;
};
/**
* Remove a class from an element, if it has it.
*
* @returns The element, with its class removed.
* @private
*/
var _removeClass = function(element, value) {
var c, cl, className, classNames = [];
if (typeof value === "string" && value) {
classNames = value.split(/\s+/);
}
if (element && element.nodeType === 1 && classNames.length > 0) {
if (element.classList && element.classList.length > 0) {
for (c = 0, cl = classNames.length; c < cl; c++) {
element.classList.remove(classNames[c]);
}
} else if (element.className) {
className = (" " + element.className + " ").replace(/[\r\n\t]/g, " ");
for (c = 0, cl = classNames.length; c < cl; c++) {
className = className.replace(" " + classNames[c] + " ", " ");
}
element.className = className.replace(/^\s+|\s+$/g, "");
}
}
return element;
};
/**
* Attempt to interpret the element's CSS styling. If `prop` is `"cursor"`,
* then we assume that it should be a hand ("pointer") cursor if the element
* is an anchor element ("a" tag).
*
* @returns The computed style property.
* @private
*/
var _getStyle = function(el, prop) {
var value = _getComputedStyle(el, null).getPropertyValue(prop);
if (prop === "cursor") {
if (!value || value === "auto") {
if (el.nodeName === "A") {
return "pointer";
}
}
}
return value;
};
/**
* Get the absolutely positioned coordinates of a DOM element.
*
* @returns Object containing the element's position, width, and height.
* @private
*/
var _getElementPosition = function(el) {
var pos = {
left: 0,
top: 0,
width: 0,
height: 0
};
if (el.getBoundingClientRect) {
var elRect = el.getBoundingClientRect();
var pageXOffset = _window.pageXOffset;
var pageYOffset = _window.pageYOffset;
var leftBorderWidth = _document.documentElement.clientLeft || 0;
var topBorderWidth = _document.documentElement.clientTop || 0;
var leftBodyOffset = 0;
var topBodyOffset = 0;
if (_getStyle(_document.body, "position") === "relative") {
var bodyRect = _document.body.getBoundingClientRect();
var htmlRect = _document.documentElement.getBoundingClientRect();
leftBodyOffset = bodyRect.left - htmlRect.left || 0;
topBodyOffset = bodyRect.top - htmlRect.top || 0;
}
pos.left = elRect.left + pageXOffset - leftBorderWidth - leftBodyOffset;
pos.top = elRect.top + pageYOffset - topBorderWidth - topBodyOffset;
pos.width = "width" in elRect ? elRect.width : elRect.right - elRect.left;
pos.height = "height" in elRect ? elRect.height : elRect.bottom - elRect.top;
}
return pos;
};
/**
* Determine is an element is visible somewhere within the document (page).
*
* @returns Boolean
* @private
*/
var _isElementVisible = function(el) {
if (!el) {
return false;
}
var styles = _getComputedStyle(el, null);
var hasCssHeight = _parseFloat(styles.height) > 0;
var hasCssWidth = _parseFloat(styles.width) > 0;
var hasCssTop = _parseFloat(styles.top) >= 0;
var hasCssLeft = _parseFloat(styles.left) >= 0;
var cssKnows = hasCssHeight && hasCssWidth && hasCssTop && hasCssLeft;
var rect = cssKnows ? null : _getElementPosition(el);
var isVisible = styles.display !== "none" && styles.visibility !== "collapse" && (cssKnows || !!rect && (hasCssHeight || rect.height > 0) && (hasCssWidth || rect.width > 0) && (hasCssTop || rect.top >= 0) && (hasCssLeft || rect.left >= 0));
return isVisible;
};
/**
* Clear all existing timeouts and interval polling delegates.
*
* @returns `undefined`
* @private
*/
var _clearTimeoutsAndPolling = function() {
_clearTimeout(_flashCheckTimeout);
_flashCheckTimeout = 0;
_clearInterval(_swfFallbackCheckInterval);
_swfFallbackCheckInterval = 0;
};
/**
* Reposition the Flash object to cover the currently activated element.
*
* @returns `undefined`
* @private
*/
var _reposition = function() {
var htmlBridge;
if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) {
var pos = _getElementPosition(_currentElement);
_extend(htmlBridge.style, {
width: pos.width + "px",
height: pos.height + "px",
top: pos.top + "px",
left: pos.left + "px",
zIndex: "" + _getSafeZIndex(_globalConfig.zIndex)
});
}
};
/**
* Sends a signal to the Flash object to display the hand cursor if `true`.
*
* @returns `undefined`
* @private
*/
var _setHandCursor = function(enabled) {
if (_flashState.ready === true) {
if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === "function") {
_flashState.bridge.setHandCursor(enabled);
} else {
_flashState.ready = false;
}
}
};
/**
* Get a safe value for `zIndex`
*
* @returns an integer, or "auto"
* @private
*/
var _getSafeZIndex = function(val) {
if (/^(?:auto|inherit)$/.test(val)) {
return val;
}
var zIndex;
if (typeof val === "number" && !_isNaN(val)) {
zIndex = val;
} else if (typeof val === "string") {
zIndex = _getSafeZIndex(_parseInt(val, 10));
}
return typeof zIndex === "number" ? zIndex : "auto";
};
/**
* Attempt to detect if ZeroClipboard is executing inside of a sandboxed iframe.
* If it is, Flash Player cannot be used, so ZeroClipboard is dead in the water.
*
* @see {@link http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Dec/0002.html}
* @see {@link https://github.com/zeroclipboard/zeroclipboard/issues/511}
* @see {@link http://zeroclipboard.org/test-iframes.html}
*
* @returns `true` (is sandboxed), `false` (is not sandboxed), or `null` (uncertain)
* @private
*/
var _detectSandbox = function(doNotReassessFlashSupport) {
var effectiveScriptOrigin, frame, frameError, previousState = _flashState.sandboxed, isSandboxed = null;
doNotReassessFlashSupport = doNotReassessFlashSupport === true;
if (_pageIsFramed === false) {
isSandboxed = false;
} else {
try {
frame = window.frameElement || null;
} catch (e) {
frameError = {
name: e.name,
message: e.message
};
}
if (frame && frame.nodeType === 1 && frame.nodeName === "IFRAME") {
try {
isSandboxed = frame.hasAttribute("sandbox");
} catch (e) {
isSandboxed = null;
}
} else {
try {
effectiveScriptOrigin = document.domain || null;
} catch (e) {
effectiveScriptOrigin = null;
}
if (effectiveScriptOrigin === null || frameError && frameError.name === "SecurityError" && /(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(frameError.message.toLowerCase())) {
isSandboxed = true;
}
}
}
_flashState.sandboxed = isSandboxed;
if (previousState !== isSandboxed && !doNotReassessFlashSupport) {
_detectFlashSupport(_ActiveXObject);
}
return isSandboxed;
};
/**
* Detect the Flash Player status, version, and plugin type.
*
* @see {@link https://code.google.com/p/doctype-mirror/wiki/ArticleDetectFlash#The_code}
* @see {@link http://stackoverflow.com/questions/12866060/detecting-pepper-ppapi-flash-with-javascript}
*
* @returns `undefined`
* @private
*/
var _detectFlashSupport = function(ActiveXObject) {
var plugin, ax, mimeType, hasFlash = false, isActiveX = false, isPPAPI = false, flashVersion = "";
/**
* Derived from Apple's suggested sniffer.
* @param {String} desc e.g. "Shockwave Flash 7.0 r61"
* @returns {String} "7.0.61"
* @private
*/
function parseFlashVersion(desc) {
var matches = desc.match(/[\d]+/g);
matches.length = 3;
return matches.join(".");
}
function isPepperFlash(flashPlayerFileName) {
return !!flashPlayerFileName && (flashPlayerFileName = flashPlayerFileName.toLowerCase()) && (/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(flashPlayerFileName) || flashPlayerFileName.slice(-13) === "chrome.plugin");
}
function inspectPlugin(plugin) {
if (plugin) {
hasFlash = true;
if (plugin.version) {
flashVersion = parseFlashVersion(plugin.version);
}
if (!flashVersion && plugin.description) {
flashVersion = parseFlashVersion(plugin.description);
}
if (plugin.filename) {
isPPAPI = isPepperFlash(plugin.filename);
}
}
}
if (_navigator.plugins && _navigator.plugins.length) {
plugin = _navigator.plugins["Shockwave Flash"];
inspectPlugin(plugin);
if (_navigator.plugins["Shockwave Flash 2.0"]) {
hasFlash = true;
flashVersion = "2.0.0.11";
}
} else if (_navigator.mimeTypes && _navigator.mimeTypes.length) {
mimeType = _navigator.mimeTypes["application/x-shockwave-flash"];
plugin = mimeType && mimeType.enabledPlugin;
inspectPlugin(plugin);
} else if (typeof ActiveXObject !== "undefined") {
isActiveX = true;
try {
ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
hasFlash = true;
flashVersion = parseFlashVersion(ax.GetVariable("$version"));
} catch (e1) {
try {
ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
hasFlash = true;
flashVersion = "6.0.21";
} catch (e2) {
try {
ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
hasFlash = true;
flashVersion = parseFlashVersion(ax.GetVariable("$version"));
} catch (e3) {
isActiveX = false;
}
}
}
}
_flashState.disabled = hasFlash !== true;
_flashState.outdated = flashVersion && _parseFloat(flashVersion) < _parseFloat(_minimumFlashVersion);
_flashState.version = flashVersion || "0.0.0";
_flashState.pluginType = isPPAPI ? "pepper" : isActiveX ? "activex" : hasFlash ? "netscape" : "unknown";
};
/**
* Invoke the Flash detection algorithms immediately upon inclusion so we're not waiting later.
*/
_detectFlashSupport(_ActiveXObject);
/**
* Always assess the `sandboxed` state of the page at important Flash-related moments.
*/
_detectSandbox(true);
/**
* A shell constructor for `ZeroClipboard` client instances.
*
* @constructor
*/
var ZeroClipboard = function() {
if (!(this instanceof ZeroClipboard)) {
return new ZeroClipboard();
}
if (typeof ZeroClipboard._createClient === "function") {
ZeroClipboard._createClient.apply(this, _args(arguments));
}
};
/**
* The ZeroClipboard library's version number.
*
* @static
* @readonly
* @property {string}
*/
_defineProperty(ZeroClipboard, "version", {
value: "2.2.0",
writable: false,
configurable: true,
enumerable: true
});
/**
* Update or get a copy of the ZeroClipboard global configuration.
* Returns a copy of the current/updated configuration.
*
* @returns Object
* @static
*/
ZeroClipboard.config = function() {
return _config.apply(this, _args(arguments));
};
/**
* Diagnostic method that describes the state of the browser, Flash Player, and ZeroClipboard.
*
* @returns Object
* @static
*/
ZeroClipboard.state = function() {
return _state.apply(this, _args(arguments));
};
/**
* Check if Flash is unusable for any reason: disabled, outdated, deactivated, etc.
*
* @returns Boolean
* @static
*/
ZeroClipboard.isFlashUnusable = function() {
return _isFlashUnusable.apply(this, _args(arguments));
};
/**
* Register an event listener.
*
* @returns `ZeroClipboard`
* @static
*/
ZeroClipboard.on = function() {
return _on.apply(this, _args(arguments));
};
/**
* Unregister an event listener.
* If no `listener` function/object is provided, it will unregister all listeners for the provided `eventType`.
* If no `eventType` is provided, it will unregister all listeners for every event type.
*
* @returns `ZeroClipboard`
* @static
*/
ZeroClipboard.off = function() {
return _off.apply(this, _args(arguments));
};
/**
* Retrieve event listeners for an `eventType`.
* If no `eventType` is provided, it will retrieve all listeners for every event type.
*
* @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null`
*/
ZeroClipboard.handlers = function() {
return _listeners.apply(this, _args(arguments));
};
/**
* Event emission receiver from the Flash object, forwarding to any registered JavaScript event listeners.
*
* @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`.
* @static
*/
ZeroClipboard.emit = function() {
return _emit.apply(this, _args(arguments));
};
/**
* Create and embed the Flash object.
*
* @returns The Flash object
* @static
*/
ZeroClipboard.create = function() {
return _create.apply(this, _args(arguments));
};
/**
* Self-destruct and clean up everything, including the embedded Flash object.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.destroy = function() {
return _destroy.apply(this, _args(arguments));
};
/**
* Set the pending data for clipboard injection.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.setData = function() {
return _setData.apply(this, _args(arguments));
};
/**
* Clear the pending data for clipboard injection.
* If no `format` is provided, all pending data formats will be cleared.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.clearData = function() {
return _clearData.apply(this, _args(arguments));
};
/**
* Get a copy of the pending data for clipboard injection.
* If no `format` is provided, a copy of ALL pending data formats will be returned.
*
* @returns `String` or `Object`
* @static
*/
ZeroClipboard.getData = function() {
return _getData.apply(this, _args(arguments));
};
/**
* Sets the current HTML object that the Flash object should overlay. This will put the global
* Flash object on top of the current element; depending on the setup, this may also set the
* pending clipboard text data as well as the Flash object's wrapping element's title attribute
* based on the underlying HTML element and ZeroClipboard configuration.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.focus = ZeroClipboard.activate = function() {
return _focus.apply(this, _args(arguments));
};
/**
* Un-overlays the Flash object. This will put the global Flash object off-screen; depending on
* the setup, this may also unset the Flash object's wrapping element's title attribute based on
* the underlying HTML element and ZeroClipboard configuration.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.blur = ZeroClipboard.deactivate = function() {
return _blur.apply(this, _args(arguments));
};
/**
* Returns the currently focused/"activated" HTML element that the Flash object is wrapping.
*
* @returns `HTMLElement` or `null`
* @static
*/
ZeroClipboard.activeElement = function() {
return _activeElement.apply(this, _args(arguments));
};
/**
* Keep track of the ZeroClipboard client instance counter.
*/
var _clientIdCounter = 0;
/**
* Keep track of the state of the client instances.
*
* Entry structure:
* _clientMeta[client.id] = {
* instance: client,
* elements: [],
* handlers: {}
* };
*/
var _clientMeta = {};
/**
* Keep track of the ZeroClipboard clipped elements counter.
*/
var _elementIdCounter = 0;
/**
* Keep track of the state of the clipped element relationships to clients.
*
* Entry structure:
* _elementMeta[element.zcClippingId] = [client1.id, client2.id];
*/
var _elementMeta = {};
/**
* Keep track of the state of the mouse event handlers for clipped elements.
*
* Entry structure:
* _mouseHandlers[element.zcClippingId] = {
* mouseover: function(event) {},
* mouseout: function(event) {},
* mouseenter: function(event) {},
* mouseleave: function(event) {},
* mousemove: function(event) {}
* };
*/
var _mouseHandlers = {};
/**
* Extending the ZeroClipboard configuration defaults for the Client module.
*/
_extend(_globalConfig, {
autoActivate: true
});
/**
* The real constructor for `ZeroClipboard` client instances.
* @private
*/
var _clientConstructor = function(elements) {
var client = this;
client.id = "" + _clientIdCounter++;
_clientMeta[client.id] = {
instance: client,
elements: [],
handlers: {}
};
if (elements) {
client.clip(elements);
}
ZeroClipboard.on("*", function(event) {
return client.emit(event);
});
ZeroClipboard.on("destroy", function() {
client.destroy();
});
ZeroClipboard.create();
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.on`.
* @private
*/
var _clientOn = function(eventType, listener) {
var i, len, events, added = {}, meta = _clientMeta[this.id], handlers = meta && meta.handlers;
if (!meta) {
throw new Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance");
}
if (typeof eventType === "string" && eventType) {
events = eventType.toLowerCase().split(/\s+/);
} else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
for (i in eventType) {
if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
this.on(i, eventType[i]);
}
}
}
if (events && events.length) {
for (i = 0, len = events.length; i < len; i++) {
eventType = events[i].replace(/^on/, "");
added[eventType] = true;
if (!handlers[eventType]) {
handlers[eventType] = [];
}
handlers[eventType].push(listener);
}
if (added.ready && _flashState.ready) {
this.emit({
type: "ready",
client: this
});
}
if (added.error) {
for (i = 0, len = _flashStateErrorNames.length; i < len; i++) {
if (_flashState[_flashStateErrorNames[i].replace(/^flash-/, "")]) {
this.emit({
type: "error",
name: _flashStateErrorNames[i],
client: this
});
break;
}
}
if (_zcSwfVersion !== undefined && ZeroClipboard.version !== _zcSwfVersion) {
this.emit({
type: "error",
name: "version-mismatch",
jsVersion: ZeroClipboard.version,
swfVersion: _zcSwfVersion
});
}
}
}
return this;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.off`.
* @private
*/
var _clientOff = function(eventType, listener) {
var i, len, foundIndex, events, perEventHandlers, meta = _clientMeta[this.id], handlers = meta && meta.handlers;
if (!handlers) {
return this;
}
if (arguments.length === 0) {
events = _keys(handlers);
} else if (typeof eventType === "string" && eventType) {
events = eventType.split(/\s+/);
} else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
for (i in eventType) {
if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
this.off(i, eventType[i]);
}
}
}
if (events && events.length) {
for (i = 0, len = events.length; i < len; i++) {
eventType = events[i].toLowerCase().replace(/^on/, "");
perEventHandlers = handlers[eventType];
if (perEventHandlers && perEventHandlers.length) {
if (listener) {
foundIndex = perEventHandlers.indexOf(listener);
while (foundIndex !== -1) {
perEventHandlers.splice(foundIndex, 1);
foundIndex = perEventHandlers.indexOf(listener, foundIndex);
}
} else {
perEventHandlers.length = 0;
}
}
}
}
return this;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.handlers`.
* @private
*/
var _clientListeners = function(eventType) {
var copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
if (handlers) {
if (typeof eventType === "string" && eventType) {
copy = handlers[eventType] ? handlers[eventType].slice(0) : [];
} else {
copy = _deepCopy(handlers);
}
}
return copy;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.emit`.
* @private
*/
var _clientEmit = function(event) {
if (_clientShouldEmit.call(this, event)) {
if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
event = _extend({}, event);
}
var eventCopy = _extend({}, _createEvent(event), {
client: this
});
_clientDispatchCallbacks.call(this, eventCopy);
}
return this;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.clip`.
* @private
*/
var _clientClip = function(elements) {
if (!_clientMeta[this.id]) {
throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");
}
elements = _prepClip(elements);
for (var i = 0; i < elements.length; i++) {
if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) {
if (!elements[i].zcClippingId) {
elements[i].zcClippingId = "zcClippingId_" + _elementIdCounter++;
_elementMeta[elements[i].zcClippingId] = [ this.id ];
if (_globalConfig.autoActivate === true) {
_addMouseHandlers(elements[i]);
}
} else if (_elementMeta[elements[i].zcClippingId].indexOf(this.id) === -1) {
_elementMeta[elements[i].zcClippingId].push(this.id);
}
var clippedElements = _clientMeta[this.id] && _clientMeta[this.id].elements;
if (clippedElements.indexOf(elements[i]) === -1) {
clippedElements.push(elements[i]);
}
}
}
return this;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.unclip`.
* @private
*/
var _clientUnclip = function(elements) {
var meta = _clientMeta[this.id];
if (!meta) {
return this;
}
var clippedElements = meta.elements;
var arrayIndex;
if (typeof elements === "undefined") {
elements = clippedElements.slice(0);
} else {
elements = _prepClip(elements);
}
for (var i = elements.length; i--; ) {
if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) {
arrayIndex = 0;
while ((arrayIndex = clippedElements.indexOf(elements[i], arrayIndex)) !== -1) {
clippedElements.splice(arrayIndex, 1);
}
var clientIds = _elementMeta[elements[i].zcClippingId];
if (clientIds) {
arrayIndex = 0;
while ((arrayIndex = clientIds.indexOf(this.id, arrayIndex)) !== -1) {
clientIds.splice(arrayIndex, 1);
}
if (clientIds.length === 0) {
if (_globalConfig.autoActivate === true) {
_removeMouseHandlers(elements[i]);
}
delete elements[i].zcClippingId;
}
}
}
}
return this;
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.elements`.
* @private
*/
var _clientElements = function() {
var meta = _clientMeta[this.id];
return meta && meta.elements ? meta.elements.slice(0) : [];
};
/**
* The underlying implementation of `ZeroClipboard.Client.prototype.destroy`.
* @private
*/
var _clientDestroy = function() {
if (!_clientMeta[this.id]) {
return;
}
this.unclip();
this.off();
delete _clientMeta[this.id];
};
/**
* Inspect an Event to see if the Client (`this`) should honor it for emission.
* @private
*/
var _clientShouldEmit = function(event) {
if (!(event && event.type)) {
return false;
}
if (event.client && event.client !== this) {
return false;
}
var meta = _clientMeta[this.id];
var clippedEls = meta && meta.elements;
var hasClippedEls = !!clippedEls && clippedEls.length > 0;
var goodTarget = !event.target || hasClippedEls && clippedEls.indexOf(event.target) !== -1;
var goodRelTarget = event.relatedTarget && hasClippedEls && clippedEls.indexOf(event.relatedTarget) !== -1;
var goodClient = event.client && event.client === this;
if (!meta || !(goodTarget || goodRelTarget || goodClient)) {
return false;
}
return true;
};
/**
* Handle the actual dispatching of events to a client instance.
*
* @returns `undefined`
* @private
*/
var _clientDispatchCallbacks = function(event) {
var meta = _clientMeta[this.id];
if (!(typeof event === "object" && event && event.type && meta)) {
return;
}
var async = _shouldPerformAsync(event);
var wildcardTypeHandlers = meta && meta.handlers["*"] || [];
var specificTypeHandlers = meta && meta.handlers[event.type] || [];
var handlers = wildcardTypeHandlers.concat(specificTypeHandlers);
if (handlers && handlers.length) {
var i, len, func, context, eventCopy, originalContext = this;
for (i = 0, len = handlers.length; i < len; i++) {
func = handlers[i];
context = originalContext;
if (typeof func === "string" && typeof _window[func] === "function") {
func = _window[func];
}
if (typeof func === "object" && func && typeof func.handleEvent === "function") {
context = func;
func = func.handleEvent;
}
if (typeof func === "function") {
eventCopy = _extend({}, event);
_dispatchCallback(func, context, [ eventCopy ], async);
}
}
}
};
/**
* Prepares the elements for clipping/unclipping.
*
* @returns An Array of elements.
* @private
*/
var _prepClip = function(elements) {
if (typeof elements === "string") {
elements = [];
}
return typeof elements.length !== "number" ? [ elements ] : elements;
};
/**
* Add a `mouseover` handler function for a clipped element.
*
* @returns `undefined`
* @private
*/
var _addMouseHandlers = function(element) {
if (!(element && element.nodeType === 1)) {
return;
}
var _suppressMouseEvents = function(event) {
if (!(event || (event = _window.event))) {
return;
}
if (event._source !== "js") {
event.stopImmediatePropagation();
event.preventDefault();
}
delete event._source;
};
var _elementMouseOver = function(event) {
if (!(event || (event = _window.event))) {
return;
}
_suppressMouseEvents(event);
ZeroClipboard.focus(element);
};
element.addEventListener("mouseover", _elementMouseOver, false);
element.addEventListener("mouseout", _suppressMouseEvents, false);
element.addEventListener("mouseenter", _suppressMouseEvents, false);
element.addEventListener("mouseleave", _suppressMouseEvents, false);
element.addEventListener("mousemove", _suppressMouseEvents, false);
_mouseHandlers[element.zcClippingId] = {
mouseover: _elementMouseOver,
mouseout: _suppressMouseEvents,
mouseenter: _suppressMouseEvents,
mouseleave: _suppressMouseEvents,
mousemove: _suppressMouseEvents
};
};
/**
* Remove a `mouseover` handler function for a clipped element.
*
* @returns `undefined`
* @private
*/
var _removeMouseHandlers = function(element) {
if (!(element && element.nodeType === 1)) {
return;
}
var mouseHandlers = _mouseHandlers[element.zcClippingId];
if (!(typeof mouseHandlers === "object" && mouseHandlers)) {
return;
}
var key, val, mouseEvents = [ "move", "leave", "enter", "out", "over" ];
for (var i = 0, len = mouseEvents.length; i < len; i++) {
key = "mouse" + mouseEvents[i];
val = mouseHandlers[key];
if (typeof val === "function") {
element.removeEventListener(key, val, false);
}
}
delete _mouseHandlers[element.zcClippingId];
};
/**
* Creates a new ZeroClipboard client instance.
* Optionally, auto-`clip` an element or collection of elements.
*
* @constructor
*/
ZeroClipboard._createClient = function() {
_clientConstructor.apply(this, _args(arguments));
};
/**
* Register an event listener to the client.
*
* @returns `this`
*/
ZeroClipboard.prototype.on = function() {
return _clientOn.apply(this, _args(arguments));
};
/**
* Unregister an event handler from the client.
* If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`.
* If no `eventType` is provided, it will unregister all handlers for every event type.
*
* @returns `this`
*/
ZeroClipboard.prototype.off = function() {
return _clientOff.apply(this, _args(arguments));
};
/**
* Retrieve event listeners for an `eventType` from the client.
* If no `eventType` is provided, it will retrieve all listeners for every event type.
*
* @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null`
*/
ZeroClipboard.prototype.handlers = function() {
return _clientListeners.apply(this, _args(arguments));
};
/**
* Event emission receiver from the Flash object for this client's registered JavaScript event listeners.
*
* @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`.
*/
ZeroClipboard.prototype.emit = function() {
return _clientEmit.apply(this, _args(arguments));
};
/**
* Register clipboard actions for new element(s) to the client.
*
* @returns `this`
*/
ZeroClipboard.prototype.clip = function() {
return _clientClip.apply(this, _args(arguments));
};
/**
* Unregister the clipboard actions of previously registered element(s) on the page.
* If no elements are provided, ALL registered elements will be unregistered.
*
* @returns `this`
*/
ZeroClipboard.prototype.unclip = function() {
return _clientUnclip.apply(this, _args(arguments));
};
/**
* Get all of the elements to which this client is clipped.
*
* @returns array of clipped elements
*/
ZeroClipboard.prototype.elements = function() {
return _clientElements.apply(this, _args(arguments));
};
/**
* Self-destruct and clean up everything for a single client.
* This will NOT destroy the embedded Flash object.
*
* @returns `undefined`
*/
ZeroClipboard.prototype.destroy = function() {
return _clientDestroy.apply(this, _args(arguments));
};
/**
* Stores the pending plain text to inject into the clipboard.
*
* @returns `this`
*/
ZeroClipboard.prototype.setText = function(text) {
if (!_clientMeta[this.id]) {
throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");
}
ZeroClipboard.setData("text/plain", text);
return this;
};
/**
* Stores the pending HTML text to inject into the clipboard.
*
* @returns `this`
*/
ZeroClipboard.prototype.setHtml = function(html) {
if (!_clientMeta[this.id]) {
throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");
}
ZeroClipboard.setData("text/html", html);
return this;
};
/**
* Stores the pending rich text (RTF) to inject into the clipboard.
*
* @returns `this`
*/
ZeroClipboard.prototype.setRichText = function(richText) {
if (!_clientMeta[this.id]) {
throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");
}
ZeroClipboard.setData("application/rtf", richText);
return this;
};
/**
* Stores the pending data to inject into the clipboard.
*
* @returns `this`
*/
ZeroClipboard.prototype.setData = function() {
if (!_clientMeta[this.id]) {
throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");
}
ZeroClipboard.setData.apply(this, _args(arguments));
return this;
};
/**
* Clears the pending data to inject into the clipboard.
* If no `format` is provided, all pending data formats will be cleared.
*
* @returns `this`
*/
ZeroClipboard.prototype.clearData = function() {
if (!_clientMeta[this.id]) {
throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");
}
ZeroClipboard.clearData.apply(this, _args(arguments));
return this;
};
/**
* Gets a copy of the pending data to inject into the clipboard.
* If no `format` is provided, a copy of ALL pending data formats will be returned.
*
* @returns `String` or `Object`
*/
ZeroClipboard.prototype.getData = function() {
if (!_clientMeta[this.id]) {
throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");
}
return ZeroClipboard.getData.apply(this, _args(arguments));
};
if (typeof define === "function" && define.amd) {
define(function() {
return ZeroClipboard;
});
} else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) {
module.exports = ZeroClipboard;
} else {
window.ZeroClipboard = ZeroClipboard;
}
})(function() {
return this || window;
}());
},{}]},{},[23,59,61,60,62,83,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,100,101,102,90,91,92,93,94,95,31,35,32,33,40,34,36,37,38,39])("zeroclipboard")
}); |
src/mixins/classable.js | oliverfencott/material-ui | let React = require('react');
let classNames = require('classnames');
module.exports = {
propTypes: {
className: React.PropTypes.string,
},
getDefaultProps(){
return {
className: '',
};
},
getClasses(initialClasses, additionalClassObj) {
let classString = '';
//Initialize the classString with the classNames that were passed in
if (this.props.className.length) classString += ' ' + this.props.className;
//Add in initial classes
if (typeof initialClasses === 'object') {
classString += ' ' + classNames(initialClasses);
}
else {
classString += ' ' + initialClasses;
}
//Add in additional classes
if (additionalClassObj) classString += ' ' + classNames(additionalClassObj);
//Convert the class string into an object and run it through the class set
return classNames(this.getClassSet(classString));
},
getClassSet(classString) {
let classObj = {};
if (classString) {
classString.split(' ').forEach((className) => {
if (className) classObj[className] = true;
});
}
return classObj;
},
};
|
wp-includes/js/jquery/jquery.js | leybal/HomeWork6 | /*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;
if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")
},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
jQuery.noConflict();
|
modules/Dragable.js | wuct/a4 | import React from 'react'
import { findDOMNode } from 'react-dom'
import emptyFunction from './utils/emptyFunction'
class Dragable extends React.Component {
static defaultProps = {
onDragStart: emptyFunction,
onDraging: emptyFunction,
onDragEnd: emptyFunction,
}
isDraging = false
dragStartPosition = {}
componentDidMount() {
this.DOM = findDOMNode(this)
this.DOM.addEventListener('mousedown', this.onMouseDown)
}
componentWillUnmount() {
this.DOM.removeEventListener('mousedown', this.onMouseDown)
window.removeEventListener('mouseup', this.onMouseUp)
window.removeEventListener('mousemove', this.onMouseMove)
}
onMouseDown = (e) => {
e.stopPropagation()
this.isDraging = true
this.dragStartPosition = {
x0: e.clientX,
y0: e.clientY,
}
this.props.onDragStart(this.dragStartPosition)
window.addEventListener('mouseup', this.onMouseUp)
window.addEventListener('mousemove', this.onMouseMove)
}
onMouseUp = (e) => {
e.stopPropagation()
this.props.onDragEnd({
...this.dragStartPosition,
x1: e.clientX,
y1: e.clientY,
})
this.isDraging = false
this.dragStartPosition = {}
window.removeEventListener('mouseup', this.onMouseUp)
window.removeEventListener('mousemove', this.onMouseMove)
}
onMouseMove = (e) => {
e.stopPropagation()
if (!this.isDraging) return
this.props.onDraging({
...this.dragStartPosition,
x1: e.clientX,
y1: e.clientY,
})
}
render() {
return <g>{this.props.children}</g>
}
}
export default Dragable
|
node_modules/react-icons/md/arrow-upward.js | bengimbel/Solstice-React-Contacts-Project |
import React from 'react'
import Icon from 'react-icon-base'
const MdArrowUpward = props => (
<Icon viewBox="0 0 40 40" {...props}>
<g><path d="m6.6 20l13.4-13.4 13.4 13.4-2.5 2.3-9.3-9.3v20.4h-3.2v-20.4l-9.4 9.3z"/></g>
</Icon>
)
export default MdArrowUpward
|
ajax/libs/zingchart-react/2.1.2/zingchart-react.es.js | cdnjs/cdnjs | import React, { Component } from 'react';
/*
All of the code within the ZingChart software is developed and copyrighted by ZingChart, Inc., and may not be copied,
replicated, or used in any other software or application without prior permission from ZingChart. All usage must coincide with the
ZingChart End User License Agreement which can be requested by email at [email protected].
Build 2.8.8_ES6
*/
if(typeof(ZC)==="undefined"){eval(function(p,a,c,k,e,d){e=function(c){return (c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c);}k=[function(e){return d[e]}];e=function(){return '\\w+'};c=1;}while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);}}return p}('2u.ZC={AT:1n(e,t){if(e.1L)1l e.1L(t);1j(1a i=0,a=e.1f;i<a;i++)if(e[i]===t)1l i;1l-1},fi:"2.8.8",mA:"",12j:!1,uz:["1c","qa","1w","92","bR","1N","88","bQ","2V","ek","5x","6U","6b","7z","6v","8p","5g","6A","3P","7a","9f","oD","8Z","9z","aZ","h7","7j","fO","8m","8h","q0","au","af","5N","vF","7Y","5A","oX","8z","b6"],jM:{Ik:["Ia","I3"],Jm:["J4","Nc"],Mt:["Kq","Lz"],Ls:["L2-aH","vq-aH"],y4:["5g-3P","y4"],2V:["94","5x"],7j:["q4","7j"],kN:["Oi"]},yF:{9f:"3P"},Mg:1n(e,t){1a i=[].7u.4v(98).6u(2);1l ZC.kD(e,t).9l(t,i)},kD:1n(e,t){1j(1a i=e.2o("."),a=i.vq(),n=0;n<i.1f;n++)t=t[i[n]];1l t[a]},4f:{1U:{},2e:0,2P:1n(e,t){ZC.4f.1U[e]=t,ZC.4f.2e++,ZC.4f.2e>ok&&(ZC.4f.1U={},ZC.4f.2e=0)}},Ig:0,TS:{},3u:4T.iH,fg:[],kn:"1U:4e/Fw;kG,Ic///Jg==",jZ:!1,ga:{},qx:[],ay:[],c6:0,w9:"1U:4e/9V;kG,Ji+Q/Nx+Nh+Ku/Lh/UJ/Ll//Kn+Kw/Nn+Mp/Mc/Mq/Gv/Hj+Gx/GZ+Hi+Hf/Hz/Jc+Iw/Is/HK/Iy/Jh/IP/Hm/Hx/Ho/Hv/Hr/Mb+My+Mv/Mo+Mj/Nf/Oa+NP+Nt/Nr+Nk/Nj+KZ/Zg/Kz+Lr+Lp/Lm/Lk+Li+Lc/Kk/Kr+LX/Ng/Ni/Nq+Mr/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"in 2u,p2:"12h"in 2u,RY:[],XA:[],DS:[0,0],12d:1c,2E:1n(e,t,i,a,n,l){1c===ZC.1d(i)&&(i=!0),1c===ZC.1d(a)&&(a=!0),1c===ZC.1d(n)&&(n=!1);1a r=(l=l||[]).1f;1j(1a o in e)if(0===r||r>0&&-1===ZC.AT(l,o))if(e[o]3E 3M){if(a){(1c===ZC.1d(t[o])||"7f"!==o&&!n)&&(t[o]=[]);1j(1a s=0,C=e[o].1f;s<C;s++)t[o].1h(e[o][s])}}1u e[o]3E 9e&&!(e[o]3E bz)?a&&(1c===ZC.1d(t[o])&&(t[o]={}),t[o]3E 9e&&!(t[o]3E bz)&&ZC.2E(e[o],t[o],i)):(1c===ZC.1d(t[o])||i)&&(t[o]=e[o])},t9:1n(e,t){t||(t=[]);1j(1a i=0,a=e.1f;i<a;i++)t.1h(e[i])},12m:1n(e,t){1a i={};ZC.2E(e,i),ZC.2E(t,e),ZC.2E(i,e)},6x:1n(e,t,i){if("fJ"!==1o.qU){1y t===ZC.1b[31]&&(t=!0);1a a,n,l=(i=i||[]).1f;1j(1a r in e)if(e.8d(r)&&(0===l||l>0&&-1===ZC.AT(i,r))){1a o=r.2x(0,1);if("."!==o&&"#"!==o)if(e[r]3E 3M)if(ZC.V8(r)!==r){1j(e[ZC.V8(r)]=[],a=0,n=e[r].1f;a<n;a++)ZC.6x(e[r][a]),e[ZC.V8(r)].1h(e[r][a]);4t e[r]}1u 1j(a=0,n=e[r].1f;a<n;a++)ZC.6x(e[r][a]);1u e[r]3E 9e&&!(e[r]3E bz)?(ZC.V8(r)!==r&&(e[ZC.V8(r)]={},ZC.2E(e[r],e[ZC.V8(r)]),4t e[r]),t&&ZC.6x(e[ZC.V8(r)],t,i)):ZC.V8(r)!==r&&(e[ZC.V8(r)]=e[r],4t e[r])}}},ZU:1n(e,t){1j(1a i in e){1a a;if(e.8d(i))if((a=i.1F(t+"-",""))!==i)if(e[a]=e[i],e[i]3E 3M)1j(1a n=0,l=e[i].1f;n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j(1a t=[],i=0;i<e.1f;i++)t.1h(3U&e[i],e[i]>>>8&3U,e[i]>>>16&3U,e[i]>>>24&3U);1l t},wY:1n(e){1j(1a t="",i=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],a=0;a<e.1f;a++)t+=i[e[a]>>4]+i[15&e[a]];1l t},x0:1n(e){1j(1a t=[],i="Ep"===e.5w(0,2)?2:0;i<e.1f;i+=2)t.1h(5z(e.5w(i,2),16));1l t},x9:1n(e){1j(1a t="",i=0;i<e.1f;i++)0!==e[i]&&(t+=5Q.dg(e[i]));1l t},mj:1n(e){1j(1a t=[],i=0;i<e.1f;i++)t.1h(e.fk(i));1l t},1k:1n(e){1l-1!==5Q(e).1L("e-")?0:""===(e=5Q(e).1F(/[^0-9\\.\\-]/gi,""))?0:1A.46(e)},1Y:1n(e){1l e=5T(e),7X(e)?0:e},4w:1n(e,t){1l 1y t===ZC.1b[31]&&(t=2),5T(4T(e).4x(t))},2l:1n(e){1l 1A.3m(e)},2t:1n(e){1l"e8"!==e&&"0"!==e&&("hx"===e||"1"===e||!!e&&!0)},8M:1n(e){1a t=(e=5Q(e).1F(/[^0-9\\.\\%\\-]/gi,"")).1L("%");1l-1!==t&&(e=e.2x(0,t),e=ZC.1Y(e)/100),e},ji:1n(e){1l 2u.xs?2u.xs(e):e},1d:1n(e){1l 1c===e||1y e===ZC.1b[31]?1c:e},7Q:1n(e,t){1l 1c===e||1y e===ZC.1b[31]?t:e},hF:1n(e){1l(e%=2m)<0&&(e+=2m),e},IL:1n(e,t){1l ZC.1Y(e)+""==e+""?t?ZC.1Y(e):ZC.2l(e):-1!==(e+="").1L("%")?ZC.1Y(e.1F("%",""))/100:-1!==e.1L("px")?ZC.1Y(e.1F("px","")):ZC.1Y(e)},QY:1n(e){1l 5z(e,16)},P6:1n(e){1l ZC.1k(e).ac(16)},hw:1n(e,t){1l 5z(e+(t-e)*1A.cX(),10)},5l:1n(e,t,i){1l e=(e=e<t?t:e)>i?i:e},DT:1n(e,t,i,a){1l a?t<e&&e<i||i<e&&e<t:t<=e&&e<=i||i<=e&&e<=t},BN:1n(e,t){1l 1A.1X(e,t)},CT:1n(e,t){1l 1A.2k(e,t)},dr:1n(e){1j(1a t=0,i=e.1f,a=-4T.iH;t<i;t++)a=1A.1X(a,e[t]);1l a},ds:1n(e){1j(1a t=0,i=e.1f,a=4T.iH;t<i;t++)a=1A.2k(a,e[t]);1l a},Fr:1n(){1j(1a e=(12l*1A.cX()+1<<0).ac(16);e.1f<6;)e="0"+e;1l"#"+e},rO:1n(e,t){1j(1a i,a=ZC.1Y(t),n=4T.iH,l=0,r=0,o=e.1f;r<o;r++)(i=1A.3m(ZC.1Y(e[r])-a))<n&&(l=r,n=i);1l l},12a:1n(e){1a t=e.2o(".");1l t[t.1f-1]||""},GR:1n(e){1l e.1F(/^\\s\\s*/,"").1F(/\\s\\s*$/,"")},HO:1n(e,t){1l t=t||1A.E,fP(1A.3a(e)/1A.3a(t))?1A.3a(e)/1A.3a(t):0},U6:1n(e){1l 2m*e/(2*1A.PI)},TB:1n(e){1l 2*e*1A.PI/2m},EE:1n(e){1l 1A.dR(ZC.TB(e))},EK:1n(e){1l 1A.dQ(ZC.TB(e))},PG:1n(e){1l!7X(5T(e))&&fP(e)},EB:1n(e){1l-1!==e.1L("-")?e.1F(/(\\-[a-z0-9])/g,1n(e){1l e.5J().1F("-","")}):e},V8:1n(e){1l e.5J()!==e&&-1===e.1L("-")&&e.2x(0,1).aO()===e.2x(0,1)?e.1F(/([A-Z])/g,1n(e){1l"-"+e.aO()}).1F(/([0-9]+)/g,1n(e){1l"-"+e.aO()}).1F("-3d","3d"):e},11R:1n(e){1l ZC.YA.dK(e)},AK:1n(e){1l 2g.cO(e)},k6:1n(e,t){1l e[0].1f<t[0].1f?1:e[0].1f>t[0].1f?-1:0},cP:1n(e){2u.5E(e,1o.sV)},bW:1n(e,t){1l t>=0&&t<=20?e.4x(t):""+e},jJ:1n(e,t,i,a){1a n=t.S[i].BY,l=t.S[a].BY;if(e==n)1l i;if(e==l)1l a;1a r=ZC.1k((i+a)/2);if(!t.S[r]){1j(;!t.S[r]&&r<a;)r++;if(r===a){1j(r=ZC.1k((i+a)/2);!t.S[r]&&r>i;)r--;if(r===i)1l 1c}}1a o=t.S[r].BY;1l r!==i&&r!==a?e==o?r:e>o?ZC.jJ(e,t,r,a):ZC.jJ(e,t,i,r):e==o?r:1c},a5:1n(e){1a t,i,a,n,l=[1,1,0,0];if(1o.3J.wN&&!ZC.3L&&ZC.AK(e)){1a r=ZC.AK(e);1j(t="";r&&(""===t||"2b"===t);)t=ZC.A4(r).2O("5G")||"",r=r.6r;-1!==(i=t.1L("9D("))&&(a=t.1L(")",i),n=t.2x(i+7,a-i).2o(","),l=[ZC.1Y(n[0]),ZC.1Y(n[3]),ZC.1Y(n[4]),ZC.1Y(n[5])])}1l l}},ZC.sm=!1,ZC.aw=5I,ZC.ax=60*ZC.aw,ZC.HR=60*ZC.ax,ZC.9s=24*ZC.HR,ZC.db=30*ZC.9s,ZC.YR=wm*ZC.9s,ZC.3B=0,2u.3g=2u.3g||{},3g.5b=3g.5b||1n(e){1a t=1y e;if("4j"!==t||1c===e)1l"3b"===t&&(e=\'"\'+e.1F("\\\\","\\\\\\\\").1F(\'"\',\'"\')+\'"\'),5Q(e);1a i,a,n=[],l=e&&e.2G===3M;1j(i in e)"1n"!=1y e[i]&&("3b"===(t=1y(a=e[i]))?a=\'"\'+a.1F("\\\\","\\\\\\\\").1F(\'"\',\'\\\\"\')+\'"\':"4j"===t&&1c!==a&&(a=3g.5b(a)),n.1h((l?"":\'"\'+i+\'":\')+5Q(a)));1l(l?"[":"{")+5Q(n)+(l?"]":"}")},3g.1q=3g.1q||1n(L0){1l""===L0&&(L0=\'""\'),7t("("+L0+")")},ZC.1b=["1T-1r","2f-4c","2f-6i","4y","1w-1s","6p","-2r-1N zc-2r-1N","6f","7u","1V","cA","eA","6k","n6-8F","6k-8F","-6F-c","aS","1V-3F","78","1s","1M","2e","-2N-c","4S-2i","zc-3m zc-6q","az-6k","3d-77","x-2f","y-2f","z-2f",\'" 9o="\',"jY","~9S(3U,3U,3U,0)","~9L(3U,3U,3U)","-2r-1N ","-cj-1B-","7h://8C.w3.eu/Cu/2F","7h://8C.w3.eu/ol/kF","11T","11V","11X","11Y","11Z","121","123","If-124-129","cU, 1 cT dN 6P:6P:6P dM","6C","83","6l","1z-x","1z-y","1z-v","11N","a2-8f","4S-8y","4S-2A","2y-1v","2y-2z","2y-2c","2y-1K","1G-1r","1G-1s","10x 4L","hU dh 6G","6G.5i.6o-2B","-2B-1P-gN","5G-5B-5D","5G-5B","bg-4e-1s","bg-4e-1M","2N-3X","1T-3X","dq-3X"];1O aA{}if(ZC.xj=1n(e){1g.H=e,1g.nW=1n(e,t){1a i,a=1g,n=a.B9.6W;if(1c!==ZC.1d(t)&&1c!==ZC.1d(n[t])&&(n=n[t]),1c!==ZC.1d(n[e])){1a l=n[e];1l 1c===ZC.1d(l[2])&&(l[2]=ZC.AO.QT(l[1],10)),1c===ZC.1d(l[3])&&(l[3]=ZC.AO.QT(l[1],10)),l}1a r=["#11a","#10h","#10j","#10l","#10p","#10q","#10r"];i=1c!==ZC.1d(r[e-a.B9.6W.1f])?r[e-a.B9.6W.1f]:"#"+ZC.YA.dK(e).5w(e%20,6);1a o=ZC.AO.QT(i,10),s=ZC.AO.QT(i,20),C="#pQ";1l a.B9.6W&&a.B9.6W[0]&&a.B9.6W[0][0]&&(C=a.B9.6W[0][0]),[C,i,o,s]},1g.mW=1n(e){e&&ZC.2E(e,1g.B9,!0)},1g.oZ=1n(e){1a t=1g;1c!==ZC.1d(t.O4[e])&&(ZC.6x(t.O4[e]),ZC.2E(t.O4[e],t.B9))},1g.O4={},ZC.2E(1o.ww,1g.O4),1g.O4.d0={6W:[["#2T","#10s","#10t","#10u"],["#2T","#10d","#104","#ZV"],["#2T","#ZW","#102","#103"],["#2T","#106","#107","#109"],["#2T","#10a","#10S","#10T"],["#2T","#10W","#10Y","#112"]],2Y:{cR:{dT:{2n:.5,"1T-1r":"#4J",1r:"#4u","2s-2e":15,6z:1,1E:"tL..."}},"1T-1r":"#pj #113",5M:{"2s-2e":14,6z:1,1r:"#2T","1T-1r":"#117 #118",3w:6},81:{"2s-2e":11,6z:1,1r:"#8I","2y-1v":30,3w:6},7b:{"2s-2e":10,1r:"#8I",1s:"100%",6z:1,"1E-3x":"2z",1M:20,2y:"3i 0 0 3i",3w:5},hg:{"2s-2e":12,1r:"#8I","1E-3x":"3H","9A-3x":"6s",1E:""},4B:{"2s-2e":11,"1w-1s":2,"1w-1r":"#gr",1P:{7N:!0},"3Q-1w":{"1w-1s":1,"1w-1r":"#gr"},2i:{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#xJ",2n:.2},"4Q-2i":{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#uX",2n:.1},43:{2h:1,2e:6,6f:ZC.1b[18],"1w-1s":2,"1w-1r":"#gr"},"4Q-43":{2h:1,2e:4,6f:ZC.1b[18],"1w-1s":1,"1w-1r":"#gr"},1H:{1r:"#xJ",7N:!0}},"1Z-x":{2V:{1M:16},3q:{1M:16}},"1Z-y":{2V:{1s:16},3q:{1s:16}},1W:{"1T-1r":"#2T","1G-1s":1,2n:.75,"1G-2n":.75,"1G-1r":"#cS","3K-6V":3,5R:{3w:"4 6",1r:"#2T","1G-1s":1,"1G-1r":"#gr","1T-1r":"#gr"},9Q:{3w:"2 6","1T-1r":"#89","1G-1s":1,"1G-1r":"#cS"},1R:{"1G-1r":"#8I","1G-1s":1}},1B:{"1V-3F":{7N:!0},1R:{3K:1,"1w-1s":1,"1G-1s":1},"2N-1R":{"1w-1s":1,"1G-1s":1}},2i:{"1w-1s":1,"1w-1r":"#4J",2n:1,"1z-1H":{1E:"%l",3w:"3 6"},"1B-1H":{3w:"3 6"}}},1w:{1B:{"3K-2n":.5,1R:{2e:4},"2N-1R":{2e:5}}},1N:{1B:{"3K-2n":.5,1R:{2e:4},"2N-1R":{2e:5}}},5x:{1B:{"3k-2f":90,3K:0}},6b:{1B:{"3k-2f":180,3K:0}},5N:{2v:{"4P-9Y":[0,0]},1B:{3K:0}},7Y:{1B:{3K:0}},8m:{1B:{3K:0}},8h:{1B:{"3k-2f":0,3K:0}},6v:{1B:{1R:{2e:4},"2N-1R":{2e:5}}},8p:{1B:{1R:{2e:4},"2N-1R":{2e:5}}},5g:{1B:{1R:{"1G-1s":0},"2N-1R":{"1G-1s":0}}},6A:{1B:{1R:{"1G-1s":0},"2N-1R":{"1G-1s":0}}},3P:{1B:{"1G-1s":1}},8Z:{1B:{"1G-1s":1}},7j:{1B:{1R:{2e:3},"2N-1R":{2e:4}},"1z-k":{2i:{2n:.5,"1T-1r":"#93 #7g"}}},8z:{"1z-r":{"1T-1r":"-1",2i:{2n:.5,"1T-1r":"#93 #7g"},1P:{"2a-r":0},9f:{2e:1,2C:[{"1T-1r":"#4J",2n:.8},{"1T-1r":"#cS",2n:.8}]}}},au:{2v:{2y:"50 100"},4B:{"1w-1s":0,43:{"1w-1s":0},"4Q-43":{"1w-1s":0},2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}},"1z-y":{2i:{2n:.25,"1T-1r":"-1 #8Y"}},"1z-y-n":{2i:{2n:.25,"1T-1r":"-1 #8Y"}},1B:{"1G-1s":1}},af:{2v:{2y:"50 100"},"1z-x":{1H:{"2s-2f":3V}},"1z-x-n":{1H:{"2s-2f":90}},4B:{"1w-1s":0,43:{"1w-1s":0},"4Q-43":{"1w-1s":0},2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}},"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"},2i:{2n:.25,"1T-1r":"#8Y -1"}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"},2i:{2n:.25,"1T-1r":"#8Y -1"}},1B:{"1G-1s":1}},5A:{1B:{1R:{1J:"3A",2e:4},"2N-1R":{2e:5}}},92:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":0,"1w-1s":1}},88:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":0,"1w-1s":1}},aZ:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},6U:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},7z:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},7a:{1B:{"1G-1s":1}},"-":""},1g.O4.9c={6W:[["#2T","#xK","#xK","#uD"],["#2T","#xL","#xL","#119"],["#2T","#pS","#pS","#10P"],["#2T","#xZ","#xZ","#10z"],["#2T","#xO","#xO","#10B"],["#2T","#xT","#xT","#10E"],["#2T","#xR","#xR","#10y"],["#2T","#wj","#wj","#10H"],["#2T","#uJ","#uJ","#pS"]],2Y:{cR:{dT:{2n:.5,"1T-1r":"#4J",1r:"#4u","2s-2e":15,6z:1,1E:"tL..."}},"1T-1r":"#j6",5M:{"2s-2e":21,6z:1,1r:"#e2","1T-1r":"2b",3w:6},81:{"2s-2e":11,6z:1,1r:"#e2","2y-1v":30,3w:6},7b:{"2s-2e":10,1r:"#e2",1s:"100%",6z:1,"1E-3x":"2z",1M:20,2y:"3i 0 0 3i",3w:5},hg:{"2s-2e":12,1r:"#8I","1E-3x":"3H","9A-3x":"6s",1E:"No dh","1T-1r":"#10I",2n:.8},4B:{"2s-2e":11,"1w-1s":1,"1w-1r":"#e5",1P:{"2s-2e":12,7N:!0,1r:"#10J"},"3Q-1w":{"1w-1s":1,"1w-1r":"#7P"},2i:{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#10K",2n:1},"4Q-2i":{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#uX",2n:.1},43:{2h:1,2e:5,6f:ZC.1b[18],"1w-1s":1,"1w-1r":"#e5"},"4Q-43":{2h:1,2e:3,6f:ZC.1b[18],"1w-1s":1,"1w-1r":"#d4"},1H:{1r:"#e2",7N:!0}},"1z-x":{iL:!0,2i:{2h:!1}},1Z:{2V:{"1T-1r":"#pA",2y:1},3q:{"1T-1r":"#d4","1G-9y":6}},"1Z-x":{2V:{1M:16,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"},3q:{1M:10,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"}},"1Z-y":{2V:{1s:16,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"},3q:{1s:10,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"}},"1Z-xi":{2V:{1s:16,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"},3q:{1s:10,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"}},"1Z-yi":{2V:{1M:16,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"},3q:{1M:10,"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"}},2A:{"1T-1r":"#2T","1G-1s":1,"1G-1r":"#d4",4g:!0,4P:{"1T-1r":"#4J"},6K:{2n:0},3q:{1s:11,"1G-1s":2,"1G-9y":3,"1w-1r":"#qi","1G-1r":"#d4","1T-1r":"#pA"},"3q-1v":{1M:11},"3q-2c":{1M:11}},2H:{3K:1,"3K-2f":45,"3K-6V":1,"3K-2n":.25,"1G-1s":1,"1G-1r":"#2T","1G-2n":1},3G:{"dS-3G":1,"1T-1r":"#jO"},1W:{"1T-1r":"#2T","1G-1s":1,3K:0,"3K-2n":.2,2n:1,"1G-2n":1,"1G-1r":"#da",5R:{3w:"5 0 5 10",1r:"#10L","1T-1r":"2b","1G-1s":0,"1G-1v":"hn 2U 2b","1G-2c":"7Z 2U #da"},9Q:{3w:"5 0 5 10","1G-1v":"7Z 2U #da"},pF:{"1T-1r":"#pA","1w-1r":"#qi",2y:2,1M:8,"1w-1s":2,"1w-1I":"eT"},b7:{"1w-1r":"#qi","1w-1s":2,1I:"10N"},1R:{"1G-1r":"#2T","1G-1s":1},"3h-on":{"1T-1r":"#jO"},"3h-6X":{"1T-1r":"#pJ"},1Z:{2V:{"1T-1r":"2b","2y-1v":3,"2y-2c":3},3q:{"1T-1r":"#pJ","1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b","1G-9y":6,1s:12,1M:12}}},1B:{"1V-3F":{7N:!0},1R:{3K:0,"1w-1s":1,"1G-1s":1,"1G-1r":"#2T"},"2N-1R":{"1w-1s":1,"1G-1s":1},zh:!0},2i:{"1w-1s":1,"1w-1r":"#e5",2n:1,"1z-1H":{1E:"%l",3w:"3 6"},"1B-1H":{3w:"3 6"}}},1w:{1B:{"1w-1s":2,3K:0,1R:{2e:4},"2N-3X":{},"2N-1R":{2e:5,"1G-1s":1,"1G-1r":"#2T"}}},1N:{1B:{"1w-1s":2,3K:0,"2n-1N":.25,"1T-1r-1I":"2U",1R:{2e:4},"2N-3X":{},"2N-1R":{2e:5,"1G-1s":1,"1G-1r":"#2T"}}},5x:{1B:{"3k-2f":90,3K:0}},6b:{1B:{"3k-2f":180,3K:0}},5N:{2v:{"4P-9Y":[0,0]},1B:{3K:0},"1z-x":{2i:{2h:!0}}},7Y:{1B:{3K:0}},8m:{1B:{3K:0,7n:{"1G-1s":1,"1G-1r":"#2T",1M:8}}},8h:{1B:{"3k-2f":0,3K:0,7n:{"1G-1s":1,"1G-1r":"#2T",1s:8}}},6v:{1B:{"1w-1r":"%kk-0","1G-1r":"%kk-0",1R:{2e:5},"2N-1R":{2e:6}},"1z-x":{2i:{2h:!0}}},8p:{1B:{"1w-1r":"%kk-0","1G-1r":"%kk-0",1R:{2e:4},"2N-1R":{2e:5}},"1z-x":{2i:{2h:!0}}},5g:{1B:{1R:{"1G-1s":1,"1G-1r":"#2T"},"2N-1R":{"1G-1s":1,"1G-1r":"#2T"}},"1z-x":{2i:{2h:!0}}},6A:{1B:{1R:{"1G-1s":1,"1G-1r":"#2T"},"2N-1R":{"1G-1s":1,"1G-1r":"#2T"}},"1z-x":{2i:{2h:!0}}},3P:{1B:{3K:0,"1G-1s":1,"1V-3F":{6f:"in","2s-2e":16,1E:"%2r-8i-1V%"}}},8Z:{1B:{"1G-1s":1}},7j:{1B:{3K:0,"1w-1s":2,"1T-1r":"%6W-1","6K-1N":!0,1R:{2e:4},"2N-1R":{2e:5,"1G-1r":"#2T"}},"1z-k":{2i:{"1w-1s":1,"1w-1I":"2U","1w-1r":"#e5","1w-gm-2e":6,"1w-hY-2e":6,2n:1,"1T-1r":"#2T #12t"},43:{"1w-1r":"#e5","1w-1s":1,2e:10}},"1z-r":{},"1z-v":{"3Q-1w":{"1w-1r":"#e5","1w-1s":1},43:{"1w-1r":"#e5","1w-1s":1},2i:{"1w-1r":"#iz","1w-1s":1}}},8z:{1B:{3K:0},1z:{"2e-7e":1},"1z-r":{iA:3V,43:{2e:11,"1w-1s":2},"1T-1r":-1,2i:{"1T-1r":"#2T"},9f:{2e:8,"1T-1r":"#iz"},3H:{2e:20,"1T-1r":"#2T","1G-1s":6,"1G-1r":"#uD"}}},au:{2v:{2y:"50 100"},4B:{"1w-1s":0,43:{"1w-1s":0},"4Q-43":{"1w-1s":0},2i:{"1w-1s":1,"1w-1I":"2U","1w-1r":"#iz","1w-gm-2e":6,"1w-hY-2e":6,2n:1},"4Q-2i":{"1w-1s":0}},"1z-x":{2h:!1,2i:{2h:0}},"1z-y":{2i:{"1T-1r":"-1",2n:1}},"1z-y-n":{2i:{"1T-1r":"-1"}},1B:{"1G-1s":1,"1G-1r":"#2T",3K:0,"2N-3X":{"1w-1r":"-1","1G-1r":"-1"}}},af:{2v:{2y:"50 100"},"1z-x":{2h:!1,2i:{2h:0},1H:{"2s-2f":3V}},"1z-x-n":{1H:{"2s-2f":90}},4B:{"1w-1s":0,43:{"1w-1s":0},"4Q-43":{"1w-1s":0},2i:{"1w-1s":1,"1w-1I":"2U","1w-1r":"#iz","1w-gm-2e":6,"1w-hY-2e":6,2n:1},"4Q-2i":{"1w-1s":0}},"1z-y":{2i:{"1T-1r":"-1",2n:1},1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"},2i:{"1T-1r":"-1"}},1B:{"1G-1s":1,"1G-1r":"#2T",3K:0,"2N-3X":{"1w-1r":"-1","1G-1r":"-1"}}},5A:{1B:{"1T-1r":"%6W-1",1R:{1J:"3A",2e:4},"2N-1R":{2e:5}}},92:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":0,"1w-1s":1}},88:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":0,"1w-1s":1}},aZ:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},6U:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},7z:{4B:{"1w-1r":"#7g",43:{2h:!1}},1B:{"1G-1s":1}},7a:{1B:{"1G-1s":1}},b6:{1B:{"1G-1s":0,3K:0,2n:.75,"1T-1r":"%6W-1"}},ap:{5i:{"6o-2B":{2h:!0,1s:"11c",3w:"5 0","1T-1r":"#jV","1G-1s":0,"1G-1r":"#jV",2L:"1K",7M:{2h:ZC.2K,2n:0},aL:{"1T-1r":"#4u",1J:"tf",2n:1},1P:{"1T-1r":"#jV","1E-3x":"1K",3w:"4 20 4 15","1G-1s":0,"1G-1r":"#jV","2s-2e":"uS",1r:"#2T","2N-3X":{"1T-1r":"#12u"}},8F:{"1w-1s":1,"1w-1r":"#vU"}},"6o-2B[2K]":{1P:{3w:"6 10 6 6"}}}},"-":""},1g.O4.9c.2Y["9t-x"]=1g.O4.9c.2Y["9t-y"]=1g.O4.9c.2Y.2i,1g.O4.b8={},ZC.2E(1g.O4.9c,1g.O4.b8,!0,!0),ZC.2E({2Y:{"1T-1r":"#7c",5M:{1r:"#2T"},81:{1r:"#2T"},7b:{1r:"#2T"},4B:{"1w-1r":"#7P",1P:{1r:"#7P"},"3Q-1w":{"1w-1r":"#7P"},2i:{"1w-1r":"#8Y"},"4Q-2i":{"1w-1r":"#8Y"},43:{"1w-1r":"#7P"},"4Q-43":{"1w-1r":"#7P"},1H:{1r:"#7P"}},1Z:{2V:{"1T-1r":"#13L"},3q:{"1T-1r":"#d4"}},"1Z-x":{2V:{"1G-1v":"hn 2U 2b","1G-2z":"5r 2U #7P","1G-2c":"5r 2U #7P","1G-1K":"5r 2U #7P"},3q:{"1G-1v":"2b","1G-2z":"2b","1G-2c":"2b","1G-1K":"2b"}},"1Z-y":{2V:{"1G-1v":"5r 2U #7P","1G-2z":"hn 2U 2b","1G-2c":"5r 2U #7P","1G-1K":"5r 2U #7P"}},2A:{"1T-1r":"#7c"},2H:{"1G-1r":"#4u"},1W:{"1T-1r":"#7c",5R:{1r:"#2T",pF:{"1T-1r":"#e2","1w-1r":"#pG"}},9Q:{1r:"#7P","1T-1r":"#e2","1G-1v":"hn 2U 2b","1G-2z":"5r 2U #d4","1G-2c":"5r 2U #d4","1G-1K":"5r 2U #d4"},pF:{"1T-1r":"#e2","1w-1r":"#pG"},b7:{"1w-1r":"#pG"},"3h-6T":{1r:"#7P"},"3h-on":{"1T-1r":"#pJ"},"3h-6X":{"1T-1r":"#jO"},1R:{"1G-1r":"#4u"},1P:{1r:"#7P"}},1B:{1R:{"1G-1r":"#7c"}},2i:{"1w-1r":"#7P","1z-1H":{"1T-1r":"#jO"},"1B-1H":{"1T-1r":"#7c",1r:"#pQ","1G-1r":"#148"}}},1w:{1B:{"2N-1R":{"1G-1r":"#7c"}}},1N:{1B:{"2N-1R":{"1G-1r":"#7c"}}},8m:{1B:{7n:{"1G-1r":"#7c"}}},8h:{1B:{7n:{"1G-1r":"#7c"}}},5g:{1B:{1R:{"1G-1r":"#7c"},"2N-1R":{"1G-1r":"#7c"}}},6A:{1B:{1R:{"1G-1r":"#7c"},"2N-1R":{"1G-1r":"#7c"}}},3P:{1B:{"1G-1r":"#7c"}},7j:{1B:{"2N-1R":{"1G-1r":"#7c"}},"1z-k":{2i:{"1w-1r":"#8Y","1T-1r":"#7c #14a"},43:{"1w-1r":"#7P"}},"1z-v":{"3Q-1w":{"1w-1r":"#8Y"},43:{"1w-1r":"#8Y"},2i:{"1w-1r":"#8Y"}}},8z:{"1z-r":{2i:{"1T-1r":"#7c"},9f:{"1T-1r":"#14c"}}},au:{4B:{2i:{"1w-1r":"#8Y"}},1B:{"1G-1r":"#7c","2N-3X":{"1w-1r":"#8Y","1G-1r":"#7c"}}},af:{4B:{2i:{"1w-1r":"#8Y"}},"1z-y":{2i:{2n:.25,"1T-1r":"#vc -1"}},"1z-y-n":{2i:{2n:.25,"1T-1r":"#vc -1"}},1B:{"1G-1r":"#7c","2N-3X":{"1w-1r":"#8Y","1G-1r":"#7c"}}},ap:{5i:{"6o-2B":{aL:{"1T-1r":"#pQ"}}}},"-":""},1g.O4.b8,!0,!0),1g.O4.b8.2Y["9t-x"]=1g.O4.b8.2Y["9t-y"]=1g.O4.b8.2Y.2i,1g.O4.lQ={2Y:{5M:{1s:"100%",3w:"1 2 2","2s-2e":10},81:{1s:"100%",3w:"1 2 2","2y-1v":14,"2s-2e":9},2v:{1s:"100%",1M:"100%",2y:"18 4 4 4"},4B:{2h:0},2H:{3K:0,"1G-9y":7},1W:{2h:0},2A:{2h:0},2i:{"1w-1s":1,"1w-1r":"#89",2n:1,"1z-1H":{1E:"%l",3w:"3 6"},"1B-1H":{"1G-1r":"#89","1G-9y":5,3w:"3 6"}},1B:{3K:0,"1V-3F":{2h:0},"2N-3X":{2h:0},"2N-1R":{2h:0},"1X-np":pp,"1X-cZ":pp}},1w:{1B:{"1w-1s":1,1R:{1J:"2b"}}},92:{"3d-77":{5u:20,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0,3G:.9}},1N:{1B:{"1w-1s":1,1R:{1J:"2b"}}},88:{"3d-77":{5u:20,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0,3G:.9}},6v:{4B:{2a:5},1B:{1R:{2e:3,3K:!1,2n:.8}}},8p:{4B:{2a:5},1B:{1R:{2e:3,3K:!1,2n:.8}}},5g:{4B:{2a:15},1B:{1R:{"3k-1J":"2b",3K:!1,2n:.8},"2k-2e":3,"1X-2e":9}},6A:{4B:{2a:15},1B:{1R:{"3k-1J":"2b",3K:!1,2n:.8},"2k-2e":3,"1X-2e":9}},3P:{2v:{2y:"18 4 4 4"},1B:{"1V-3F":{2h:0}},1z:{"2e-7e":.95}},7a:{2v:{2y:"32 4 4 4"},1B:{"1V-3F":{2h:0}},1z:{"2e-7e":1}},8Z:{2v:{2y:"18 4 4 4"},1B:{"1V-3F":{2h:0}},1z:{"2e-7e":.95}},7j:{2v:{2y:"18 4 4 4"},1B:{"1w-1s":1,1R:{3K:0,2e:2}},1z:{"2e-7e":.95}},6U:{"3d-77":{5u:20,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0,3G:.9}},7z:{"3d-77":{5u:20,2f:45,"x-2f":0,"y-2f":-20,"z-2f":0,3G:.9}},b6:{2v:{2y:"18 4 4 4"},1B:{"1G-1s":0}},8z:{2v:{2y:"18 4 4 4"},1B:{Bq:[5]},4B:{2h:1},1z:{"2e-7e":.9},"1z-r":{"1T-1r":"-1",iA:3V,43:{2h:0},1P:{2h:0},2i:{2h:0},9f:{2e:6,"1T-1r":"#iz",2C:[]},3H:{"1G-1s":0,2e:2,"1T-1r":"#2T"}}},au:{2v:{2y:"18 4 4 4"}},af:{2v:{2y:"18 4 4 4"}},8m:{1B:{"2V-8w":.5,7n:{"1G-1s":0,1M:4}}},8h:{1B:{"2V-8w":.5,7n:{"1G-1s":0,1s:4}}},5A:{1B:{"1w-1s":1,1R:{2h:0},"2N-3X":{2h:0}}},"-":""},1g.O4.14i={6W:[["#4u","#14k","#vU","#14f"],["#4u","#144","#13U","#13N"],["#4u","#13P","#13R","#13S"],["#4u","#13T","#13V","#da"],["#4u","#13X","#13Y","#13Z"],["#4u","#142","#uL","#14n"],["#4u","#v9","#vS","#14o"]],2Y:{"1T-1r":"#111",5M:{1r:"#2T"},81:{1r:"#8I"},4B:{"2s-2e":11,"1w-1s":2,"1w-1r":"#89",2i:{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#89",2n:.2},"4Q-2i":{2h:1,"1w-1s":1,"1w-1I":"2U","1w-1r":"#89",2n:.2},43:{2h:1,2e:6,6f:ZC.1b[18],"1w-1s":2,"1w-1r":"#89"},"4Q-43":{2h:1,2e:4,6f:ZC.1b[18],"1w-1s":1,"1w-1r":"#89"},1H:{1r:"#2T"},1P:{1r:"#2T"}}},7j:{"1z-k":{2i:{2n:.5,"1T-1r":"#14I #8I"}}},"-":""},1g.O4.14K=1g.O4.lQ,1g.B9={ap:{5i:{al:[{id:"uM",4a:"4s"},{id:"vA",4a:"4s"},{id:"vm",4a:"2b"},{id:"uK",4a:"2b"},{id:"uH",4a:"2b"},{id:"vj",4a:"2b"},{id:"3D",4a:"2b"},{id:"wV",4a:"2b"},{id:"x7",4a:"2b"},{id:"wX",4a:ZC.ca?"2b":"4s"},{id:"tD",4a:ZC.ca?"2b":"4s"}],eb:{1J:1,2L:"rb"},4Y:{2y:"10 3i 3i 10",1s:30,1M:22,3w:4,1P:{"1T-1r":"#lJ","1G-1s":1,"1G-1r":"#14L"},"1P-6X":{"1T-1r":"#93","1G-1r":"#7g"}},7O:{"1T-1r":"#2T",1r:"#4u"},"6o-2B":{3w:0,"1G-1s":1,"1G-1r":"#4u",7M:{2h:ZC.2K,2y:"5 3i 3i 5",2n:.8,"1T-1r":"#8I #4J","1G-9y":8,1s:40,1M:40},aL:{"1T-1r":"#2T #vS",1J:"yD",2n:.8},1P:{"1T-1r":"#14M","1E-3x":"1K",3w:"4 20 4 8","1G-1s":1,"1G-1r":"#4u",1r:"#2T","2N-3X":{"1T-1r":"#14O"}},8F:{"1w-1s":1,"1w-1r":"#cY"}},"6o-2B[2K]":{1P:{3w:"6 10 6 6"}}}},6W:[],2Y:{5M:{1s:"100%",6z:1,"2s-2e":13},81:{1s:"100%",6z:1,"2s-2e":11},1Z:{2V:{"1T-1r":"#pj","1G-1r":"#7g"},3q:{"1T-1r":"#7g","1G-1r":"#89","1G-1s":2,"1G-1v":"5r 2U #93","1G-1K":"5r 2U #93","1G-2z":"5r 2U #4J","1G-2c":"5r 2U #4J"}},"1Z-x":{2V:{1M:16},3q:{1M:16}},"1Z-y":{2V:{1s:16},3q:{1s:16}},"1Z-xi":{2V:{1s:16},3q:{1s:16}},"1Z-yi":{2V:{1M:16},3q:{1M:16}},2A:{1s:"100%",1M:50,2y:"3i 50 20 50","1G-1s":1,3K:0,"1T-1r":"#v9","1G-1r":"#4J",4P:{2n:.5,"1T-1r":"#8I"},6K:{2n:.1,"1T-1r":"#4J"},3q:{1s:9,1M:16,"1G-1s":1,"1w-1s":1,"1w-1r":"#111","1G-1r":"#14P","1G-9y":2,"1T-1r":"#uL"},"3q-1v":{1s:16,1M:9},"3q-2c":{1s:16,1M:9}},2v:{1s:"100%",1M:"100%",2y:"60 50 65 50"},"2v[2A]":{2y:"60 50 105 50"},4B:{"1w-1s":1,2i:{"1w-1s":1,"1w-1r":"#7g"},43:{2e:6,"1w-1s":2},"4Q-2i":{"1w-1s":1,"1w-1r":"#7g"},"4Q-43":{2e:4,"1w-1s":1},1H:{6z:1,3w:6,7N:!0},1P:{3w:2,"3i-3x":!0,7N:!0},1R:{"1w-1s":1,"1w-1r":"#4u","1T-1r":"#89"},"5G[5B]":{1P:{"2s-2e":10,3w:2,1r:"#4u","1T-1r":"#2T"}}},"4B[3d]":{"1T-1r":"#89"},"1z-y[2q]":{1H:{"2s-2f":3V},1P:{"1E-3x":"2z"}},"1z-y[5C]":{1H:{"2s-2f":90},1P:{"1E-3x":"1K"}},1B:{4L:{"1w-1s":1,"1w-1r":"#8I",2e:.5},"1V-3F":{7N:!0,1E:"%v",6z:1,6f:"3i",3K:1},"2H-1E":"%v",3K:1,"1w-1s":1,1R:{1J:"9n",3K:1},"5U-3X":{3K:!0,"3K-vW":2,"3K-6V":1,"3K-2n":.91}},2H:{3K:1,3w:"4 8","3K-6V":3,"2a-y":ZC.2K?-40:-20},"2H[4O]":{3w:"4 8","2a-y":0},2i:{1R:{1J:"3A"},"1B-1H[bs]":{1E:\'<b 1I="1r:%1r">%1B-1E:</b> %2r-1V\',3w:10,"1T-1r":"#2T #93","1G-1s":1,"1G-1r":"#4J",1r:"#4u","1E-3x":"1K"},"1B-1H[aC]":{1E:\'<b 1I="1r:%1r">%1B-1E:</b> %2r-1V\',3w:5,"1T-1r":"#2T #93","1G-1s":1,"1G-1r":"#4J",1r:"#4u","1E-3x":"1K"}},3G:{"dS-3G":1,"1G-1s":0,"1T-1r":"#lJ",2n:.25,1H:{2h:!1,"1T-1r":"#2T","2s-2e":10,3w:2,"1G-1s":1,"1G-1r":"#4J"}},7C:{"1G-1s":1,"1G-1r":"#4u","1T-1r":"#cS",2e:4},"1W[2L]":{2y:10},1W:{"1T-1r":"#93",2n:1,3K:1,2y:"10 10 3i 3i",3w:"4 2 4 2",1P:{"1E-3x":"1K",2y:"2 6 2 4",3w:"2 4"},"1P-6X":{2n:.25},1R:{3K:0,2e:6,"1G-1r":"#4J","1G-1s":1},5R:{"2s-2e":12,"1E-3x":"1K",6z:1},9Q:{"1E-3x":"1K"},b7:{"1w-1r":"#4u","1w-1s":1},"3h-6T":{1r:"#4u"},"3h-on":{"1T-1r":"#wQ"},"3h-6X":{"1T-1r":"#4J"},1Z:{2V:{1s:12,1M:12,"1T-1r":"#pj","1G-1r":"#7g"},3q:{1s:12,1M:12,"1T-1r":"#7g","1G-1r":"#89","1G-1s":2,"1G-1v":"5r 2U #93","1G-1K":"5r 2U #93","1G-2z":"5r 2U #4J","1G-2c":"5r 2U #4J"}}}},5x:{1B:{"1V-3F":{6f:"1v-4R"}}},6U:{1B:{"1V-3F":{6f:"1v-4R"}},"3d-77":{5u:40,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0}},aZ:{"3d-77":{5u:40,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0}},6b:{"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x[2q]":{1H:{"2s-2f":3V}},"1z-x[5C]":{1H:{"2s-2f":90}},1B:{"1V-3F":{6f:"1v-4R"}}},bR:{"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x[2q]":{1H:{"2s-2f":3V}},"1z-x[5C]":{1H:{"2s-2f":90}}},bQ:{1B:{"3k-2f":0},"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x[2q]":{1H:{"2s-2f":3V}},"1z-x[5C]":{1H:{"2s-2f":90}}},7z:{"1z-y":{1H:{"2s-2f":0}},"1z-x":{1H:{"2s-2f":3V}},"1z-y-n":{1H:{"2s-2f":0}},"1z-x-n":{1H:{"2s-2f":90}},"3d-77":{5u:40,2f:45,"x-2f":0,"y-2f":-20,"z-2f":0},1B:{"1V-3F":{6f:"1v-4R"}}},8h:{"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x":{1H:{"2s-2f":3V}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x-n":{1H:{"2s-2f":90}}},1w:{1B:{"1w-1s":4,1R:{1J:"3A",2e:4}}},1N:{1B:{"1w-1s":4,1R:{1J:"3A",2e:4},"1V-3F":{6f:"1v"}}},92:{"3d-77":{5u:40,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0},1B:{"1G-1s":1,"1w-1s":1,1R:{1J:"3A",2e:4,2n:1,2h:0}}},88:{"3d-77":{5u:40,2f:45,"x-2f":-20,"y-2f":0,"z-2f":0},1B:{"1G-1s":1,"1w-1s":1,1R:{1J:"3A",2e:4,2n:1,2h:0},"1V-3F":{6f:"1v"}}},6v:{4B:{2a:10},1B:{1R:{1J:"3A",2e:4},"1V-3F":{6f:"1v"}}},4z:{4B:{2a:10},1B:{"2n-1N":.4,1R:{1J:"2b"},"1V-3F":{6f:"1v"}}},8p:{4B:{2a:10},"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x":{1H:{"2s-2f":3V}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x-n":{1H:{"2s-2f":90}},1B:{1R:{1J:"3A",2e:4},"1V-3F":{6f:"1v"}}},5g:{4B:{2a:40},1B:{1R:{1J:"3A","3k-1J":"8H","3k-2a-x":-.2,"3k-2a-y":-.2},"2N-1R":{"3k-1J":"8H","3k-2a-x":-.2,"3k-2a-y":-.2},"1V-3F":{6f:"6s",1E:"%2r-2e-1V"},"2H-1E":"%2r-2e-1V"}},6A:{4B:{2a:40},"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x":{1H:{"2s-2f":3V}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x-n":{1H:{"2s-2f":90}},1B:{1R:{1J:"3A","3k-1J":"8H","3k-2a-x":-.2,"3k-2a-y":-.2},"2N-1R":{"3k-1J":"8H","3k-2a-x":-.2,"3k-2a-y":-.2},"1V-3F":{6f:"6s",1E:"%2r-2e-1V"},"2H-1E":"%2r-2e-1V"}},h7:{"1z-y":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x":{1H:{"2s-2f":3V}},"1z-y-n":{1H:{"2s-2f":0},1P:{"1E-3x":"3H"}},"1z-x-n":{1H:{"2s-2f":90}}},3P:{2v:{2y:"35 5 5 5"},1z:{"2e-7e":"3i","1w-1s":0,2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}},1B:{"3k-1J":"8H","1V-3F":{8W:{"1w-1s":1},6f:"4R",1E:"%t",2h:1}}},7a:{"3d-77":{"x-2f":38,"y-2f":0,"z-2f":0},2v:{2y:"25 5 5 5"},1z:{"2e-7e":"3i","1w-1s":0,2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}},1B:{"3k-1J":"9w","1V-3F":{8W:{"1w-1s":1},6f:"4R",1E:"%t",2h:1}}},8Z:{2v:{2y:"40 5 15 5"},1z:{"2e-7e":.8,"1w-1s":0,2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}},1B:{"3k-1J":"8H","1V-3F":{8W:{"1w-1s":1},1E:"%t",2h:1}}},b6:{2v:{2y:"30 10 10 10"},1B:{2n:.5,"1G-1s":4},1z:{"2e-7e":.65,"1w-1s":0,2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0}}},7j:{4B:{2i:{"1w-1s":1,"1w-1r":"#4J","1T-1r":"-1"},43:{"1w-1s":1},1P:{"3i-3x":!1}},1z:{2h:0,"2e-7e":.7},"1z-k":{"3Q-2f":3V},2v:{2y:"40 5 5 5"},1B:{"1w-1s":4,77:"1w",1R:{1J:"3A"}}},8z:{4B:{2i:{"1G-1s":1,"1G-1r":"#4J","1T-1r":"-1"}},1z:{"1w-1s":0,2i:{"1w-1s":0},"4Q-2i":{"1w-1s":0},"2e-7e":.7},"1z-r":{"3Q-2f":3V,"1T-1r":"#2T",2i:{"1w-1s":0},43:{6f:"5P"},1P:{"2a-r":"-45%"}},1B:{2e:"85%"},2v:{2y:"40 5 5 5"}},7Y:{1B:{"1w-1s":1,"1G-1s":1,"2H-1E":"14S:&8x;$%bp<br>14T:&8x;$%sR<br>14U:&8x;$%sO<br>ha:&8x;$%7w"}},5A:{1B:{"1w-1s":2,"1V-3F":{1E:"%2r-2k-1V - %2r-1X-1V"},"2H-1E":"%2r-2k-1V - %2r-1X-1V"}},"-":""},1g.PS=1n(e,t){1a i,a=1g,n=!1;1l 1c!==ZC.1d(i=a.B9.2Y[e])&&1c!==ZC.1d(i.4a)&&(n=n||ZC.2t(i.4a)),1c!==ZC.1d(a.B9[t])&&1c!==ZC.1d(i=a.B9[t][e])&&1c!==ZC.1d(i.4a)&&(n=n||ZC.2t(i.4a)),n},1g.2w=1n(e,t,i,a){1a n,l,r,o=1g;i=1c===ZC.1d(i)||ZC.2t(i),a=1c!==ZC.1d(a)&&ZC.2t(a),t 3E 3M||(t=1m 3M(t));1a s=[],C="";1j(l=0,r=t.1f;l<r;l++)if(/(\\(\\w+\\))(.*)/.5Y(t[l])){1a A=5v.$1;C=t[l].1F(A,"2Y"),-1===ZC.AT(s,C)&&s.1h(C),C=t[l].1F(A,A.2x(1,A.1f-1)),-1===ZC.AT(s,C)&&s.1h(C)}1u-1===ZC.AT(s,t[l])&&s.1h(t[l]),/ap(.*)/.5Y(t[l])&&-1===ZC.AT(s,t[l].1F("ap","6G"))&&s.1h(t[l].1F("ap","6G")),/6G(.*)/.5Y(t[l])&&-1===ZC.AT(s,t[l].1F("6G","ap"))&&s.1h(t[l].1F("6G","ap"));1a Z={};1j(l=0,r=s.1f;l<r;l++){1j(1a c=s[l].2o("."),p=o.B9,u=0,h=c.1f;u<h;u++)if(1c!==ZC.1d(n=p[c[u]]))p=n;1u if(1c!==ZC.1d(n=p[ZC.V8(c[u])]))p=n;1u{if(1c===ZC.1d(n=p[ZC.EB(c[u])])){p=1c;1p}p=n}if(p)1j(1a 1b in p)1c!==ZC.1d(p[1b])&&(a||"4j"!=1y p[1b]||p[1b].1f)&&(i||1c===ZC.1d(e[1b])?o.H.R0&&1c!==ZC.1d(o.H.R0[1b])||(Z[1b]=p[1b]):i&&"4j"==1y p[1b]&&(o.H.R0&&1c!==ZC.1d(o.H.R0[1b])||(Z[1b]=p[1b])))}ZC.2E(Z,e)}},ZC.AO={14V:1n(e,t){1j(1a i=[],a=0,n=e.p.1f;a<n;a++)if(e.p[a]){1a l=(e.p[a][0]-e.x)/e.w,r=(e.p[a][1]-e.y)/e.h;i.1h([t.x+t.w*l,t.y+t.h*r])}1u i.1h(1c);1l{l:t.w*e.l/e.w,r:t.w*e.r/e.w,p:i}},yy:1n(e,t,i){1a a=2g.dB("fv")[0],n=2g.4V("14W");n.1J="1E/7s",n.4X=t+"?v"+ZC.fi;1a l=!1;n.gx=n.f7=1n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ZC.1b[14]])&&(t[ZC.1b[14]]=e),1c===ZC.1d(t[ZC.1b[13]])&&1c!==ZC.1d(e=ZC.HD[ZC.1b[13]])&&(t[ZC.1b[13]]=e),1c!==ZC.1d(t[ZC.1b[12]])&&-1!==t[ZC.1b[12]]&&1y t["1X-6k"]!==ZC.1b[31]&&-1!==t["1X-6k"]&&(t[ZC.1b[12]]=ZC.BN(t["1X-6k"],t[ZC.1b[12]])),!o)if(1c!==ZC.1d(t.az)&&t.az)r=4T(r).14w(ZC.CT(20,t[ZC.1b[25]])),1c!==ZC.1d(t[ZC.1b[14]])&&(r=r.1F(/\\./g,t[ZC.1b[14]]));1u{if(1c!==ZC.1d(t.5L)&&t.5L){n="";1a s=t["5L-dv"]||"";if("3b"!=1y s&&s.1f){""+ZC.1Y(s[0])!==s[0]&&(s=[5I].4A(s));1j(1a C=1,A=s[0]||5I,Z=s.7u(1),c=1c,p=0;p<Z.1f;p++)0===Z[p].1L("#")&&(c=p,Z[p]=Z[p].2x(1));if(Z.1f){if(1c!==c)C=c;1u if(1c!==ZC.1d(t["1X-d1"]))C=t["1X-d1"];1u{1a u=ZC.HO(ZC.2l(4T(r)),A);C=1A.4n(u),C=ZC.CT(C,Z.1f-1)}n=Z[C];1a h=(r=""+4T(r)/1A.5k(A,C)).2o(".");2===h.1f&&h[1].1f>=9&&(r=1c!==ZC.1d(t[ZC.1b[12]])&&-1!==t[ZC.1b[12]]?""+ZC.4w(r,t[ZC.1b[12]]):""+ZC.4w(r))}}1u{1a 1b=ZC.HO(ZC.2l(4T(r)))/1A.bD;1Q(ZC.2l(4T(r))){1i 5I:1b=3;1p;1i gR:1b=6;1p;1i qM:1b=9}if(1c!==ZC.1d(t["1X-d1"])&&(1b=3*t["1X-d1"]),"KB"===s.5J())r=""+4T(r)/gz,n="KB";1u if("MB"===s.5J())r=""+4T(r)/14B,n="MB";1u if("GB"===s.5J())r=""+4T(r)/14C,n="GB";1u if("TB"===s.5J())r=""+4T(r)/14E,n="TB";1u if("PB"===s.5J())r=""+4T(r)/14p,n="PB";1u if(1b>=0&&1b<3)1Q(s){2q:r=r,n="";1p;1i"K":r=""+4T(r)/5I,n="K";1p;1i"M":r=""+4T(r)/gR,n="M";1p;1i"B":r=""+4T(r)/qM,n="B"}1u 1b>=3&&1b<6&&""===s||"K"===s.5J()?(r=""+4T(r)/5I,n="K"):1b>=6&&1b<9&&""===s||"M"===s.5J()?(r=""+4T(r)/gR,n="M"):(1b>=9&&""===s||"B"===s.5J())&&(r=""+4T(r)/qM,n="B")}if(ZC.PG(r))if(1c!==ZC.1d(t[ZC.1b[12]])&&-1!==t[ZC.1b[12]])r=ZC.bW(4T(r),ZC.BN(0,ZC.1k(t[ZC.1b[12]])));1u{1a d=r.2o(".")[1]||"";-1!==t["1X-6k"]&&t["1X-6k"]<d.1f&&(r=ZC.bW(4T(r),ZC.BN(0,ZC.1k(t["1X-6k"]))))}1c!==ZC.1d(t[ZC.1b[14]])&&(r=r.1F(/\\./g,t[ZC.1b[14]]))}if(!7X(r)&&"3b"!=1y l){if(1c!==ZC.1d(t[ZC.1b[12]])&&-1!==t[ZC.1b[12]]&&ZC.PG(r)&&(1c!==ZC.1d(t.5L)&&t.5L||(r=ZC.bW(4T(r),ZC.BN(0,ZC.1k(t[ZC.1b[12]]))))),1c!==ZC.1d(t[ZC.1b[13]])||1c!==ZC.1d(t[ZC.1b[14]])){1j(1a f=r.2o("."),g="",B=0,v=f[0].1f;B<v;B++){1a E=f[0].2x(B,B+1);g+=E,-1===ZC.AT(["-","+"],E)&&(f[0].1f-B-1)%3==0&&f[0].1f-B-1!=0&&(g+=t[ZC.1b[13]])}r=g+(1c!==ZC.1d(f[1])?t[ZC.1b[14]]+f[1]:"")}1c!==ZC.1d(t.5L)&&t.5L&&(r+=n)}}1l r},ru:1n(e){1a t=e.1L("("),i="",a="";-1!==t?(i=ZC.GR(e.2x(0,t)),a=ZC.GR(e.2x(t+1,e.1f-1))):i=ZC.GR(e);1a n=[],l="";if(""!==a){1a r=!1,o=!1,s=!1;l="";1j(1a C=0,A=a.1f;C<A;C++){1a Z=a.2x(C,C+1);1Q(Z){1i"\\\\":s?(l+="\\\\",s=!1):s=!0;1p;1i\'"\':s?(l+=\'"\',s=!1):o?(n.1h(l),l="",o=!1):r?l+=Z:o=!0;1p;1i"\'":s?(l+="\'",s=!1):r?(n.1h(l),l="",r=!1):o?l+=Z:r=!0;1p;1i" ":(r||o)&&(l+=Z);1p;1i",":r||o?l+=Z:(""!==l&&n.1h(l),l="");1p;2q:l+=Z}}}1l""!==l&&n.1h(l),[i,n]},er:1n(e){1l e.ac().1F(/^([0-9])$/,"0$1")},YM:1n(e,t,i,a){t=t||ZC.HD["5B-rL"].iy,1y i===ZC.1b[31]&&(i=!1),1y a===ZC.1b[31]&&(a=0),i&&(e+=j3*a);1a n,l,r,o,s,C,A,Z,c=1m a1;c.139(e),i?(n=c.13J(),l=c.12P(),r=c.12Q(),o=c.12S(),s=c.12T(),C=c.12O(),A=c.12V(),Z=c.12X()):(n=c.132(),l=c.133(),r=c.136(),o=c.12x(),s=c.12y(),C=c.12z(),A=c.12C(),Z=c.vd());1j(1a p=[["mm",ZC.AO.er(A+1)],["dd",ZC.AO.er(C)],["Y",Z],["y",Z.ac().5w(2,2)],["F",ZC.HD["kE-eU"][A]],["m",A+1],["M",ZC.HD["kE-5L"][A]],["n",A],["d",C],["D",ZC.HD["lI-5L"][s]],["j",C],["l",ZC.HD["lI-eU"][s]],["N",s+1],["w",s],["S",1n(){1l C%10==1?"st":C%10==2?"nd":C%10==3?"rd":"th"}],["a",n<12?"am":"pm"],["A",n<12?"AM":"PM"],["g",n%12||12],["G",n],["h",ZC.AO.er(n%12||12)],["H",ZC.AO.er(n)],["i",ZC.AO.er(l)],["s",ZC.AO.er(r)],["q",o]],u=0;u<p.1f;u++)t=t.1F("%"+p[u][0],p[u][1]);1l t},jo:{},YY:1n(e,t){1a i=1c;if(t&&t.BO?i=t.BO:t&&t.A&&t.A.BO&&(i=t.A.BO),"3b"==1y e&&-1!==e.1L("%1r-")&&ZC.ay.1f>0)1j(1a a=0;a<ZC.ay.1f;a++)-1===e.1L("(+")&&-1===e.1L("(-")||(e=e.1F(/%1r-(\\d+?)\\((\\+|\\-)(\\d+?)\\)/gi,1n(){1a e=ZC.AO.G9(ZC.ay[ZC.1k(98[1])]);1l"+"===98[2]?e=ZC.AO.QT(e,ZC.1k(98[3])):"-"===98[2]&&(e=ZC.AO.JM(e,ZC.1k(98[3]))),e})),e=e.1F("%1r-"+a,ZC.ay[a]);1u"3b"==1y e&&i&&-1!==e.1L("%6W-")&&(e=i[ZC.1k(e.1F("%6W-",""))]);1l e},G9:1n(e,t){1a i,a,n,l;if(1c!==ZC.1d(ZC.AO.jo[e]))1l ZC.AO.jo[e];1a r=ZC.GR(5Q(e)),o=1,s=!1;1l 0===r.1f?"":("9S("===(r=r.1F("Ep","#")).2x(0,5)?(i=1m 5v("9S\\\\((\\\\d{1,3}),\\\\s*(\\\\d{1,3}),\\\\s*(\\\\d{1,3}),\\\\s*([0-9.]+)\\\\)","gi").3n(r))&&(1===(a=ZC.P6(i[1])).1f&&(a="0"+a),1===(n=ZC.P6(i[2])).1f&&(n="0"+n),1===(l=ZC.P6(i[3])).1f&&(l="0"+l),r="#"+a+n+l,o=ZC.BN(0,ZC.CT(1,5T(i[4]))),s=!0):"9L("===r.2x(0,4)?(i=1m 5v("9L\\\\((\\\\d{1,3}),\\\\s*(\\\\d{1,3}),\\\\s*(\\\\d{1,3})\\\\)","gi").3n(r))&&(1===(a=ZC.P6(i[1])).1f&&(a="0"+a),1===(n=ZC.P6(i[2])).1f&&(n="0"+n),1===(l=ZC.P6(i[3])).1f&&(l="0"+l),r="#"+a+n+l):"#"===r.2x(0,1)?4===r.1f?r="#"+r.2x(1,2)+r.2x(1,2)+r.2x(2,3)+r.2x(2,3)+r.2x(3,4)+r.2x(3,4):7!==r.1f&&(r=""):1c!==ZC.1d(ZC.P.qh[r.5J()])&&(r="#"+ZC.P.qh[r.5J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6(r[1]):ZC.P6(r[1]),r[2]=ZC.1k(r[2])<16?"0"+ZC.P6(r[2]):ZC.P6(r[2]),e="#"+r[0]+r[1]+r[2]},QT:1n(e,t){if(-1===e)1l-1;if(t>=100)1l"#j6";e=ZC.AO.G9(e),1y t===ZC.1b[31]&&(t=10);1a i=5z(e.5w(1,2),16),a=5z(e.5w(3,2),16),n=5z(e.5w(5,2),16);1l"#"+(0|bK+i+(bK-i)*t/100).ac(16).5w(1)+(0|bK+a+(bK-a)*t/100).ac(16).5w(1)+(0|bK+n+(bK-n)*t/100).ac(16).5w(1)},jk:1n(e,t){1a i=5z(e.5w(1,2),16),a=5z(e.5w(3,2),16),n=5z(e.5w(5,2),16);1l ZC.1d(t)?"9L("+i+","+a+","+n+")":{r:i,g:a,b:n}},Dl:1n(e,t,i){1l"#"+((1<<24)+(e<<16)+(t<<8)+i).ac(16).7u(1)},oI:1n(e,t,i){1a a=ZC.AO.jk(e);1l(12D*a.r+12G*a.g+114*a.b)/5I>=128?i:t},12I:1n(e,t,i){e=ZC.AO.G9(e),t=ZC.AO.G9(t);1a a=ZC.AO.jk(e),n=ZC.AO.jk(t),l={};1j(1a r in a)l[r]=1A.4n(i*a[r]+(1-i)*n[r]);1l ZC.AO.Dl(l.r,l.g,l.b)},kP:1n(){},u1:1n(){},gc:1n(e,t){1a i;1j(i=0;i<t.1f;i++)e[t[i]]=1c;1j(i in e)0===i.1L("137")&&"1n"==1y e[i]&&(e[i]=1c)}},ZC.P={qh:{12N:"cY",13y:"13z",13t:"13B",13r:"13q",13e:"Bt",13g:"13a",13o:"13p",12v:"Zv",Zu:"Sh",Sj:"Sc",Sn:"Bt",So:"Sp",Sl:"Sa",Rt:"S3",Rm:"Rn",Rr:"Rl",Rw:"Tq",Ts:"Ty",Tz:"U2",Tm:"Sy",SO:"Bm",Td:"Tf"},GE:1n(e,t,i){1l"<1N"+(i&&!t&&"iw"!==i?\' 1I="4U:\'+i+\'"\':"")+(t&&"7C"!==i||"iw"===i?\' 7L="7s:;"\':"")+\' 2S="\'+e+\'" \'},qL:1n(e){1a t;if(ZC.A4.6J.a6)4M{t=2g.4V("<kI />")}4K(o){t=2g.4V("kI")}1u t=2g.4V("kI");t.id=e.id+"-kI",t.1I.dp="8X",e.3c(t);1a i=1c,a=t.Tj||t.Ov;if(!(i=a.2g?a.2g:a).3s){1a n=i.4V("Oq");i.3c(n);1a l=i.4V("Qr");n.3c(l);1a r=i.4V("mC");n.3c(r)}1l i},BX:1n(e){1a t;if(1y ZC.bn===ZC.1b[31]){if(ZC.ca)t=!1;1u{t=!0;4M{2g.Qt("Qv")}4K(i){t=!1}}t&&!ZC.2K&&(t=!1),t&&(t="Qx"in 2g.gb),ZC.bn=t}1u t=ZC.bn;if(t)1Q(e){1i"6Z":1i"6C":e="4G";1p;1i"83":e="6h";1p;1i"7D":1i"6l":e="5V";1p;1i"3I":e="4G"}1l e},o3:1n(e,t){1a i,a,n,l=[],r=t.JY,o=t.OQ,s=t.PF,C=r-s/2;if(e.1f>0){1a A=0,Z=0;1j(0!==r&&(A=ZC.1k(C*ZC.EE(o)+s),Z=ZC.1k(C*ZC.EK(o)+s)),i=0,a=e.1f;i<a;i++)if(1c!==ZC.1d(e[i])){1a c=[];1j(n=0;n<e[i].1f;n++)c[n]=e[i][n];1a p=c.1f;if(2===p||4===p)1j(n=0;n<p;n++)c[n]=e[i][n]+(n%2?Z+t.BC:A+t.BJ);l.1h(c)}1u l.1h(1c)}1l l},k8:1n(e,t,i,a,n){1y n===ZC.1b[31]&&(n=!1);1a l,r,o=[e[0],e[1]];1Q(e.1f>=4&&(o[2]=e[2],o[3]=e[3]),e.1f>=6&&(o[4]=e[4],o[5]=e[5]),7===e.1f&&(o[6]=e[6]),t){1i"3f":1i"2F":1a s,C;if(i.CW)s=C=i.AZ%2==1?.5:0,ZC.A4.6J.a6&&ZC.97&&"2F"===t&&(s=i.AZ%2==1?.5:0,C=i.AZ%2==1?0:.5),o[0]=1A.46(o[0])-s,o[1]=1A.46(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l],"3L"===t){1a h=i.AA%2m==0?10:1;o[0]=ZC.1k(h*o[0]),o[1]=ZC.1k(h*o[1]),4===o.1f&&(o[2]=ZC.1k(h*o[2]),o[3]=ZC.1k(h*o[3]))}}1u o=ZC.P.k8(e[l],t,i,a,n);if(1c!==ZC.1d(o)&&!7X(o[0])&&!7X(o[1])&&fP(o[0])&&fP(o[1]))if(r<=20&&a&&(c[0]=ZC.CT(c[0],o[0]/("3L"===t?10:1)),c[1]=ZC.CT(c[1],o[1]/("3L"===t?10:1)),c[2]=ZC.BN(c[2],o[0]/("3L"===t?10:1)),c[3]=ZC.BN(c[3],o[1]/("3L"===t?10:1))),0===l)p.1h(("2F"===t?"M ":"m ")+o[0]+" "+o[1]);1u if(u&&(p.1h(("2F"===t?"M ":"m ")+o[0]+" "+o[1]),u=!1),2===o.1f)p.1h(("2F"===t?"L ":"l ")+o[0]+" "+o[1]);1u if(4===o.1f)p.1h(("2F"===t?"Q ":"qb ")+o[0]+" "+o[1]+" "+o[2]+" "+o[3]),"3L"===t&&p.1h("l "+o[2]+" "+o[3]);1u if(6===o.1f)if("2F"===t){1a 1b=0;o[3]%2m==o[4]%2m&&(1b=o[4]>=o[3]?.Bv:-.Bv),s=ZC.AN.BM(o[0],o[1],o[2],o[3]+1b),C=ZC.AN.BM(o[0],o[1],o[2],o[4]-1b),A="0 0",0===o[5]?o[4]-o[3]>2m?(A="0 1",C[0]=s[0],C[1]=s[1]):A=o[4]-o[3]<=180?"0 1":"1 1":o[3]-o[4]>2m?(A="0 0",C[0]=s[0],C[1]=s[1]):A=o[3]-o[4]<=180?"0 0":"1 0",p.1h("a "+o[2]+","+o[2]+" 0 "+A+" "+(C[0]-s[0])+","+(C[1]-s[1]))}1u"3L"===t&&(o[2]*=10,s=ZC.AN.BM(o[0],o[1],o[2],o[3]),C=ZC.AN.BM(o[0],o[1],o[2],o[4]),A=1===o[5]?"at":"wa",p.1h(A+" "+ZC.1k(o[0]-o[2])+","+ZC.1k(o[1]-o[2])+","+ZC.1k(o[0]+o[2])+","+ZC.1k(o[1]+o[2])+" "+ZC.1k(s[0])+","+ZC.1k(s[1])+" "+ZC.1k(C[0])+","+ZC.1k(C[1])));1u 7===o.1f&&p.1h(("2F"===t?"C ":"c ")+o[0]+" "+o[1]+" "+o[2]+" "+o[3]+" "+o[4]+" "+o[5])}1u u=!0;1l i.E["8u-dc-2R"]||i.OD&&ZC.4f.2P("2R-2W-"+Z,p.2M("#")),i.H&&r<=20&&a&&(i.H.E[i.K+"-ch"]=c),p},MK:1n(e,t){1a i,a,n=e.Rh||e.Eh;1l t=ZC.1k(t||"0"),n&&n.7p?n.7p.1f>0?(i=n.7p[t].aR,a=n.7p[t].bG):n.rU.1f>0&&(i=n.rU[t].aR,a=n.rU[t].bG):(i=e.aR,a=e.bG),[ZC.1k(i||"0"),ZC.1k(a||"0")]},F3:1n(e,t,i){1a a;1l i=i||2g,1c!==ZC.1d(t)?i.zq?a=i.zq(t,e):(a=i.4V(e)).4l("eq",t):a=i.4V(e),"7A:"===e.2x(0,4)&&(a.7U="sN"),a},ER:1n(e){1a t;e 3E 3M||(e=[e]);1j(1a i=0,a=e.1f;i<a;i++)"4j"!=1y(t=e[i])&&(t=ZC.AK(e[i])),t&&(1y t.gn!==ZC.1b[31]?t.gn.aP(t):1y t.6r!==ZC.1b[31]&&t.6r.aP(t))},G4:1n(e,t){1j(1a i in t)if("3b"==1y i&&"4j"!=1y t[i]&&"1n"!=1y t[i])4M{e.4l(i,t[i])}4K(a){}},PR:1n(e,t){1j(1a i in t)"3b"==1y i&&"4j"!=1y t[i]&&"1n"!=1y t[i]&&(e.1I[i]=t[i])},r7:1n(e){1a t;if(e===2g)1l!0;if(!e)1l!1;if(!e.6r)1l!1;if(e.1I){if("2b"===e.1I.3N)1l!1;if("8X"===e.1I.dp)1l!1}if(2u.g5){if("2b"===(t=2u.g5(e,"")).3N)1l!1;if("8X"===t.dp)1l!1}if(t=e.kj){if("2b"===t.3N)1l!1;if("8X"===t.dp)1l!1}1l ZC.P.r7(e.6r)},TA:1n(e){1a t=e.7U||ZC.A4(e).3S("1O");1l 1c!==ZC.1d(t)&&"4j"==1y t&&(t=1y t.dH!==ZC.1b[31]?t.dH:""),t||""},II:1n(e,t,i,a,n,l,r,o){if(e)1Q(r=r||"",t){1i"3f":o?e.9q("2d").q2(i,a,n,l):e.1s=e.1s;1p;1i"3L":1i"2F":1a s=e.7k.1f;if(s>gz&&1y e.4o!==ZC.1b[31])1l 8o(e.4o="");if(s>0)1j(1a C=s-1;C>=0;C--)""===r?e.aP(e.7k[C]):0===e.7k[C].id.1L(r+"-")&&e.aP(e.7k[C])}},E5:1n(e,t){1Q("3b"==1y e&&(e=ZC.AK(e)),t){1i"3f":1l e.9q("2d");1i"2F":1i"3L":1l e}},K2:1n(e,t){1Q(t){1i"2F":1l ZC.P.s2(e);1i"3L":1i"3f":1l ZC.P.I0(e)}},HF:1n(e,t){1Q(t){1i"2F":1l ZC.P.s2(e);1i"3L":1l ZC.P.I0(e);1i"3f":1l ZC.P.zl(e)}},s2:1n(e){1a t;if(ZC.AK(e.id))1l ZC.AK(e.id);1a i=ZC.P.F3("g",ZC.1b[36]);1l 1c!==ZC.1d(t=e.id)&&i.4l("id",t),1c!==ZC.1d(t=e.2p)&&i.4l("1O",t),1c!==ZC.1d(t=e.8q)&&i.4l("z-2Z",t),1c!==ZC.1d(t=e["3v-2R"])&&i.4l("3v-2R",t),e.8T?e.p.hh(i,e.8T.nA):e.p.3c(i),i},XM:1n(e){1a t;ZC.P.ER(e.id);1a i=ZC.P.F3("vp",ZC.1b[36]);1l i.id=e.id,1c!==ZC.1d(e.cx)?((t=ZC.P.F3("3A",ZC.1b[36])).id=e.id+"-2S",ZC.P.G4(t,{cx:e.cx,cy:e.cy,r:e.r})):((t=ZC.P.F3("Py",ZC.1b[36])).id=e.id+"-2S",ZC.P.G4(t,{2W:e.2R})),i.3c(t),i},zl:1n(e){1a t;if(ZC.AK(e.id))1l ZC.AK(e.id);1a i=2g.4V("3f"),a=i.1I;if(1c!==ZC.1d(t=e.id)&&(i.id=t),1c!==ZC.1d(t=e.2p)&&(i.7U=t),1c!==ZC.1d(t=e.wh)){1a n=(""+t).2o("/");e[ZC.1b[19]]=n[0],e[ZC.1b[20]]=n[1]}if(1c!==ZC.1d(t=e.tl)){1a l=(""+t).2o("/");e.1v=l[0],e.1K=l[1]}1l i.1s=e[ZC.1b[19]],i.1M=e[ZC.1b[20]],1c!==ZC.1d(t=e.1K)&&(a.1K=t+"px"),1c!==ZC.1d(t=e.1v)&&(a.1v=t+"px"),1c!==ZC.1d(t=e.3N)&&(a.3N=t),1c!==ZC.1d(t=e.2L)&&(a.2L=t),1c!==ZC.1d(t=e.8q)&&(a.9K=t),e.p.3c(i),i},I0:1n(e){1a t,i,a,n,l,r;if(ZC.AK(e.id))1l a=ZC.AK(e.id),1c!==ZC.1d(t=e.wh)&&(l=(""+t).2o("/"),a.1I.1s=l[0]+"px",a.1I.1M=l[1]+"px"),1c!==ZC.1d(t=e.tl)&&(r=(""+t).2o("/"),a.1I.1v=r[0]+"px",a.1I.1K=r[1]+"px"),a;(n=(a=2g.4V("3C")).1I).vH="ll",1c!==ZC.1d(t=e.wh)&&(l=(""+t).2o("/"),e[ZC.1b[19]]=l[0],e[ZC.1b[20]]=l[1]),1c!==ZC.1d(t=e.tl)&&(r=(""+t).2o("/"),e.1v=r[0],e.1K=r[1]),1c!==ZC.1d(t=e.id)&&(a.id=t),1c!==ZC.1d(t=e.2p)&&""!==t&&(a.7U=t);1j(1a o=[["1v","","px"],["1K","","px"],[ZC.1b[19],"","px"],[ZC.1b[20],"","px"],"2L","9M",["9d","rA|rD"],["8q","9K"],"3v","3N",["6M","","px"],"6Q","6N","cD","e4","cW","o7","1r","1G","wJ","lS","u0","lW","1T","4U",["2y","m0|nK|nn|lZ","px"],["m0","","px"],["nK","","px"],["nn","","px"],["lZ","","px"],["3w","cE|dU|dV|dW","px"],["cE","","px"],["dU","","px"],["dV","","px"],["dW","","px"],"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o.QJ.2o(","),C=0;C<s.1f;C++){1a A=ZC.GR(s[C]),Z=!1;if(2===(a=A.2o(">")).1f&&(Z=!0,ZC.A4(a[0]).5f(1n(){1a e=1g;ZC.A4(a[1],1g).5f(1n(){1g.6r===e&&o.P9.1h(1g)})})),2===(a=A.2o(" ")).1f&&(Z=!0,ZC.A4(a[0]).5f(1n(){ZC.A4(a[1],1g).5f(1n(){o.P9.1h(1g)})})),!Z)if("#"===A.2x(0,1))ZC.AK(A.2x(1))&&(o.P9=[ZC.AK(A.2x(1))]);1u if("."===A.2x(0,1))if(2g.gj){if(o.MN.gj)n=o.MN.gj(A.2x(1));1u if(n=2g.gj(A.2x(1)),o.MN!==2g){1a c=[];1j(l=0,r=n.1f;l<r;l++)ZC.A4.uC(n[l],o.MN)&&c.1h(n[l]);n=c}1j(l=0,r=n.1f;l<r;l++)o.P9.1h(n[l])}1u{1a p=1m 5v("(^|\\\\s)"+A.2x(1)+"(\\\\s|$)","i"),u=o.MN.dB("*"),h="";1j(l=0,r=u.1f;l<r;l++)"4j"==1y(h=u[l].7U)&&(h=1y h.dH!==ZC.1b[31]?h.dH:""),""!==h&&p.5Y(h)&&o.P9.1h(u[l])}1u 1j(l=0,r=(n=o.MN.dB(A)).1f;l<r;l++)o.P9.1h(n[l])}1l o.1f=o.P9.1f,1g},ZC.A4.5n={7v:1n(){1j(1a e,t=[],i=0,a=1g.P9.1f;i<a;i++){1a n=[1g.P9[i]];if((e=98.1f)>1)1j(1a l=1;l<e;l++)n.1h(98[l]);t.1h(98[0].9l(1g,n))}1l t},5f:1n(){1j(1a e,t=0,i=1g.P9.1f;t<i;t++){1a a=[1g.P9[t]];if((e=98.1f)>1)1j(1a n=1;n<e;n++)a.1h(98[n]);98[0].9l(1g.P9[t],a)}1l 1g},9x:1n(){1a e=[];1l 1g.5f(1n(){1j(1a t=0,i=1g.7k.1f;t<i;t++)1===1g.7k[t].fC&&e.1h(1g.7k[t])}),1g.P9=e,1g},3r:1n(){1g.7v.4v(1g,1n(e){e&&e.6r&&e.6r.aP(e)})},mv:1n(){1g.7v.4v(1g,1n(e){if(e)1j(;e.7k.1f;)e.aP(e.7k[e.7k.1f-1])})},jm:1n(e){1a t,i;1y e===ZC.1b[31]&&(e=!0);1a a=1g.7v.4v(1g,1n(a){if(!a)1l 1c;if(a===2u){1a n=2g.3s;1l a.yO?(t=a.yO,i=a.Ud):n&&n.gn&&n.gn.l6?(t=n.gn.l6,i=n.gn.yP):n&&n.l6&&(t=n.l6,i=n.yP),{1s:t,1M:i}}1a l,r,o=e?"8K":ZC.A4(a).fU("3N");if(2u.g5){1a s=2u.g5(a,1c);l=s.rG(ZC.1b[19]).7u(0,-2),r=s.rG(ZC.1b[20]).7u(0,-2)}1u if(a.iF){1a C=a.iF();l=C.1s?C.1s:a.ri,r=C.1M?C.1M:a.rp}1u l=a.ri,r=a.rp;if("2b"===o||""===o||1y o===ZC.1b[31]){1a A=a.1I,Z=A.dp,c=A.2L,p=A.3N;A.dp="8X",A.2L="4E",A.3N="8K",t=l,i=r,A.3N=p,A.2L=c,A.dp=Z}1u t=l||0,i=r||0;1l{1s:t,1M:i}});1l 1===a.1f?a[0]:a},fU:1n(e){1a t=1g.7v.4v(1g,1n(e,t){if("3N"===t)1l e.1I.3N;1a i,a=2g;if(t=ZC.EB(t),!e||e===a)1l jY;if("3p"===t&&1y e.Xs!==ZC.1b[31]){1a n=(ZC.A4(e).fU("kw")||"").mP(/2n\\(3p=(.*)\\)/);1l n&&n[1]?5T(n[1])/100:1}if(-1!==ZC.AT(["9d","rA","rD"],t))1l(i=e.1I.9d)?i:(i=e.1I.rA)?i:(i=e.1I.rD)?i:"2b";1a l=e.1I?e.1I[t]:1c;if(!l)if(a.jx&&a.jx.g5){1a r=a.jx.g5(e,1c);t=t.1F(/([A-Z])/g,"-$1").aO(),l=r?r.rG(t):1c}1u if(e.kj&&(l=e.kj[t],/^\\d/.5Y(l)&&!/px$/.5Y(l)&&"6N"!==t)){1a o=e.1I.1K,s=e.sW.1K;e.sW.1K=e.kj.1K,e.1I.1K=l||0,l=e.1I.Ya+"px",e.1I.1K=o,e.sW.1K=s}1l"3p"===t&&(l=5T(l)),/Fc/.5Y(8U.cv)&&-1!==ZC.AT(["1K","1v","2z","2c"],t)&&"8A"===ZC.A4(e).fU("2L")&&(l="3i"),"3i"===l?1c:l},e);1l 1===t.1f?t[0]:t},wh:1n(){1a e;1l 1g.P9[0]?1c!==ZC.1d(e=ZC.A4(1g.P9[0]).jm())?[ZC.1k(e[ZC.1b[19]]),ZC.1k(e[ZC.1b[20]])]:[0,0]:1c},1s:1n(e){1a t;if(1y e===ZC.1b[31]){1a i=1g.7v.4v(1g,1n(e){1l 1c!==ZC.1d(t=ZC.A4(e).jm())?ZC.1k(t[ZC.1b[19]]):0});1l 1===i.1f?i[0]:i}1l 1g.7v.4v(1g,1n(e,t){e.1I.1s=t+"px"},e),1g},1M:1n(e){1a t;if(1y e===ZC.1b[31]){1a i=1g.7v.4v(1g,1n(e){1l 1c!==ZC.1d(t=ZC.A4(e).jm())?ZC.1k(t[ZC.1b[20]]):0});1l 1===i.1f?i[0]:i}1l 1g.7v.4v(1g,1n(e,t){e.1I.1M=t+"px"},e),1g},aV:1n(){1l ZC.A4.1Z().1K},aW:1n(){1l ZC.A4.1Z().1v},2O:1n(e,t){if(1y t===ZC.1b[31]){1a i=1g.7v.4v(1g,1n(t){1a i=ZC.A4(t).fU(e);1l-1!==(""+i).1L("px")?ZC.1k(i):i});1l 1===i.1f?i[0]:i}1l 1g.7v.4v(1g,1n(e,t,i){e.1I[t]=i},e,t),1g},3S:1n(e,t){if(1y t===ZC.1b[31]){1a i=1g.7v.4v(1g,1n(t){1l t.bT(e)});1l 1===i.1f?i[0]:i}1l 1g.7v.4v(1g,1n(e,t,i){e.4l(t,i)},e,t),1g},8L:1n(e){if(1y e===ZC.1b[31]){1a t=1g.7v.4v(1g,1n(e){1l e.1V});1l 1===t.1f?t[0]:t}1l 1g.7v.4v(1g,1n(e,t){e.1V=t},e),1g},4m:1n(){1l 1g.7v.4v(1g,1n(e){e.1I.3N="8K"}),1g},5d:1n(){1l 1g.7v.4v(1g,1n(e){e.1I.3N="2b"}),1g},2a:1n(){1a e=1g.7v.4v(1g,1n(e){if(!(e&&(e.x&&e.y||1c!==!e.6r&&"2b"!==ZC.A4(e).fU("3N"))))1l jY;1a t,i,a,n,l,r,o,s={1v:0,1K:0},C={1v:0,1K:0},A=e&&e.Gi;1l A&&((i=A.3s)===e&&(s={1v:i.Yd,1K:i.Xz}),t=A.gb,1y e.iF!==ZC.1b[31]&&(C=e.iF()),a=A.jx||A.Xo,n=t.jC||i.jC||0,l=t.jB||i.jB||0,r=a.yg||t.aW,o=a.yf||t.aV,s={1v:C.1v+r-n,1K:C.1K+o-l}),s});1l 1===e.1f?e[0]:e},3t:1n(e,t,i){if(""!==(e=ZC.A4.iC(e))){if(i||(i=!ZC.sm||{sq:!0}),-1!==e.1L(" ")){1j(1a a=e.2o(/\\s+/),n=0;n<a.1f;n++)1g.3t(a[n],t,i);1l 1g}1l 1g.7v.4v(1g,1n(e,t,a){1n n(e){1a t=(e=e||2u.Es).2X||e.sH,i=ZC.A4.BX(e);1c!==i&&a.4v(t,i)}ZC.A4.IY||(ZC.A4.IY=[]),ZC.A4.IY.1h([e,t,a,n]),e.j2?e.j2(t,n,i):e.m6("on"+t,n)},e,t),1g}},3l:1n(e,t){if(""!==(e=ZC.A4.iC(e))){if(-1!==e.1L(" ")){1j(1a i=e.2o(/\\s+/),a=0;a<i.1f;a++)1g.3l(i[a],t);1l 1g}1l 1g.7v.4v(1g,1n(e,t,i){if(1y ZC.A4.IY!==ZC.1b[31])1j(1a a=0,n=ZC.A4.IY.1f;a<n;a++)if((ZC.A4.IY[a][0]===e||e.86&&"WL"===e.86.5J()&&e.id===ZC.A4.IY[a][0].id)&&ZC.A4.IY[a][1]===t&&ZC.A4.IY[a][2]===i){e.Fn?e.Fn(t,ZC.A4.IY[a][3],!0):e.Xa("on"+t,ZC.A4.IY[a][3]),ZC.A4.IY.6u(a,1);1p}},e,t),1g}},4g:1n(e,t,i){if(""!==(e=ZC.A4.iC(e))){if(i||(i=!ZC.sm||{sq:!0}),0===e.1L("dE")&&(i={sq:!1}),-1!==e.1L(" ")){1j(1a a=e.2o(/\\s+/),n=0;n<a.1f;n++)1g.4g(a[n],t,i);1l 1g}1a l=1g.QJ;1l ZC.A4.9F||(ZC.A4.9F={}),ZC.A4.9F[e]||(ZC.A4.9F[e]=[],2g.j2?2g.j2(e,r,i):2g.m6("on"+e,r)),ZC.A4.9F[e].1h([l,t]),1g}1n r(t){1a i=(t=t||2u.Es).2X||t.sH,a=i.7U||"";"4j"==1y a&&(a=1y a.dH!==ZC.1b[31]&&1c!==ZC.1d(a.dH)?a.dH:"");1a l,r,o=ZC.A4.9F[e],s=1c,C=1c,A=[];1j(l=0,r=o.1f;l<r;l++)("4j"==1y o[l][0]&&i===o[n][0]||"3b"==1y o[l][0]&&("."===o[l][0].2x(0,1)&&-1!==ZC.AT(a.2o(" "),o[l][0].1F(".",""))||"#"===o[l][0].2x(0,1)&&i.id===o[l][0].2x(1)))&&(s=o[l][1],C=ZC.A4.BX(t),1c!==ZC.1d(s)&&1c!==ZC.1d(C)&&A.1h([s,i,C]));1j(l=0,r=A.1f;l<r;l++)A[l][0].4v(A[l][1],A[l][2])}},4i:1n(e,t){if(""!==(e=ZC.A4.iC(e))){1a i,a,n;if(-1!==e.1L(" ")){1j(a=0,n=(i=e.2o(/\\s+/)).1f;a<n;a++)1g.4i(i[a],t);1l 1g}1a l=1g.QJ;if(ZC.A4.9F||(ZC.A4.9F={}),i=ZC.A4.9F[e])1j(a=i.1f-1;a>=0;a--)i[a][0]!==l||t&&i[a][1]!==t||ZC.A4.9F[e].6u(a,1);1l 1g}}},ZC.A4.Xf=1n(e){1j(1a t=[],i=0;i<ZC.A4.9F[e].1f;i++)t.1h(ZC.A4.9F[e][i][0]);1l t.2M(",")},ZC.A4.iC=1n(e){1l ZC.ca&&(e=ZC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gy)}4K(A){}1a C="q9:"===2u.82.hV;if(s){n&&(s.f7=1n(){4===s.f8&&((C||s.6T>=oN&&s.6T<fN)&&o&&o(s.uu,s.6T,s,t),s.6T>=sK&&r&&r(s,s.6T,s.sZ,t),s.f7=1m 2u.bz,s=1c)}),2u.jW||(s.jl=1n(){r&&r(s,0,"",t)}),"vZ"===i.5J()?(s.bp("vZ",t,n),s.cV("X-Zj-Zb","gy"),s.cV("Zk-1J","f5/x-8C-4I-Zo")):(""!==a&&(-1===t.1L("?")&&(t+="?"),t+="&"+a),s.bp("bY",t,n)),l&&l(s);4M{s.8t(a),n||((C||s.6T>=oN&&s.6T<fN)&&o&&o(s.uu,s.6T,s,t),s.6T>=sK&&r&&r(s,s.6T,s.sZ,t),s=1c)}4K(Z){C&&r&&(r(s,s.6T,s.sZ,t),s.f7=1m 2u.bz,s=1c)}}},ZC.AN={zV:1n(e,t){1a i,a,n=1o.3J.wF,l=[],r=0;1n o(e,t){-1===ZC.AT(e,t)&&e.1h(t)}1j(i=0;i<e.1f;i++)e[i]+=t;1a s=-1;1j(i=1;i<e.1f;i++)ZC.2l(e[i]-e[i-1])<n?(l[r]=l[r]||{2k:-1,1X:-1,2C:[]},-1===l[r].2k&&(l[r].2k=i>1?e[i-2]:t,-1===s&&(s=l[r].2k),l[r].2k),o(l[r].2C,i-1),o(l[r].2C,i)):l[r]&&(l[r].1X=e[i],l[r].1X,r++);l[r]&&-1===l[r].1X&&(l[r].1X=2m+t);1a C=l.1f;if(C>1&&l[C-1].1X-l[0].2k==2m){1j(a=0;a<l[0].2C.1f;a++)e[l[0].2C[a]]+=2m;l[C-1].2C=l[C-1].2C.4A(l[0].2C),l[C-1].1X+=l[0].2k,l=l.6u(1)}1j(l.1f>1&&(l[l.1f-1].1X=l[0].2k+2m),i=0;i<l.1f;i++){1a A=l[i],Z=A.2C.1f,c=(A.1X-A.2k)/(Z+4);c=ZC.CT(c,n);1a p=0;1j(a=0;a<A.2C.1f;a++)p+=e[A.2C[a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-t)/(i-e));1l(n<1||l)&&(r=n/2.5*1A.dR(s),o=n/2.5*1A.dQ(s)),[(e+i)/2+(e<i?r:-r),(t+a)/2+o]}1l[e,(t+a)/2]},sd:1n(e,t){1a i=(e[1]-t[1])/(e[0]-t[0]);1l[i,e[1]-i*e[0]]},gC:1n(e,t,i,a){if(t[0]===a[0]&&t[1]===a[1])1l t;if(e[0]===i[0]&&e[1]===i[1])1l e;1a n=ZC.AN.sd(e,t),l=n[0],r=n[1],o=ZC.AN.sd(i,a),s=o[0],C=(o[1]-r)/(l-s);1l[C,l*C+r]},Q7:1n(e,t,i){1c===ZC.1d(t)&&(t=5);1a a=0,n=0;1c!==ZC.1d(i)&&(a=i[0],n=i[1]);1j(1a l,r,o,s="",C=ZC.6R?ZC.3B:0,A=0,Z=e.1f;A<Z;A++)e[A]&&(0===A?(r=e[A][0]+C+a,o=e[A][1]+C+n,l=A,s+=1A.46(r,10)+","+1A.46(o,10)+","):1A.5y((e[A][0]+C-r)*(e[A][0]+C-r)+(e[A][1]+C-o)*(e[A][1]+C-o))>t&&e[A-1]&&(1A.5y((e[A][0]-e[A-1][0])*(e[A][0]-e[A-1][0])+(e[A][1]-e[A-1][1])*(e[A][1]-e[A-1][1]))>t&&A-l>1&&(s+=1A.46(e[A-1][0]+C+a,10)+","+1A.46(e[A-1][1]+C+n,10)+","),r=e[A][0]+C+a,o=e[A][1]+C+n,l=A,s+=1A.46(r,10)+","+1A.46(o,10)+","));1l s=s.2x(0,s.1f-1)},Z8:1n(e,t){if(1c===ZC.1d(e)||e.1f<2)1l"";1c===ZC.1d(t)&&(t=6,ZC.2K&&(t+=10));1a i,a,n,l,r,o=[];1j(i=0,a=e.1f;i<a;i++)(0===i||i>0&&1c!==ZC.1d(e[i])&&1c!==ZC.1d(e[i-1])&&e[i].2M("/")!==e[i-1].2M("/")||1c===ZC.1d(e[i]))&&o.1h(e[i]);1a s=[],C=[],A=!1;1j(i=0,a=o.1f;i<a;i++)if(o[i]){1a Z,c,p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i)),0===i&&(i=1A.4h(t/a)))}1l[i,a]},uN:1n(e,t){1l.5*(2*t[1]+(-t[0]+t[2])*e+(2*t[0]-5*t[1]+4*t[2]-t[3])*e*e+(-t[0]+3*t[1]-3*t[2]+t[3])*e*e*e)},uP:1n(e,t){1a i,a,n,l,r,o=e.1f,s=[],C=[],A=[];1j(i=0;i<o-1;i++)a=e[i+1]-e[i],n=t[i+1]-t[i],C.1h(a),s.1h(n),A.1h(n/a);1a Z=[A[0]];1j(i=0;i<C.1f-1;i++){l=A[i];1a c=A[i+1];if(l*c<=0)Z.1h(0);1u{a=C[i];1a p=C[i+1];r=a+p,Z.1h(3*r/((r+p)/l+(r+a)/c))}}Z.1h(A[A.1f-1]);1a u=[],h=[];1j(i=0;i<Z.1f-1;i++){l=A[i];1a 1b=Z[i],d=1/C[i];r=1b+Z[i+1]-l-l,u.1h((l-1b-r)*d),h.1h(r*d*d)}1l 1n(i){1a a=e.1f-1;if(i===e[a])1l t[a];1j(1a n,l=0,r=h.1f-1;l<=r;){n=1A.4n(.5*(l+r));1a o=e[n];if(o<i)l=n+1;1u{if(!(o>i))1l t[n];r=n-1}}a=1A.1X(0,r);1a s=i-e[a],C=s*s;1l t[a]+Z[a]*s+u[a]*C+h[a]*s*C}},YQ:1n(e,t,i,a){1c===ZC.1d(a)&&(a=1/(i/t.1f*4));1a n,l,r=[];if(e)if((n=[].4A(t))[1]&&n[2]){n[0]=n[0]||n[1]||n[2]||n[3],n[1]=n[1]||n[2]||n[0]||n[3],n[2]=n[2]||n[3]||n[1]||n[0],n[3]=n[3]||n[2]||n[1]||n[0];1a o=ZC.AN.uP([0,1,2,3],n);1j(l=1;l<=2;l+=a)r.1h([l-1,o(l)])}1u r.1h([]);1u 1j(1a s=1;s<t.1f-2;s++)if(1!==a)if((n=[t[s-1],t[s],t[s+1],t[s+2]])[1]&&n[2])1j(n[0]=n[0]||n[1]||n[2]||n[3],n[1]=n[1]||n[2]||n[0]||n[3],n[2]=n[2]||n[3]||n[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A,Z,e[c+12],6,Up),C,A,e[c+3],10,-Ux),s,C,e[c+10],15,-Vf),Z,s,e[c+1],21,-Vm),A=r(A,Z=r(Z,s=r(s,C,A,Z,e[c+8],6,Vl),C,A,e[c+15],10,-Vk),s,C,e[c+6],15,-Vi),Z,s,e[c+13],21,Vh),A=r(A,Z=r(Z,s=r(s,C,A,Z,e[c+4],6,-Vg),C,A,e[c+11],10,-Vd),s,C,e[c+2],15,Uz),Z,s,e[c+9],21,-Vc),s=o(s,u),C=o(C,h),A=o(A,1b),Z=o(Z,d)}1l 3M(s,C,A,Z)}},1y 1o===ZC.1b[31]&&(2u.1o={Vb:!0}),1o.Va={},1o.fB={},1o.V4={},1o.6g={},1o.6g.2e=0,1o.6g.1U={},1o.6g.a8=1n(e,t,i,a){1a n;if(1c!==ZC.1d(1o.6g.1U[i]))(n=1o.6g.1U[i]).pc=!0,ZC.wp=!0,a||(n.7l(t),n.K=i),ZC.wp=!1;1u{1Q(e){1i"DP":n=1m DP(t);1p;1i"I2":n=1m I2(t);1p;1i"DR":n=1m DR(t);1p;1i"QW":n=1m QW(t);1p;1i"CX":n=1m CX(t)}n.K=i,1o.6g.2e++,1o.6g.2e>1o.3J.wO?(1o.6g.1U={},1o.6g.2e=0):1o.6g.1U[i]=n}1l n},1o.ft={},1o.ww={},1o.c7=2,1o.Bu=!1,1o.qu=1,1o.ys={1w:"xy",92:"3d,1w",1N:"xy",88:"3d,1N",bR:"yx",bQ:"yx",5x:"xy",6U:"3d,5x",6b:"yx",7z:"3d,6b",6v:"xy",5g:"xy",8p:"yx",6A:"yx",3P:"r",7a:"3d,3P",8Z:"r",8z:"r",8m:"5x",8h:"6b",au:"xy",af:"yx",5N:"xy",7j:"r",5A:"xy",oX:"yx",7Y:"xy,5x",b6:"r"},1o.4F={9R:!1,b5:!1,ez:!1,8j:!1,m8:!1},1o.yz=1n(e){1j(1a t=0;t<e.1f;t++){if(e[t].4X)if(e[t].4X.1L("1o.2k.js")>-1)1l e[t].4X.2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")||-1!==e.2X.id.1L("-2A-")||1o.3J.bh){1a a,n,l,r,o,s;i=i||{};1a C=1c===ZC.1d(t)?1o.XH(e):1o.7d(t);if(C){if(-1!==ZC.AT(C.KX,ZC.1b[38]))1l!1;if(1c===ZC.1d(t)?(n=ZC.P.MK(e),a=C.ng(n[0],n[1])):a=1c!==ZC.1d(i[ZC.1b[3]])?C.OF(i[ZC.1b[3]]):C.AI[0],!a)1l!1;1a A=ZC.A4("#"+C.K+"-1v");1c===ZC.1d(t)?(l=n[0]-A.2a().1K,r=n[1]-A.2a().1v):(l=C.I/2,r=C.F/2);1a Z={};e&&(Z=1o.gP(e,C));1a c=ZC.AO.C2("gd",C,Z,!0);if(!c&&1y c!==ZC.1b[31]&&(!e&&!i["6j-7r"]||e&&e.2X.id!==C.K+"-2B-1N"))1l e.6S(),!1;1a p=ZC.a5(C.K);C.rH(a?a.L:-1,e);1a u=-1;if(0!==1o.sS)u=1o.sS;1u 1j(1a h=ZC.AK(C.K);-1===u&&1c!==h.6r;)"3i"!==(u=ZC.1k(ZC.A4(h).2O("9K")))&&""!==u&&1c!==ZC.1d(u)||(u=-1),h=h.6r;u&&-1!==u&&1c!==ZC.1d(u)||(u=1);1a 1b=ZC.A4("#"+C.K+"-2B");if(1b.2O("9K",1o.pY+u+1),1c===ZC.1d(t)){if(e.2X.id===C.K+"-6F-9V"||e.2X.id===C.K+"-6F-eh")1l!0;e.6S()}if(!ZC.AK(C.K+"-2B"))1l!1;l=A.2a().1K,r=A.2a().1v;1a d=A.1s(),f=A.1M();1c===ZC.1d(t)?(o=(n=ZC.P.MK(e))[0]||ZC.DS[0],s=n[1]||ZC.DS[1]):(o=l+C.I/2,s=r+5);1a g=!1;if(C.U9("cH",!1),C.O2>0&&(C.U9("cH",!0),g=!0),C.U9("cG",!1),C.O2<C.QS.1f-1&&(C.U9("cG",!0),g=!0),C.U9("4Y",g,!0),o>=l&&o<=l+d*p[0]&&s>=r&&s<=r+f*p[1]){ZC.A4(".zc-2B").5f(1n(){1g.id!==C.K+"-2B"&&C.9j()}),C.T3=[o,s,1c===ZC.1d(t)?e.2X.id:t],1b.2O("3p",0).4m();1a B,v,E=ZC.1k(1b.2O(ZC.1b[19]))+ZC.1k(1b.2O("dW"))+ZC.1k(1b.2O("dU")),b=ZC.1k(1b.2O(ZC.1b[20]))+ZC.1k(1b.2O("cE"))+ZC.1k(1b.2O("dV")),m=1,K=!1;if(C.o.5i&&C.o.5i["6o-2B"]&&C.o.5i["6o-2B"]&&(m=C.o.5i["6o-2B"].2n?C.o.5i["6o-2B"].2n:1,K=C.o.5i["6o-2B"].Zl),1b.2O("3p",m).5d(),"d0"!==C.LU&&K){if(K){1a D=C.B9.O4[C.LU].ap.5i["6o-2B"];ZC.2E(C.o.5i["6o-2B"],D),B="1K"!==C.o.5i["6o-2B"].2L&&ZC.1d(C.o.5i["6o-2B"].2L)?A.2a().1K+A.1s()-E:A.2a().1K}v=A.2a().1v,1b.2O("1K",ZC.BN(1,B)+"px").2O("1v",ZC.BN(1,v)+"px").2O(ZC.1b[20],A.1M()+"px").2O("3F-Br","1G-3F").4m(),1b=ZC.A4("#"+C.K+"-2B"),K&&1b.P9[0].Zs>A.1M()&&1b.2O("9M-y","1Z")}1u{if(1c===ZC.1d(t)&&e.2X.id===C.K+"-2B-1N"){ZC.AK(C.K+"-2B").1I.cE=0;1a F=ZC.A4("#"+C.K+"-2B-1N").3S("9o").2o(","),I=ZC.1k(F[3])-ZC.1k(F[1]);ZC.AK(C.K+"-2B").1I.qC=ZC.1k(F[0])>C.I/2?"100% 0% !7q":"0% 0% !7q",B=l+(ZC.1k(F[0])>C.I/2?ZC.1k(F[2])-E:ZC.1k(F[0])),v=r+(ZC.1k(F[1])>C.F/1.25?ZC.1k(F[3])-b-I:ZC.1k(F[3]))}1u ZC.AK(C.K+"-2B").1I.qC="50% 0% !7q",B=C.T3[0]-E/2,v=C.T3[1],b>C.F*p[1]?v=r:v-r+b>C.F*p[1]&&(v=ZC.BN(v-b,C.F*p[1]-b)),B<l&&(B=ZC.BN(B,l)),B+E>l+C.I*p[0]&&(B=ZC.CT(l+C.I*p[0]-E/2,B-E/2));if(i.2L)1Q(i.2L){1i"1v":1p;1i"1v-1K":B=B-(C.I*p[0]-E)/2+5;1p;1i"1v-2z":B=B+(C.I*p[0]-E)/2-5;1p;1i"2c":v=v+(C.F*p[1]-b)-10;1p;1i"2c-1K":v=v+(C.F*p[1]-b)-10,B=B-(C.I*p[0]-E)/2+5;1p;1i"2c-2z":v=v+(C.F*p[1]-b)-10,B=B+(C.I*p[0]-E)/2-5;1p;1i"1K":v=v+(C.F*p[1]-b)/2-5,B=B-(C.I*p[0]-E)/2+5;1p;1i"2z":v=v+(C.F*p[1]-b)/2-5,B=B+(C.I*p[1]-E)/2-5}1u 1c!==ZC.1d(i.x)&&1c!==ZC.1d(i.y)&&(B=l+ZC.1k(i.x),v=r+ZC.1k(i.y));if(1b.2O("1K",ZC.BN(1,B)+"px").2O("1v",ZC.BN(1,v)+"px").4m(),ZC.6R){1a X=ZC.A4("#"+C.K+"-2B 3C").1s()[0]||120;1b.2O(ZC.1b[19],X+"px")}}1l C.dI=!0,!1}}}},ZC.A4(2g).3t("gd",1o.ZF)),1o.sn=1n(e,t){if(1o.2O)1l 1o.2O.uk?1o.2O.uk(e,t):1o.2O.Zr(e+"{"+t+"}",0)},1o.wh=1n(e,t,i){"3i"===t&&(t="100%"),"3i"===i&&(i="100%");1a a=[0,0];1l-1===(""+t).1L("%")&&-1===(""+i).1L("%")||(a=e.wh()),[-1!==(""+t).1L("%")?a[0]*5z(t,10)/100:5z(t,10),-1!==(""+i).1L("%")?a[1]*5z(i,10)/100:5z(i,10)]},1o.IY={},1o.3t=1n(e,t,i){e=e||"1o-jQ",1o.IY[e]||(1o.IY[e]={}),1o.IY[e][t]?1o.IY[e][t].1h({fn:i}):1o.IY[e][t]=[{fn:i}]},1o.3l=1n(e,t,i){if(e=e||"1o-jQ",1o.IY[e]&&1o.IY[e][t])if(i){1j(1a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r:#4u;3w:5r;2y:0;1T-1r:#2T",".zc-4I-5o-7S ak":"3w:dC aa !7q;2y:0 Za 0 0 !7q;1T-1r:#93 !7q;1G:5r Yh #89 !7q",".zc-4I-s0":"2s-2e:Xq !7q;Yg-Xm:-7Z;1w-1M:125%",".zc-4I-s1":"2s-2e:rm !7q;1w-1M:125%",".zc-4I-s1 a":"1r:#2T;3w:Xl aa;2L:lz;1v:dC;1G:7Z 2U #8I;1G-2c:hn 2U #8I",".zc-cF-6K":"1T-1r:#2T;1r:#8I !7q",".zc-cF-fM":"1T-1r:#4J;1r:#7g !7q",".zc-4r 1H":"3N:Xj-8K;2L:lz;1v:-5r",".zc-d7 3C":"2L:4E;1E-3x:3H;3w:8e;1T:#4J;1r:#2T",".zc-f1-6R":"3w:0;2L:4E;2s-2e:uS;2s-79:6z;2s-9i:"+1o.9J+";1r:#lJ;1E-3x:1K",".zc-f1":"3w:0;2L:4E;","#zc-5O":"3N:8K;2L:4E;1v:0;1K:0;1s:100%;1M:100%;2y:0;3w:0;1T:#2T;",".zc-2B":"2L:4E;3N:2b;1T-6D:no-6D !7q;1T-2L:50% 0% !7q;",".zc-2B-ex":"2s-2e:7Z;3w:0;1w-1M:7Z;1G-2c:7Z 2U #4u",".zc-2B-1P":"4U:8n;Et-8w:ll",".zc-9a":"1T:#93",".zc-9a 3C.zc-9a-wd":"2L:4E;1G:5r 2U #89;3w:aa Xi;1T-1r:#8I;1r:#2T",".zc-gq":"1T-1r:#2T;1r:#4u;1G:5r 2U #4J",".zc-2i-1H-6t":"1G-il:il",".zc-2i-1H-6t td":"3w:dC aa 5r 5r",".zc-1U-6t":"1G-il:il",".zc-1U-6t oC":"2s-9i:"+1o.9J+";1E-3x:1K;2s-2e:rm;2s-79:r9;3w:Gh si Gh dC;1T-1r:#89;1G-2c:5r 2U #cS",".zc-1U-6t th":"2s-9i:"+1o.9J+";1E-3x:1K;2s-2e:Xg;2s-79:r9;3w:5r si 5r dC;1T-1r:#7g;1G-2c:7Z 2U #cS",".zc-1U-6t td":"2s-9i:"+1o.9J+";1E-3x:1K;2s-2e:Bb;3w:7Z si 7Z dC;1T-1r:#j6;1G-2c:7Z 2U #93;Et-8w:ll",".zc-aU":"1v:0;1K:0;2L:lz",".zc-3m":"1v:0;1K:0;2L:4E"};ZC.ca||(h[".zc-1U-6t th:cI(:7S-Eo)"]="1G-2z:7Z eT #cS",h[".zc-1U-6t td:cI(:7S-Eo)"]="1G-2z:7Z 2U #93");1a 1b=2g.dB("fv")[0],d=2g.4V("1I");if(d.1J="1E/2O",d.4l("1U-Fg","1o"),1b.3c(d),!1o.2O)1j(n=0,l=2g.eY.1f;n<l;n++)2g.eY[n].Ey&&"1o"===2g.eY[n].Ey.bT("1U-Fg")&&(1o.2O=2g.eY[n]);1j(1a f in 1o.2O||(1o.2O=2g.eY[2g.eY.1f-1]),h)1c!==ZC.1d(1o.so[f])?1o.sn(f,1o.so[f]):1o.sn(f,h[f])}if("3L"===t&&!1o.tc)2g.Xd.2P("7A","u8:sE-rc-c1:3L"),2g.Xc().Xb=".sN { Ej:3R(#2q#Fv); }",1o.tc=!0;1a g="";1o.kJ&&(g=1o.kJ),e.1U&&1c!==ZC.1d(i=e.1U.bJ)&&(g=i),1c!==ZC.1d(i=e.bJ)&&(g=i);1a B={1U:!1,d5:!1,2O:!1,6O:!1};if(1c!==ZC.1d(i=e.4f))1j(1a v in B)1c!==ZC.1d(a=i[v])&&(B[v]=ZC.2t(a));1a E=!1;1c!==ZC.1d(i=e.5O)&&(E=ZC.2t(i));1a b=!0;1c!==ZC.1d(i=e["3i-bF"])&&(b=ZC.2t(i));1a m=ZC.A4("#"+Z);r=(e[ZC.1b[19]]||"100%")+"",o=(e[ZC.1b[20]]||""+1o.gt.1M)+"","3i"===r&&(r="100%"),"3i"===o&&(o="100%");1a K=1o.wh(m,r,o);s=K[0],C=K[1],E&&(s=ZC.A4(2u).1s(),C=ZC.A4(2u).1M(),2g.3s.1I.9M="8X"),s<10&&(s=1o.gt.1s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.HD=1o.ft[i]),1c!==ZC.1d(i=e["4f-Yf"])&&(u.N6=i),1o.aQ)if(!1o.YF[Y])1j(1a L in 4t 1o.aQ[Y],4t ZC.TS[Y],1o.6g.1U)0===L.1L(Y+"-")&&(4t 1o.6g.1U[L],1o.6g.2e--);if(u.bb(),m.2O("9M","8X"),u.M2&&m.2O("2L","4E").2O("1v",0).2O("1K",0),(-1!==u.FV.1L("%")||-1!==u.MY.1L("%")||u.M2||u.QQ)&&b){1a w=u.QQ||u.M2?ZC.A4(2u):m,M=w.1s(),H=w.1M(),P=0;u.jp=!1,u.Z3=2u.eP(1n(){1a e;if(ZC.AK(Z)&&!u.mw){1a t=ZC.A4("#"+Z+"-1v"),i=!1;if(-1!==(""+u.FV).1L("%")&&t.1f&&w.1f&&t.1s()!==w.1s()&&(i=!0),0!==P||w.1s()===M&&w.1M()===H&&!i){if(w.1s()+w.1M()>0&&(w.1s()!==M||w.1M()!==H)&&(e=u.M2||u.QQ?1o.wh(w,""+w.1s(),""+w.1M()):1o.wh(w,u.FV,u.MY))[0]>10&&e[1]>10){1j(u.I=e[0],u.F=e[1],M=w.1s(),H=w.1M(),n=0,l=u.AI.1f;n<l;n++)u.AI[n].MH[0]=0;O()}}1u if(M=w.1s(),H=w.1M(),M>10&&H>10){1j(-1!==(""+u.FV).1L("%")?u.I=M*ZC.IL(u.FV):u.I=M,-1!==(""+u.MY).1L("%")?u.F=H*ZC.IL(u.MY):u.F=H,n=0,l=u.AI.1f;n<l;n++)u.AI[n].MH[0]=0;O()}P++}1u 2u.9W(u.Z3)},1o.3J.En)}1l u}1n N(){if(!u.E.wh||u.E.wh!==u.I+"/"+u.F){1j(1a e=!1,t=0;t<1o.HY.1f;t++)1o.HY[t].K===u.K&&(e=!0);e&&u.bF()}u.jp=!1}1n O(){u.jp?u.VV.1s!==u.I&&(iO(u.t3),u.VV.1s=u.I,u.VV.1M=u.F,u.t3=5E(N,1o.3J.sX)):(u.jp=!0,u.VV={1s:u.I,1M:u.F},u.t3=5E(N,1o.3J.sX))}},2u.1o=1o,ZC.A4.6J.a6&&5T(ZC.A4.6J.aF)<9){1a sU=2u.Dq;2u.Dq=1n(){1j(;1o.HY.1f;)1o.3n(1o.HY[0].K,"9P");ZC.A4(2g).3l(ZC.P.BX("6Z"),1o.MQ).3l(ZC.P.BX("7D"),1o.MQ).3l(ZC.P.BX(ZC.1b[48]),1o.MQ).3l(ZC.P.BX(ZC.1b[47]),1o.MQ).3l(ZC.P.BX(ZC.1b[49]),1o.MQ).3l("3I",1o.SN).3l("gd",1o.ZF),1o.HY=[],sU&&sU()}}1o.ft.nM={aG:!1,"6k-8F":".","n6-8F":"","2B-tU":"Yc nX DO","2B-tN":"Yb nX DO","2B-eG":"xU","2B-6F":"xV Y8","2B-tR":"i3 As Y6","2B-tq":"i3 As Xy","2B-ya":"lm Xr","2B-y9":"lm Xx","2B-wS":"lm 8j","2B-wI":"lm Xw","2B-nR":"i3 dh zF","2B-od":"yY dh zF","2B-lH":"Xv dh","2B-eQ":"zr In","2B-f2":"zr Xu","2B-fE":"i3 Xt","2B-4N":"i3 Wz","2B-4r":"nJ Aj","2B-tY":"z1 To 2D","2B-tW":"z1 To 3D","2B-gQ":"rk u3","2B-mZ":"yY u3","2B-tM":"rk Uf yQ","2B-tP":"rk Rk yQ","2B-5O":"yT z3","2B-gN":"Qn yT z3","2B-cH":"Go sY","2B-cG":"Go Qm","5B-rL":{sf:"%d %M %Y<br>%g:%i:%s %A<br>%q ms",mQ:"%d %M %Y<br>%g:%i:%s %A",iy:"%d %M %Y<br>%g:%i %A",lL:"%d %M %Y<br>%g %A",dn:"%d %M %Y",eL:"%M %Y",jS:"%Y"},"lI-5L":["Ql","Qj","Qi","Qg","cU","Qf","Qd"],"lI-eU":["Qc","Qb","Qa","Pz","Qp","Qh","Qq"],"kE-5L":["cT","QA","Rg","Rf","Da","Rd","Rc","Rb","Ra","Qz","Qs","Qy"],"kE-eU":["Qw","Qu","Pw","Pd","Da","Pv","Pa","P0","Oz","Oy","Ox","Ow"],"q8-b9":"tS...","8v-b9":"Ou...","7O-b9-eU":"tS. tL...","7O-b9-5L":"tS...","7O-b9-lQ":"...","4L-5R":"An Af On Ot","4L-aJ":"Af Os:","4L-7w":"ha","4r-5R":"nJ Aj Or","4r-zG":"Ai 3g dh","4r-Fx":"Ai Op Oo","4r-Ft":"nL Pb:","4r-Gl":"3g dh:","4r-Fd":"nL Bc Pc","4r-Fb":"if Bl Pn to Pu Pt ql 12s Ps to Pr Pq","4r-Fk":"Bc Pp is Po...","4r-f3":"nJ","4r-ju":"Pm","4r-Dz":"nL Pf Pl Pk Pj.\\n\\Pi Bl!","6B-7w":"ha","4N-fc":"Ef 3g","4N-fd":"Gp 3g","4N-7w":"ha","4N-9l":"Ph","d7-7w":"ha","1W-wB":"nX %3h% of %a4%"},ZC.HD=1o.ft.nM,1o.7d=1n(e){1j(1a t=0;t<1o.HY.1f;t++)if(1o.HY[t].K===e)1l 1o.HY[t];1l 1c},1o.tC=1n(e,t){1l e.OF(t)},1o.Pg=1n(e){e.A8&&e.A8.g3();1j(1a t=0;t<e.AI.1f;t++)e.AI[t].L7()},1o.Ri=1n(e,t,i){1l e.rB(t,i)},1o.Px=1n(e){e&&e.pg(!0)},1o.Az=1n(e){ZC.XA.1h(e)},1o.Ay=1n(e){1l e.ki.2o(",")},1o.Rj=1n(e,t,i){1Q(1o.Az(e),t){1i"aI":1o.3t(1c,"f6",1n(t,a){1j(1a n=a[ZC.1b[16]].1f,l=0;l<n;l++)if(a[ZC.1b[16]][l].1J===e){1a r=a[ZC.1b[16]][l];r.id?r.id=r.id:r.id=e.1F(/-/g,"")+l,a[ZC.1b[16]][l]=i(r)}1l a});1p;1i"Sv":1o.3t(1c,"f6",1n(t,a){1a n=1o.7d(t.id);if(-1!==1o.Ay(n).1L(e))1j(1a l=a[ZC.1b[16]].1f,r=1c,o=0;o<l;o++)(r=a[ZC.1b[16]][o]).8d(e)&&(a[ZC.1b[16]][o]=i(r,t.id));1l a})}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(ZC.1b[48]),1o.MQ).3l(ZC.P.BX(ZC.1b[47]),1o.MQ).3l(ZC.P.BX(ZC.1b[49]),1o.MQ).3l("3I",1o.SN).3l("gd",1o.ZF),Z.D4&&Z.D4.3l()}1j(1o.oA&&1c!==(A=1o.oA(e,t,i))&&(a=A),1o.pT&&1c!==(A=1o.pT(e,t,i))&&(a=A),1o.oi&&1c!==(A=1o.oi(e,t,i))&&(a=A),1o.s3&&1c!==(A=1o.s3(e,t,i))&&(a=A),1o.qH&&1c!==(A=1o.qH(e,t,i))&&(a=A),1o.pu&&1c!==(A=1o.pu(e,t,i))&&(a=A),n=0,l=1o.hv.1f;n<l;n++)t===1o.hv[n].4v&&1c!==(A=1o.hv[n].7r.4v(1o,e,i))&&(a=A);1l a},1o.mf("Ak",1n(e,t){1a i=1o.7d(e);i.DD["6o-2B"]=i.DD["6o-2B"]||{},i.DD["6o-2B"]["5F-2C"]=i.DD["6o-2B"]["5F-2C"]||[];1j(1a a=t.id||"",n=i.DD["6o-2B"]["5F-2C"],l=!1,r=0;r<n.1f;r++)if(n[r].id===a){l=!0;1p}l||i.DD["6o-2B"]["5F-2C"].1h(t)}),1o.oA=1n(e,t,i){1a a;2g.cO("zc-5O")&&(e="zc-5O"),"3b"==1y(i=i||{})&&(i=3g.1q(i));1a n,l,r,o,s,C,A,Z,c,p,u,h,1b,d,f,g,B,v,E,b,m=1o.7d(e),K=!(1c!==ZC.1d(i.3T)&&!ZC.2t(i.3T)),D=1c!==ZC.1d(i.4Y)&&ZC.2t(i.4Y),F=1y i.gk!==ZC.1b[31]&&ZC.2t(i.gk);if(m){1Q(-1===ZC.AT(["zs","zv","qw","zx","zy","zC","zE","aK"],t)&&((l=m.FD()).aQ=i,ZC.AO.C2(t,m,l)),t){1i"Ss":if(!(n=m.C7(i[ZC.1b[3]])))1l 1c;n.IA&&n.IA.NT&&(n.IA.NT(),n.IA.3l()),n.I9&&n.I9.NT&&(n.I9.NT(),n.I9.3l());1p;1i"Sr":1l(n=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=n.o.an),t=0;t<n.E3.1f;t++)if("*"===n.E3[t].c8&&n.E3[t].js){n.o["js-c8"]=n.E3[t].js,n.E3.6u(t,1);1p}if((e=n.o["js-c8"])&&("7s:"===e.2x(0,11)||e.1L("(")<e.1L(")")))4M{n.OP="";1a r=e.1F("7s:",""),o=e.1L("("),s=e.1L(")");-1!==o&&-1!==s&&(n.OP=r.5w(o+1,s-o-1),r=r.5w(0,o)),n.IH=ZC.kD(r,2u)}4K(A){}if(1y n.H!==ZC.1b[31]&&1c!==n.H.R0)1j(1a C in n.H.R0)n.H.R0.8d(C)&&1c===ZC.1d(n.o[C])&&(n.o[C]=n.H.R0[C])}8a(){1l{}}dw(e,t,i){1j(1a a=t.2o(","),n=i.2o(","),l=0,r=n.1f;l<r;l++)e[a[l]]=n[l]}12R(){1l 1g.o}13K(e){1g.o=e}tF(){1l 1g.E}bT(e){1l 1g.E[e]}4l(e,t){1g.E[e]=t}oH(e){1a t=1g.8a();1l t[e]?1g[t[e]]:1c}m9(e,t){1a i=1g.8a();i[e]&&(1g[i[e]]=t)}1C(e,t,i){1c===t&&(t=!0);1a a=1g;e&&(a.I4||(a.I4={},ZC.2E(a.o,a.I4,!0,i)),a.JW||(a.JW={}),ZC.2E(e,a.JW,!0,i),ZC.2E(e,a.o,!0,i)),1y a.k4!==ZC.1b[31]&&a.k4()&&e&&ZC.2E(e,a.o)}k4(){}4C(e){1j(1a t=0,i=e.1f;t<i;t++)1g.o.8d(e[t][0])&&1g.YS(e[t][0],e[t][1],e[t][2],e[t][3],e[t][4])}YS(e,t,i,a,n){1a l,r=1g;if(1c!==(l=r.o[e])&&1y l!==ZC.1b[31]){if(i)1Q(-1!==i.1L("p")&&(l=ZC.8M(l),i=i.1F("p","")),-1!==i.1L("a")&&(l=ZC.2l(l),i=i.1F("a","")),i){1i"i":l=ZC.1k(l);1p;1i"f":l=ZC.1Y(l);1p;1i"b":l=ZC.2t(l);1p;1i"c":l=ZC.AO.YY(l,r),(l=ZC.AO.G9(l,r))3E 3M&&("1r"===e||"2s-1r"===e?(r.o["1E-2n"]=l[1],r.X4=l[1],r.E["1E-2n"]=l[1]):e===ZC.1b[61]?(r.o["1G-2n"]=l[1],r.O8=l[1],r.E["b-2n"]=l[1]):("1w-1r"===e&&(r.E["l-2n"]=l[1]),1c===ZC.1d(r.o.2n)&&(r.C5=l[1])),l=l[0])}1c!==ZC.1d(a)&&1c!==ZC.1d(n)&&(l=ZC.5l(l,a,n)),r[t]=l}}DB(){1j(1a e=1g,t=!1,i=0,a=e.E3.1f;i<a;i++){1a n=!1;4M{n=1m bz("1l ("+e.IX(e.E3[i].c8)+")")()}4K(l){n=!1}n&&(t=!0,e.1C(e.E3[i]))}1l t}Bf(e){1j(1a t="",i=0,a=e.1f;i<a;i++){1a n=!1;4M{n=1m bz("1l ("+1g.IX(e[i].c8)+")")()}4K(l){n=!1}n&&(t+="<"+e[i].c8+">")}1l""!==t?[t,ZC.YA.dK(t)]:1c}IX(){1l!0}1S(e){1a t=1g;ZC.2E(e.o,t.o),e.I4&&(t.I4=t.I4||{},ZC.2E(e.I4,t.I4)),e.JW&&(t.JW=t.JW||{},ZC.2E(e.JW,t.JW)),ZC.2E(e.E,t.E),ZC.2E(e.E3,t.E3)}}1O CX 2j Fl{2G(e){1D(e),1g.7l(e)}7l(e){1D.7l(e);1a t=1g;e&&e.H&&(t.H=e.H),t.K="",t.DH=1c,t.AM=!0,t.A0="-1",t.AC="-1",t.GO="",t.HM="",t.W7=!0,t.D7="",t.MD="6D",t.TL="50% 50%",t.X3="",t.KR=1,t.NN="9w",t.NE=90,t.WT=0,t.WG=0,t.AZ=0,t.B7="#4u",t.GA="",t.EV=0,t.G8=0,t.AQ=0,t.BU="#4u",t.C5=1,t.O8=1,t.TJ="n7",t.eR="46",t.ME=!1,t.OQ=45,t.JY=2,t.TF=.75,t.S8="#4J",t.PF=0,t.CW=!0,t.OV=!1,t.LC=!1,t.rf=!1,t.OU=1c,t.BG=""}8a(){1a e=1D.8a();1l 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ZC.1k(C.E.76)),1y C.E.7y!==ZC.1b[31]&&(u=ZC.1k(C.E.7y)),r=0,o=e.1f;r<o;r++){if(A=-1,Z=-1,e[r].7m){if(1c!==(t=ZC.1d(e[r].7m["2r-2Z"]))){if(Z=0,c=[],"4j"==1y t)c=t;1u if("3b"==1y t){if(-1!==t.1L(","))c=t.2o(",");1u if(-1!==t.1L("-"))1j(i=t.2o("-"),a=ZC.1k(i[0]);a<=ZC.1k(i[1]);a++)c.1h(a)}1u c=[t];-1!==ZC.AT(c,u)&&(Z=1)}if(1c!==(t=e[r].7m["1B-2Z"])&&1y t!==ZC.1b[31]){if(A=0,c=[],"4j"==1y t)c=t;1u if("3b"==1y t){if(-1!==t.1L(","))c=t.2o(",");1u if(-1!==t.1L("-"))1j(i=t.2o("-"),a=ZC.1k(i[0]);a<ZC.1k(i[1]);a++)c.1h(a)}1u c=[t];-1!==ZC.AT(c,p)&&(A=1)}}0!==A&&0!==Z&&C.1C(e[r])}}if(1c!==(e=C.OU)&&C.1C(e),e=C.o[ZC.1b[0]]){if(e=ZC.AO.YY(e,1g),"9L("===5Q(e).2x(0,4))1j(n=1m 5v("9L\\\\((\\\\d{1,3}),\\\\s*(\\\\d{1,3}),\\\\s*(\\\\d{1,3})\\\\)");l=n.3n(e);)e=e.1F(l[0],ZC.AO.G9(l[0]));if("9S("===5Q(e).2x(0,5))1j(n=1m 5v("9S\\\\((\\\\d{1,3}),\\\\s*(\\\\d{1,3}),\\\\s*(\\\\d{1,3})\\\\,\\\\s*([0-9.]+)\\\\)");l=n.3n(e);){1a h=ZC.AO.G9(l[0],C);e=e.1F(l[0],h[0]),C.o.2n=h[1],C.C5=h[1],C.E["bg-2n"]=h[1],1c===ZC.1d(C.E["b-2n"])&&(C.E["b-2n"]=1),1c===ZC.1d(C.E["l-2n"])&&(C.E["l-2n"]=1)}1a 1b=ZC.GR(5Q(e)).2o(/\\s+|;|,/);C.A0=ZC.AO.G9(1b[0]),C.AC=1===1b.1f?C.A0:ZC.AO.G9(1b[1])}if(!(1c===ZC.1d(C.o[ZC.1b[62]])&&1c===ZC.1d(C.o[ZC.1b[61]])&&1c===ZC.1d(C.o["1w-1I"])||1c===ZC.1d(C.o["1G-1v"])&&1c===ZC.1d(C.o["1G-2z"])&&1c===ZC.1d(C.o["1G-2c"])&&1c===ZC.1d(C.o["1G-1K"])&&1c===ZC.1d(C.o.1G))){1a d=["1v","2z","2c","1K"],f={1v:[0,"2U","#4u"],2z:[0,"2U","#4u"],2c:[0,"2U","#4u"],1K:[0,"2U","#4u"]};if(C.I4=C.I4||{},e=C.I4.1G)1j(s=e.2o(/\\s/),r=0;r<4;r++)f[d[r]]=[ZC.1k(s[0]||"0"),ZC.GR(s[1]||"2U"),ZC.AO.G9(s[2]||"#cY")];if(1c!==ZC.1d(C.I4[ZC.1b[62]]))1j(r=0;r<4;r++)f[d[r]][0]=C.I4[ZC.1b[62]];if(1c!==ZC.1d(C.I4["1w-1I"]))1j(r=0;r<4;r++)f[d[r]][1]=C.I4["1w-1I"];if(1c!==ZC.1d(C.I4[ZC.1b[61]]))1j(r=0;r<4;r++)f[d[r]][2]=C.I4[ZC.1b[61]];1j(r=0;r<4;r++)(e=C.I4["1G-"+d[r]])&&(s=e.2o(/\\s/),f[d[r]]=[ZC.1k(s[0]||"0"),ZC.GR(s[1]||"2U"),ZC.AO.G9(s[2]||"#cY")]);if(C.JW=C.JW||{},e=C.JW.1G)1j(s=e.2o(/\\s/),r=0;r<4;r++)f[d[r]]=[ZC.1k(s[0]||"0"),ZC.GR(s[1]||"2U"),ZC.AO.G9(s[2]||"#cY")];if(1c!==ZC.1d(C.JW[ZC.1b[62]]))1j(r=0;r<4;r++)f[d[r]][0]=C.JW[ZC.1b[62]];if(1c!==ZC.1d(C.JW["1w-1I"]))1j(r=0;r<4;r++)f[d[r]][1]=C.JW["1w-1I"];if(1c!==ZC.1d(C.JW[ZC.1b[61]]))1j(r=0;r<4;r++)f[d[r]][2]=C.JW[ZC.1b[61]];1j(r=0;r<4;r++)(e=C.JW["1G-"+d[r]])&&(s=e.2o(/\\s/),f[d[r]]=[ZC.1k(s[0]||"0"),ZC.GR(s[1]||"2U"),ZC.AO.G9(s[2]||"#cY")]);1j(r=0;r<4;r++)1c===ZC.1d(C.o["1G-"+d[r]])&&(C.o["1G-"+d[r]]=f[d[r]].2M(" "))}C.4C([["2h","AM","b"],["1T-1r-1","A0","c"],["1T-1r-2","AC","c"],["5c-hJ","GO"],["5c-oO","HM"],["1T-3v","W7","b"],["1T-4e","D7"],["1T-6D","MD"],["1T-2L","TL"],["1T-iu","X3"],["1T-1z","KR","f"],["3k-1J","NN"],["3k-2f","NE","i"],["3k-2a-x","WT","f"],["3k-2a-y","WG","f"],[ZC.1b[4],"AZ","i"],["1w-1r","B7","c"],["1w-1I","GA",""],["1O","DH"],["2p","DH"],["1G","BG"]]),"2b"===C.NN&&(C.AC=C.A0,C.NN="9w"),""!==C.BG&&(s=C.BG.2o(/\\s/),C.AQ=ZC.1k(s[0]||"0"),C.GA=ZC.GR(s[1]||"2U"),C.BU=ZC.AO.G9(s[2]||"#cY")),C.GO=ZC.AO.YY(C.GO,1g),C.KM(),C.4C([["1w-gm-2e","EV","i"],["1w-hY-2e","G8","i"],[ZC.1b[62],"AQ","i"],[ZC.1b[61],"BU","c"],["2n","C5","f",0,1],["3K","ME","b"],["3K-2f","OQ","i",0,2m],["3K-6V","JY","i"],["3K-2n","TF","f",0,1],["3K-1r","S8","c"],["3K-vW","PF","i"]]),C.O8=C.C5,C.4C([["1G-2n","O8","f",0,1]])}}ZC.CM={kz:1n(e,t,i){1a a,n,l;if(e&&i&&0!==i.1f){if(!t.E["8u-dc-2R"])1j(a=0,n=i.1f;a<n;a++)i[a]&&(i[a][0]=5T(4T(i[a][0]).4x(2)),i[a][1]=5T(4T(i[a][1]).4x(2)));1a r=!1,o=i.1f;1j(a=0;a<o;a++)1c!==ZC.1d(i[a])&&(l=[i[a][0],i[a][1]],1c!==ZC.1d(i[a][2])&&l.1h(i[a][2],i[a][3]),1c!==ZC.1d(i[a][4])&&l.1h(i[a][4],i[a][5]),t.OV&&(l[0]=1A.46(l[0]),l[1]=1A.46(l[1]),4===l.1f&&(l[2]=1A.46(l[2]),l[3]=1A.46(l[3]))),t.CW&&t.AZ%2==1&&(l[0]-=.5,l[1]-=.5,4===l.1f&&(l[2]-=.5,l[3]-=.5))),0===a?e.dX(l[0],l[1]):i[a]?(r&&(e.dX(l[0],l[1]),r=!1),2===l.1f?e.hQ(l[0],l[1]):4===l.1f?e.wf(l[0],l[1],l[2],l[3]):6===l.1f&&e.6y(l[0],l[1],l[2],ZC.TB(l[3]),ZC.TB(l[4]),l[5])):r=!0}},2I:1n(e,t){1a i=t.H.AB;if(1!==t.C5&&t.LC&&(1c===ZC.1d(t.o[ZC.1b[61]])&&(t.BU=t.A0),1c===ZC.1d(t.o[ZC.1b[62]])))1Q(i){1i"3f":t.AQ=.2;1p;1i"2F":t.AQ=.1;1p;1i"3L":t.AQ=.2,t.E.pU=t.C5/10}},1t:1n(e,t,i,a,n,l){if(1c===ZC.1d(n)&&(n=2),1c===ZC.1d(a)&&(a=!1),1c===ZC.1d(l)&&(l=!1),e&&i&&0!==i.1f&&t){1a r,o,s,C,A,Z;!l&&i.1f>2&&1c!==i[0]&&1c!==i[i.1f-1]&&i[0].2M(",")===i[i.1f-1].2M(",")&&(t.TJ="46");1a c=t.H.AB;if("3f"!==c||0!==t.AZ&&"-1"!==t.B7){if(t.ME&&1c!==ZC.1d(t.C6)&&!a){t.C6=t.C6||t.Z;1a p,u=ZC.P.o3(i,t);1y t.oY!==ZC.1b[31]?p=t.oY:((p=1m DR(t)).1S(t),p.K=t.K+"-sh",p.ME=!1,p.AZ+=p.PF,p.B7=p.S8),p.C5=t.C5*p.TF,1y t.145===ZC.1b[31]&&(t.oY=p),p.CW=!1,r=ZC.P.E5(t.C6,c),ZC.CM.2I(r,p),ZC.CM.1t(r,p,u,!1,1,l)}1a h=ZC.1k(t.EV||"0"),1b=ZC.1k(t.G8||"0");"2U"===t.GA&&(h=1b=0);1a d=i.1f;1y t.AA===ZC.1b[31]&&(t.AA=0),"3f"===c&&(e.141=t.eR,e.vB=t.TJ,e.n5=ZC.AO.ed(ZC.AO.G9(t.B7),a?t.O8:t.C5),e.cr=t.AZ,e.nf());1a f=!1;if(-1!==ZC.AT(["2F","3L"],c))o=l?[]:ZC.P.m5(i,c,t,a);1u{1a g=!1;"fm"!==t.GA&&(g=e.lN)&&e.lN(0===h||0===1b?[]:[h,1b]);1a B=0,v=[ZC.3u,ZC.3u,-ZC.3u,-ZC.3u];1j(Z=0;Z<d;Z++)if(1c!==i[Z]){if(1c!==(s=ZC.bE?i[Z]:ZC.P.k8(i[Z],c,t,a))&&!7X(s[0])&&!7X(s[1])&&fP(s[0])&&fP(s[1]))if(d<=6&&a&&(v[0]=ZC.CT(v[0],s[0]),v[1]=ZC.CT(v[1],s[1]),v[2]=ZC.BN(v[2],s[0]),v[3]=ZC.BN(v[3],s[1])),0===Z)2===s.1f?e.dX(s[0],s[1]):6===s.1f&&e.6y(s[0],s[1],s[2],ZC.TB(s[3]),ZC.TB(s[4]),s[5]);1u if(f&&(e.dX(s[0],s[1]),f=!1),g||0===h||0===1b||4===s.1f||6===s.1f||7===s.1f)2===s.1f?e.hQ(s[0],s[1]):4===s.1f?e.wf(s[0],s[1],s[2],s[3]):6===s.1f?e.6y(s[0],s[1],s[2],ZC.TB(s[3]),ZC.TB(s[4]),s[5]):7===s.1f&&e.13W(s[0],s[1],s[2],s[3],s[4],s[5]);1u if(1c!==i[Z-1]){1a E=ZC.P.k8(i[Z-1],c,t,a),b=E[4===E.1f?2:0],m=E[4===E.1f?3:1],K=s[0],D=s[1],F=h+1b,I=K-b,X=D-m,x=1A.5y(I*I+X*X)+B;if(x>h){1a y;B=0,y="fm"===t.GA?1A.4n(ZC.2l(x/((F+t.AZ+1b)/2))):1A.4n(ZC.2l(x/F));1a Y=1A.nw(X,I),L=1A.dR(Y),w=1A.dQ(Y),M=b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N.1C(t.o["1v-3X"]),N.K=t.K+"-1v",N.1q(),"2F"===c?ZC.CM.U0(e,N,o.2M(" "),a,l):"3L"===c?ZC.CM.U1(e,N,o.2M(" "),a):ZC.CM.1t(e,N,i,a,n,l)}}}},mN:1n(e,t,i){1a a,n,l,r;ZC.1d(t)&&(t=!1),i=i||"h";1a o=[],s=[];1j(a=0,n=e.1f;a<n;a++)e[a]&&("h"===i?(s.1h(e[a][0]),o.1h(e[a][1])):(s.1h(e[a][1]),o.1h(e[a][0])),0===a&&(s.1h(s[0]),o.1h(o[0])));1j(s.1h(s[s.1f-1]),o.1h(o[o.1f-1]),e=[],l=1,r=o.1f;l<r-1;l++){1a C=[o[l-1],o[l],o[l+1],o[l+2]],A=ZC.2l(s[l+1]-s[l]),Z=1/(A/C.1f),c=ZC.AN.YQ(t,C,A,Z);1j(a=0,n=c.1f;a<n;a++)1c!==ZC.1d(c[a][0])&&1c!==ZC.1d(c[a][1])?"h"===i?e.1h([s[l]+c[a][0]*A,c[a][1]]):e.1h([c[a][1],s[l]+c[a][0]*A]):e.1h(1c)}1l e},jj:1n(e,t,i){t.H&&t.H.G0?(1c===ZC.1d(t.H.G0[e.id])&&(t.H.G0[e.id]=2g.oB()),t.H.G0[e.id].3c(i)):e.3c(i)},U0:1n(e,t,i,a,n){if(""!==i||n){1a l,r,o,s,C,A,Z;ZC.4f.1U["2F-5q"]||(ZC.4f.1U["2F-5q"]=ZC.P.F3("5q",ZC.1b[36])),l=n?ZC.4f.1U["2F-5q"].jy(!0):ZC.P.F3("2R",ZC.1b[36]);1a c={};if(t.DH&&""!==t.DH&&(c["1O"]=t.DH),n||(c.d=i),n){t.I<0&&(t.iX-=t.I,t.I=-t.I),t.F<0&&(t.iY+=t.F,t.F=-t.F);1a p=0,u=0,h=1;t.CW&&(h=0,p=u=t.AZ/2,0===t.iX&&(p=0),0===t.iY&&(u=0)),0===h||t.I<=3||t.F<=3?(r=1A.4n(t.iX)+p,o=1A.4n(t.iY)+u,s=1A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=ZC.1k("x"===t?e[0]:e[1])}pV(e,t){1a i;-1!==(""+e).1L("8L")&&(t="y"),-1!==(""+e).1L("8b")&&(t="x"),e=ZC.1Y((""+e).1F("8b","").1F("8L",""));1a a=1g.H||1o.HY[0];if(a){1a n=1g.A||a.AI[0];n&&("x"===t?1c!==(i=n.BT("k")[0])&&(e=ZC.1k(i.AX(e))):1c!==(i=n.BT("v")[0])&&(e=ZC.1k(i.AX(e))))}1l ZC.1k(e)}cn(e,t,i){1a a=1g;t=t||"x";1a n=""+e;if(-1!==n.1L("fR")||-1!==n.1L("fQ"))1l a.hl(e,t);if(-1!==n.1L("8L")||-1!==n.1L("8b"))1l a.pV(e,t);if(""+ZC.1Y(e)!==n)1l-1!==(e+="").1L("%")?a.cn(5T(e.1F("%",""))/100,t,!0):-1!==e.1L("px")?a.cn(5T(e.1F("px","")),t):a.cn(5T(e),t);1a l=1y a.E["p-x"]!==ZC.1b[31]?a.E["p-x"]:a.A.iX,r=1y a.E["p-y"]!==ZC.1b[31]?a.E["p-y"]:a.A.iY,o=1y a.E["p-1s"]!==ZC.1b[31]?a.E["p-1s"]:a.A.I,s=1y a.E["p-1M"]!==ZC.1b[31]?a.E["p-1M"]:a.A.F;1l(e>=1||e<0||1o.3J.uy)&&!i?"x"===t?l+5T(e):r+5T(e):e>=0&&e<1||i?"x"===t?(o=o||1,1A.46(l+o*e)):(s=s||1,1A.46(r+s*e)):8o 0}9v(e){1a t,i=1g;if(i.TY)1l-1!==(""+i.o.x).1L("fQ")?i.iX=i.hl(i.o.x,"x"):i.YS("x","iX"),-1!==(""+i.o.y).1L("fR")?i.iY=i.hl(i.o.y,"y"):i.YS("y","iY"),8o i.ZD();1===e?(1c!==(t=ZC.1d(i.o.x))&&(i.iX=i.cn(t,"x")),1c!==(t=ZC.1d(i.o.y))&&(i.iY=i.cn(t,"y")),-1===i.iX&&(i.iX=i.A.iX),-1===i.iY&&(i.iY=i.A.iY)):2===e&&(i.ZD(),i.I=i.CY[2]-i.C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1b.x,(1-c)*(1-c)*h.y+2*c*(1-c)*d.y+c*c*1b.y])}1u if(7===C.D[e].1f&&i[e-1]){1a f={x:i[i.1f-1][0],y:i[i.1f-1][1]},g={x:C.D[e][0],y:C.D[e][1]},B={x:C.D[e][2],y:C.D[e][3]},v={x:C.D[e][4],y:C.D[e][5]};1j(c=0;c<=1;c+=.1){1a E=(1-c)*(1-c)*(1-c),b=3*c*(1-c)*(1-c),m=3*c*c*(1-c),K=c*c*c;i.1h([E*f.x+b*g.x+m*B.x+K*v.x,E*f.y+b*g.y+m*B.y+K*v.y])}}1u i.1h(C.D[e]);1u i.1f>-1&&p.1h(ZC.AN.Q7(i,1A.2k(5,C.AH/5),[C.BJ,C.BC])),i=[];if(0!==C.AA)1j(a=ZC.1k((C.CY[0]+C.CY[2])/2),n=ZC.1k((C.CY[1]+C.CY[3])/2),e=0,t=i.1f;e<t;e++)1c!==i[e]&&(l=i[e][0]-a,r=i[e][1]-n,o=l*ZC.EE(C.AA)-r*ZC.EK(C.AA),s=l*ZC.EK(C.AA)+r*ZC.EE(C.AA),i[e]=[o+a,s+n]);1l i.1f>-1&&p.1h(ZC.AN.Q7(i,1A.2k(5,C.AH/5),[C.BJ,C.BC])),p}}1q(e){1a t,i,a,n,l,r,o;1c===ZC.1d(e)&&(e=!1),1g.o.cM||e||1D.1q();1a s=1g;if(!s.o.cM&&!e){s.4C([["3e","g0"]]),"3b"==1y s.o.1P&&s.4C([["1P","pH"]]),0!==s.g0&&(1c===ZC.1d(s.o["3e-1P"])||s.o["3e-1P"])&&(s.o["3e-1P"]=!0,s.o["3e-b1-z-3Z"]=!0);1a C=["2a-x","2a-y"];1j(i=0;i<2;i++){1a A=C[i],Z="2a-x"===A?"fQ":"fR";if(1c!==(t=s.o[A])&&1y t!==ZC.1b[31]&&-1!==(t=""+t).1L(Z)){t=ZC.1Y(t.1F(Z,""));1a c=1o.4W.4W[s.g0];c&&(t=1o.4W.6Y(A.1F("2a-"),t,s.A.I,s.A.F,c.bS.v7),s.o[A]=t)}}1j(s.4C([["3R","E4"],["2X","FE"],["4U","IV"],["id","H3"],["2f","AA","i"],["8A","KC","b"],["7N","KC","b"],[ZC.1b[1],"B2","f"],[ZC.1b[2],"BH","f"],[ZC.1b[8],"CJ","i"],[ZC.1b[21],"AH","f"],["2e-2","L1","f"],["8u-dc-2R","QP","b"],["1J","DN"],["2W","D"],["2a-x","BJ"],["2a-y","BC"],["2a-z","t0","i"],["2a-r","DQ","i"],["z-3Z","n3","i"],["z-2Z","JR","f"],["10M","hy"]]),s.BJ=ZC.IL(s.BJ,!0),s.BC=ZC.IL(s.BC,!0),s.BJ>-1&&s.BJ<1&&1y s.E["p-1s"]!==ZC.1b[31]&&(s.BJ*=s.E["p-1s"]),s.BC>-1&&s.BC<1&&1y s.E["p-1M"]!==ZC.1b[31]&&(s.BC*=s.E["p-1M"]),s.AH=ZC.BN(1,s.AH),s.L1=ZC.BN(1,s.L1),1c!==s.o["z-3Z"]&&1y s.o["z-3Z"]!==ZC.1b[31]||(s.n3=s.JR),"fW"!==s.DN&&"5q"!==s.DN||s.4C([[ZC.1b[19],"AH","f"],[ZC.1b[20],"L1","f"]]),s.na?(s.D=3g.1q(3g.5b(s.FA)),s.na=!1):s.FA=3g.1q(3g.5b(s.D)),i=0,a=s.D.1f;i<a;i++)if(1c!==s.D[i])1j(1a p=0;p<s.D[i].1f;p++)-1===(""+s.D[i][p]).1L("fR")&&-1===(""+s.D[i][p]).1L("fQ")||(s.na=!0,s.D[i][p]=s.hl(s.D[i][p],p%2==0?"x":"y")),-1===(""+s.D[i][p]).1L("8b")&&-1===(""+s.D[i][p]).1L("8L")||(s.na=!0,s.D[i][p]=s.pV(s.D[i][p],p%2==0?"x":"y"))}if(s.o.cM=1c,s.AA=s.AA%2m,s.9v(1),"2V"!==s.DN){1a u=s.AH;1Q(s.DN){1i"5F":1p;1i"Cf":u=s.AH;1a h=.1*s.AH;s.D=[[s.iX-u,s.iY+u-h],[s.iX,s.iY-u-h],[s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(l.x2),y1:ZC.1k(l.y1),y2:ZC.1k(l.y2)})),!e){if(ZC.P.G4(t,{id:n,11P:"xn"}),a.H.KG.7k[0].3c(t),""!==a.GO&&""!==a.HM)1j(1a r=a.GO.2o(/\\s+|;/),o=a.HM.2o(/\\s+|;/),s=0,C=r.1f;s<C;s++){1a A=ZC.AO.G9(r[s],a);"4j"!=1y A&&(A=[A,a.C5]),r[s]=A[0];1a Z=o[s]||1;ZC.DT(Z,0,1)||(Z=1);1a c=A[1];i=r[s],"-1"===r[s]&&(c=0,i="9L(3U,3U,3U)");1a p=ZC.P.F3("8P",ZC.1b[36]);ZC.P.G4(p,{2a:Z,"8P-1r":i,"8P-3p":c}),t.3c(p)}1u{1a u=1,h=a.A0;"-1"===a.A0&&(u=0,h="9L(3U,3U,3U)");1a 1b=ZC.P.F3("8P",ZC.1b[36]);ZC.P.G4(1b,{2a:0,"8P-1r":h,"8P-3p":u});1a d=1,f=a.AC;"-1"===a.AC&&(d=0,f="9L(3U,3U,3U)");1a g=ZC.P.F3("8P",ZC.1b[36]);ZC.P.G4(g,{2a:1,"8P-1r":f,"8P-3p":d}),t.3c(1b),t.3c(g)}a.E.3k="3R(#"+n+")"}}1u"-1"!==a.A0&&(a.E.3k=a.A0)}Z2(){1a e=1g;if("4j"==1y e.E.5e&&1y e.H!==ZC.1b[31]&&e.H){1a t=e.mY()[1].2o(",");if("3A"===e.DN)e.H.KG.3c(ZC.P.XM({id:e.K+"mk-3v",cx:t[0],cy:t[1],r:t[2]})),e.E["3v-2R"]=e.K+"mk-3v";1u if(t.1f>6){1j(1a i="",a=0,n=t.1f;a<n;a+=2)i+=ZC.1k(t[a])+ZC.1k(e.BJ)+","+(ZC.1k(t[a+1])+ZC.1k(e.BC))+" ";e.H.KG.3c(ZC.P.XM({id:e.K+"mk-3v",2R:i})),e.E["3v-2R"]=e.K+"mk-3v"}}}U0(){1a e,t,i,a,n,l,r=1g,o=r.Z;if("4z"===r.DN||"1w"===r.DN?(t=r.CY[0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a.E["p-1s"]!==ZC.1b[31]?a.E["p-1s"]:a.A.I,l=1y a.E["p-1M"]!==ZC.1b[31]?a.E["p-1M"]:a.A.F;1l(e=ZC.2l(e))>1&&!i?ZC.1k(e):e<=1||i?"w"===t?ZC.1k(n*e):ZC.1k(l*e):8o 0}6e(e,t,i,a,n){1a l,r,o=1g;if(i=i||0,a=a||0,t=t||"4s",n=n||"n","4s"===t){1a s=5Q(e).2o(/\\s+|;|,/);1l 1===s.1f?[o.6e(s[0],"tb",i,a,n),o.6e(s[0],"lr",i,a,n),o.6e(s[0],"tb",i,a,n),o.6e(s[0],"lr",i,a,n)]:2===s.1f?[o.6e(s[0],"tb",i,a,n),o.6e(s[1],"lr",i,a,n),o.6e(s[0],"tb",i,a,n),o.6e(s[1],"lr",i,a,n)]:3===s.1f?[o.6e(s[0],"tb",i,a,n),o.6e(s[1],"lr",i,a,n),o.6e(s[2],"tb",i,a,n),o.6e(s[1],"lr",i,a,n)]:[o.6e(s[0],"tb",i,a,n),o.6e(s[1],"lr",i,a,n),o.6e(s[2],"tb",i,a,n),o.6e(s[3],"lr",i,a,n)]}1l e+""=="3i"?-2:e+""=="4O"&&"y"===n?"4O":ZC.1Y(e)+""!=e+""?-1!==(e+="").1L("%")?o.6e(ZC.1Y(e.1F("%",""))/100,t):-1!==e.1L("px")?o.6e(ZC.1Y(e.1F("px","")),t):o.6e(ZC.1Y(e),t):((o.A||1y o.E["p-1s"]!==ZC.1b[31])&&(l=1y o.E["p-1s"]!==ZC.1b[31]?o.E["p-1s"]:o.A.I),(o.A||1y o.E["p-1M"]!==ZC.1b[31])&&(r=1y o.E["p-1M"]!==ZC.1b[31]?o.E["p-1M"]:o.A.F),(e=ZC.2l(e))>=1?ZC.1k(e):e<1?"lr"===t?ZC.1k((o.A?l:i)*e):ZC.1k((o.A?r:a)*e):8o 0)}1S(e){1D.1S(e);1j(1a t="I,F,E1,DM,DY,E2,F2,FT,F0,FC,KU,EP,DI,YC,H6,G5,ET,MC,oo,QC,ON,NX,PL,FB".2o(","),i=0,a=t.1f;i<a;i++)1y e[t[i]]!==ZC.1b[31]&&(1g[t[i]]=e[t[i]])}9v(e){1a t,i,a,n,l,r=1g;if(2!==(e=e||1))if(r.TY)r.4C([["x","iX"],["y","iY"],[ZC.1b[19],"I"],[ZC.1b[20],"F"]]);1u{1a o=1y r.E["p-x"]!==ZC.1b[31]?r.E["p-x"]:r.A.iX,s=1y r.E["p-y"]!==ZC.1b[31]?r.E["p-y"]:r.A.iY,C=1y r.E["p-1s"]!==ZC.1b[31]?r.E["p-1s"]:r.A.I,A=1y r.E["p-1M"]!==ZC.1b[31]?r.E["p-1M"]:r.A.F;if(!r.Q8){1a Z=0,c=0,p=0,u=0;if(1c!==ZC.1d(r.o.2y)){1a h=""+r.o.2y;if(-1!==h.1L("4O")){1a 1b=r.6e(h,"4s",0,0,"y");"4O"===1b[0]&&(r.E["d-2y-1v"]=r.E["d-2y"]=!0),"4O"===1b[1]&&(r.E["d-2y-2z"]=r.E["d-2y"]=!0),"4O"===1b[2]&&(r.E["d-2y-2c"]=r.E["d-2y"]=!0),"4O"===1b[3]&&(r.E["d-2y-1K"]=r.E["d-2y"]=!0),r.o.2y=h.1F(/4O/g,"20")}}"4O"===r.o.2y&&(r.E["d-2y"]=r.E["d-2y-1v"]=r.E["d-2y-2z"]=r.E["d-2y-2c"]=r.E["d-2y-1K"]=!0,r.o.2y=1c),1y r.E["d9-eZ"]===ZC.1b[31]||1c!==ZC.1d(r.o["9b-3y"])&&ZC.2t(r.o["9b-3y"])||(1c!==ZC.1d(r.o[ZC.1b[57]])&&1c===ZC.1d(r.o[ZC.1b[59]])&&(r.o[ZC.1b[59]]="3i"),1c!==ZC.1d(r.o[ZC.1b[59]])&&1c===ZC.1d(r.o[ZC.1b[57]])&&(r.o[ZC.1b[57]]="3i"),1c!==ZC.1d(r.o[ZC.1b[60]])&&1c===ZC.1d(r.o[ZC.1b[58]])&&(r.o[ZC.1b[58]]="3i"),1c!==ZC.1d(r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1K":a=0;1p;1i"2z":a=1;1p;1i"3H":a=.5;1p;2q:(a=ZC.IL(l[0]))>1&&(a/=r.A.I)}1Q(l[1]){1i"1v":n=0;1p;1i"2c":n=1;1p;1i"6s":n=.5;1p;2q:(n=ZC.IL(l[1]))>1&&(n/=r.A.F)}}r.E["2L-6w"]=[a,n],r.iX=r.A.iX+ZC.1k(a*(r.A.I-r.I-v[1]-v[3]))+v[3],r.iY=r.A.iY+ZC.1k(n*(r.A.F-r.F-v[0]-v[2]))+v[0]}r.CY=[r.iX,r.iY,r.iX+r.I,r.iY+r.F]}}}1q(){1D.1q();1a e,t=1g;if(!t.o.cM){if(t.4C([["bi","X5"],["5q-Cm","FB","b"],["3H-3Q","om","b"],["6I","KU","b"],["6I-1J","11k"],["6I-2L","EP"],["6I-7m","DI"],["6I-fV","YC"],["6I-1s","H6","i"],["6I-1M","G5","i"],["6I-2a","ET","i"],["6I-sw","MC","i"],["1G-1v","QC"],["1G-2z","ON"],["1G-2c","NX"],["1G-1K","PL"]]),1c!==(e=ZC.1d(t.o["1G-9y"]))){1a i=5Q(e).2o(/\\s+|;|,/);2===i.1f?(t.F2=t.FT=ZC.1k(i[0]),t.F0=t.FC=ZC.1k(i[1])):4===i.1f?(t.F2=ZC.1k(i[0]),t.FT=ZC.1k(i[1]),t.F0=ZC.1k(i[2]),t.FC=ZC.1k(i[3])):t.F2=t.FT=t.F0=t.FC=ZC.1k(i[0])}1c!==ZC.1d(t.o["6I-mi"])&&(t.OS=1m DR(t.A)),t.4C([["1G-9y-1v-1K","F2","i"],["1G-9y-1v-2z","FT","i"],["1G-9y-2c-2z","F0","i"],["1G-9y-2c-1K","FC","i"]])}}UX(e){1a t=e.2o(/\\s/);1l t[0]=ZC.1k(t[0]),t[2]=ZC.AO.G9(t[2]),t}1t(){1a e=1g;if(1c!==e.DI&&!(e.DI 3E 3M)&&"wz"===e.A.OE){1a t=e.A.OJ(e.DI);e.DI=[t[0],t[1]],e.DI[0]-=e.BJ,e.DI[1]-=e.BC}if(e.om&&(e.iX-=e.I/2,e.iY-=e.F/2),"-1"!==e.BU&&0!==e.AQ||e.QC+e.ON+e.NX+e.PL!==""||"-1"!==e.A0||"-1"!==e.AC||""!==e.D7||""!==e.GO||""!==e.HM){1a i=e.H.AB;e.ME&&e.C6&&e.nb();1a a,n={x:"iX",y:"iY",1s:"I",1M:"F"};if(e.o["2c-3X"]&&!e.YP&&!e.eW&&!e.WD){1a l=1m I2(-1===e.A.iX&&-1===e.A.iY?e:e.A);1j(a in l.1S(e),l.eW=!0,l.ME=!1,l.Z=e.Z,l.X5=e.X5,l.1C(e.o["2c-3X"]),l.K=e.K+"-2c",l.1q(),l.hq(),n)1c===ZC.1d(l.o[a])||-1===(""+l.o[a]).1L("+")&&-1===(""+l.o[a]).1L("-")||(l[n[a]]=e[n[a]]+ZC.1k(l.o[a]));l.1t()}if(e.QC+e.ON+e.NX+e.PL===""){1Q(i){1i"3f":e.WS();1p;1i"2F":e.U0();1p;1i"3L":e.U1()}if(e.KU&&e.OS){1a r,o;if(e.DI&&2===e.DI.1f?(r=e.DI[0],o=e.DI[1]):e.E.cp&&(r=e.E.cp[0],o=e.E.cp[1]),e.OS.Z=e.OS.C6=e.Z,e.OS.1S(e),e.OS.1C(e.o["6I-mi"]),e.OS.K=e.K+"-6I-mi",e.OS.o.x=r,e.OS.o.y=o,e.E.cm){1a s=e.E.cm[0],C=e.E.cm[1],A=1A.nw(ZC.1k(C)-ZC.1k(o),ZC.1k(s)-ZC.1k(r));7X(A)&&(A=0),1c===ZC.1d(e.OS.o.2f)&&(e.OS.o.2f=ZC.U6(A))}e.OS.1q(),e.OS.1t()}}1u{1a Z=e.AQ,c=e.BU,p=e.GA;1Q(e.AQ=0,i){1i"3f":e.WS();1p;1i"2F":e.U0();1p;1i"3L":e.U1()}e.AQ=Z;1a u=e.A0,h=e.AC;e.A0=e.AC="-1";1j(1a 1b,d=["1v","2z","2c","1K"],f=["QC","ON","NX","PL"],g=0;g<d.1f;g++)if(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if(l.YS("1E","AP"),1c!==ZC.1d(l.AP)&&(l.AP=""+l.AP,l.AP=l.EX(l.AP),l.AP=l.AP.1F(/\\n/g,"<br>").1F(/\\\\n/g,"<br>"),"2F"===l.H.AB&&(l.AP=l.AP.1F(/&8x;/g," "))),l.4C([["iQ","qT","b"],["8u-1s","XF","b"],["1X-1s","OW","i"],["1w-1M","FH","i"],["1s-fV","q5","f"],["11J-1E","iP","b"],["3v-1E","qg","b"],["6z","hu","b"],["bm","N9","b"],["hk","R4","b"],["1E-bL","KD"],["aG","hN","b"],["1E-3x","OH"],["3x","OH"],["9A-3x","JZ"],["2s-2e","DG","f"],["1X-sI","YL","i"],["2s-9i","GF"],["2s-2f","AA","i"],["1r","C0","c"],["2s-1r","C0","c"],["1E-2n","X4","f",0,1],["11I-pP","VP","b"]]),l.DG=ZC.BN(1,l.DG),1c===ZC.1d(l.o["1E-2n"])&&(l.X4=l.C5),l.hu&&(l.7K="6z"),1c!==(e=ZC.1d(l.o["2s-79"]))&&(l.7K=e),1c===ZC.1d(l.o["1E-bL"])&&(l.KD=l.R4?"hk":"2b"),1c!==(e=ZC.1d(l.o["2s-1I"]))&&(l.N9="bm"===e||"bk"===e),1c!==(e=ZC.1d(l.o.3w))){1a r=5Q(e).2o(/\\s+|;|,/);t=1===r.1f?[ZC.1k(r[0]),ZC.1k(r[0]),ZC.1k(r[0]),ZC.1k(r[0])]:2===r.1f?[ZC.1k(r[0]),ZC.1k(r[1]),ZC.1k(r[0]),ZC.1k(r[1])]:3===r.1f?[ZC.1k(r[0]),ZC.1k(r[1]),ZC.1k(r[2]),ZC.1k(r[0])]:[ZC.1k(r[0]),ZC.1k(r[1]),ZC.1k(r[2]),ZC.1k(r[3])],l.FP=t[0],l.FR=t[1],l.FZ=t[2],l.EN=t[3]}if(l.4C([["3w-1v","FP","i"],["3w-2z","FR","i"],["3w-2c","FZ","i"],["3w-1K","EN","i"]]),l.AP){l.YL>0&&l.AP.1f>l.YL&&(l.AP=l.AP.2x(0,l.YL)+"...");1a o=l.AP.2o(/<br>|<br\\/>|<br \\/>|\\n/),s="";1y l.o["4d-4D"]!==ZC.1b[31]&&ZC.2t(l.o["4d-4D"])&&(o=[l.AP],s="[pR]");o.1f;1j(l.KQ=ZC.P.kL(1g.H.K,s+l.AP,1g.GF,1g.DG,1g.7K,1g.FH,!0)+l.FP+l.FZ,i=0,a=o.1f;i<a;i++)l.NU=ZC.BN(l.NU,l.eM(o[i])+l.EN+l.FR)}1u l.AP="",l.NU=ZC.1k(1.25*l.DG),l.KQ=-1===l.FH?ZC.1k(1.25*l.DG):l.FH;if((1c===ZC.1d(l.o[ZC.1b[19]])||7X(l.I)||0===l.I)&&(l.I=l.NU),(1c===ZC.1d(l.o[ZC.1b[20]])||7X(l.F)||0===l.F)&&(l.F=l.KQ),l.I=ZC.CT(l.I,l.OW),l.iP&&l.NU>l.I&&!l.E.pf&&l.I>2*l.DG){1a C,A="",Z=0,c=l.AP.1F(/<br>/gi," [##] ").2o(/\\s|<br>/),p=[];1j(i=0,a=c.1f;i<a;i++)if((C=l.eM(c[i]))>.9*l.I){1a u=1A.4h(C/l.I*.9),h=1A.4h(c[i].1f/u);1j(n=0;n<u;n++)p.1h(c[i].5w(n*h,h))}1u p.1h(c[i]);1j(i=0,a=p.1f;i<a;i++)""!==p[i]&&("[##]"===p[i]?(A+="<br>",Z=0):(Z+=C=1+l.eM(p[i]+" "))>.9*l.I?(i>0&&(A+="<br>"),A+=p[i]+" ",Z=C):A+=p[i]+" ");A=(A=A.1F(/<br><br>/g,"<br>").1F(/ <br> <br>/g," <br>")).1F(/(.+?)<br> $/g,"$1");1a 1b=l.o.1E;l.o.1E=A,l.E.pf=!0,l.1q(),l.o.1E=1b,l.E.pf=!1}if(!(1c!==ZC.1d(l.o[ZC.1b[19]])&&1c!==ZC.1d(l.o[ZC.1b[20]])||1c===ZC.1d(l.o.2L)&&1c===ZC.1d(l.o.2y)&&1c===ZC.1d(l.o[ZC.1b[57]])&&1c===ZC.1d(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if(1c===ZC.1d(ZC.4f.1U["d5-"+e.R2])){1a t=["gs-3b"===e.N6?"go="+1A.cX():"",1o.iq?"k1="+e.AB:""].2M("&");ZC.A4.ao({1J:"bY",3R:e.R2,pn:"1E",eg:1n(t){e.S7.d5||"7h-g9"!==e.N6||t.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:t,4L:1n(t,i,a,n){1l e.NG({8D:ZC.1b[63],aJ:"bV cI fb ("+n+")"},ZC.1b[64]),!1},aB:1n(t){1a i;4M{i=3g.1q(t),ZC.4f.1U["d5-"+e.R2]=t}4K(a){1l e.NG(a,"3g jE"),!1}e.MT=i,ZC.6x(e.MT),e.2w()}})}1u{1a i;4M{i=3g.1q(ZC.4f.1U["d5-"+e.R2])}4K(a){1l e.NG(a,"3g jE"),!1}e.MT=i,ZC.6x(e.MT),e.2w()}}2w(e,t){1a i=1g;if(i.MJ="2w",""!==(t=t||i.QZ)&&0!==t.1L("7s:"))if(1c===ZC.1d(ZC.4f.1U["1U-"+t])){1a a=["gs-3b"===i.N6?"go="+1A.cX():"",1o.iq?"k1="+i.AB:""].2M("&");ZC.A4.ao({1J:"bY",3R:t,pn:"1E",eg:1n(e){i.S7.1U||"7h-g9"!==i.N6||e.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:a,4L:1n(e,t,a,n){1l i.NG({8D:ZC.1b[63],aJ:"bV cI fb ("+n+")"},ZC.1b[64]),!1},aB:1n(t){i.i6(e,t)}})}1u i.i6(e,ZC.4f.1U["1U-"+t]),ZC.4f.1U["1U-"+t]=1c;1u""!==i.F8?i.i6(e,i.F8):1c!==i.MF&&(i.py?i.MF=3g.1q(3g.5b(i.py)):i.py=3g.1q(3g.5b(i.MF)),i.i6(e,i.MF))}i6(e,t){1a i=1g;ZC.TS[i.K]=(1m a1).bv(),ZC.AO.su("uj",i)?ZC.AO.C2("uj",i,i.FD(),t,1n(t){i.pL(e,t)}):i.pL(e,t)}n2(e){1a t,i;if(!1o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1b[16]].1f;i<A5;i++)if(1c!==ZC.1d(DF[ZC.1b[16]][i])){if(1c!==ZC.1d(G=DF[ZC.1b[16]][i].5X)){1a FG=[];1j(DF[ZC.1b[16]][i][ZC.1b[10]]=DF[ZC.1b[16]][i][ZC.1b[10]]||[],j=0,JA=G.1f;j<JA;j++)if(G[j].eE&&G[j]["3e-1P"]||FG.1h(G[j]),1c!==ZC.1d(G[j].1J)&&0===G[j].1J.1L("1o."))4M{1a M5=G[j].Ch||{},EG=G[j].1J+"."+(M5.8D||"");M5[ZC.1b[3]]=i;1a fF=7t(EG).4v(s,M5,DF,G[j]);1j(1a i4 in fF)fF.8d(i4)&&("1H"===fF[i4].jI?DF[ZC.1b[16]][i][ZC.1b[10]].1h(fF[i4]):FG.1h(fF[i4]))}4K(e){}DF[ZC.1b[16]][i].5X=FG}1a jK;if(1c!==ZC.1d(jK=DF[ZC.1b[16]][i].fB))1j(1a w2=s.rB(DF,i),k=0;k<jK.1f;k++){1a fz=jK[k];if(1c!==ZC.1d(fz.1J)&&1c!==ZC.1d(1o.fB[fz.1J])&&"1n"==1y 1o.fB[fz.1J].1q)4M{1a BP={};ZC.2E(fz,BP),BP.2Y=w2.2Y,BP.6G={id:s.K,1s:s.I,1M:s.F};1a o=1o.fB[fz.1J].1q.4v(s,BP);if(1c!==ZC.1d(G=o.Ht))1j(j=0;j<G.1f;j++)DF[ZC.1b[16]].1h({}),ZC.2E(G[j],DF[ZC.1b[16]][DF[ZC.1b[16]].1f-1]);if(1c!==ZC.1d(G=o[ZC.1b[10]]))1j(1c===ZC.1d(DF[ZC.1b[16]][i][ZC.1b[10]])&&(DF[ZC.1b[16]][i][ZC.1b[10]]=[]),j=0;j<G.1f;j++)DF[ZC.1b[16]][i][ZC.1b[10]].1h(G[j]);if(1c!==ZC.1d(G=o.5X))1j(1c===ZC.1d(DF[ZC.1b[16]][i].5X)&&(DF[ZC.1b[16]][i].5X=[]),j=0;j<G.1f;j++)DF[ZC.1b[16]][i].5X.1h(G[j])}4K(e){}}}}Gj(e,t){1a i=1g;1Q(e){1i"1w":1l 1m qp(i);1i"1N":1l 1m qq(i);1i"bR":1l 1m Dm(i);1i"bQ":1l 1m Do(i);1i"2V":1i"5x":1i"94":1l 1m ln(i);1i"6b":1l 1m l2(i);1i"9z":1i"h7":1i"aZ":1j(1a a=!1,n=i.o[ZC.1b[16]][t][ZC.1b[11]],l=0,r=n.1f;l<r;l++)n[l]&&n[l].1J&&-1!==n[l].1J.1L("3d")&&(a=!0);1l a?1m qc(i):i.o[ZC.1b[16]][t].1B&&i.o[ZC.1b[16]][t].1J&&i.o[ZC.1b[16]][t].1B&&i.o[ZC.1b[16]][t].1B.1J&&-1!==i.o[ZC.1b[16]][t].1B.1J.1L("3d")?1m qc(i):"9z"===e?1m qd(i):1m Dp(i);1i"6v":1l 1m Ds(i);1i"8p":1l 1m Dj(i);1i"5g":1l 1m Du(i);1i"6A":1l 1m Dw(i);1i"9f":1i"3P":1l 1m qn(i);1i"8Z":1l 1m Ea(i);1i"7j":1i"q4":1l 1m Eb(i);1i"b6":1l 1m zB(i);1i"fO":1i"8m":1l 1m Gm(i);1i"8h":1l 1m Gr(i);1i"q0":1i"au":1l 1m Gg(i);1i"af":1l 1m Fo(i);1i"vF":1i"5N":1l 1m Gt(i);1i"7Y":1l 1m Fq(i);1i"5A":1l 1m Fu(i);1i"oX":1l 1m Fm(i);1i"8z":1l 1m Fs(i);1i"92":1l 1m Ad(i);1i"88":1l 1m Dg(i);1i"oD":1i"7a":1l 1m FK(i);1i"ek":1i"6U":1l 1m Gf(i);1i"7z":1l 1m Ga(i);1i"qa":1l 1m Ex(i);2q:1l 1m Fh(i)}}OF(e){1j(1a t=1g,i=0,a=t.AI.1f;i<a;i++)if(t.AI[i].K===t.K+"-2Y-"+e||t.AI[i].K===t.K+"-2Y-id"+e||t.AI[i].K===e||i===e)1l t.AI[i];1l 1c}ng(e,t){1a i=1g,a=ZC.A4("#"+i.K+("2F"===i.AB?"-1v":"-3Y")),n=ZC.a5(i.K);e-=a.2a().1K,t-=a.2a().1v;1j(1a l=1c,r=0,o=i.AI.1f;r<o;r++)ZC.DT(e,i.AI[r].iX,i.AI[r].iX+i.AI[r].I*n[0])&&ZC.DT(t,i.AI[r].iY,i.AI[r].iY+i.AI[r].F*n[1])&&(l=i.AI[r]);1l l}pg(e){1a t,i=1g;if(1y i.E.vy===ZC.1b[31]){1y e===ZC.1b[31]&&(e=!1),i.4C([["bJ","LU"]]),i.o[ZC.1b[16]]&&1===i.o[ZC.1b[16]].1f&&1c!==ZC.1d(t=i.o[ZC.1b[16]][0].bJ)&&(i.LU=t),""===i.LU&&(i.LU="9c"),i.LU=5Q(i.LU).1F("1o","d0");1j(1a a=i.LU.2o(/\\s+|;|,/),n=0,l=a.1f;n<l;n++)i.B9.oZ(a[n]);i.B9.mW(i.MT),ZC.2K&&i.B9.oZ("2K"),e||(i.E.vy=!0)}}1q(e){1a t,i,a,n,l,r,o=1g;o.NM="x",o.E.4H=ZC.GR(3g.5b(o.o)),ZC.2E(o.o.vu,o.O7),1===o.o[ZC.1b[16]].1f&&ZC.2E(o.o[ZC.1b[16]][0].vu,o.O7);1a s=o.FD();if(1c!==ZC.1d(e)&&(s[ZC.1b[3]]=e),ZC.AO.C2("Il",o,s),o.MJ="1q",o.QR[1]=o.QR[0],o.QR[0]="",o.QR[0]+=o.I+":"+o.F+":",1c!==ZC.1d(t=o.o[ZC.1b[16]]))1j(o.QR[0]+=t.1f+":",n=0;n<t.1f;n++)o.QR[0]+=(t[n].1J||"")+":",o.QR[0]+=(t[n].x||"")+":"+(t[n].y||"")+":"+(t[n][ZC.1b[19]]||"")+":"+(t[n][ZC.1b[20]]||"")+":",1c!==ZC.1d(t[n][ZC.1b[11]])&&(o.QR[0]+=t[n][ZC.1b[11]].1f+":");if(ZC.AK(o.K+"-3Y-c")&&o.3j(e,!1),1y jF!==ZC.1b[31]&&(o.HA=1m jF(o)),1c===ZC.1d(e)){o.pg(),o.B9.B9["2s-9i"]&&(1o.9J=o.B9.B9["2s-9i"]);1a C=!!o.o.5i;if(o.B9.2w(o.o,"6G",!1,!0),o.4C([["5i","DD"],["yI","R0"]]),o.o[ZC.1b[16]]&&1===o.o[ZC.1b[16]].1f&&(i=o.o[ZC.1b[16]][0],1c!==ZC.1d(t=i.5i)&&(o.DD=t),1c!==ZC.1d(t=i.yI)&&(o.R0=t)),ZC.6x(o.R0),ZC.2E(o.B9.B9.ap.5i,o.DD,!1,!0,!0),o.DD.al)1j(n=o.DD.al.1f-1;n>=0;n--)1j(r=0;r<n;r++)if(o.DD.al[n].id===o.DD.al[r].id){o.DD.al.6u(n,1);1p}if(C||4t o.o.5i,ZC.6x(o.DD),o.N={},1c!==ZC.1d(t=o.o.1I))1j(a in t)"3R"!==a&&(o.N[a]=t[a]);if(o.o[ZC.1b[16]]&&1===o.o[ZC.1b[16]].1f&&(i=o.o[ZC.1b[16]][0],1c!==ZC.1d(t=i.1I)))1j(a in t)"3R"!==a&&(o.N[a]=t[a]);ZC.6x(o.N),o.O7[ZC.1b[16]]&&1D.1q(),o.4C([["i0","dO"],["m9-i0","dO"],["3y","NM"],["h-8w","ja","i"],["v-8w","j8","i"],["7N","KC","b"],["4m-7O","mn","b"]]),o.o[ZC.1b[16]]&&1===o.o[ZC.1b[16]].1f&&(i=o.o[ZC.1b[16]][0],1c!==ZC.1d(t=i.i0)&&(o.dO=t),1c!==ZC.1d(t=i["m9-i0"])&&(o.dO=t),1c!==ZC.1d(t=i.7N)&&(o.KC=ZC.2t(t)),1c!==ZC.1d(t=i["4m-7O"])&&(o.mn=ZC.2t(t))),1c!==ZC.1d(t=1o.ft[o.dO])&&(ZC.HD=t),o.AI=[]}1a A=0,Z=0,c=o.I,p=o.F;if(1c!==ZC.1d(o.o.2y)||1c!==ZC.1d(o.o[ZC.1b[57]])||1c!==ZC.1d(o.o[ZC.1b[58]])||1c!==ZC.1d(o.o[ZC.1b[59]])||1c!==ZC.1d(o.o[ZC.1b[60]])){1a u=1m I2(o);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ZC.1b[19]])&&(o.E["2Y-"+m+"-1s"]=o.AI[m].o[ZC.1b[19]]=1A.1X(F,F-K)),1c===ZC.1d(o.AI[m].o[ZC.1b[20]])&&(o.E["2Y-"+m+"-1M"]=o.AI[m].o[ZC.1b[20]]=1A.1X(I,I-D))}o.AI[m].1q()}o.LA===1b&&(m++,++E===v&&(b++,E=0))}}1c===ZC.1d(e)&&1c!==ZC.1d(t=o.o.cR)&&(o.HP={1J:"kc",dL:10},ZC.2E(t,o.HP))}jz(e,t){t=t||"";1a i=[];1j(1a a in e)if("4j"==1y e[a])1j(1a n=1g.jz(e[a],t+"."+a),l=0,r=n.1f;l<r;l++)-1===ZC.AT(i,n[l])&&i.1h(n[l]);1u{1a o=t+"."+a;"1T-4e"!==a&&"Ez"!==a||""===e[a]||"zc."===e[a].2x(0,3)||(!ZC.6R&&ZC.j0&&"Dr"===e[a].2x(0,8)&&(e[a]=ZC.j0[e[a].2x(8)]),"!"===e[a].eV(0)&&(e[a]=e[a].2x(1),1g.E["bZ-8J"]=1g.E["bZ-8J"]||[],1g.E["bZ-8J"].1h(e[a])),i.1h([e[a],"4e"])),"4X"===a&&""!==e[a]&&"zc."!==e[a].2x(0,3)&&-1!==o.1L(".8J.")&&(!ZC.6R&&ZC.j0&&"Dr"===e[a].2x(0,8)&&(e[a]=ZC.j0[e[a].2x(8)]),"!"===e[a].eV(0)&&(e[a]=e[a].2x(1),1g.E["bZ-8J"]=1g.E["bZ-8J"]||[],1g.E["bZ-8J"].1h(e[a])),i.1h([e[a],"4e"])),".6O"===o.5w(o.1f-4,4)&&"3b"==1y e[a]&&i.1h([e[a],"6O"]),"3R"===a&&(-1!==o.1L(".1I.")&&i.1h([e[a],"2O"]),-1!==o.1L(".6O.")&&i.1h([e[a],"6O"]),-1!==o.1L(".1R.")&&i.1h([e[a],"4e"])),"3b"==1y e[a]&&"3R"!==a&&(0===e[a].1L("3R:")&&a===ZC.1b[5]||0===e[a].1L("7s:"))&&-1===ZC.AT(["5D","1E","Hk"],ZC.EB(a))&&i.1h([e[a],"1U"])}1l i}OR(JC){1a s=1g;if(1o.3J.qX){1a J5=s.jz(s.o).4A(s.jz(s.MT));if(0!==J5.1f){1a UY=0,LP={},r8=0;s.E["bZ-8J"]=s.E["bZ-8J"]||[];1a C4=2u.eP(1n(){if(UY>=J5.1f){1j(1a e in 2u.9W(C4),s.nT(s.o),LP)if(0!==e.1L("1U:")&&-1===ZC.AT(s.E["bZ-8J"],e))4M{1a t=2g.4V("3f");t.1s=LP[e].1s,t.1M=LP[e].1M,t.9q("2d").cg(LP[e],0,0);1a i=t.kB("4e/9V");LP[e].gx=1c,LP[e].jl=1c,LP[e].4X=i,ZC.4f.1U[e]=LP[e]}4K(a){}2u.5E(1n(){1o.YF[s.K]&&JC()},1)}1u qB(++r8)},20);qB(r8)}1u 1o.YF[s.K]&&JC()}1u 1o.YF[s.K]&&JC();1n qB(i){if(!(i>=J5.1f)){1a F8,ML,KH=J5[i][0],l5=J5[i][1];if("3R:"===KH.2x(0,4)){1a QZ=KH.2x(4);s.QU["3R:"+QZ]="[]";4M{F8=["gs-3b"===s.N6?"go="+1A.cX():""].2M("&"),ZC.A4.ao({1J:"bY",3R:QZ,eg:1n(e){s.S7.1U||"7h-g9"!==s.N6||e.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:F8,4L:1n(e,t,i,a){1l s.NG({8D:ZC.1b[63],aJ:"bV cI fb ("+a+")"},ZC.1b[64]),!1},aB:1n(e,t,i,a){s.QU["3R:"+a]=e,UY++}})}4K(JB){1l s.NG(JB,ZC.1b[64]),!1}}1u if("7s:"===KH.2x(0,11))if("zc.Nu.2w"===s.QU[KH]){s.QU[KH]="[]";1a DW=ZC.AO.ru(KH.2x(11)),O={id:s.K,t8:KH,5H:1n(e){s.QU[KH]=e,UY++}},Em=DW[0];O.98=DW[1];4M{1a jq=7t(Em).4v(s,O);1c!==ZC.1d(jq)&&jq&&(s.QU[KH]=jq,UY++)}4K(JB){1l s.NG(JB,"sc 1U 6G"),!1}}1u UY++;1u"4e"===l5?(LP[KH]=1m cL,LP[KH].Dd="Df",LP[KH].gx=1n(){UY++},LP[KH].jl=1n(){1a e=ZC.2t(s.o.Ky);if(ZC.fg.1h(KH),e)1l s.NG({8D:ZC.1b[63],aJ:"bV cI fb ("+1g.4X+")"},"bV 6G (4e)"),!1;1g.4X=ZC.kn,UY++},LP[KH].4X=KH,ZC.4f.1U[KH]=LP[KH]):"2O"===l5?(F8=["gs-3b"===s.N6?"go="+1A.cX():""].2M("&"),ZC.A4.ao({1J:"bY",3R:KH,eg:1n(e){s.S7.2O||"7h-g9"!==s.N6||e.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:F8,4L:1n(e,t,i){1l s.NG(i,"bV 6G"),!1},aB:1n(e){1j(1a t={},i=e.mP(/[a-zA-Z0-9\\.\\#\\-](.+?)\\{((.|\\s)+?)\\}/gi),a=0,n=i.1f;a<n;a++){ML=i[a].2o("{");1a l=ZC.GR(ML[0]),r=l.2o(/\\s+/);if(1===r.1f||2===r.1f&&ZC.GR(r[0])==="#"+s.K){t[l=ZC.GR(1===r.1f?r[0]:r[1])]||(t[l]={});1j(1a o=0,C=(ML=ML[1].1F("}","").2o(";")).1f;o<C;o++){1a A=ML[o].2o(":");2===A.1f&&(t[l][ZC.GR(A[0])]=""+ZC.GR(A[1]))}}}1c!==ZC.1d(s.o.1I)?ZC.2E(t,s.o.1I):1c!==ZC.1d(s.o[ZC.1b[16]])&&1===s.o[ZC.1b[16]].1f&&s.o[ZC.1b[16]][0].1I&&ZC.2E(t,s.o[ZC.1b[16]][0].1I),UY++}})):"6O"===l5&&(F8=["gs-3b"===s.N6?"go="+1A.cX():""].2M("&"),ZC.A4.ao({1J:"bY",3R:KH,eg:1n(e){s.S7.6O||"7h-g9"!==s.N6||e.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:F8,4L:1n(e,t,i){1l s.NG(i,"bV 6G"),!1},aB:1n(e,t,i,a){s.m4[a]=e,UY++}}))}}}nT(BZ){1a s=1g;1j(1a p in BZ)if("4j"==1y BZ[p])s.nT(BZ[p]);1u 1j(1a F8 in s.QU)F8===BZ[p]&&(BZ[p]=7t(s.QU[F8]))}bF(e){1a t,i,a,n,l=1g;if(l.E.bF=!0,l.E.wh=l.I+"/"+l.F,l.o[ZC.1b[16]])if(l.lp)1o.3n(l.K,"9P"),1o.bb(1o.aQ[l.K]);1u if(1y e===ZC.1b[31]&&(e=!1),ZC.AO.C2("bF",l,l.FD()),e=!1);1u{1j(i=0;i<l.AI.1f;i++)1j(n=0;n<l.AI[i].AY.A7.1f;n++)l.E["g-"+i+"-p-"+n+".2h"]=l.AI[i].E["1B"+n+".2h"];1j(i=0;i<l.AI.1f;i++)l.E["g-"+l.AI[i].L+"-aX"]=3g.5b(l.AI[i].CV);1j(1a r=l.o[ZC.1b[16]],o=[ZC.1b[10],"5X"],s=0,C=r.1f;s<C;s++)1j(1a A=0;A<o.1f;A++){1a Z=o[A],c=[];if(1c!==ZC.1d(r[s][Z])){1j(i=0,a=r[s][Z].1f;i<a;i++)r[s][Z][i].eE||c.1h(r[s][Z][i]);r[s][Z]=c}}if(l.VS(l.o),l.o=ZC.AO.C2("f6",l,l.FD(),l.o),ZC.A4("#"+l.K+"-1v").1s(l.I).1M(l.F),l.E["6j-7r"]&&(ZC.A4("#"+l.K+"-fD").1s(l.I).1M(l.F),4t l.E["6j-7r"]),1===(t=ZC.A4("#"+l.K+"-5S")).1f&&t.1s(l.I).1M(l.F).2O("3v","5q(7Z,"+(l.I-1)+"px,"+(l.F-1)+"px,7Z)"),"2F"===l.AB&&(l.KG.4l(ZC.1b[19],l.I),l.KG.4l(ZC.1b[20],l.F)),"3f"===l.AB||"3L"===l.AB){1j(ZC.A4("#"+l.K+"-3Y").1s(l.I).1M(l.F),i=0,a=l.AI.1f;i<a;i++)ZC.A4("#"+l.AI[i].K+"-2N").3r();ZC.A4("#"+l.K+"-3Y>3C").1s(l.I).1M(l.F)}1j("3f"===l.AB&&((t=ZC.AK(l.K+"-3Y-c"))&&(t.1s=l.I,t.1M=l.F),(t=ZC.AK(l.K+"-3Y-c-1v"))&&(t.1s=l.I,t.1M=l.F),ZC.A4("#"+l.K+"-2J-2c 3f, #"+l.K+"-2J-1v 3f, #"+l.K+"-b2 3f").5f(1n(){1g.1s=l.I,1g.1M=l.F})),"3L"===l.AB&&ZC.A4("#"+l.K+"-2J-2c 3C, #"+l.K+"-2J-1v 3C, #"+l.K+"-b2 3C").5f(1n(){1g.1I.1s=l.I+"px",1g.1I.1M=l.F+"px"}),l.1q(),i=0,a=l.AI.1f;i<a;i++)l.AI[i].UK&&l.AI[i].UK(),l.AI[i].HH=!0,l.AI[i].oy=l.AI[i].GB,l.AI[i].GB=!1;1j(l.1t(),i=0;i<l.AI.1f;i++)1j(n=0;n<l.AI[i].AY.A7.1f;n++)4t l.E["g-"+i+"-p-"+n+".2h"];1j(i=0;i<l.AI.1f;i++)l.AI[i].HH=!1,l.AI[i].GB=l.AI[i].oy,4t l.AI[i].oy,4t l.E["g-"+l.AI[i].L+"-aX"]}}rz(){1a e=1g.o[ZC.1b[16]],t=[ZC.1b[10],"5X"];if(e)1j(1a i=0,a=e.1f;i<a;i++)1j(1a n=0;n<t.1f;n++){1a l=t[n],r=[];if(1c!==ZC.1d(e[i][l])){1j(1a o=0,s=e[i][l].1f;o<s;o++)e[i][l][o].eE||r.1h(e[i][l][o]);e[i][l]=r}}}3j(e,t,i){1a a=1g;1j(1a n in a.E)-1!==n.1L("-1H-")&&-1!==n.1L("-ch")&&4t a.E[n];if(1y t===ZC.1b[31]&&(t=!0),ZC.A4("."+a.K+"-4Y-1N").4i("3I",a.pl),ZC.A4("."+a.K+"-4Y-1N").3r(),1c!==ZC.1d(e))a.OF(e).3j();1u{t&&a.rz(),a.rM();1j(1a l=0,r=a.AI.1f;l<r;l++)"3L"===a.AB&&i?a.AI[l].9P():a.AI[l].3j();1a o,s,C;1c!==(o=ZC.AK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].3R){1a C=ZC.P.F3("Jv",ZC.1b[36]);ZC.P.G4(C,{eq:"7h://8C.w3.eu/ol/Hc",7L:i[s].3R,aU:"Gz",1J:"1E/2O"}),a.gA.1h(i[s].3R),o.3c(C)}1p;1i"3L":1i"3f":ZC.P.I0({2p:"zc-aU zc-3Y",wh:n,id:a.K+"-3Y",p:r})}}q7(){}1t(){1a e=1g;e.MJ="1t";1a t=e.I+"/"+e.F;if(e.Y1(),1c===ZC.AK(e.K+"-1v")){e.t2();1a i=ZC.AK(e.K+"-3Y");if(e.O7[ZC.1b[16]]&&ZC.P.HF({2p:"zc-3m",id:e.K+"-3Y-c",wh:t,p:i},e.AB),e.H.2Q())ZC.P.HF({2p:"zc-3m",id:e.K+"-3Y-c-1v",wh:t,p:i},e.AB),ZC.P.HF({2p:ZC.1b[24],id:e.K+ZC.1b[15],p:i,wh:t,3N:"2b"},e.AB);1u{ZC.P.K2({2p:"zc-3m",wh:t,id:e.K+"-2J-2c",p:i},e.AB),1o.3J.mR&&ZC.P.K2({2p:"zc-3m",wh:t,id:e.K+"-2J-4W",p:i},e.AB),ZC.P.K2({2p:"zc-3m",wh:t,id:e.K+"-aS",p:i},e.AB),1o.3J.mR||ZC.P.K2({2p:"zc-3m",wh:t,id:e.K+"-2J-4W",p:i},e.AB),ZC.P.K2({2p:"zc-3m",wh:t,id:e.K+"-2J-1v",p:i},e.AB),ZC.P.K2({2p:"zc-3m",wh:t,id:e.K+"-2N",p:i},e.AB),ZC.P.K2({2p:"zc-3m",wh:t,id:e.K+"-2J-5m",p:i},e.AB),ZC.P.K2({2p:"zc-3m zc-1E",wh:t,id:e.K+"-1E",p:i},e.AB);1a a="1W",n="b2";("1W"===e.o["1v-6q"]||e.o[ZC.1b[16]]&&1===e.o[ZC.1b[16]].1f&&"1W"===e.o[ZC.1b[16]][0]["1v-6q"])&&(a="b2",n="1W"),ZC.P.K2({2p:"zc-3m",wh:t,id:e.K+"-"+a,p:i},e.AB),ZC.P.K2({2p:"zc-3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<e.AI[s].BL.1f;c++)if(e.AI[s].BL[c].H7){Z=!0;1p}}if(e.G0){1j(1a p in e.G0)ZC.AK(p).3c(e.G0[p]);e.G0=1c}if(e.E[ZC.1b[53]]=1c,e.UB||e.V3||(e.ZJ?e.nk():e.ZJ=2u.eP(1n(){e.sT(),e.UB||e.V3?(2u.9W(e.ZJ),ZC.P.ER(e.K+"-f1-1E")):ZC.AK(e.K+"-f1-1E")||e.nk()},oQ)),-1===ZC.AT(e.KX,ZC.1b[38])&&e.rH(),-1===ZC.AT(e.KX,ZC.1b[41])?(1y p8!==ZC.1b[31]&&(e.A8=1m p8(e)),Z&&e.HA.3t(),A&&1y K9!==ZC.1b[31]&&(e.D4=1m K9(e),e.D4.3t()),ZC.2K&&(e.h6=1n(t){ZC.ej={xy:ZC.P.MK(t),ts:(1m a1).bv()},t.2X.id===e.K+"-2B-1N"?(ZC.3o=!1,e.A8&&e.A8.5d(),1o.ZF(t)):(1c===e.DD||1c===ZC.1d(e.DD["3h-1Z"])||e.DD["3h-1Z"]||t.6S(),ZC.3o=!1,e.9j(),e.A8&&e.A8.5d(),e.W1(t))},e.P2=1n(){2u.iO(e.uc),e.gW=1c},e.s4=1n(t){if(ZC.ej){1a i=ZC.P.MK(t);if(ZC.2l(i[0]-ZC.ej.xy[0])>100&&(1m a1).bv()-ZC.ej.ts<5I){1a a=e.FD();a.bf=i[0]>ZC.ej.xy[0]?"2z":"1K",ZC.AO.C2("ej",e,a)}ZC.ej=1c}e.dI||ZC.3o||1o.SN(t),e.P2(t)},ZC.A4("#"+e.K+"-5S").3t("4G",e.h6).3t("6h",e.P2).3t("5V",e.s4),ZC.A4("#"+e.K+"-2B-1N").4g("4G",e.h6)),e.h5=1n(t){1a i=e.FD();i.ev=t,ZC.AO.C2("ad",e,i)},ZC.A4("#"+e.K+"-5S").3t("ad",e.h5),ZC.A4("#"+e.K+"-3e").3t("ad",e.h5),e.rE=1n(t){27===t.IS&&e.QQ&&(e.kC||e.h2())},ZC.A4(2g).3t("zZ",e.rE),e.h2=1n(){ZC.A4("#"+e.K+ZC.1b[66]).4i("3I",e.h2),ZC.lA=1c,ZC.P.ER(e.K+"-1U-6t"),e.9P(),1o.ei&&ZC.AK(1o.ei)&&(ZC.AK(1o.ei).1I.3N="2b")},ZC.A4("#"+e.K+ZC.1b[66]).4g("3I",e.h2)):ZC.2K&&(e.rh=1n(e){1l e.6S(),1o.SN(e),!1},ZC.A4("#"+e.K+"-5S").3t("4G",e.rh)),1c!==e.HP){1a u=ZC.1k(e.HP.dL);u=u>=50?u:5I*u,2u.5E(1n(){e.MP(),e.2w()},u)}e.MJ="",ZC.TS[e.K]=(1m a1).bv()-ZC.TS[e.K],e.E["d6-ar"]&&(ZC.AO.C2("ar",e,e.FD()),e.E["d6-ar"]=1c),e.E["d6-2w"]&&(ZC.AO.C2("2w",e,e.FD()),e.E["d6-2w"]=1c)}bU(e){1j(1a t=1g,i=0;i<t.AI.1f;i++)t.AI[i].BI&&t.AI[i].BI.oT(e)}tp(){1a e=1g,t=2g.4V("3f");t.1s=e.I,t.1M=e.F,t.4l("1O","");1j(1a i=0;i<e.AI.1f;i++)e.AI[i].BI&&e.AI[i].BI.oT(!0,t);1l t}Jb(){1c===ZC.1d(ZC.ou)&&(ZC.ou=1n(e){1o.3n(e.id,"Ap")}),1o.3n(1g.K,"Ak",{1E:"ud hc","1n":"ZC.ou()",6E:100})}nk(){1a e,t=1g,i={},a=t.DD.eb;t.B9.2w(i,"6G.5i.eb"),a&&ZC.2E(a,i),1===t.o[ZC.1b[16]].1f&&t.o[ZC.1b[16]][0].5i&&(e=t.o[ZC.1b[16]][0].5i.eb)&&ZC.2E(e,i);1a n=ZC.5l(ZC.1k(i.1J||1),1,2),l=i.2L||"br";-1===ZC.AT(["tl","tr","br","bl"],l)&&(l="br"),t.Jn=l;1a r,o=32,s=146,C=0,A=1;ZC.6R&&(o=30,s=168,C=8,A=1),s=126,o=22;1a Z={9c:["#Iz","#Ib"],b8:["#Bm","#Ih"]},c=Z.9c;if(1o.kJ&&(c="9c"===t.LU||"d0"===t.LU?Z.9c:Z.b8),1===t.o[ZC.1b[16]].1f)if(t.o[ZC.1b[16]][0][ZC.1b[0]]){1a p=ZC.AO.G9(t.o[ZC.1b[16]][0][ZC.1b[0]]);7===p.1f&&(c=ZC.AO.oI(p,Z.b8,Z.9c))}1u if(t.o[ZC.1b[16]][0].bJ){1a u=t.o[ZC.1b[16]][0].bJ;c="9c"===u||"d0"===u?Z.9c:Z.b8}1a h,1b,d=1y 2u!==ZC.1b[31]&&2u.82?2u.82.Av:"",f=1y 2u!==ZC.1b[31]&&2u.82?2u.82.Cw:"";1Q(r=\'<a 5M="sc It by hc" 1I="1r:\'+c[0]+\' !7q;2s-2e:Bb !7q;3N:8K !7q;3p:1 !7q; 1E-bL:2b;" 7L="7h://8C.1o.c1/?Av=\'+d+"&Cw="+f+\'">GW by <7B 1I="1r:\'+c[1]+\'; 2s-79:6z;">hc</7B></a>\',l){1i"br":h=t.F-o,1b=t.I-s;1p;1i"bl":h=t.F-o,1b=6;1p;1i"tr":h=2,1b=t.I-s;1p;1i"tl":h=2,1b=6}1c!==ZC.1d(e=ZC.AK(t.K+"-1v"))&&ZC.P.I0({2p:ZC.6R?"-6R":"",p:e,id:t.K+"-f1-1E",tl:h+"/"+1b,wh:s+"/"+(o-C),1r:ZC.6R?1===n?"#lJ":"#2T":"",3w:C,3p:A,2L:"4E",4U:"8n",6Q:1o.9J,4d:r},t.AB)}rM(){1a e=1g;ZC.A4("#"+e.K+"-2B").4i(ZC.1b[47],e.TW),ZC.A4("."+e.K+"-2B-1P").4i(ZC.1b[47],e.TW),ZC.A4("."+e.K+"-2B-1P").4i("3I 5V",e.sg).4i("6Z",e.tj).4i("7D",e.rN),e.E["2B-1P-hb"]=!1,1c!==e.HA&&e.HA.3l(),1c!==e.D4&&e.D4.3l(),ZC.2K&&(ZC.A4("#"+e.K+"-5S").3l("4G",e.h6).3l("6h",e.P2).3l("5V",e.s4),ZC.A4("#"+e.K+"-2B-1N").4i("4G",e.h6),ZC.A4("#"+e.K+"-5S").3l("4G",e.rh)),ZC.A4("#"+e.K+"-5S").3l("ad",e.h5),ZC.A4("#"+e.K+"-3e").3l("ad",e.h5),ZC.A4(2g).3l("zZ",e.rE),ZC.A4("#"+e.K+ZC.1b[66]).4i("3I",e.h2)}U9(e,t,i){1y i===ZC.1b[31]&&(i=!1);1a a=ZC.AK("zc-2B-"+(i?"ex":"1P")+"-"+e);a&&(a.1I.3N=t?"8K":"2b")}rH(LN,ev){if(!1o.3J.Gn){1a s=1g,G,i,A5,j,JA;1y LN===ZC.1b[31]&&(LN=-1);1a DD={};ZC.2E(s.DD,DD),-1!==LN&&s.o[ZC.1b[16]][LN]&&ZC.2E(s.o[ZC.1b[16]][LN].5i,DD,1c,1c,!0),ZC.A4("#"+s.K+"-2B").3r();1a S1=[];1j(1y ZC.AL===ZC.1b[31]&&S1.1h({id:"3D",4a:"2b"},{id:"vh",4a:"2b"},{id:"vg",4a:"2b"}),i=DD.al.1f-1;i>0;i--)1j(1a Gc=DD.al[i].id,ii=i-1;ii>=0;ii--)DD.al[ii].id===Gc&&DD.al.6u(ii,1);if(1c!==ZC.1d(G=DD.al))1j(i=0,A5=G.1f;i<A5;i++){1a ND=!1;1j(j=0,JA=S1.1f;j<JA;j++)S1[j].id===G[i].id&&(ND=!0);ND||S1.1h(G[i])}1a JI=DD["6o-2B"],OO=DD["6o-2B[2K]"];1j(i=0,A5=S1.1f;i<A5;i++)1c!==ZC.1d(S1[i]["1n"])&&(1c===ZC.1d(JI)&&(JI={}),1c===ZC.1d(JI["5F-2C"])&&(JI["5F-2C"]=[]),JI["5F-2C"].1h(S1[i]));JI["5F-2C"]&&JI["5F-2C"].3Z(1n(e,t){1l ZC.1k(e.6E||"0")>ZC.1k(t.6E||"0")}),s.N4=1m DP(s);1a j5=s.LU.2o(/\\s+|;|,/),DX,LL,UR,rS,GP;1j(i=0,A5=j5.1f;i<A5;i++)if(s.B9.O4[j5[i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1h(GS("eG",EH.1E)),JU.1h(J9("eG"))),1y ZC.Cb!==ZC.1b[31]){EH=G3("Oj"),"2b"!==EH.4a&&(EH=G3("Mm"),"2b"!==EH.4a&&JU.1h(GS("tR",EH.1E?EH.1E:1c)),EH=G3("x7"),"2b"!==EH.4a&&JU.1h(GS("tq",EH.1E?EH.1E:1c)),JU.1h(J9("8v")));1a TR=["Mx","Mz","wX","tD","xl","wV","xV"],tJ=0,tv=0;1j(i=0;i<TR.1f;i++)"xl"===TR[i]&&ZC.AK(s.K+"-1U-6t")&&(TR[i]="Jf"),EH=G3(TR[i]),"2b"!==EH.4a&&(tJ++,tv=i,JU.1h(GS(TR[i].aO(),EH.1E)));tJ>0&&JU.1h(J9(TR[tv].aO()))}if(-1!==LN){1a H7=!1;1j(j=0,JA=s.AI[LN].BL.1f;j<JA;j++)s.AI[LN].BL[j].H7&&(H7=!0);if(H7&&1y jF!==ZC.1b[31]){1a gO=!1;EH=G3("Jp"),"2b"!==EH.4a&&(JU.1h(GS("eQ",EH.1E)),gO=!0),EH=G3("Jr"),"2b"!==EH.4a&&(JU.1h(GS("f2",EH.1E)),gO=!0),EH=G3("Jt"),"2b"!==EH.4a&&(JU.1h(GS("fE",EH.1E)),gO=!0),gO&&JU.1h(J9("3G"))}}1a gM=!1,tA=!1;if(-1!==LN&&(-1!==ZC.AT(["1w","1N","2V","5x","6b","3P","9z"],s.AI[LN].AF)&&(gM=!0,s.XS="2d"),-1!==ZC.AT(["92","88","ek","6U","7z","7a","aZ"],s.AI[LN].AF)&&(tA=!0,s.XS="3d")),(gM||tA)&&(EH=G3("3D"),"2b"!==EH.4a&&(EH=G3(gM?"vh":"vg"),"2b"!==EH.4a&&(JU.1h(GS(gM?"tW":"tY",EH.1E)),JU.1h(J9("14Z"))))),-1!==LN){1a C=s.AI[LN],nF=!1,kH=!1;1j(j=0;j<C.BL.1f;j++){1a B=C.BL[j];0===B.BD.1L(ZC.1b[51])&&(nF=!0),"3a"===B.C8&&(kH=!0)}nF&&(EH=G3("151"),"2b"!==EH.4a&&(EH=G3(kH?"uH":"uK"),"2b"!==EH.4a&&(JU.1h(GS(kH?"tM":"tP",EH.1E)),JU.1h(J9("f9"))))),(C.CZ||C.KE)&&(EH=G3("u3"),"2b"!==EH.4a&&(EH=G3(C.eX?"15K":"17N"),"2b"!==EH.4a&&(JU.1h(GS(C.eX?"mZ":"gQ",EH.1E)),JU.1h(J9("2i")))))}1a j7=0,B5;if(1y ZC.Aa!==ZC.1b[31]&&(EH=G3("vA"),"2b"!==EH.4a&&(JU.1h(GS("4N",EH.1E)),j7++),EH=G3("vm"),"2b"!==EH.4a&&(JU.1h(GS("4r",EH.1E)),j7++)),j7>0&&JU.1h(J9("b2")),EH=G3("vj"),"2b"===EH.4a||s.M2||(s.QQ?(EH=G3("17O"),JU.1h(GS("gN",EH.1E)),JU.1h(J9("gN"))):(JU.1h(GS("5O",EH.1E)),JU.1h(J9("5O")))),s.IC&&(EH=G3("17P"),"2b"!==EH.4a&&JU.1h(GS("cH",EH.1E)),EH=G3("17Q"),"2b"!==EH.4a&&JU.1h(GS("cG",EH.1E)),JU.1h(J9("4Y"))),JU.1f>0&&-1!==JU[JU.1f-1].1L("zc-2B-ex")&&JU.6u(JU.1f-1,1),s.tH={},-1!==LN)if(JI&&1c!==ZC.1d(B5=JI["5F-2C"]))1j(JU.1f>0&&JU.1h(J9("5F")),i=0,A5=B5.1f;i<A5;i++){1a mV=!0;if(1c!==ZC.1d(B5[i].4a)&&("2b"===B5[i].4a?mV=!1:"4s"!==B5[i].4a&&(mV=!ev||7t(B5[i].4a).4v(s,1o.gP(ev,s),B5[i].id,ev))),mV){1a AP,K=B5[i].id||"5F-"+i;"ex"===B5[i].id||"ex"===B5[i].1J?JU.1h(J9(K,!0)):"5R"===B5[i].1J?(AP=B5[i].1E||"sD vO "+i,JU.1h(x6(K,AP,!0))):(AP=B5[i].1E||"sD vO "+i,s.tH[K]={fn:B5[i]["1n"]||"",3R:B5[i].3R||"",2X:B5[i].2X||""},JU.1h(GS(K,AP,!0)))}}s.UB||(JU.1h(J9("1o")),JU.1h(GS("wt","ud hc"))),ZC.P.I0({id:s.K+"-2B",p:2g.3s,2p:"zc-2B zc-1I",1v:1c===ZC.1d(GP)?0:GP.iY+GP.F/2,1K:1c===ZC.1d(GP)?0:GP.iX+GP.I/2,u0:s.N4.AQ+"px 2U "+s.N4.BU,1T:(-1===s.N4.A0?"b0":s.N4.A0)+" "+mK(s.N4.D7),cE:s.N4.FP,dU:s.N4.FR,dV:s.N4.FZ,dW:s.N4.EN,4d:JU.2M("")}),s.E["2B-1P-hb"]||(s.sg=1n(e){1a t,i=1!==e.2X.fC?e.2X.6r.id:e.2X.id,a=i.2x(0,i.1L("-2B-1P-")),n=1o.7d(a);ZC.2K&&n.P2();1a l=n.ng(n.T3[0],n.T3[1]);n.9j(),ZC.2K&&1o.SN(e);1a r=i.1F(n.K+"-2B-1P-","");n.yW({4y:l?l.K:1c,tK:r,ev:ZC.A4.BX(e)});1a o=n.o["8v-lE"]||n.o[ZC.1b[16]][0]["8v-lE"]||"";1Q(r){1i"tY":1i"tW":l&&n.rF(l.K);1p;1i"tU":s.DD=s.DD||{},s.DD["3h-1Z"]=!0;1p;1i"tN":s.DD=s.DD||{},s.DD["3h-1Z"]=!1;1p;1i"gQ":n.W0(l.K,!0);1p;1i"mZ":n.W0(l.K,!1);1p;1i"tM":n.W4(l.K,"lb");1p;1i"tP":n.W4(l.K,"3a");1p;1i"eG":n.rC();1p;1i"tR":n.NH("9V");1p;1i"tq":n.NH("eh");1p;1i"ya":n.NH("fG",""===o?1c:{fn:o});1p;1i"y9":n.NH("2F",""===o?1c:{fn:o});1p;1i"lH":1o.3n(n.K,"lH");1p;1i"wS":1o.3n(n.K,"zb",""===o?1c:{fn:o});1p;1i"wI":(t=G3("tD"))["5F-1n"]?n.ZP({4y:l?l.K:1c,tK:r,lE:o,"1n":t["5F-1n"]}):1o.3n(n.K,"zf",""===o?1c:{fn:o});1p;1i"nR":1i"od":1o.3n(n.K,"yM",{oU:r});1p;1i"6F":n.l1();1p;1i"4N":n.lg();1p;1i"4r":n.lk();1p;1i"5O":n.ta();1p;1i"cH":1o.3n(n.K,"cH");1p;1i"cG":1o.3n(n.K,"cG");1p;1i"eQ":l&&(n.HA.C=l,n.lD({4y:l.K}));1p;1i"f2":l&&(n.HA.C=l,n.lB({4y:l.K}));1p;1i"fE":l&&(n.HA.C=l,n.lq({4y:l.K}));1p;1i"wt":n.ss();1p;2q:1c!==ZC.1d(G=s.tH[r])&&(""!==G.fn?n.ZP({4y:l?l.K:1c,tK:r,"1n":G.fn}):""!==G.3R&&l&&l.TZ(e,G.3R,G.2X))}},s.tj=1n(){1g.1I.u5=LL.A0,1g.1I.1r=LL.C0,1g.1I.lW=1g.1I.lS=LL.AQ+"px 2U "+LL.BU},s.rN=1n(){1g.1I.u5=DX.A0,1g.1I.1r=DX.C0,1g.1I.lW=1g.1I.lS=DX.AQ+"px 2U "+DX.BU},s.TW=1n(e){1l e.6S(),!1},ZC.A4("#"+s.K+"-2B").4g(ZC.1b[47],s.TW),ZC.A4("."+s.K+"-2B-1P").4g(ZC.1b[47],s.TW),ZC.A4("."+s.K+"-2B-1P").4g("3I 5V",s.sg).4g("6Z",s.tj).4g("7D",s.rN),s.E["2B-1P-hb"]=!0)}}1n mK(e){1l""!==e&&e?"3R("+(0===e.1L("zc.")?ZC.bt[e]:e)+")":"2b"}1n J9(e){1l\'<3C id="\'+s.K+"-2B-ex-"+e+\'" 1O="zc-2B-ex" 1I="1T-1r:\'+DX.A0+";1T-4e:"+mK(DX.D7)+" 6D-x 50% 0%;1G-2c-1s:"+UR[ZC.1b[4]]+";1G-2c-1r:"+UR["1w-1r"]+\';">&8x;</3C>\'}1n GS(e,t,i){t=t||ZC.HD["2B-"+e];1a a=1y i!==ZC.1b[31]&&i?" zc-5F-2B-1P "+s.K+"-5F-2B-1P":"";1l\'<3C 1O="\'+s.K+"-2B-1P"+a+\'" 1I="1s:\'+s.N4.o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.3j()}1u i.3j(1c,1c,t);K9&&K9.5Z&&(K9.5Z[i.K]=1c)}tG(e){e=e||ZC.HD["q8-b9"];1a t=1g;if(1c===ZC.AK(t.K+"-9a")){ZC.P.I0({2p:"zc-3m zc-1I zc-9a",id:t.K+"-9a",p:ZC.AK(t.K+"-1v"),wh:t.I+"/"+t.F,3p:.75}),ZC.P.I0({2p:"zc-9a-wd",id:t.K+"-9a-t",p:ZC.AK(t.K+"-9a"),4d:e});1a i=ZC.A4("#"+t.K+"-9a-t");i.2O("1v",t.F/2-i.1M()/2+"px").2O("1K",t.I/2-i.1s()/2+"px")}}kQ(){ZC.P.ER(1g.K+"-9a")}ss(){1a e=1g;ZC.AO.C2("18d",e,e.FD()),ZC.P.I0({2p:"zc-3m",id:e.K+"-6B-4P",p:ZC.AK(e.K+"-1v"),wh:e.I+"/"+e.F,1T:"#89",3p:.75});1a t=ZC.CT(18e,e.I),i=ZC.CT(ui,e.F),a=ZC.BN(0,(e.I-t)/2),n=ZC.BN(0,(e.F-i)/2),l=ZC.P.I0({2p:"zc-6B zc-1I",id:e.K+"-6B",p:ZC.AK(e.K+"-1v"),tl:n+"/"+a,wh:t-(ZC.97?0:10)+"/"+(i-(ZC.97?0:10))}),r="";""!==e.SL&&(r="sD 18f 1j<br />"+e.SL),l.4o=\'<3C 1O="zc-6B-1"><a 7L="7h://8C.1o.c1" 2X="qN">1o.c1</a></3C><3C 1O="zc-6B-2">&1S;18h-\'+(1m a1).vd()+\'</3C><3C 1O="zc-6B-3"><3C id="\'+e.K+\'-6B-7w">\'+ZC.HD["6B-7w"]+\'</3C></3C><3C 1O="zc-6B-4" 1I="3w:\'+(i-ui)+\'px 8e 8e 8e;"><3C>&8x;<br />183 \'+ZC.fi+" ["+e.AB+"]</3C>"+r+"</3C>",ZC.A4("#"+e.K+"-6B-7w").3t("3I",1n(){ZC.AO.C2("17K",e,e.FD()),ZC.P.ER([e.K+"-6B",e.K+"-6B-4P"])})}NG(e,t){1a i=1g;if(ZC.AO.su("4L",i))ZC.AO.C2("4L",i,{id:i.K,4L:e,17u:t,4H:i.E.4H||i.E.Ed});1u{1a a="";a+="4j"==1y e?e.8D+":"+e.aJ+"\\n\\n":e+"\\n\\n",1c!==ZC.1d(t)&&(a+="17h:"+t+"\\n\\n"),a+="3g 1U:\\n\\n"+i.E.4H+"\\n\\n",i.Y1(),1c===ZC.AK(i.K+"-1v")&&i.t2(),ZC.P.I0({2p:"zc-3m zc-4L zc-1I",id:i.K+"-4L",p:ZC.AK(i.K+"-1v"),wh:i.I-(ZC.97?0:10)+"/"+(i.F-(ZC.97?0:10))}).4o=\'<3C 1O="zc-4I-5o-1H zc-4I-s0">\'+ZC.HD["4L-5R"]+\'</3C><3C 1O="zc-4I-5o-1H zc-4I-s1">\'+ZC.HD["4L-aJ"]+\'</3C><3C 1O="zc-4I-5o-ai"><bX id="\'+i.K+\'-4L-aJ" 1I="1s:\'+(i.I-35)+"px;1M:"+(i.F-135)+\'px;"></bX></3C><3C 1O="zc-4I-5o-ai zc-4I-5o-7S"><ak 1J="7M" 1V="\'+ZC.HD["4L-7w"]+\'" id="\'+i.K+\'-4L-7w" /></3C>\',ZC.A4("#"+i.K+"-4L-aJ").8L(ZC.GR(a)),ZC.A4("#"+i.K+"-4L-7w").3t("3I",1n(){ZC.P.ER(i.K+"-4L")})}}lg(){}lk(){}ta(){1a e=1g,t=2g.4V("3C");t.id="zc-5O",t.1I.9K=1o.Eq,t.1I.9M="8X";1a i,a,n=2g.3s,l=!1;1j(1o.ei&&ZC.AK(1o.ei)&&(l=!0,(n=ZC.AK(1o.ei)).1I.3N="8K"),n.3c(t),ZC.lA={},i=0,a=e.AI.1f;i<a;i++){1a r=e.AI[i];if(1c!==r.AY)1j(1a o=0,s=r.AY.A7.1f;o<s;o++)ZC.lA["g-"+r.L+"-p-"+o]=r.E["1B"+o+".2h"]}ZC.P.ER(e.K+"-1U-6t");1a C,A=3g.1q(e.E.4H),Z=A[ZC.1b[16]];1j(i=Z.1f-1;i>=0;i--)if(Z[i].eE)Z.6u(i,1);1u{if(1c!==ZC.1d(Z[i].5X))1j(C=Z[i].5X.1f-1;C>=0;C--)Z[i].5X[C].eE&&Z[i].5X.6u(C,1);if(1c!==ZC.1d(Z[i][ZC.1b[10]]))1j(C=Z[i][ZC.1b[10]].1f-1;C>=0;C--)Z[i][ZC.1b[10]][C].eE&&Z[i][ZC.1b[10]].6u(C,1)}l||2u.1Z(0,0),1o.bb({id:"zc-5O",bA:e.AB,1s:ZC.A4(l?n:2u).1s(),1M:ZC.A4(l?n:2u).1M(),t1:!0,bJ:e.LU,gZ:e.ki,1U:A,d5:e.MT,Dy:e.R2})}W4(e,t){1a i,a,n,l=1g,r=0,o=!1;1j(i=0,a=l.AI.1f;i<a;i++)if(e===l.AI[i].K){1j(r=i,n=0;n<l.AI[i].AY.A7.1f;n++)if(l.AI[i].AY.A7[n].IT){o=!0;1p}1a s;1j(s=l.AI[r].AJ["3d"]||o?l.o[ZC.1b[16]][i]:l.AI[i].o,n=0;n<10;n++){1a C=ZC.1b[51]+(0===n?"":"-"+n);1c===ZC.1d(s[C])&&1c===ZC.1d(s[ZC.EB(C)])&&1c!==l.AI[i].BK(C)?s[C]={f9:t}:(1c!==ZC.1d(s[C])&&(s[C].f9=t),1c!==ZC.1d(s[ZC.EB(C)])&&(s[ZC.EB(C)].f9=t))}}4t l.E["2Y"+r+".3G"],l.AI[r].AJ["3d"]||o?l.JS():l.AI[r].JS(!0,!0)}W0(e,t){1a i=1g;if(i.D4){1j(1a a=0,n=i.AI.1f;a<n;a++)e===i.AI[a].K&&(i.AI[a].eX=t,i.AI[a].E["2i-on"]=t);if(t){1a l=ZC.A4("#"+i.K+"-1v"),r={ea:ZC.DS[0]-l.2a().1K,hD:ZC.DS[1]-l.2a().1v,1J:ZC.1b[48],2X:{id:i.K+"-5S"}};i.D4.QK(r)}1u K9.hE(i.K)}}rF(e){1j(1a t=1g,i=["1w","1N","2V","5x","6b","3P","9z"],a=0,n=t.AI.1f;a<n;a++)if(e===t.AI[a].K){1a l=t.o[ZC.1b[16]][a];if("9z"===l.1J)1j(1a r=0,o=l[ZC.1b[11]].1f;r<o;r++){1a s=l[ZC.1b[11]][r];s.1J=s.1J||"1w","3d"===t.XS?s.1J=s.1J.1F("3d",""):-1!==ZC.AT(i,s.1J)&&(s.1J=s.1J+"3d")}1u"3d"===t.XS?l.1J=l.1J.1F("3d",""):-1!==ZC.AT(i,l.1J)&&(l.1J=l.1J+"3d")}t.XS="3d"===t.XS?"2d":"3d",t.E.4H=ZC.GR(3g.5b(t.o)),t.JS()}rC(e){1j(1a t,i=1g,a=0;a<i.AI.1f;a++)4t i.E["g"+a+"-1W-e6"];if(e=e||{},ZC.AO.C2("eG",i,{id:i.K,4y:e[ZC.1b[3]]}),1c!==ZC.1d(t=e[ZC.1b[3]])){1a n=i.C7(t);1c!==n&&(i.MP(n),i.2w(n.K))}1u i.QS=[],i.O2=-1,i.MP(),i.rz(),i.2w()}zu(e){1a t,i=1g;if(e=e||{},1c!==ZC.1d(t=e[ZC.1b[3]])){1a a=i.C7(t);1c!==a&&1c!==ZC.1d(e.h4)&&(i.MP(a),i.2w(t,e.h4))}1u 1c!==ZC.1d(t=e.h4)&&(i.QZ=t,i.MP(),i.2w())}l1(){}NH(){}TM(){}yW(e){ZC.2E(1g.FD(),e),ZC.AO.C2("17m",1g,e)}ZP(O){1a s=1g;4M{1a DW=ZC.AO.ru(O["1n"]);O["1n"]=DW[0],O.98=DW[1],ZC.2E(s.FD(),O),7t(O["1n"]).4v(s,O)}4K(JB){1l s.NG(JB,"sc 1U 6G"),!1}}C7(e){1a t=1g;1l 1c!==ZC.1d(e)?t.OF(e):t.AI.1f>0?t.AI[0]:1c}3t(e,t){1o.3t(1g.K,e,t)}3l(e,t){1o.3l(1g.K,e,t)}3n(e,t){1l 1o.3n(1g.K,e,t)}gc(){1j(1a e=0,t=1g.AI.1f;e<t;e++)1g.AI[e].gc()}}RZ.5n.Ac=1n(e){1a t,i,a,n,l,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(i.K+"-1Z-y-c"),i.A.AB,i.iX,i.iY,i.I,i.F)),i.BI&&(i.BI.IO=!1);1a f=1b.E["2Y"+i.L+".3G"]||{};1j(e.s7=!1,(l=i.BT("v")[0])&&1c!==ZC.1d(e.5t)&&1c!==ZC.1d(e.5s)&&(e.5t===l.H1&&e.5s===l.HL||(e.s7=!0)),s=0,C=i.BT("k").1f;s<C;s++)if(A=1===(n=i.BT("k")[s]).L?"":"-"+n.L,1c!==ZC.1d(e["8V"+A])&&1c!==ZC.1d(e["96"+A]))if(e["8V"+A]===e["96"+A])4t e["8V"+A],4t e["96"+A];1u{1j(1a g=!1,B=!1,v=0,E=n.W.1f;v<E&&(e["8V"+A]<=n.W[v]&&!g&&(e["4q"+A]=v,g=!0),e["96"+A]<=n.W[v]&&!B&&(e["4p"+A]=v,B=!0),!g||!B);v++);g||(e["4q"+A]=0),B||(e["4p"+A]=n.W.1f-1),e["7E"+A]=!0,e.s8=!(g&&B)}1u a=i.BI&&i.BI.LT&&e.ib?i.BI.NV[n.BD][ZC.1b[5]]:n.W,1c!==ZC.1d(t=a[e["4q"+A]])&&(e["8V"+A]=t),1c!==ZC.1d(t=a[e["4p"+A]])&&(e["96"+A]=t),e.s8=!(e["4q"+A]===n.E6&&e["4p"+A]===n.EF);"fE"===e.8f&&(e.s8=!1,e.s7=!1);1a b=ZC.AO.C2("3G",i.A,e,!0);if(e.aE&&!d)1l;if(i.BI&&i.BI.LT){a=i.BI.NV[n.BD][ZC.1b[5]];1a m=ZC.ds(a),K=ZC.dr(a);1c!==ZC.1d(e.8V)&&1y e.8V!==ZC.1b[31]?(r=ZC.1k(i.BI.B4.I*(e.8V-m)/(K-m)),r=ZC.BN(r,0)):r=0,1c!==ZC.1d(e.96)&&1y e.96!==ZC.1b[31]?(o=ZC.1k(i.BI.B4.I*(e.96-m)/(K-m)),o=ZC.CT(o,i.BI.B4.I)):o=i.BI.B4.I,d||i.BI.3T(r,o,i.BI.MX,i.BI.IZ)}if(b||1y b===Z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.BT("k").1f;a<n;a++)1c===i["4q"+(C=1===(o=l.BT("k")[a]).L?"":"-"+o.L)]&&1c===ZC.1d(i["4p"+C])&&1c===ZC.1d(i["8V"+C])&&1c===ZC.1d(i["96"+C])||(i["7E"+C]=!0),"3a"===o.C8&&(1c!==ZC.1d(i["4q"+C])&&(i["4q"+C]=ZC.HO(i["4q"+C],o.EU)),1c!==ZC.1d(i["4p"+C])&&(i["4p"+C]=ZC.HO(i["4p"+C],o.EU)));if(1c!==ZC.1d(i.lv)&&i.lv)1j(a=0,n=l.BT("v").1f;a<n;a++)i["5t"+(C=1===(s=l.BT("v")[a]).L?"":"-"+s.L)]=i.5t||1c,i["5s"+C]=i.5s||1c;1j(a=0,n=l.BT("v").1f;a<n;a++)C=1===(s=l.BT("v")[a]).L?"":"-"+s.L,1c===ZC.1d(i["5t"+C])&&1c===ZC.1d(i["5s"+C])||(i["7R"+C]=!0),"3a"===s.C8&&(1c!==ZC.1d(i["5t"+C])&&(i["5t"+C]=ZC.HO(i["5t"+C],s.EU)),1c!==ZC.1d(i["5s"+C])&&(i["5s"+C]=ZC.HO(i["5s"+C],s.EU)));c.PD(i);1p;1i"17q":if(l=c.C7(i[ZC.1b[3]]),1c!==ZC.1d(i.lx)&&i.lx)1j(a=0,n=l.BT("k").1f;a<n;a++)i["4q"+(C=1===(o=l.BT("k")[a]).L?"":"-"+o.L)]=i.4q||1c,i["4p"+C]=i.4p||1c;1j(a=0,n=l.BT("k").1f;a<n;a++)C=1===(o=l.BT("k")[a]).L?"":"-"+o.L,1c===ZC.1d(i["4q"+C])&&1c===ZC.1d(i["4p"+C])||(l.BI&&l.BI.LT?(i.ib=!0,i["8V"+C+"-aE"]=i["4q"+C],i["4q"+C]=ZC.rO(l.BI.NV[o.BD][ZC.1b[5]],i["4q"+C])):-1!==(A=ZC.AT(o.W,i["4q"+C]))&&(i["4q"+C]=A),l.BI&&l.BI.LT?(i.ib=!0,i["96"+C+"-aE"]=i["4p"+C],i["4p"+C]=ZC.rO(l.BI.NV[o.BD][ZC.1b[5]],i["4p"+C])):-1!==(Z=ZC.AT(o.W,i["4p"+C]))&&(i["4p"+C]=Z),i["7E"+C]=!0);if(1c!==ZC.1d(i.lv)&&i.lv)1j(a=0,n=l.BT("v").1f;a<n;a++)i["5t"+(C=1===(s=l.BT("v")[a]).L?"":"-"+s.L)]=i.5t||1c,i["5s"+C]=i.5s||1c;1j(a=0,n=l.BT("v").1f;a<n;a++)C=1===(s=l.BT("v")[a]).L?"":"-"+s.L,1c===ZC.1d(i["5t"+C])&&1c===ZC.1d(i["5s"+C])||(i["7R"+C]=!0);c.PD(i);1p;1i"fE":c.lq(i)}1l 1c},ZC.Cb={},ZC.AO.kP=1n(e,t,i,a){"o1"===(a=a||"9V")&&(a="eh");1a n=2g.4V("3f");n.1s=t,n.1M=i,n.1I.1s=t+"px",n.1I.1M=i+"px";1a l,r=n.9q("2d");e 3E 3M||(e=[e]);1j(1a o=0,s=e.1f;o<s;o++)if(-1===e[o].7U.1L("zc-no-6F")){1a C=!1;4M{e[o].kB("4e/"+a)}4K(Z){C=!0}if(!C)if(l=e[o].bT("1U-3v")){1a A=l.2o(",");r.cg(e[o],ZC.BN(0,A[0]),ZC.BN(0,A[1]),ZC.CT(A[2],e[o].1s),ZC.CT(A[3],e[o].1M),ZC.BN(0,A[0]),ZC.BN(0,A[1]),ZC.CT(A[2],e[o].1s),ZC.CT(A[3],e[o].1M))}1u r.cg(e[o],0,0,e[o].1s,e[o].1M,0,0,t,i)}1l n.kB("4e/"+a)},ZC.AO.u1=1n(e,t,i,a,n){1c===ZC.1d(n)&&(n=!1);1a l=ZC.AO.kP(e,t,i,a);if(n){1a r=2g.4V("5S");1l r.4X=l,r}l=l.1F("4e/"+a,"4e/tz-kN"),2g.82.7L=l},RZ.5n.l1=1n(){1a e=1g,t=[];if(!e.kC){e.kC=!0;1a i=2g.3s.7k,a=ZC.A4(2g.3s).2O(ZC.1b[0]),n=ZC.A4(2g.3s).2O("1T-4e");ZC.A4(2g.3s).2O(ZC.1b[0],"#2T").2O("1T-4e","2b");1j(1a l=0,r=i.1f;l<r;l++)1===i[l].fC&&(t[l]=i[l].1I.3N,i[l].1I.3N="2b");2g.3s.3c(ZC.AK(e.K+"-fD")),2u.5E(1n(){2u.6F(),2u.5E(1n(){ZC.A4(2g.3s).2O(ZC.1b[0],a).2O("1T-4e",n),ZC.AK(e.K+"-fD")&&ZC.AK(e.K).3c(ZC.AK(e.K+"-fD"));1j(1a l=0,r=i.1f;l<r;l++)1===i[l].fC&&(i[l].1I.3N=t[l]);e.kC=!1},5I)},50)}},RZ.5n.NH=1n(e,t,i,a){1a n=1g;if(t=t||{},1y i===ZC.1b[31]&&(i=!1),!ZC.AK(n.K+"-d7")){e=e||"9V";1a l=t.f4,r=t.fn||"";ZC.P.II(ZC.AK(n.K+"-2i-c"),n.AB,0,0,n.I,n.F),ZC.A4(".zc-2i-1H").3r();1a o,s,C=("3f"===n.AB||1o.gD||1o.3J.h0)&&"fG"!==e&&"2F"!==e;if(ZC.2K||!C||i||l||(o=ZC.P.I0({2p:"zc-3m zc-d7 zc-1I",id:n.K+"-d7",8q:5,p:ZC.AK(n.K+"-1v"),wh:n.I+"/"+n.F}),s=ZC.P.I0({id:n.K+"-d7-7w",p:o,8q:10,tl:"5/"+(n.I-15),4d:ZC.HD["d7-7w"]}),ZC.A4(s).2O("4U","8n").2O("1K",n.I-15-ZC.A4(s).1s()+"px"),ZC.A4(s).3t("3I",1n(){ZC.A4(o).3r()})),ZC.2K&&(l=!0),!1o.3J.h0||l||"2F"!==n.AB||"9V"!==e&&"eh"!==e){1a A;if("3f"===n.AB&&"fG"!==e&&"2F"!==e){1a Z,c,p=2g.4V("3f");1j(p.1s=n.I,p.1M=n.F,Z=0,c=n.AI.1f;Z<c;Z++)n.AI[Z].BB&&n.AI[Z].BB.E9(p);1a u=[];ZC.A4("#"+n.K+" 3f").5f(1n(){-1===ZC.AT([n.K+"-2i-c",n.K+"-7W-c"],1g.id)&&u.1h(1g)}),u.1h(p),u.1h(n.tp());1a h=ZC.AO.u1(u,n.I,n.F,e,!0);h.id=n.K+"-6F-"+e,o.3c(h)}1u if(i||n.tG(ZC.HD["8v-b9"]),"3L"===n.AB||"3f"===n.AB&&("fG"===e||"2F"===e)){1a 1b=2g.4V("3C"),d="zc-8v-2F-"+n.K;1b.id=d,1b.1I.3N="2b",2g.3s.3c(1b),1o.bb({id:d,bA:"!2F",Db:!0,1s:n.I,1M:n.F,1U:n.E.4H,d5:n.MT,bJ:n.LU,eC:!0,hb:{2w:1n(){2u.5E(1n(){1a e=1o.7d(d);if(e.E["4O-2J"])1a t=2u.eP(1n(){"9p"===e.E["4O-2J"]&&(2u.9W(t),e.bU(!0),A=ZC.AK(d+"-1v").4o,e.bU(!1),1o.3n(d,"9P",{tV:!0}),f())},100);1u e.bU(!0),A=ZC.AK(d+"-1v").4o,e.bU(!1),1o.3n(d,"9P",{tV:!0}),f()},100)}}})}1u"2F"===n.AB&&(n.bU(!0),A=ZC.AK(n.K+"-1v").4o,f(),n.bU(!1));C&&!i&&(ZC.A4(s).2O("4U","8n").2O("1K",n.I-15-ZC.A4(s).1s()+"px"),ZC.A4(s).3t("3I",1n(){ZC.A4(o).3r()}))}1u 1o.3n(n.K,"Co",{5H:1n(l){if(-1!==l){1a r=2g.4V("5S");r.id=n.K+"-6F-"+e,r.4X=l,o.3c(r)}1u ZC.P.ER(n.K+"-d7"),1o.3J.h0=0,n.NH(e,t,i,a)}})}1n f(){1a s,C,Z={2F:A=A.1F(/<kp(.+?)<\\/kp>/g,""),w:n.I,h:n.F,t:e,fn:r};if(ZC.2E(t,Z),1o.gD&&"fG"!==e&&"2F"!==e&&!l){1a c="kG=1&";1j(C in Z)c+=C+"="+gh(Z[C])+"&";ZC.A4.ao({1J:"hW",3R:1o.tO,1U:c,aB:1n(t,l,r){if(n.kQ(),i)a&&a(t,l,r);1u{1a s=2g.4V("5S");s.4X=t,s.id=n.K+"-6F-"+e,o.3c(s)}}})}1u{ZC.AK(n.K+"-8v")&&ZC.P.ER(n.K+"-8v");1a p=ZC.P.I0({2p:"zc-3m zc-1I",id:n.K+"-8v",p:ZC.AK(n.K+"-1v"),3N:"2b"}),u=(s=1c!==ZC.1d(Z.ci)&&1c!==ZC.1d(Z.3h)?ZC.P.qL(ZC.AK(n.K+"-8v")):2g).4V("Eg");1j(C in u.8f=1o.tO,u.9T="hW",u.17r="17s/4I-1U",1c!==ZC.1d(Z.ci)&&1c!==ZC.1d(Z.3h)?s.3s.3c(u):p.3c(u),u.1I.3N="2b",Z){1a h=s.4V("Dk");h.1J="8X",h.8D=C,h.1V=Z[C],u.3c(h)}u.f3(),u=1c,1c!==ZC.1d(Z.ci)&&1c!==ZC.1d(Z.3h)&&2u.5E(1n(){ZC.A4("#"+n.K+"-8v").3r()},Ff),2u.5E(1n(){n.kQ()},5I)}}},RZ.5n.TM=1n(e){1a t=1g;e=e||"9V";1a i,a,n=[],l=2g.4V("3f");1j(l.1s=t.I,l.1M=t.F,i=0,a=t.AI.1f;i<a;i++)t.AI[i].BB&&t.AI[i].BB.E9(l);1l ZC.A4("#"+t.K+" 3f").5f(1n(){-1===ZC.AT([t.K+"-2i-c",t.K+"-2H-c"],1g.id)&&n.1h(1g)}),n.1h(l),n.1h(t.tp()),ZC.AO.kP(n,t.I,t.F,e)},ZC.AO.nj=1n(e,t,i){if(!ZC.ca){i=i||"f5/tz-kN";1a a=2g.4V("a");8U.Ao?8U.Ao(1m ky([e],{1J:i}),t):hU&&"f4"in a?(a.7L=hU.og(1m ky([e],{1J:i})),a.4l("f4",t),2g.3s.3c(a),a.3I(),2g.3s.aP(a)):82.7L="1U:f5/tz-kN,"+gh(e)}},ZC.AO.hf=1n(e,t){1a i,a,n,l,r,o,s,C,A,Z,c,p,u,h=[],1b="",d=[];1j("7V"===(t=t||"6O")&&h.1h(\'<4d eq:o="u8:sE-rc-c1:p4:p4" eq:x="u8:sE-rc-c1:p4:zn" eq="7h://8C.w3.eu/TR/17t-17v">\',"<fv>","\\17w!--[if 17x nv 9]><kA><x:Bk><x:Bi><x:B3><x:Bg>hc</x:Bg><x:Bh><x:17y/></x:Bh></x:B3></x:Bi></x:Bk></kA><![17z]--\\17A",\'<1I>td{1G:2b;2s-9i:17B,nN-nh} .8R{nv-8R-5D:"0.6P";} .1E{nv-8R-5D:"@";}</1I>\',"<Am 8D=17F 17G=17H.17I>","<Am o8=Dc-8>","</fv>","<3s>"),i=0,a=e.AI.1f;i<a;i++){1a f=e.AI[i],g=f.AY.A7,B={},v=[],E=f.BT("k")[0];"4d"!==t&&"7V"!==t&&"dZ"!==t||(h.1h("<6t>"),f.J1&&""!==f.J1.AP&&(d.1h([f.J1.AP]),h.1h("<oC>"+f.J1.AP+"</oC>")),h.1h("<Au>"),h.1h("<tr>")),c=[],u=[];1a b="18i",m=!1;1j(E&&(E.FF&&"5B"===E.FF.o.1J&&(b="a1",m=!0),E.M&&E.M.AP&&(b=E.M.AP.1F(/\\"|\\\'/g,""))),"6O"===t?c.1h(\'"\'+b+\'"\'):"dZ"===t?u.1h(b):"4d"!==t&&"7V"!==t||c.1h("<th>"+b+"</th>"),n=0,l=g.1f;n<l;n++)(1c===ZC.1d(g[n].o["8v"])||ZC.2t(g[n].o["8v"]))&&(p=(p=1c!==ZC.1d(g[n].AP)?g[n].AP+"":"kO "+n).1F(/\\"|\\\'/g,""),"6O"===t?c.1h(\'"\'+p+\'"\'):"dZ"===t?u.1h(p):"4d"!==t&&"7V"!==t||c.1h("<th"+("7V"===t?\' AS="mX" 1O="1E"\':"")+">"+p+"</th>"),v.1h(""));if("6O"===t?h.1h(c.2M(",")):"dZ"===t?d.1h(u):"4d"!==t&&"7V"!==t||h.1h(c.2M("")),"4d"!==t&&"7V"!==t||(h.1h("</tr>"),h.1h("</Au>"),h.1h("<Bs>")),E){1j(s=0,C=E.W.1f;s<C;s++)B[s+""]={kZ:!1,cZ:[].4A(v)};1j(n=0,l=g.1f;n<l;n++)if(1c===ZC.1d(g[n].o["8v"])||ZC.2t(g[n].o["8v"]))1j(r=0,o=g[n].S.1f;r<o;r++){1a K=g[n].S[r];K&&(B[s=K.BY?""+K.BY:""+r]=B[s]||{kZ:!0,cZ:[].4A(v)},B[s].cZ[n]=K.AE,B[s].kZ=!0)}1a D=[];1j(s in B)B[s].kZ&&D.1h([s,B[s].cZ]);D.3Z(1n(e,t){1l e[0]-t[0]});1a F=1c;1j(A=0,Z=D.1f;A<Z;A++){if("4d"!==t&&"7V"!==t||h.1h("<tr>"),"3P"!==f.AF&&"7a"!==f.AF&&"8Z"!==f.AF||E.W[D[A][0]]&&(D[A][0]=E.W[D[A][0]]),E.BW[D[A][0]]&&(D[A][0]=E.BW[D[A][0]]),E.W[D[A][0]]&&(D[A][0]=E.W[D[A][0]]),(F=f.A.FD()).5o=A,F.mX=0,F[ZC.1b[9]]=D[A][0],D[A][0]=ZC.AO.C2("Ax",f.A,F,D[A][0],1c),ZC.1d(D[A][1]))1j(1a I=0;I<D[A][1].1f;I++)(F=f.A.FD()).5o=A,F.mX=I+1,F[ZC.1b[9]]=D[A][1][I],D[A][1][I]=ZC.AO.C2("Ax",f.A,F,D[A][1][I],1c);m&&(D[A][0]=ZC.AO.YM(D[A][0],"%Y-%mm-%dd %H:%i:%s",f.UU,f.NA),"6O"===t&&(D[A][0]=\'"\'+D[A][0]+\'"\')),"6O"===t?h.1h([].4A(D[A][0]).4A(D[A][1]).2M(",")):"dZ"===t?d.1h([].4A(D[A][0]).4A(D[A][1])):"4d"!==t&&"7V"!==t||h.1h("<td"+("7V"===t?\' AS="5o"\':"")+">"+[].4A(D[A][0]).4A(D[A][1]).2M("</td><td>")+"</td>"),"4d"!==t&&"7V"!==t||h.1h("</tr>")}}"4d"!==t&&"7V"!==t||(h.1h("</Bs>"),h.1h("</6t>")),a>1&&i<a-1&&("6O"===t?h.1h("","",""):"4d"!==t&&"7V"!==t||h.1h("<p>&8x;</p>"))}1l"7V"===t&&h.1h("</3s>","</4d>"),"dZ"===t?d:("6O"===t?1b=h.2M("\\n"):"4d"!==t&&"7V"!==t||(1b=h.2M("")),1b)},1o.oi=1n(e,t,i){1a a,n,l,r,o,s="",C="";1n A(e){ZC.A4.ao({1J:"hW",3R:n,1U:e,aB:1n(e,t,i){l&&l(e,t,i)}})}2g.cO("zc-5O")&&(e="zc-5O"),"3b"==1y(i=i||{})&&(i=3g.1q(i));1a Z=1o.7d(e);if(Z)1Q(t){1i"Co":if(r="9V",1c!==ZC.1d(a=i.5D)&&(r=a),1c!==ZC.1d(a=i.Cj)&&(r=a),"o1"===r&&(r="eh"),1o.3J.h0&&"2F"===Z.AB&&("9V"===r||"eh"===r)){Z.bU(!0);1a c=ZC.AK(Z.K+"-2F").6r.4o,p=c.1L(">"),u=c.1L("</2F>");c=(c=\'<2F eq:kF="7h://8C.w3.eu/ol/kF" eq="7h://8C.w3.eu/Cu/2F" aF="1.1" 1s="\'+Z.I+\'" 1M="\'+Z.F+\'">[gF]\'+c.2x(p+1,u+6)).1F(/<kp(.+?)<\\/kp>/g,"");1a h=1n(){1a e,t=2u.hU||2u.18Z||2u;e=t.og&&2u.ky?t.og(1m 2u.ky([c],{1J:"4e/2F+kA;o8-nU-16"})):"1U:4e/2F+kA;o8=Dc-8,"+gh(c),Z.bU(!1);1a a=1m 2u.cL;a.Dd="Df",a.4X=e,a.gx=1n(){1a t=2g.4V("3f"),n=t.9q("2d");if(t.1s=a.1s,t.1M=a.1M,n.cg(a,0,0,t.1s,t.1M),i.5H&&"1n"==1y i.5H)4M{i.5H(t.kB("4e/"+r))}4K(l){i.5H(e)}}},1b=0,d=1n(){1a e=1m gy;e.bp("oH",Z.gA[1b]),e.Ck="1E",e.oL=1n(e){1a t=e.2X.Bx,i=t.mP(/18W?:\\/\\/[^ \\)]+/g),a=0;i.18U(1n(e){1a n=1m gy;n.bp("oH",e),n.Ck="18T",n.oL=1n(n){1a l=1m 18Y;l.oL=1n(n){t=t.1F(1m 5v(e),n.2X.18S),++a===i.1f&&(c=c.1F("[gF]","[gF]<1I><![18V["+t+"]]></1I>"),++1b===Z.gA.1f?(c=c.1F("[gF]",""),h()):d())},l.18Q(n.2X.Bx)},n.8t()})},e.8t()};Z.gA.1f?d():(c=c.1F("[gF]",""),h())}if("3f"!==Z.AB&&!1o.gD)1l-1;if("3f"===Z.AB){if(!i.5H||"1n"!=1y i.5H)1l Z.TM(r);4M{i.5H(Z.TM(r))}4K(B){i.5H(-1)}}1u Z.NH(r,{},!0,i.5H);1p;1i"18P":1i"18z":if(!i.f4&&"3f"!==Z.AB&&!1o.gD)1l-1;if(r="9V",o={},1c!==ZC.1d(a=i.Ch)&&(o=a),1c!==ZC.1d(a=i.ci)&&(o.ci=a),1c!==ZC.1d(a=i.3h)&&(o.3h=a),1c!==ZC.1d(a=i.5D)&&(r=a),1c!==ZC.1d(a=i.Cj)&&(r=a),1c!==ZC.1d(a=i.lE)&&(s=a),n=Z.E.ow||"",1c!==ZC.1d(a=i.3R)&&(n=a),l=1c,1c!==ZC.1d(a=i.5H)&&(l=a),"o1"===r&&(r="eh"),i.f4&&("3f"!==Z.AB||"fG"===r))1l o.f4=!0,""!==s&&(o.fn=s),8o Z.NH(r,o);if(""!==n){if("3f"===Z.AB)1l A(Z.TM(r));Z.NH(r,o,!0,1n(e){1l A(e)})}1p;1i"lH":if(n=Z.E.nx||"",1c!==ZC.1d(a=i.3R)&&(n=a),C=ZC.AO.18n(Z),""===n)1l C;l=1c,1c!==ZC.1d(a=i.5H)&&(l=a),ZC.A4.ao({1J:"hW",3R:n,1U:C,aB:1n(e,t,i){l&&l(e,t,i)}});1p;1i"zb":C=ZC.AO.hf(Z,"6O"),ZC.AO.nj(C,(i.fn||Z.K)+".6O","1E/6O;zg:nU-8");1p;1i"zf":C=ZC.AO.hf(Z,"7V"),ZC.AO.nj(C,(i.fn||Z.K)+".7V","f5/18o.ms-zn;zg:nU-8");1p;1i"18p":1a f=ZC.AO.hf(Z,"dZ");if(!i.5H||"1n"!=1y i.5H)1l f;4M{i.5H(f,i.fn||Z.K)}4K(B){i.5H(-1)}1p;1i"yM":if("nR"===i.oU)if(C=ZC.AO.hf(Z,"4d"),ZC.AK(Z.K+"-1U-6t"))ZC.AK(Z.K+"-1U-6t").4o=C;1u{1a g=ZC.P.I0({id:Z.K+"-1U-6t",2p:"zc-1U-6t "+Z.K+"-1U-6t"});ZC.P.PR(g,{1s:Z.I+"px","1X-1M":"18r",9M:"3i"}),g.4o=C,ZC.AK(Z.K).6r.hh(g,ZC.AK(Z.K).nA)}1u"od"===i.oU&&ZC.P.ER(Z.K+"-1U-6t")}1l 1c},ZC.Aa={},ZC.AO.XE=1n(e){1j(1a t,i="",a=!1,n=!1,l=0,r="",o=0,s=(e=e.1F(/\\t|\\r|\\n/g,"")).1f;o<s;o++)1Q(t=e.5w(o,1)){1i\'"\':a=!a,i+=e.5w(o,1),r=t;1p;1i"{":i+=e.5w(o,1),a||(i+="\\n"+1m 3M(l+1).2M(" "),l++,r=t);1p;1i"}":a||(i+="\\n"+1m 3M(l).2M(" "),l--,r=t),i+=e.5w(o,1);1p;1i"[":1a C=e.1L("]",o),A=e.1L("}",o);A=-1===A?zt:A;1a Z=e.1L("{",o);Z=-1===Z?zt:Z,C<ZC.CT(A,Z)?(n=!0,i+=e.5w(o,1)):(n=!1,i+=e.5w(o,1),i+="\\n"+1m 3M(l+1).2M(" "),l++),r=t;1p;1i"]":n&&(n=!1),"}"===r&&(l--,i+="\\n"+1m 3M(l).2M(" ")),i+=e.5w(o,1),r=t;1p;1i" ":a&&(i+=e.5w(o,1),r=t);1p;1i",":i+=e.5w(o,1),a||n||(i+="\\n"+1m 3M(l).2M(" ")),r=t;1p;2q:i+=e.5w(o,1),r=t}1l i},RZ.5n.lg=1n(){1a e=1g;ZC.AO.C2("18t",e,e.FD());1a t=ZC.P.I0({2p:"zc-3m zc-4N zc-1I",id:e.K+"-4N",p:ZC.AK(e.K+"-1v"),wh:e.I-(ZC.97?0:10)+"/"+(e.F-(ZC.97?0:10))});t.1I.9K=99,t.4o=ZC.ji(\'<3C 1O="zc-4I-5o-1H zc-4I-s1">&8x;<a 7L="7s:8o(0)" id="\'+e.K+\'-4N-fd" 1O="zc-cF-6K">\'+ZC.HD["4N-fd"]+\'</a>&8x;<a 7L="7s:8o(0)" id="\'+e.K+\'-4N-fc" 1O="zc-cF-fM">\'+ZC.HD["4N-fc"]+\'</a></3C><3C 1O="zc-4I-5o-ai"><bX id="\'+e.K+\'-4N-4H" 1I="1s:\'+(e.I-35)+"px;1M:"+(e.F-95)+\'px;"></bX></3C><3C 1O="zc-4I-5o-ai zc-4I-5o-7S" id="\'+e.K+\'-4N-zw"><ak 1J="7M" 1V="\'+ZC.HD["4N-7w"]+\'" id="\'+e.K+\'-4N-7w" /></3C>\'),1o.qu&&(ZC.AK(e.K+"-4N-zw").4o+=\'<ak 1J="7M" 1V="\'+ZC.HD["4N-9l"]+\'" id="\'+e.K+\'-4N-9l" />\'),ZC.A4("#"+e.K+"-4N-4H").8L(ZC.AO.XE(e.E.7b)),ZC.A4("#"+e.K+"-4N-fc").3t("3I",1n(){ZC.AK(e.K+"-4N-fc").7U="zc-cF-6K",ZC.AK(e.K+"-4N-fd").7U="zc-cF-fM",ZC.A4("#"+e.K+"-4N-4H").8L(ZC.AO.XE(e.E.4H))}),ZC.A4("#"+e.K+"-4N-fd").3t("3I",1n(){ZC.AK(e.K+"-4N-fc").7U="zc-cF-fM",ZC.AK(e.K+"-4N-fd").7U="zc-cF-6K",ZC.A4("#"+e.K+"-4N-4H").8L(ZC.AO.XE(e.E.7b))}),ZC.A4("#"+e.K+"-4N-7w").3t("3I",1n(){ZC.AO.C2("zD",e,e.FD()),ZC.P.ER(e.K+"-4N")}),1o.qu&&ZC.A4("#"+e.K+"-4N-9l").3t("3I",1n(){ZC.AO.C2("zD",e,e.FD());1a t=ZC.A4("#"+e.K+"-4N-4H").8L();ZC.P.ER(e.K+"-4N"),1o.3n(e.K,"aK",{1U:t})})},RZ.5n.lk=1n(){1a e=1g;if(e.I<fN||e.F<fN)2u.bp("7h://8C.1o.c1/ES/","","");1u{1a t=ZC.P.I0({2p:"zc-3m zc-4r zc-1I",id:e.K+"-4r",p:ZC.AK(e.K+"-1v"),wh:e.I-(ZC.97?0:10)+"/"+(e.F-(ZC.97?0:10))}),i="";i+=\'<3C 1O="zc-4I-5o-1H zc-4I-s0">\'+ZC.HD["4r-5R"]+\'</3C><3C 1O="zc-4I-5o-1H"><ak 1J="Fz" id="\'+e.K+\'-r3" fh="fh" /><1H 1j="\'+e.K+\'-r3">\'+ZC.HD["4r-zG"]+"</1H>",ZC.3f&&(i+=\'&8x;&8x;&8x;&8x;&8x;<ak 1J="Fz" id="\'+e.K+\'-qS" fh="fh" /><1H 1j="\'+e.K+\'-qS">\'+ZC.HD["4r-Fx"]+"</1H>"),i+=\'</3C><3C 1O="zc-4I-5o-1H zc-4I-s1">\'+ZC.HD["4r-Ft"]+\'</3C><3C 1O="zc-4I-5o-ai"><bX id="\'+e.K+\'-4r-Gd" 1I="1s:\'+(e.I-35)+"px;1M:"+((e.F-fN)/2-10)+\'px;"></bX></3C><3C 1O="zc-4I-5o-1H zc-4I-s1">\'+ZC.HD["4r-Gl"]+\'</3C><3C 1O="zc-4I-5o-ai"><bX id="\'+e.K+\'-4r-4H" 1I="1s:\'+(e.I-35)+"px;1M:"+(e.F-18u)/2+\'px;"></bX></3C><3C 1O="zc-4I-5o-1H zc-4I-s1">\'+ZC.HD["4r-Fd"]+(e.I>=18w?" <7B>("+ZC.HD["4r-Fb"]+")</7B>":"")+\'</3C><3C 1O="zc-4I-5o-ai"><ak 1J="1E" id="\'+e.K+\'-4r-ql" 1I="1s:\'+(e.I-35)+\'px;" /></3C><3C 1O="zc-4I-5o-ai zc-4I-5o-7S"><ak 1J="7M" 1V="\'+ZC.HD["4r-f3"]+\'" id="\'+e.K+\'-4r-f3" /><ak 1J="7M" 1V="\'+ZC.HD["4r-ju"]+\'" id="\'+e.K+\'-4r-ju" /></3C>\',t.4o=ZC.ji(i),ZC.A4("#"+e.K+"-4r-4H").8L("18x\\n----------\\n"+ZC.AO.XE(e.E.4H)+"\\n\\18l\\n----------\\n"+ZC.AO.XE(e.E.7b)),ZC.A4("#"+e.K+"-4r-ju").3t("3I",1n(){ZC.P.ER(e.K+"-4r")}),ZC.A4("#"+e.K+"-4r-f3").3t("3I",1n(){1a t=ZC.A4("#"+e.K+"-4r-ql");if(/^((\\w+\\+*\\-*)+\\.?)+@((\\w+\\+*\\-*)+\\.?)*[\\w-]+\\.[a-z]{2,6}$/.5Y(t.8L())){1a i="";ZC.3f&&(i=e.TM("9V"));1a a=("Ef:"+e.E.4H+" Gp:"+e.E.7b).1F(/\\r|\\n|\\t|(\\s{2,})/g,""),n="",l=[];ZC.A4("#"+e.K+"-qS").3S("fh")&&l.1h("****18D:",i),ZC.A4("#"+e.K+"-r3").3S("fh")&&l.1h("****3g:",a),l.1h("****18E:",ZC.A4("#"+e.K+"-4r-Gd").8L(),"****18F:",t.8L(),"****fi:",ZC.fi,"****18G:",e.I,"****18H:",e.F,"****hU:",2u.82.7L,"****UA:",8U.cv,"****18I:",e.AB.5J(),"****18J:",Fa.1s+"x"+Fa.1M);1j(1a r=0;r<l.1f-1;r+=2)n+=l[r]+gh(l[r+1]);n+="****18K";1a o=ZC.P.qL(ZC.AK(e.K+"-4r")),s=o.4V("Eg");s.8f=2g.82.hV+"//8C.1o.c1/ES/18L.18M",s.9T="hW",o.3s.3c(s);1a C=o.4V("Dk");C.1J="1E",C.8D="1U",C.1V=n,s.3c(C),s.f3(),2u.5E(1n(){Dt(ZC.HD["4r-Dz"]),ZC.P.ER(e.K+"-4r")},5I)}1u t.8L(ZC.HD["4r-Fk"])})}},RZ.5n.q7=1n(){1a e,t,i,a=1g;ZC.P.ER([a.K+"-4Y-2R",a.K+"-4Y-d8-2R",a.K+"-4Y-dP-2R",a.K+"-4Y-5c",a.K+"-4Y-d8-5c",a.K+"-4Y-dP-5c"]),1c!==ZC.1d(e=a.o.4Y)&&(a.IC=1m DP(a),a.B9.2w(a.IC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ZC.3B)+","+ZC.1k(r+s+ZC.3B),n+=\'" />\'),""!==n&&(ZC.AK(a.K+"-3e").4o+=n),a.pl=1n(e){e.2X.id===a.K+"-4Y-d8-1N"?1o.3n(a.K,"cH"):e.2X.id===a.K+"-4Y-dP-1N"&&1o.3n(a.K,"cG")},ZC.A4("."+a.K+"-4Y-1N").4g("3I",a.pl)}},ZC.AL={gg:1,DZ:0,E0:0,FS:40},ZC.DE={sP:1n(e,t){1a i,a;1l t.AA%180==0?(i=1m CA(e,-e.I/2,t.iY-e.iY-e.F/4,0),a=1m CA(e,e.I/2,t.iY-e.iY-e.F/4,0)):(i=1m CA(e,t.iX-e.iX-e.I/4,-e.F/2,0),a=1m CA(e,t.iX-e.iX-e.I/4,e.F/2,0)),ZC.U6(1A.a7((a.E8[1]-i.E8[1])/(a.E8[0]-i.E8[0])))+(t.AA%180==0?0:t.AA%2m==90?90:-90)},D9:1n(e,t,i,a,n,l,r,o,s){s=s||"z";1a C,A,Z,c,p=1m ZQ(e,t);1Q(s){1i"x":C=1m CA(t,i,n,r),A=1m CA(t,a,n,r),Z=1m CA(t,a,l,o),c=1m CA(t,i,l,o);1p;1i"y":C=1m CA(t,i,n,r),A=1m CA(t,i,l,r),Z=1m CA(t,a,l,o),c=1m CA(t,a,n,o);1p;1i"z":C=1m CA(t,i,n,r),A=1m CA(t,i,n,o),Z=1m CA(t,a,l,o),c=1m CA(t,a,l,r)}1l p.2P(C),p.2P(A),p.2P(Z),p.2P(c),p},D5:1n(e,t,i,a){1y a===ZC.1b[31]&&(a=!1);1a n,l=1c,r=1c;i 3E 3M?l=i:(l=i.2W,r=i.rX);1j(1a o=1m ZQ(e,t),s=0,C=l.1f;s<C;s++)1c!==ZC.1d(l[s])&&(a?o.2P(l[s],r?r[s]:1c):o.2P(1m CA(t,l[s][0],l[s][1],l[s][2]),r?1m CA(t,r[s][0],r[s][1],r[s][2]):1c));1l(n=e.o["z-17e"])&&(o.MI=[ZC.1k(n),ZC.1k(n),ZC.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1K:o/n[0]-u+"px",1v:s/n[1]-u+"px"}),1c!==(t=ZC.AK(a+"-2H-1E"))&&(t.1I.3N="2b",ZC.P.PR(t,{1s:i.A8.I+"px",1M:i.A8.F+"px",1K:o/n[0]+"px",1v:s/n[1]+"px"}),t.1I.3N="8K")}}}hd(e){1g.4m(e)}g4(e,t){1a i,a,n,l,r,o,s,C=1g,A=C.H.K,Z=e.9N||e.2X.id,c=Z.1F(/--([a-zA-Z0-9]+)/,"").1F("-bN-1N","-1N").1F("-1N-2R","").1F("-2R","").1F("-1R-3A","").1F("-1R","").2o("-").9r(),p=Z.2o("--"),u=!1,h=!1,1b=!1;if("2r"===c[1]&&"1B"===c[3]&&"cj"===c[4]&&(u=!0),ZC.P.ER([A+"-2H-1E",A+"-2H",A+"-2H-1E-9d"]),u){if(!(l=C.H.OF(c[5])))1l;if(r=l.AY.A7[c[2]],o=r.FQ(c[0]),"xy"===l.AJ.3y&&o.RX(),!o)1l;ZC.A4("#"+A+"-2Y-"+c[5]+"-1B-"+c[2]+"-bg-2N-c").4m()}1u"1W"===c[2]&&0===c[1].1L("1P")&&(h=!0),0!==c[2].1L("1z")||0!==c[1].1L("1P")&&0!==c[1].1L("1R")||(1b=!0),l=C.H.OF(c[3]);if(ZC.AK(A+"-2H")||(ZC.P.K2({id:A+"-2H",p:ZC.AK(A+"-3Y"),2p:"zc-3m zc-2H",wh:C.H.I+"/"+C.H.F,9M:"8X"},C.H.AB),ZC.P.HF({id:A+"-2H-c",p:ZC.AK(A+"-2H"),2p:"zc-3m",tl:"-4J/-4J",1s:140,1M:60},C.H.AB)),C.A8=1o.6g.a8("DP",C,A+"-2H-1E"),C.A8.OL="2H",C.A8.A=C.H,l&&l.A8&&C.A8.1S(l.A8),u)C.A8.1C(r.A8.o),l.CV["p"+r.L]&&l.CV["p"+r.L]["n"+o.L]&&C.A8.1C(r.A8.o[ZC.1b[73]]),2===p.1f&&C.A8.1C(r.o0(p[1]));1u{1a d=!1;if(h&&l.BB&&1c!==ZC.1d(l.BB.o.2H)&&(C.A8.o.1E="",C.A8.1C(l.BB.o.2H),d=!0),1b){C.A8.1C({"1T-1r":"#2T","1G-1s":1,"1G-1r":"#4J"});1a f=l.BK(c[2].1F(/\\1b/g,"-"));if(f&&1c!==ZC.1d(f.o.2H)&&(C.A8.o.1E="",C.A8.1C(f.o.2H),d=!0),0===c[1].1L("7J"))f&&(-1!==c[1].1L("vC")&&f.o.1H&&f.o.1H.2H?(C.A8.o.1E="",C.A8.1C(f.o.1H.2H),d=!0):f.o.1P&&f.o.1P.2H&&(C.A8.o.1E="",C.A8.1C(f.o.1P.2H),d=!0));1u if(0===c[1].1L("b4")){1a g=ZC.1k(c[1].1F("b4",""));f.QE[g]&&f.QE[g].o.1H&&f.QE[g].o.1H.2H&&(C.A8.o.1E="",C.A8.1C(f.QE[g].o.1H.2H),d=!0)}}if("2S"===c[2])if(C.A8.1C({"1T-1r":"#2T","1G-1s":1,"1G-1r":"#4J"}),e.2X.bT("1U-jR"))C.A8.1C({1E:e.2X.bT("1U-2H-1E")}),d=!0;1u 1j(a=0,n=l.FG.1f;a<n;a++)if(1c!==ZC.1d(l.FG[a])){1a B=l.FG[a]3E QW?l.FG[a].BE:l.FG[a];l.K+"-2S-"+c[1]===l.FG[a].K&&1c!==ZC.1d(i=B.o.2H)&&(C.A8.1C(i),C.A8.o.7o&&(C.A8.o.x=B.iX,C.A8.o.y=B.iY),d=!0)}if("1H"===c[2])1j(C.A8.1C({"1T-1r":"#2T","1G-1s":1,"1G-1r":"#4J"}),a=0,n=l.BW.1f;a<n;a++)l.K+"-1H-"+c[1]===l.BW[a].K&&1c!==ZC.1d(i=l.BW[a].o.2H)&&(C.A8.1C(i),C.A8.o.7o&&(C.A8.o.x=l.BW[a].iX+l.BW[a].I/2,C.A8.o.y=l.BW[a].iY+l.BW[a].F/2),d=!0);if("xy"===c[2]&&(C.A8.1C({"1T-1r":"#2T","1G-1s":1,"1G-1r":"#4J"}),d=!0),!d)1l}if(t&&C.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,t.lT=!1,t.BW=1c,t.n8=!1}1q(){1a e,t=1g;t.K=t.C.K+"-2A",t.4C([["4g","p1","b"],["aE","LT","b"],["2k-6V","PI","i"],["2k-6V-x","PI","i"],["2k-6V-y","PI","i"],["2h","AM","b"]]);1a i="("+t.C.AF+").2A",a=t.H.B9;1n n(e){1l[i+".3O",i+".3O-"+e,i+".3q",i+".3q-"+e]}t.B4=1m I2(t.C),t.B4.K=t.C.K+"-2A-15T",a.2w(t.B4.o,[i]),t.B4.1C(t.o),t.B4.1q(),t.o.1H&&(t.BW=[]),t.o.3q&&t.o.3q.1H&&(t.J7=1m DP(t.C),t.J7.1C(t.o.3q.1H),t.J7.1C({1E:" "}),t.J7.1q(),t.J7.AM&&(t.n8=!0)),t.P7=1m CX(t.C),a.2w(t.P7.o,[i+".4P"]),1c!==ZC.1d(e=t.o.4P)&&t.P7.1C(e),t.P7.1q(),t.V7=1m CX(t.C),a.2w(t.V7.o,[i+".6K"]),1c!==ZC.1d(e=t.o.6K)&&t.V7.1C(e),t.V7.1q(),t.IR=1m I2(t.B4),t.HE=1m I2(t.B4),t.JD=1m I2(t.B4),t.H2=1m I2(t.B4),a.2w(t.IR.o,n("1K")),a.2w(t.HE.o,n("2z")),a.2w(t.JD.o,n("1v")),a.2w(t.H2.o,n("2c"));1j(1a l=["3q","3O"],r=0;r<l.1f;r++)1c!==ZC.1d(e=t.o[l[r]])&&(t.IR.1C(e),t.HE.1C(e),t.JD.1C(e),t.H2.1C(e)),1c!==ZC.1d(e=t.o[l[r]+"-1K"])&&t.IR.1C(e),1c!==ZC.1d(e=t.o[l[r]+"-2z"])&&t.HE.1C(e),1c!==ZC.1d(e=t.o[l[r]+"-1v"])&&t.JD.1C(e),1c!==ZC.1d(e=t.o[l[r]+"-2c"])&&t.H2.1C(e);t.IR.1q(),t.HE.1q(),t.JD.1q(),t.H2.1q()}qQ(){1a e=1g;e.NV={};1j(1a t,i=e.C.BL,a=0,n=i.1f;a<n;a++)(t=i[a])&&("k"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ZC.A4("."+e.C.K+"-2A-4P").3t("3I",e.qK),e.lT=!0}}gc(){ZC.AO.gc(1g,["Z","C6","o","I4","JW","C","H","B4","V7","KL","K0","L8","JH","KK","JD","HE","H2","IR","9O","P7","mg","Y0","mB","WP"])}}1O iM 2j CX{2G(e,t){1D(e);1a i=1g;i.C=e,i.H=e.A,i.JE=!1,i.Z=1c,i.BJ=0,i.BC=0,i.ik="",i.cz="yx"===i.C.AJ.3y,i.AF=i.ij=i.y8="1Z-"+(t||"x"),i.cz&&(i.AF+="i",i.ij="1Z-xi"===i.AF?"1Z-y":"1Z-x")}1q(){1a e,t=1g;t.K=t.C.K+"-"+t.ij,t.4C([["2a-x","BJ"],["2a-y","BC"]]);1a i="("+t.C.AF+").",a=t.H.B9;t.B0=1m I2(t.C),a.2w(t.B0.o,[i+"1Z.2V",i+t.AF+".2V"]),1c!==ZC.1d(e=t.o.2V)&&t.B0.1C(e),t.B0.1q(),t.AW=1m I2(t.C),a.2w(t.AW.o,[i+"1Z.3q",i+t.AF+".3q"]),1c!==ZC.1d(e=t.o.3q)&&t.AW.1C(e),t.AW.1q()}1t(){1a e=1g,t=e.C.BT("k")[0],i=e.C.BT("v")[0],a=e.C.Q;if(("1Z-x"===e.AF||"1Z-xi"===e.AF)&&t.E6===t.X&&t.EF===t.A1||("1Z-y"===e.AF||"1Z-yi"===e.AF)&&i.H1===i.B8&&i.HL===i.BS)1l e.3l(),ZC.A4("#"+e.C.K+"-"+e.AF+"-3q").3r(),ZC.A4("#"+e.C.K+"-"+e.AF+"-2V").3r(),8o ZC.P.II(e.Z,e.H.AB,e.C.iX,e.C.iY,e.C.I,e.C.F);e.Z=ZC.AK(e.C.K+"-"+e.y8+"-c");1a n=ZC.AK(e.H.K+"-1v");"1Z-x"===e.AF||"1Z-yi"===e.AF?(e.B0.iX=a.iX+e.BJ,e.B0.iY=a.iY+a.F+t.AZ-1+e.BC,e.B0.I=a.I,e.cz?(e.AW.I=ZC.1k(ZC.BN(4,e.B0.I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>i.C.Q.iY+i.C.Q.F&&(t.iY=i.C.Q.iY+i.C.Q.F-t.F),t.iY<i.C.Q.iY&&(t.iY=i.C.Q.iY),t.1t(),ZC.A4("#"+i.K+"-3q").2O("1v",t.iY+"px"))}ih(e){1a t=1g;if(t.C.OI=e,t.C.HA&&ZC.2t(t.C.HA.o.6c))1j(1a i=0;i<t.H.AI.1f;i++)t.H.AI[i].HA&&ZC.2t(t.H.AI[i].HA.o.6c)&&(t.H.AI[i].OI=e)}3T(e){1a t=1g;"1Z-x"===t.AF||"1Z-yi"===t.AF?(t.AW.iX=e,ZC.A4("#"+t.K+"-3q").2O("1K",e+"px"),t.6L()):(t.AW.iY=e,ZC.A4("#"+t.K+"-3q").2O("1v",e+"px"),t.6L()),t.JE&&(t.ih(!0),t.3G(!0))}3l(){1a e=1g;ZC.A4("."+e.C.K+"-"+e.AF+"-3q").3l("6C 4G",e.RJ),ZC.A4("."+e.C.K+"-"+e.AF+"-2V").3l("3I",e.RH)}fo(e){1a t=1g.C.HU();t.1J=e,ZC.AO.C2("fo",1g.H,t)}3t(){1a e=1g,t=e.H.K,i=0,a=0;e.RJ=1n(n){if(n.6S(),!(n.7M>1)&&(e.ik=e.H.KX.2M(","),e.H.KX.1h(ZC.1b[38],"yh",ZC.1b[39],ZC.1b[40],ZC.1b[41]),e.H.HA)){e.H.HA.C=e.C,e.H.HA.1q();1j(1a l=n.2X;l&&"mC"!==l.86.5J();){if(-1!==ZC.P.TA(l).1L("zc-"+e.AF+"-3q"))1p;l=l.6r}if((ZC.2K||!(n.9g>1))&&l){1a r=ZC.P.MK(n),o=ZC.A4("#"+t+"-1v").2a();if("1Z-x"===e.AF||"1Z-yi"===e.AF){1a s=r[0]-o.1K;i=s-e.AW.iX}1u{1a C=r[1]-o.1v;a=C-e.AW.iY}1l ZC.A4(2g.3s).3t("83 6h",e.RI),ZC.A4(2g.3s).3t("6l 5V",e.NT),e.JE=!0,!1}}},e.RI=1n(n){if(e.JE){e.ih(!1);1a l=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a.B5.1f%i&&(a.D0.2k=a.D0.2k+(i-a.B5.1f%i)),a.D0.1X=a.B5.1f)):"3h"===a.U8&&(t=1A.4n(e/a.ED),a.D0.2k=t*a.ED,a.D0.1X=a.D0.2k+a.ED,a.D0.3h=t+1)),n}1q(){1a e,t,i,a,n=1g;if(n.E["d9-eZ"]=!0,n.QH=0,n.L9=0,1c!==ZC.1d(e=n.A.A.E["2Y-"+n.A.K+"-1W-6w"])&&(n.o.x=e.x-n.A.iX,n.o.y=e.y-n.A.iY),ZC.3o)n.FM&&n.FM.1q(),n.KO&&n.KO.1q();1u{a=n.A.H.B9;1a l="("+n.A.AF+")";1D.1q(),n.4C([["il","MA","b"],["jg","VA","b"],["15p","VI","b"],["6c","SF","b"],["9M","U8"],["1X-2C","ED","i"],["6d","fY","i"],["15q-3O","UT"],["5U-1B","X1","b"],["5U-1W","LG","b"],["3x","oS"],["9A-3x","JZ"]]),n.MA&&!n.VA&&(n.MA=!1),1o.3J.q3&&(n.E["xg-3x-2L"]||(n.mh({3x:n.oS,"9A-3x":n.JZ,3y:n.NM}),n.E["xg-3x-2L"]=!0)),n.X1&&1c===ZC.1d(n.o["5U-1W"])&&(n.LG=n.X1),n.BQ=1m DP(n),a.2w(n.BQ.o,l+".1W.1P"),n.o.1P&&1c===ZC.1d(n.o.1P.2h)&&(n.o.1P.2h=!0),n.BQ.1C(n.o.1P),n.BQ.1q(),n.ZY=1m DP(n),a.2w(n.ZY.o,l+".1W.1P-6X"),n.o["1P-6X"]&&1c===ZC.1d(n.o["1P-6X"].2h)&&(n.o["1P-6X"].2h=!0),n.ZY.1C(n.o["1P-6X"]),n.ZY.1q(),n.A2=1m DR(n),a.2w(n.A2.o,l+".1W.1R"),n.o.1R&&1c===ZC.1d(n.o.1R.2h)&&(n.o.1R.2h=!0),n.A2.1C(n.o.1R),n.A2.E.1J="2q",n.A2.E["4m-1R"]=!0,n.A2.E["4m-1w"]=!1,1c!==ZC.1d(e=n.A2.o.1J)&&(n.A2.E.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F,n.L9+=n.KO.F),n.D0.4a&&!n.NI){1a I=1m DP(n);I.AP=" ",I.1C(n.o["3h-6T"]),1c!==ZC.1d(I.o.1E)&&""!==I.o.1E||(I.o.1E="#"),I.1q(),n.F+=I.F+4,n.L9+=I.F+4}b&&(n.o[ZC.1b[19]]=1c),m&&(n.o[ZC.1b[20]]=1c),n.NI||(n.I+=n.EN+n.FR,n.F+=n.FP+n.FZ),n.E["2q-1s"]&&(n.I=n.E["2q-1s"])}}mh(e){1a t=1g;if(1c!==ZC.1d(e)){1a i=t.A.H.B9.B9.2Y.1W,a=e.3x||i.3x,n=e["9A-3x"]||i["9A-3x"],l=e.3y||i.3y;(a||n)&&("3H"===a?(1c===ZC.1d(t.o.3y)&&(l=t.o.3y="cs"),t.o.2L="50% "):t.o.2L="1K"===a?"0% ":"100% ",t.o.2L+="6s"===n?"50%":"2c"===n?"100%":"0%","cs"!==l&&"6s"!==n||(t.o["9b-3y"]=!0))}}VB(e){1a t=1g;1y e===ZC.1b[31]&&(e=!0),t.A.E["1W-6w"]={e6:t.NI,2k:t.D0.2k,1X:t.D0.1X,3h:t.D0.3h},e&&(t.A.A.E["2Y-"+t.A.K+"-1W-6w"]={x:t.iX,y:t.iY})}3j(e,t){1c===ZC.1d(e)&&(e=!1),1c===ZC.1d(t)&&(t=!1);1a i=1g,a=i.A.K+"-1W-",n=1c;ZC.A4("."+a+"1P",n).3r(),ZC.A4("."+a+"5R",n).3r(),ZC.A4("."+a+"9Q",n).3r(),ZC.A4("#"+a+"3h-6T",n).3r(),e&&!t||(ZC.3o||i.3l(),ZC.A4("."+a+"3h-1N",n).3r(),ZC.A4("."+a+"5R-1N",n).3r(),ZC.A4("."+a+"1P-1N",n).3r(),ZC.A4("."+a+"1R-1N",n).3r()),ZC.3o?ZC.P.II(ZC.AK(a+"c"),i.A.H.AB,i.A.iX,i.A.iY,i.A.I,i.A.F):ZC.P.II(ZC.AK(a+"c"),i.A.H.AB,i.iX-2*i.AQ-2*i.JY,i.i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].6E}d.A.AY.E["1B-3Z"]=!0,ZC.3o=!1,d.3j(!1),d.A.JS()},ZC.A4("#"+d.K+"-a3").4g(ZC.P.BX("6Z"),d.p5).4g(ZC.P.BX("7D"),d.pC),ZC.A4("#"+d.K+"-3o-1N").4g(ZC.P.BX(ZC.1b[47]),d.ZN),ZC.A4("#"+d.K+"-jg-1N").4g(ZC.P.BX("3I"),d.YK),ZC.A4("."+d.K+"-3h-1N").4g(ZC.P.BX("3I"),d.Z9),d.BQ.o.r6&&ZC.A4("."+d.A.K+"-1W-1P-1N").4g(ZC.1b[47],d.WJ)}d.E.lX=1c,1===d.A.A.E["1W-qV"]||ZC.3o||(d.MA&&1c===ZC.1d(d.A.A.E["g"+d.A.L+"-1W-e6"])||d.A.A.E["g"+d.A.L+"-1W-e6"]&&!d.NI)&&(2u.5E(1n(){d.YK(!0)},0),d.A.A.E["g"+d.A.L+"-1W-e6"]=!0)}}gc(){ZC.AO.gc(1g,["B5","D","QE","Z","C6","o","JW","I4","KO","FM","BQ","ZY","H","A","A2","NR","D0"])}}1O xD 2j DR{2G(e){1D(e);1a t=1g;t.N3=1c,t.BA=1c,t.M=1c,t.JR=0,t.BE=1c,t.GC="2c",t.L6=40,t.eO=[2,4]}1q(){1a e,t,i,a=1g;(a.4C([["z-2Z","JR","i"],["1f","L6","i"],["77","eO"],["bf","GC"]]),1c===ZC.1d(a.o.6j)&&1c===ZC.1d(a.o.to))&&(1c!==ZC.1d(a.o.x)&&1c!==ZC.1d(a.o.y)&&1c!==ZC.1d(a.o.1f)&&1c!==ZC.1d(a.o.2f)&&(t="3b"==1y a.o.x?a.A.OJ(a.o.x)[0]:ZC.1k(a.o.x),i="3b"==1y a.o.y?a.A.OJ(a.o.y)[1]:ZC.1k(a.o.y),a.o.6j={x:t+a.L6*ZC.EK(a.AA+180),y:i+a.L6*ZC.EE(a.AA+180)},a.o.to={x:t+a.L6*ZC.EK(a.AA),y:i+a.L6*ZC.EE(a.AA)}));1c!==ZC.1d(e=a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ee+="<td>"+ve[P]+"</td>",We%Qe==Qe-1&&(Ee+="</tr>"),We++):Ee+=ve[le[P].E.vX],Je||!Re));P++);if(Je&&(We%Qe!=Qe-1&&(Ee+="</tr>"),Ee+="</6t>"),""!==se&&(Ee+=se),!Be&&le.1f>0&&(1b=F=K,d=I=D,""!==Ee&&(le[0].o.1E=Je||Re?Ee:Ee.2x(0,Ee.1f-4),le[0].1q()),M=1c!==ZC.1d(v.o.6V)?ZC.1k(v.o.6V):6,1c===ZC.1d(v.o.x)?fe.D8?1b<O[ee].iX+O[ee].I/2?le[0].iX=1b+M+14:le[0].iX=1b-le[0].I-M-14:ae&&ae.iX>=f.iX+f.I/2?le[0].iX=F-le[0].I-M:le[0].iX=F+M:le[0].iX-=f.iX,1c===ZC.1d(v.o.y)?fe.D8?ae&&ae.iY>=f.iY+f.F/2?le[0].iY=I-le[0].F-M:le[0].iY=I+M:d<O[ee].iY+O[ee].F/2?le[0].iY=d+M+14:le[0].iY=d-le[0].F-M-14:le[0].iY-=f.iY),ie){1a Ue=-1,Ve=-1;if($||(1c===ZC.1d(p.ea)&&c(),$=!0),Ce.1f>0){1a je=[];1j(E=ZC.3u,X=0,x=Ce.1f;X<x;X++)Ce[X][0]>=0&&(E=ZC.CT(Ce[X][0],E));1j(-1!==de&&(E=ZC.BN(E,de)),X=0,x=Ce.1f;X<x;X++)1c!==ZC.1d(Ce[X])&&(-1===Ce[X][0]||Ce[X][0]<=E)&&(O[ee].CZ&&O[ee].CZ.o["bs-1w"]&&ZC.2t(O[ee].CZ.o["bs-1w"])?(je=[].4A(Ce[X][1]),"xy"===O[ee].AJ.3y?Ue=ZC.4w(Ce[X][1][1][0]):"yx"===O[ee].AJ.3y&&(Ve=ZC.4w(Ce[X][1][1][1]))):je=je.4A(Ce[X][1]));if(O[ee].CZ.o.4P){1a qe=-1;je.1f>1&&je[1]&&(qe=je[1][0]||-1),O[ee].CZ.9O||(O[ee].CZ.9O=1m I2(O[ee]),O[ee].CZ.9O.1C({"1T-1r":"#2T",2n:.85}),O[ee].CZ.9O.1C(O[ee].CZ.o.4P),O[ee].CZ.9O.Z=a,O[ee].CZ.9O.1q()),O[ee].CZ.9O.iX=qe,O[ee].CZ.9O.iY=O[ee].Q.iY,O[ee].CZ.9O.I=1A.1X(2,O[ee].Q.iX+O[ee].Q.I-qe+2),O[ee].CZ.9O.F=O[ee].Q.F,O[ee].CZ.9O.1t()}if(O[ee].AJ["3d"])1j(O[ee].NB(),X=0,x=je.1f;X<x;X++)je[X]&&(y=1m CA(O[ee],je[X][0]-ZC.AL.DZ,je[X][1]-ZC.AL.E0,0),je[X][0]=y.E8[0],je[X][1]=y.E8[1]);O[ee].CZ.K=O[ee].K+"-9t-x",ZC.CM.1t(n,O[ee].CZ,je)}if(Ae.1f>0){if(O[ee].AJ["3d"])1j(O[ee].NB(),X=0,x=Ae.1f;X<x;X++)1c!==ZC.1d(Ae[X])&&(y=1m CA(O[ee],Ae[X][0]-ZC.AL.DZ,Ae[X][1]-ZC.AL.E0,0),Ae[X][0]=y.E8[0],Ae[X][1]=y.E8[1]);ZC.CM.1t(n,O[ee].KE,Ae)}if(Be){1j(u=le.1f-1;u>=0;u--)ZC.DT(le[u].DI[0],f.iX-5,f.iX+f.I+5)&&ZC.DT(le[u].DI[1],f.iY-5,f.iY+f.F+5)||le.6u(u,1);if(le.1f>1)1j(1a $e=!0;$e;)1j($e=!1,u=0;u<le.1f-1;u++)if(le[u].AM&&(ge.D8&&le[u].iX>le[u+1].iX||!ge.D8&&le[u].iY>le[u+1].iY)){1a et=le[u];le[u]=le[u+1],le[u+1]=et,$e=!0}if(le.1f>0){1a tt=[],it=[];1j(u=0;u<le.1f;u++)1c!==ZC.1d(le[u].o.x)&&1c!==ZC.1d(le[u].o.y)&&it.1h(le[u]);1j(1a at,nt,lt,rt=!0,ot=0,st=le.1f*le.1f;rt&&ot<st;)1j(ot++,rt=!1,u=0;u<le.1f-1;u++)if(le[u].AM&&-1===ZC.AT(it,le[u]))if(fe.D8){if(le[u+1].iX<le[u].iX+le[u].I){if(le[u+1].iX-le[u].I-4<f.iX&&-1===ZC.AT(tt,le[u])&&(tt.1h(le[u]),le[u].iX=f.iX),le[u+1].iX=le[u].iX+le[u].I+4,le[u+1].iX+le[u+1].I>f.iX+f.I)1j(lt=le[u+1].iX-(f.iX+f.I-le[u+1].I),at=0,nt=le.1f;at<nt;at++)le[at].iX-lt>=f.iX?le[at].iX-=lt:(le[at].iX=f.iX,at>0&&(le[u+1].E["1R-y"]<f.iY+f.F/2?le[at].iY=le[at-1].iY+le[at-1].F+4:le[at].iY=le[at-1].iY-le[at].F-4));rt=!0}}1u if(le[u+1].iY<le[u].iY+le[u].F){if(le[u+1].iY-le[u].F-4<f.iY&&-1===ZC.AT(tt,le[u])&&(tt.1h(le[u]),le[u].iY=f.iY),le[u+1].iY=le[u].iY+le[u].F+4,le[u+1].iY+le[u+1].F>f.iY+f.F)1j(lt=le[u+1].iY-(f.iY+f.F-le[u+1].F),at=0,nt=le.1f;at<nt;at++)le[at].iY-lt>=f.iY?le[at].iY-=lt:(le[at].iY=f.iY,at>0&&(le[u+1].E["1R-x"]<f.iX+f.I/2?le[at].iX=le[at-1].iX+le[at-1].I+4:le[at].iX=le[at-1].iX-le[at].I-4));rt=!0}}}1a Ct=!1;1j(u=0,h=Ze.1f;u<h;u++)if(-1===Ze[u].E.8G||Ze[u].E.8G<=E){1a At=Ze[u];O[ee].AJ["3d"]&&(O[ee].NB(),y=1m CA(O[ee],At.iX+At.I/2-ZC.AL.DZ,At.iY+At.F/2-ZC.AL.E0,0),At.iX=y.E8[0]-At.I/2,At.iY=y.E8[1]-At.F/2,y=1m CA(O[ee],At.DI[0]-ZC.AL.DZ,At.DI[1]-ZC.AL.E0,0),At.DI[0]=y.E8[0],At.DI[1]=y.E8[1]),O[ee].CZ&&O[ee].CZ.o["bs-1w"]&&ZC.2t(O[ee].CZ.o["bs-1w"])?("xy"===O[ee].AJ.3y&&Ue===ZC.4w(At.iX+At.I/2)||"yx"===O[ee].AJ.3y&&Ve===ZC.4w(At.iY+At.F/2))&&!Ct&&(At.1t(),Ct=!0):At.1t()}1j(E=ZC.3u,P=0,N=le.1f;P<N;P++)le[P].E.8G>=0&&(E=ZC.CT(le[P].E.8G,E));1j(-1!==de&&(E=ZC.BN(E,de)),L=0,P=0,N=le.1f;P<N;P++)if(-1===le[P].E.8G||le[P].E.8G<=E){1a Zt=ZC.DT(le[P].DI[0],f.iX-5,f.iX+f.I+5)&&ZC.DT(le[P].DI[1],f.iY-5,f.iY+f.F+5);if(!Be||Zt){if(le[P].AM){1Q(le[P].E[ZC.1b[7]]){1i"1v":fe.D8?le[P].DI[0]=le[P].iX-le[P].G5:le[P].DI[1]=le[P].iY+le[P].F+le[P].G5;1p;1i"2c":fe.D8?le[P].DI[0]=le[P].iX+le[P].I+le[P].G5:le[P].DI[1]=le[P].iY-le[P].G5}if(-1!==ZC.AT(["1v","2c"],le[P].E[ZC.1b[7]])){1a ct=le[P].iX+le[P].I/2;le[P].iX=ZC.BN(le[P].iX,0),le[P].iX=ZC.CT(le[P].iX,t.H.I-le[P].I),le[P].iY=ZC.BN(le[P].iY,0),le[P].iY=ZC.CT(le[P].iY,t.H.F-le[P].F),1c===ZC.1d(le[P].o["6I-2a"])&&(le[P].ET=5z(100*(ct-le[P].iX-le[P].I/2)/(le[P].I-le[P].H6),10))}if(O[ee].AJ["3d"]&&(O[ee].NB(),y=1m CA(O[ee],le[P].iX+le[P].I/2-ZC.AL.DZ,le[P].iY+le[P].F/2-ZC.AL.E0,0),le[P].iX=y.E8[0]-le[P].I/2,le[P].iY=y.E8[1]-le[P].F/2,y=1m CA(O[ee],le[P].DI[0]-ZC.AL.DZ,le[P].DI[1]-ZC.AL.E0,0),le[P].DI[0]=y.E8[0],le[P].DI[1]=y.E8[1],"1K"===le[P].EP?le[P].iX=le[P].DI[0]+M:le[P].iX=le[P].DI[0]-le[P].I-M),O[ee].AJ["3d"]||Be||0!==L||(le[P].iX=ZC.BN(f.iX-5,le[P].iX),le[P].iY=ZC.BN(f.iY-5,le[P].iY),le[P].iX=ZC.CT(f.iX+f.I-le[P].I+5,le[P].iX),le[P].iY=ZC.CT(f.iY+f.F-le[P].F+5,le[P].iY)),Be||!Be&&0===L){1a pt=Be?P:0;(!Be||"3f"===t.H.AB&&le[pt].o["1T-4e"]&&""!==le[pt].o["1T-4e"])&&le[pt].1q(),le[pt].1t(),L++}}if(Zt){1a ut=1m DR(t);if(t.H.B9.2w(ut.o,"("+O[ee].AF+").2i.1R"),ut.K=le[P].K+"-1R",ut.Z=ut.C6=a,ut.iX=le[P].E["1R-x"],ut.iY=le[P].E["1R-y"],O[ee].AJ["3d"]&&(O[ee].NB(),y=1m CA(O[ee],ut.iX-ZC.AL.DZ,ut.iY-ZC.AL.E0,0),ut.iX=y.E8[0],ut.iY=y.E8[1]),Y=le[P].E["2i-1I"],ut.A0=ut.AC=ZC.AO.JM(Y[ZC.1b[0]]),ut.BU=Y.1r,ut.1C(O[ee].CZ.o.1R),ut.1C(O[ee].AY.A7[le[P].E.76].o["2i-1R"]),"5p"===ut.o.1J){1a ht=O[ee].AY.A7[le[P].E.76];ht.A2&&ht.A2.o.1J&&(ut.o.1J=ht.A2.o.1J)}ut.1q(),ut.AM&&"2b"!==ut.DN&&ut.AH>1&&ut.1t()}}}(H=O[ee].HU()).2C=ne,H.2i={x:F,y:I},H.ev=p,H["1z-1H"]=ue,ZC.AO.C2("xB",t.H,H),O[ee].PW(!0)}1u(H={}).2i={x:F,y:I},H.ev=p,ZC.AO.C2("xB",t.H,H)}}}}}},t.mO=1n(){0!==1o.3J.oq&&2u.5E(1n(){c()},ZC.1k(1o.3J.oq))},ZC.A4(2g.3s).3t("83 4G 6h",t.QK),ZC.A4(2g.3s).3t("5V",t.mO)}}K9.hE=1n(e){1a t=1o.7d(e);if(t){1o.hB=1c;1a i=ZC.AK(e+"-2i-c"),a=ZC.A4(i).1s(),n=ZC.A4(i).1M();ZC.A4("."+e+"-2i-1H").3r(),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1c!==ZC.1d(e=b["16Z-3z"])&&(g=ZC.2t(e)),1c!==ZC.1d(e=b["16Y-5D"])&&(B=ZC.2t(e)),1c!==ZC.1d(e=b.o9)&&(E=e),1c!==ZC.1d(E)&&E.1f>0){i=[],1c!==ZC.1d(e=b["5o-8F"])?c=e:Z.2o(/\\n/).1f>0?c="\\n":Z.2o(/\\r/).1f>0&&(c="\\r");1a m=Z.2o(c),K=0;1j(l=0,r=m.1f;l<r;l++)if(""!==m[l].1F(/\\s+/g,"")){i[K]=[];1j(1a D=0,F=0;D<m[l].1f-1;)n=m[l].2x(D,D+E[F]),i[K].1h(n),D+=E[F],F++;K++}}1u{i=[[]],a=1c!==ZC.1d(e=b["5o-8F"])?1m 5v("(\\\\"+p+"|"+e+\'|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\\\\'+p+e+"]*))","gi"):1m 5v("(\\\\"+p+\'|\\\\r?\\\\n|\\\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\\\\'+p+"\\\\r\\\\n]*))","gi");1j(1a I=1c;I=a.3n(Z);){1a X=I[1];X.1f&&X!==p&&i.1h([]),n=I[2]?I[2].1F(1m 5v(\'""\',"g"),\'"\'):I[3],i[i.1f-1].1h(n)}}1a x=[];1j(l=0,r=i.1f;l<r;l++)0!==i[l].2M("").1F(/\\s+/g,"").1f&&x.1h(i[l]);1a y=0,Y=0;if((1c===ZC.1d(h)||h)&&(x.1f>1&&1===x[0].1f?(1c===ZC.1d(t.o.5M)?t.o.5M={1E:x[0][0]}:1c===ZC.1d(t.o.5M.1E)&&(t.o.5M.1E=x[0][0]),h=!0):h=!1),h&&y++,u){1j(i=[],h&&i.1h(x[0]),o=y,s=x.1f;o<s;o++)1j(C=0,A=x[o].1f;C<A;C++)1c===ZC.1d(i[C+y])&&(i[C+y]=[]),i[C+y].1h(x[o][C]);x=i}if("1n"==1y 1o.wk)1j(o=0,s=x.1f;o<s;o++)1j(C=0,A=x[o].1f;C<A;C++)x[o][C]=1o.wk.4v(1g,x[o][C],o,C,t.C.A.K);1a L=0;1j(l=0,r=x.1f;l<r;l++)L=ZC.BN(L,x[l].1f);1a w=[];if(1c===ZC.1d(1b)){1a M=x[y].2M("").1f;1b=x[y].2M("").1F(/[0-9]/g,"").1f/M>.75}1b&&(w=x[y],y++);1a H=[];if(1c===ZC.1d(d))if(1b&&-1!==w[0].1L("\\\\"))d=!0;1u{1a P="";1j(o=y,s=x.1f;o<s;o++)P+=x[o][0];1a N=P.1f;d=P.1F(/[0-9]/g,"").1f/N>.75}if(d){1j(o=y,s=x.1f;o<s;o++)B?H.1h(ZC.1k(x[o][Y])):H.1h(x[o][Y]);Y++}1a O=[],S=[];1j(C=Y;C<L;C++){S[C-Y]=[];1a T=1c,k=1c,z=0,G=1c;1j(o=y,s=x.1f;o<s;o++)if(1c!==ZC.1d(x[o][C])&&""!==x[o][C]&&1y x[o][C]!==ZC.1b[31]){n=x[o][C],1c!==ZC.1d(G)||v||(G=n.1F(/[0-9\\-\\,\\.\\+\\e]+/g,"%v")),v||(n=n.1F(/[^0-9\\-\\,\\.\\+\\e]+/g,""));1a J=n.1L("."),Q=n.1L(",");-1!==J&&-1!==Q?J<Q?(T=".",k=",",z=ZC.BN(0,n.1f-Q)):(T=",",k=".",z=ZC.BN(0,n.1f-J)):-1===J&&-1!==Q?n.1f-Q-1==3?(T=",",k="."):(T=".",k=",",z=ZC.BN(0,n.1f-Q)):-1!==J&&-1===Q&&(n.1f-J-1==3?(T=".",k=","):(T=",",k=".",z=ZC.BN(0,n.1f-J))),"."===T&&(n=n.1F(/\\./g,"").1F(/,/g,".")),","===T&&(n=n.1F(/,/g,"")),S[C-Y].1h(v?n:ZC.1Y(n))}1u S[C-Y].1h(1c);O[C-Y]={},1c!==ZC.1d(G)&&(O[C-Y].5D=G),1c!==ZC.1d(T)&&(O[C-Y][ZC.1b[13]]=T),1c!==ZC.1d(T)&&(O[C-Y][ZC.1b[14]]=k),0!==z&&(O[C-Y][ZC.1b[12]]=z)}if(B)1j(l=0,r=S.1f;l<r;l++)1j(1a R=0;R<S[l].1f;R++)S[l][R]=[H[R],S[l][R]];1a W=[];1Q(t.C.AF){1i"1w":1i"1N":1i"5x":1i"6b":1i"92":1i"88":1i"6U":1i"7z":1i"9z":1c===ZC.1d(t.o[ZC.1b[50]])&&(t.o[ZC.1b[50]]={});1a U=[];d&&1c!==ZC.1d(w[0])&&(U=w[0].2o(/\\\\/)),1c!==ZC.1d(U[0])&&(1c===ZC.1d(t.o[ZC.1b[50]].1H)&&(t.o[ZC.1b[50]].1H={}),1c===ZC.1d(t.o[ZC.1b[50]].1H.1E)&&(t.o[ZC.1b[50]].1H.1E=U[0])),d&&(1c===ZC.1d(t.o[ZC.1b[50]][ZC.1b[5]])?t.o[ZC.1b[50]][ZC.1b[5]]=H:1c===ZC.1d(t.o[ZC.1b[50]][ZC.1b[10]])&&(t.o[ZC.1b[50]][ZC.1b[10]]=H));1a V=[];if(1c!==ZC.1d(g)&&g)1j(l=0,r=S.1f;l<r;l++)V[l]=ZC.1b[51]+(0===l?"":"-"+(l+1));1u if(1c!==ZC.1d(f)&&f){1a j={},q=0,$=[];1j(l=0,r=S.1f;l<r;l++){1j(1a ee=0,te=0,ie=S[l].1f;te<ie;te++)ee+=S[l][te];ee/=S[l].1f;1a ae=1A.46(ZC.HO(ee)/1A.bD/2);1c===ZC.1d(j[ae])&&(j[ae]=ZC.1b[51]+(0===q?"":"-"+(q+1))),-1===ZC.AT($,O[l].5D)?(V[l]=ZC.1b[51]+(0===q?"":"-"+(q+1)),q++):(V[l]=j[ae],q++),$.1h(O[l].5D)}}1j(0===V.1f&&(V[0]=ZC.1b[51]),1c===ZC.1d(t.o[ZC.1b[11]])&&(t.o[ZC.1b[11]]=[]),l=0,r=S.1f;l<r;l++)1c===ZC.1d(t.o[ZC.1b[11]][l])&&(t.o[ZC.1b[11]][l]={}),t.o[ZC.1b[11]][l][ZC.1b[5]]=S[l],1b&&(1c===ZC.1d(t.o[ZC.1b[11]][l].1E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g,i=0,a=t.BL.1f;i<a;i++)if(t.BL[i].BD===e)1l t.BL[i];1l 1c}NL(e){1l e}xf(e){1l 1m ZC.wx(1g,e)}NY(){1j(1a e=1g,t=0,i=e.BL.1f;t<i;t++){1a a=e.BL[t],n=a.BD;e.A.B9.2w(a.o,["("+e.AF+").4B","("+e.AF+")."+n.1F(/\\-[0-9]+/,""),"("+e.AF+")."+n.1F(/\\-[0-9]+/,"-n"),"("+e.AF+")."+n],!1,!0);1a l=n.1F(/\\-[0-9]+/,"")+"-n";e.o[l]&&a.1C(e.o[l]),e.o[n]&&a.1C(e.o[n]),e.AJ["3d"]&&e.A.B9.2w(a.o,["("+e.AF+").4B[3d]","("+e.AF+")."+n.1F(/\\-[0-9]+/,"")+"[3d]","("+e.AF+")."+n.1F(/\\-[0-9]+/,"-n")+"[3d]","("+e.AF+")."+n+"[3d]"],!1,!0),e.AJ["3d"]&&a.1C(e.o[n+"[3d]"]),a.1q()}}UQ(){1l 1c}ov(e){1a t,i,a,n=1g,l=0,r=n.AY.A7.1f;1j(t=0;t<r;t++)l=ZC.BN(l,n.AY.A7[t].S.1f);1n o(e){1l e=(e=(e=e.1F(/(%N|%2r-gp)/g,l)).1F(/(%P|%1B-gp)/g,r)).1F(/(%S|%1z-6p-gp)/g,a.W.1f)}1j(t=0,i=n.BL.1f;t<i;t++)(a=n.BL[t]).H8(e),2===e&&(a.IX=o,a.DB()&&a.1q()),1c===ZC.1d(a.o["1X-2C"])&&1c===ZC.1d(a.o["1X-cA"])&&a.T6(),1c===ZC.1d(a.o["1X-9X"])&&a.jw()}OJ(){}NB(){}qP(){}qG(){}mG(){1a e=1g,t=e.A.B9,i="("+e.AF+")";e.Q=1m I2(e),e.Q.OL="2v",e.Q.K=e.K+"-2v";1a a=[i+".2v"];if(e.BI&&a.1h(i+".2v[2A]"),e.AJ["3d"]&&a.1h(i+".2v[3d]"),t.2w(e.Q.o,a),e.Q.1C(e.o.aI),e.Q.1C(e.o.2v),e.BI&&e.Q.1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1g,n=["1v","2z","2c","1K"],l={};1j(t=0;t<n.1f;t++)l[n[t]]=!1,a.E["2v.d-2y-"+n[t]]&&(a.o.2v["2y-"+n[t]]=1c),a.o.2v&&"4O"===a.o.2v["2y-"+n[t]]&&(l[n[t]]=!0,a.o.2v["2y-"+n[t]]="20");1a r=!1,o={};if("xy"===a.AJ.3y&&(r=!0),("xy"===a.AJ.3y||"yx"===a.AJ.3y)&&(a.Q.E["d-2y"]||a.E["2v.d-2y"])){1j(1a s=0,C=a.BL.1f;s<C;s++){1a A=0,Z=0,c="",p=a.BL[s];if(p.AM&&p.TN){"k"===p.AF?c=p.D8?"2q"===p.B6?"1K":"2z":"2q"===p.B6?"2c":"1v":"v"===p.AF&&(c=p.D8?"2q"===p.B6?"2c":"1v":"2q"===p.B6?"1K":"2z");1a u=0;if(a.Q.E["d-2y-"+c]||a.E["2v.d-2y-"+c]){1a h=1m DP(p);h.1S(p.BQ);1a 1b=ZC.BN(1,ZC.1k((p.A1-p.X)/p.ED));1j(t=p.X;t<=p.A1;t+=1b)if(h.AP=p.FO(t),h.iP&&("k"===p.AF&&!p.D8||"v"===p.AF&&p.D8)&&(h.o[ZC.1b[19]]=ZC.1k(.9*p.A9)),h.1q(),h.AM)if(Z=ZC.BN(Z,h.AA%180==0?h.F:h.I),A=ZC.BN(A,h.AA%180==0?h.I:h.F),u=ZC.BN(u,1.5*h.DG*(h.AP||"").2o(/<br>|<br\\/>|<br \\/>|\\n/).1f),"1v"===c||"2c"===c){if(u=ZC.BN(u,.o4*h.DG+1.mr*ZC.2l(ZC.EK(h.AA))*ZC.BN(h.I,h.F)),A=h.I,Z=u,r&&"k"===p.AF){o[p.BD]||(o[p.BD]=[]);1a d=1c===ZC.1d(h.o["3i-3x"])||ZC.2t(h.o["3i-3x"]),f=.o4*h.DG+1.mr*ZC.2l(ZC.EE(h.AA))*ZC.BN(h.I,h.F);"2q"===p.B6?(d&&(ZC.DT(ZC.hF(h.AA),90,180)||ZC.DT(ZC.hF(h.AA),3V,2m))&&o[p.BD].1h(f),d||o[p.BD].1h(f/2)):(d&&(ZC.DT(ZC.hF(h.AA),0,90)||ZC.DT(ZC.hF(h.AA),180,3V))&&o[p.BD].1h(f),d||o[p.BD].1h(f/2))}}1u A=u=ZC.BN(u,.o4*h.DG+1.mr*ZC.2l(ZC.EE(h.AA))*ZC.BN(h.I,h.F)),Z=h.F;1a g=1m DP(p);g.1S(p.M),g.AP=p.M.AP,g.1q(),""!==g.AP&&g.AM&&(Z+=g.AA%180==0?g.F:g.I,A+=g.AA%180==0?g.I:g.F)}if(a.o.2v||(a.o.2v={}),("4O"===a.o.2v["2y-"+c]||a.Q.E["d-2y-"+c])&&(a.Q.E["d-2y-"+c]=!1,l[c]=!0,a.o.2v["2y-"+c]="0"),l[c]){a.o.2v["2y-"+c]=ZC.1Y(a.o.2v["2y-"+c]||"0"),a.E[p.BD+"-6V"]=a.o.2v["2y-"+c];1a B=("1v"===c||"2c"===c?ZC.1k(Z):ZC.1k(A))+10+(a.AJ["3d"]?20:0);if(p.VW?a.o.2v["2y-"+c]=ZC.BN(a.o.2v["2y-"+c],B):a.o.2v["2y-"+c]+=B,1c!==ZC.1d(a.o.2v["2y-"+c+"-2a"])&&(a.o.2v["2y-"+c]+=ZC.1k(a.o.2v["2y-"+c+"-2a"])),!a.A.UB){1a v={},E=a.A.DD.eb;a.A.B9.2w(v,"6G.5i.eb"),E&&ZC.2E(E,v),1===a.A.o[ZC.1b[16]].1f&&a.A.o[ZC.1b[16]][0].5i&&(e=a.A.o[ZC.1b[16]][0].5i.eb)&&ZC.2E(e,v);1a b=v.2L||"br";-1===ZC.AT(["tl","tr","br","bl"],b)&&(b="br"),("2c"!==c||"bl"!==b&&"br"!==b)&&("1v"!==c||"tl"!==b&&"tr"!==b)||(a.o.2v["2y-"+c]+=15)}"2c"===c&&("xy"===a.AJ.3y&&a.IA||"yx"===a.AJ.3y&&a.I9)&&(a.o.2v["2y-"+c]+=15),"1K"===c&&("xy"===a.AJ.3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["hI-3R"]),(e=C.o.6O)&&("4j"==1y e?e.3R?C.RS=e.3R:e["1U-3b"]&&(c=e["1U-3b"]):C.RS=e),""!==C.RS&&1c!==ZC.1d(C.A.m4[C.RS])&&(c=C.A.m4[C.RS]),C.H.NZ&&(c=C.H.NZ),c)){1a p=C.xf(c);C.o=p.1q()}if(C.LT=1o.xk,C.4C([["cf","UU","b"],["cJ","NA","f"],["aE","LT","b"],["nz","CB","b"],["7H-1J","KW"],["zd-1J","lY"],["3R-1U","ps"],["3h","LA","i"],["6W","BO"],["3Z-2J","pW","b"]]),C.BO.1f>0)1j(A.B9.6W=[],a=0;a<C.BO.1f;a++){1a u=C.BO[a],h=ZC.AO.JM(C.BO[a],10),1b=ZC.AO.QT(C.BO[a],10);A.B9.6W.1h(["#2T",u,h,1b])}"7a"===C.AF&&(C.F9.7I=!0),(C.AJ["3d"]||C.A.es)&&(C.LT=!1),C.qG(),-1===ZC.AT(C.H.KX,ZC.1b[41])&&((1c!==ZC.1d(e=C.o.2A)||A.PS("2A",C.AF))&&C.AJ[ZC.1b[56]]&&(C.BI&&!C.E["d9-2A-1q"]||1y oR===ZC.1b[31]||(C.E["d9-2A-1q"]=!1,C.BI=1m oR(C),C.BI.OL="2A",A.2w(C.BI.o,Z+".2A"),(t=C.o.2v)&&C.BI.1C({"1T-1r":t[ZC.1b[0]],"1T-1r-1":t["1T-1r-1"],"1T-1r-2":t["1T-1r-2"],"5c-oO":t["5c-oO"],"5c-hJ":t["5c-hJ"]}),C.BI.1C(e),C.BI.1q())),(1c!==ZC.1d(e=C.o["1Z-x"])||A.PS("1Z-x",C.AF))&&C.AJ["4S-1Z"]&&(C.IA||1y iM===ZC.1b[31]||(C.IA=1m iM(C,"x"),C.IA.OL="16T",A.2w(C.IA.o,Z+".1Z-x"),C.IA.1C(e),C.IA.1q())),(1c!==ZC.1d(e=C.o["1Z-y"])||A.PS("1Z-y",C.AF))&&C.AJ["4S-1Z"]&&(C.I9||1y iM===ZC.1b[31]||(C.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0),r.L7("6F",!0),r.L7("mx",!0),e||(!r.BI||r.BI&&!r.BI.LT)&&r.L7("8A",!0),r.AY.YX=[],r.A.T1=[],1o.4F.ez||r.BB&&r.BB.3j(),r.E.c3=[];1a o,s,C,A=ZC.6R?ZC.AK(r.A.K):1c;if(ZC.2K||ZC.6R)ZC.A4("."+r.K+"-2r-1N",A).3r();1u if(ZC.AK(r.A.K+"-5S")&&ZC.AK(r.A.K+"-3e")){ZC.AK(r.A.K+"-5S").4l("qy","");1a Z=ZC.AK(r.A.K+"-3e").jy(!0);1j(a=(n=Z.7k.1f)-1;a>=0;a--)-1!==Z.7k[a].7U.1L(r.K+"-2r-1N")&&Z.aP(Z.7k[a]);ZC.P.ER(r.A.K+"-3e"),ZC.AK(r.A.K+"-1v").3c(Z),ZC.AK(r.A.K+"-5S").4l("qy","#"+r.A.K+"-3e")}1Q(r.AY.HQ=[],ZC.A4("."+r.K+"-1V-3F",A).3r(),ZC.A4("."+r.K+"-1z-1R-1H",A).3r(),ZC.A4("."+r.K+"-1z-1P",A).3r(),ZC.A4("."+r.K+"-1z-1H",A).3r(),ZC.A4("."+r.K+"-2i-1H",A).3r(),ZC.A4("."+r.K+"-2S-1H",A).3r(),ZC.A4("."+r.K+"-qt-1H",A).3r(),e||ZC.A4("."+r.K+"-2A-1P",A).3r(),r.A.AB){1i"2F":1j(a=0,n=r.AY.A7.1f;a<n;a++)r.AY.A7[a].HI=1c;ZC.A4("#"+r.A.K+"-mq").9x().5f(1n(){"15k"!==1g.86.5J()&&(0!==1g.id.1L(r.K+"-")&&1!==r.A.AI.1f||(e?1g.id!==r.K+"-5c"&&-1===1g.id.1L("-2A-5c")&&-1===1g.id.1L("-2B-7W-5c")&&-1!==1g.id.1L(r.K+ZC.1b[35])&&(t&&r.GB||-1!==1g.id.1L(r.K+"-1W-")&&1o.4F.ez||ZC.A4(1g).3r()):-1===1g.id.1L("zc-2B-")&&-1===1g.id.1L("-2B-7W-")&&(-1!==1g.id.1L(r.K+"-1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,t){1c===ZC.1d(e)&&(e=!1);1a i=1g;(-1===ZC.AT(i.H.KX,ZC.1b[41])||t)&&(ZC.A4("."+i.K+"-2r-1N").4i("6C 6Z 4G",i.XL).4i("6l 7D 5V",i.qA).4i("83 6h",i.r5).4i("3I",i.TS).4i("gd",i.TS).4i("9h",i.qZ),i.BB&&(1o.4F.ez||(ZC.A4("."+i.K+"-1W-1P-1N").4i("6l 4G",i.SZ).4i("fX",i.9m).4i("ad",i.9m),ZC.A4("."+i.K+"-1W-1R-1N").4i("6l 4G",i.SZ).4i("fX",i.9m).4i("ad",i.9m),ZC.A4("#"+i.K+"-1W-a3").4i("fX",i.9m).4i("ad",i.9m),ZC.2K||(ZC.A4("."+i.K+"-1W-1P-1N").4i(ZC.P.BX("6Z"),i.R3).4i(ZC.P.BX("7D"),i.RG).4i(ZC.P.BX(ZC.1b[48]),i.PX),ZC.A4("."+i.K+"-1W-1R-1N").4i(ZC.P.BX("6Z"),i.R3).4i(ZC.P.BX("7D"),i.RG).4i(ZC.P.BX(ZC.1b[48]),i.PX))))),i.oW()}oW(){}RO(){}PW(){}JQ(){}R9(){}Q6(){}L7(e,t){1a i=1g;e=e||"2N",1c===ZC.1d(t)&&(t=!1);1a a=ZC.AK((t?i.A.K:i.K)+"-"+e+"-c");a&&(ZC.P.II(a,i.H.AB,i.iX,i.iY,i.I,i.F,i.K,"mx"===e),ZC.A4("."+i.K+"-1H-2N").3r()),"2N"===e&&(ZC.P.II(ZC.AK(i.K+"-2J-2N-c"),i.H.AB,i.iX,i.iY,i.I,i.F,i.K),ZC.P.II(ZC.AK(i.K+"-2J-4W-2N-c"),i.H.AB,i.iX,i.iY,i.I,i.F,i.K),1o.3J.lf&&ZC.P.II(ZC.AK(i.K+"-4k-2N-c"),i.H.AB,i.iX,i.iY,i.I,i.F,i.K)),"3I"===e&&(ZC.P.II(ZC.AK(i.K+"-2J-3I-c"),i.H.AB,i.iX,i.iY,i.I,i.F,i.K),ZC.P.II(ZC.AK(i.K+"-2J-4W-3I-c"),i.H.AB,i.iX,i.iY,i.I,i.F,i.K)),i.qm(e,t)}qm(){}qv(e,t){1a i,a=1g;if(1c!==ZC.1d(e)&&1c!==ZC.1d(t)){1a n=a.AY.A7[e].J2,l=a.AY.A7[e].RR;if("2b"===n)1l;if(1c!==ZC.1d(a.CV["p"+e])){if(1c!==ZC.1d(a.CV["p"+e]["n"+t])){if(4t a.CV["p"+e]["n"+t],l)1j(i=0;i<a.AY.A7.1f;i++)4t a.CV["p"+i]["n"+t]}1u if("2Y"===n?(a.CV={},a.CV["p"+e]={}):"1B"===n&&(a.CV["p"+e]={}),a.CV["p"+e]["n"+t]=!0,l)1j(i=0;i<a.AY.A7.1f;i++)a.CV["p"+i]=a.CV["p"+i]||{},a.CV["p"+i]["n"+t]=!0}1u if("2Y"===n&&(a.CV={}),a.CV["p"+e]={},a.CV["p"+e]["n"+t]=!0,l)1j(i=0;i<a.AY.A7.1f;i++)a.CV["p"+i]=a.CV["p"+i]||{},a.CV["p"+i]["n"+t]=!0}1c!==ZC.1d(e)&&1c!==ZC.1d(t)&&(a.HH=!0,a.JS(!0,!0))}1t(e){1c===ZC.1d(e)&&(e=!1);1a t,i,a,n,l,r,o=1g;o.A.qf=o.K,o.VH=e,2u.iO(ZC.qx[o.K]),o.A.pX("vb"+o.L);1a s,C,A,Z,c,p,u,h=o.BT("k")[0],1b=ZC.3u,d=-ZC.3u,f={},g=o.AY.A7,B=0;1j(Z=0;Z<g.1f;Z++)if(g[Z].o.aU)1j(A=0;A<g.1f;A++)if(g[A].o.id&&g[A].o.id===g[Z].o.aU){B++,u=!0;1a v=[];1j(l=0;l<g[A].S.1f;l++)(h.EC?g[A].S[l].BY>=h.B8&&g[A].S[l].BY<=h.BS:g[A].S[l].L>=h.X&&g[A].S[l].L<=h.A1)?(s=g[A].S[l].AE,1b=1A.2k(1b,s),d=1A.1X(d,s),u?(u=!1,g[A].S[l].BY?v.1h([g[A].S[l].BY,0]):v.1h(0),p=s):g[A].S[l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r"]=1c,n.GB||n.A.XX(),n.A.OD=!1,(n.LT||!n.GB||n.H.E["2Y."+n.K+".lV"]||!n.AJ[ZC.1b[55]]||-1!==ZC.AT(n.H.KX,ZC.1b[41])||1o.4F.b5)&&(n.MJ="9p"),"y5"===n.lY&&(n.xu=!1,n.H.E["2Y."+n.K+".lV"]=!0),t=0,i=n.BL.1f;t<i;t++)n.BL[t].6L();if(!n.A.E["d6-2w"]){1a l=ZC.AO.C2("15Q",n.A,n.HU(),!0);if(l)1j(1a r=[ZC.1b[10],"5X","15L","e9"],o=0;o<r.1f;o++)l[r[o]]&&(n.o[r[o]]=(n.o[r[o]]||[]).4A(l[r[o]]))}1n s(e){1a t,i,a=(e.9N||e.2X.id).1F("-1N-2R","").1F("-2R","").1F(/--([a-zA-Z0-9]+)/,"").1F("-1R","").1F("-3A","").2o("-").9r();1l"2r"===a[1]&&(t=a[2],i=a[0]),[t,i]}if(n.AJ["3d"]||(n.bj(),n.PE(),n.JQ(),-1===ZC.AT(n.H.KX,ZC.1b[41])&&n.Q6()),-1===ZC.AT(n.H.KX,ZC.1b[41])){1a C=ZC.A4("."+n.K+"-2r-1N");n.XL=1n(e){if(!(1o.aY&&"6Z"===1o.mI&&"6Z"===e.1J||(1o.hH=n.A.K,1o.aY=e,1o.mI=e.1J,ZC.3o||n.BB&&n.BB.ZG||-1===ZC.P.TA(e.2X).1L("zc-2r-1N")||"9p"!==n.MJ))){ZC.2K&&(n.E["2r-2X-id"]=e.2X.id,ZC.3o=!1,n.H.9j(),1c===n.H.DD||1c===ZC.1d(n.H.DD["3h-1Z"])||n.H.DD["3h-1Z"]||e.6S(),n.A.W1(e));1a a=s(e);if(n.AY.A7[a[0]]){1a l=n.AY.A7[a[0]].FQ(a[1]);if(l&&(l.N?(ZC.ay=[l.N.C0,l.N.A0,l.N.AC,l.N.BU,l.N.B7],l.NK&&ZC.ay.1h(l.NK.A0,l.NK.AC,l.NK.BU,l.NK.B7)):ZC.ay=[],n.E["1B"+a[0]+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n.A8.AM&&n.A.A8.hd(e)}},C.4g("83 6h",n.r5),n.TS=1n(e){if((e.9N||-1!==ZC.P.TA(e.2X).1L("zc-2r-1N"))&&"9p"===n.MJ){1a t=s(e),i=n.AY.A7[t[0]].FQ(t[1]);if(i&&("2b"===i.A.J2||!ZC.2K&&0!==e.7M||(n.A.E[ZC.1b[53]]=!0,n.gf(),n.qv(i.A.L,i.L)),i.OY(e,"3I"),i.A.UL(e,"3I"),1c!==ZC.1d(i.A.E4)&&"gS"!==i.A.E4))if(i.A.E4 3E 3M)1j(1a a=0;a<i.A.E4.1f;a++){1a l=i.A.FE;i.A.FE 3E 3M&&(l=i.A.FE[a]||"2Y="+(n.o.id||"")),a===i.L&&n.TZ(e,i.EX(i.A.E4[a],1c,1c,!0),l)}1u n.TZ(e,i.EX(i.A.E4,1c,1c,!0),i.A.FE||"2Y="+(n.o.id||""))}},n.qZ=1n(e){if(-1!==ZC.P.TA(e.2X).1L("zc-2r-1N")&&"9p"===n.MJ){1a t=s(e),i=n.AY.A7[t[0]].FQ(t[1]);i&&(i.OY(e,"ym"),i.A.UL(e,"ym"))}},ZC.2K||C.4g("3I",n.TS).4g("gd",n.TS).4g("9h",n.qZ)}if(n.pM(),n.A.E["tr-ev-"+n.L]?(n.A.E["tr-ev-"+n.L]=1c,n.qD()):n.qD(),n.iI){n.iI=!1;1a A={4y:n.K};1j(t=0,i=n.BT("k").1f;t<i;t++){1a Z=n.BT("k")[t];1c!==ZC.1d(e=Z.M0)&&(A["7E"+(a=1===Z.L?"":"-"+Z.L)]=!0,A["4q"+a]=e[0],A["4p"+a]=e[1])}1j(t=0,i=n.BT("v").1f;t<i;t++){1a c=n.BT("v")[t];1c!==ZC.1d(e=c.M0)&&(A["7R"+(a=1===c.L?"":"-"+c.L)]=!0,A["5t"+a]=e[0],A["5s"+a]=e[1])}if(A.qW=!0,n.A.G0){1j(1a p in n.A.G0)ZC.AK(p).3c(n.A.G0[p]);n.A.G0=1c}n.A.PD(A)}}pM(){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"yv":2u.xC.82.7L=E4;1p;1i"2u":1c!==ZC.1d(PM[1])&&""!==PM[1]&&(2u.1v[PM[1]].82.7L=E4);1p;1i"2Y":1a YH=1c;if("()"===E4.2x(E4.1f-2)||"7s:"===E4.2x(0,11))4M{1a EG=E4.1F("7s:","").1F("()","");7t(EG)&&(YH=7t(EG).4v(s))}4K(e){}1c!==ZC.1d(PM[1])&&""!==PM[1]?"yw"===PM[1]||"yv"===PM[1]?(s.A.MP(),YH?1o.3n(s.A.K,"aK",{1U:YH}):s.A.2w(1c,E4)):(C=s.A.OF(PM[1]),C&&(s.A.MP(C),s.A.E["tr-ev-"+C.L]=!0,s.A.O2++,YH?1o.3n(s.A.K,"aK",{4y:PM[1],1U:YH}):s.A.2w(PM[1],E4))):(C=s.A.AI[0],s.A.MP(C),YH?1o.3n(s.A.K,"aK",{4y:C.K,1U:YH}):(s.A.E["tr-ev-"+C.L]=!0,s.A.O2++,s.A.2w(C.K,E4)));1p;2q:2u.82.7L=E4}}}I1(e,t,i){1a a=1g;if(1c===ZC.1d(i)&&(i=a.AY.A7.1f-1),1c!==ZC.1d(e)&&1y e!==ZC.1b[31])1l a.AY.A7[e];if(1c===ZC.1d(t)||1y t===ZC.1b[31])1l a.AY.A7[i];1j(1a n=0,l=a.AY.A7.1f;n<l;n++)if(t===a.AY.A7[n].H3)1l a.AY.A7[n];1l 1c}Z0(e,t){1a i,a,n=1g;(e=e||{})[ZC.1b[54]]=e[ZC.1b[54]]||n.7T();1a l=1c;if(1y e.3W!==ZC.1b[31]&&(l=ZC.1k(e.3W)),-1===l)1j(l=[],i=0,a=n.AY.A7.1f;i<a;i++)l.1h(i);l 3E 3M||(l=[l]);1a r=e.4Z||"";r 3E 3M||(r=[r]);1a o=[];1j(i=0,a=ZC.BN(l.1f,r.1f);i<a;i++){1a s=n.I1(l[i],r[i]);if(s){1a C={};ZC.2E(e,C);1a A=s.L;C.3W=A,C.4Z=s.H3,("4m"===t&&!n.E["1B"+A+".2h"]||"5d"===t&&n.E["1B"+A+".2h"])&&o.1h(C)}}1j(i=0,a=o.1f;i<a;i++)n.A.o[ZC.1b[16]][n.L][ZC.1b[11]][o[i].3W].2h="4m"===t,i===a-1&&(o[i].JS=1),n.PC(o[i])}PC(e){1a t,i,a,n=1g;n.A.E["2Y."+n.K+".lV"]=!1,e=e||{};1a l=!1;1c!==ZC.1d(e.b1)&&e.b1&&(l=!0);1a r=!1;e[ZC.1b[54]]=e[ZC.1b[54]]||n.7T(),1c!==ZC.1d(t=e["bx-1W"])&&(r=ZC.2t(t));1a o=n.I1(e.3W,e.4Z);if(o){1a s=o.L;1Q(e[ZC.1b[54]]){1i"5d":if(n.BB&&(n.BB.E.lX=!0),n.E["1B"+s+".2h"]=!n.E["1B"+s+".2h"],1c!==ZC.1d(n.A.o[ZC.1b[16]][n.L][ZC.1b[11]])&&(n.A.o[ZC.1b[16]][n.L][ZC.1b[11]][s].2h=n.E["1B"+s+".2h"]),n.AJ["3d"])r=!0,l||n.JS();1u{1a C=n.E["1B"+s+".2h"]?"8K":"2b";if(1o.3J.bh||ZC.A4("."+n.K+ZC.1b[35]+s+"-2r-1N").5f(1n(){if("xN"===1g.86.5J()){1a e=ZC.A4(1g),t=e.3S("9o"),a=e.3S("2S");"2b"===C?(t="-"+t.1F(/,/g,",-"),"5q"===a?4===(i=t.2o(",")).1f&&(t=[i[2],i[3],i[0],i[1]].2M(",")):"3A"===a&&3===(i=t.2o(",")).1f&&(t=[i[0],i[1],-i[2]].2M(","))):(t=t.1F(/\\-/g,""),"5q"===a&&4===(i=t.2o(",")).1f&&(t=[i[2],i[3],i[0],i[1]].2M(","))),e.3S("9o",t)}}),n.A.KC)ZC.AK(n.K+"-4k-bl-c").1I.3N=C,ZC.AK(n.K+"-4k-fl-c").1I.3N=C,ZC.AK(n.K+"-4k-vb-c").1I.3N=C;1u{1j(a=0;a<o.T2;a++)(t=ZC.AK(n.K+"-1B-"+s+"-bl-"+a+"-c"))&&(t.1I.3N=C);1j(a=0;a<o.l4;a++)(t=ZC.AK(n.K+"-1B-"+s+"-fl-"+a+"-c"))&&(t.1I.3N=C);(t=ZC.AK(n.K+"-1B-"+s+"-vb-c"))&&(t.1I.3N=C)}1a A=ZC.A4("."+n.K+"-1B-"+s+"-1V-3F");n.E["1B"+s+".2h"]?(A.4m(),ZC.A4("."+n.K+ZC.1b[35]+s+"-2A").4m()):(A.5d(),ZC.A4("."+n.K+ZC.1b[35]+s+"-2A").5d())}1p;1i"3r":n.gf(),r=!0,n.E["a2-8f-3r"]=!0,n.E["1B"+s+".2h"]=!n.E["1B"+s+".2h"],e.JS&&(l||(n.LF("on-1W-a2"),n.JS(!0,!0)))}n.BB&&!r&&(n.BB.3j(),n.BB.1t())}}LF(e){1a t=1g,i=!0,a=t.o.1B||{};1c!==ZC.1d(a.8y)&&1c!==ZC.1d(a.8y[e])&&(i=ZC.2t(a.8y[e])),t.HH="y5"===t.lY||!i}HU(){1l{id:1g.A.K,Cl:1g.L,4y:1g.K.1F(1g.A.K+"-2Y-",""),x:1g.iX,y:1g.iY,1s:1g.I,1M:1g.F,6G:1g.A.FD()}}SC(){}S5(){}gc(){1j(1a e=0;e<1g.BL.1f;e++)1g.BL[e].gc();1j(1a t=0;t<1g.AY.A7.1f;t++)1g.AY.A7[t].gc();ZC.AO.gc(1g.AY,["A","C","H","F5","o","I4","JW"]),ZC.AO.gc(1g,["Z","C6","AJ","J1","KP","MZ","F9"])}}K1.5n.PE=1n(){1a e,t,i,a,n,l,r,o,s=1g;s.qE(),s.BW=[],s.FG=[],s.YN=[],s.LP=[],s.FL=[],s.XP={};1a C,A,Z,c=s.A.B9,p="("+s.AF+")";if(1c!==ZC.1d(C=s.o[ZC.1b[10]]))1j(t=0,i=C.1f;t<i;t++){C[t].id||(C[t].id="18A"+t+"1b"+ZC.hw(5I,6H)),a=C[t].id||t,n=!1,l=!1,s.E["2J.dY"]&&-1===ZC.AT(s.E["2J.dY"],a)&&(n=!0,l=!0),C[t].cM&&(n=!0);1a u=1o.6g.a8("DP",s,s.K+"-1H-"+a,n);if(!l||!u.pc){if(c.2w(u.o,p+".1H"),u.1C(C[t]),1c!==ZC.1d(e=u.o.xC))1j(1a h=0;h<s.BW.1f;h++)if(""+s.BW[h].H3==""+e){u.E["p-x"]=s.BW[h].iX,u.E["p-y"]=s.BW[h].iY,u.E["p-1s"]=s.BW[h].I,u.E["p-1M"]=s.BW[h].F;1p}if(u.H3=a,u.K=s.K+"-1H-"+a,u.GJ=s.K+"-1H zc-1H",1c!==ZC.1d(e=C[t].7m)&&(u.E.7m=e),u.EX=1n(t){if(!t||-1===(""+t).1L("%"))1l t;t=""+t;1a i,a=[];a.1h(["%id",s.A.K]),a.1h(["%4y",s.K.1F(s.A.K+"-2Y-","")]);1a n=s.E.3T;1j(1a l in n)a.1h(["%"+l,n[l]]);a.3Z(ZC.k6);1j(1a r=0,o=a.1f;r<o;r++)i=1m 5v(a[r][0],"g"),t=t.1F(i,a[r][1]);1a C,A,Z,c,p=u.o["2q-1V"]||" ";1j(i=1m 5v("(%1B-([0-9]+?)-1V(-*)([0-9]*?))|(%1B-1V-([0-9]+?))|(%1B-1V)|(%8l)|(%2r-8i-1V)","g"),t=t.1F(i,p),i=1m 5v("\\\\((.+?)\\\\)\\\\(([0-9]*)\\\\)\\\\(([0-9]*)\\\\)");C=i.3n(t);)if("%2r-1V"===C[1]){A="";1a h=0,1b=0;""!==(e=C[2])&&(h=ZC.1k(e)),""!==(e=C[3])&&(1b=ZC.1k(e)),(c=s.AY.A7[h])&&(Z=c.FQ(1b,3))&&(A=Z.EX(C[1])),t=t.1F(C[0],A)}1l t},u.1q(),C[t]["3d"]){1a 1b=1m CA(s,u.iX+u.I/2-ZC.AL.DZ,u.iY+u.F/2-ZC.AL.E0,ZC.1k(C[t].z||"0"));u.iX=1b.E8[0]-u.I/2,u.iY=1b.E8[1]-u.F/2}}s.BW.1h(u),s.FL.1h({1J:"1H",2Z:t,ah:u.JR}),s.XP[a]={2S:"1H",bM:t}}if(1c!==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c",a.K+"-2J-4W-c");1j(1a l=0;l<n.1f;l++)(i=ZC.AK(n[l]))&&ZC.P.II(i,a.H.AB,a.iX,a.iY,a.I,a.F,a.K);"3f"===a.A.AB&&!1o.hp&&ZC.bE||(ZC.A4("."+a.K+"-1H").3r(),ZC.A4("."+a.K+"-2S-1H").3r(),ZC.A4("."+a.K+"-7C-1H").3r()),e||(ZC.A4("."+a.K+"-1H-1N").5f(1n(){if(-1===ZC.AT([a.K+"-5M-1N",a.K+"-81-1N",a.K+"-7b-1N"],1g.id)){1a e=1m 5v("18s(x|y|k|v)-(7J|b4)([0-9]+)").3n(1g.id);!t&&e&&e.1f||ZC.P.ER(1g.id)}}),ZC.A4("."+a.K+"-2S-1N").5f(1n(){(!ZC.g6||ZC.g6&&"1"!==1g.bT("1U-3e"))&&ZC.P.ER(1g.id)}),ZC.A4("."+a.K+"-7C-1N").3r()),"2F"===a.A.AB&&ZC.A4("#"+a.A.K+"-2F").9x().5f(1n(){1a e=a.K+"-1H-";"xW"===1g.86.aO()&&1g.id.2x(0,e.1f)===e&&ZC.P.ER(1g.id)})},K1.5n.oW=1n(){1a e=1g;(e.H.O7["2J-1v"]||e.H.O7["2J-2c"])&&(ZC.A4("."+e.K+"-1H-1N").4i(ZC.2K?"4G":"6C 6Z",e.pD).4i(ZC.2K?"5V":"6l 7D",e.pE).4i(ZC.2K?"6h":ZC.1b[48],e.ra),ZC.2K||ZC.A4("."+e.K+"-1H-1N").4i("3I",e.US).4i("9h",e.US),ZC.A4("."+e.K+"-2S-1N").4i(ZC.2K?"4G":"6C 6Z",e.pK).4i(ZC.2K?"5V":"6l 7D",e.pI).4i(ZC.2K?"6h":ZC.1b[48],e.pB),ZC.2K||ZC.A4("."+e.K+"-2S-1N").4i("3I",e.V0).4i("9h",e.V0))},K1.5n.O1=1n(){1a e,t,i,a,n=1g;if(n.ZH=!1,1c!==ZC.1d(i=n.o[ZC.1b[10]]))1j(e=0,t=i.1f;e<t;e++){1a l=""+(i[e].1E||"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d(e),a.S5(ZC.1b[48],t)},a.V0=1n(e){1a t=n(e);if("9h"!==e.1J){e.hz||a.L7("3I"),a.TU=a.TU||{},a.TU["pN"+t.ip]?(a.TU["pN"+t.ip]=1c,a.L7("3I")):(e.hz||(a.TU={}),a.TU["pN"+t.ip]=1,a.R9("2S",t.io,"3I")),a.S5("3I",t);1a i=a.FG[t.io].BE||a.FG[t.io];if(i&&i.E4&&"gS"!==i.E4)if(i.E4 3E 3M)1j(1a l=0;l<i.E4.1f;l++)1c!==ZC.1d(i.FE[l])&&a.TZ(e,i.E4[l],i.FE[l]);1u a.TZ(e,i.E4,i.FE)}1u a.S5("9h",t)},ZC.A4("."+a.K+"-2S-1N").4g(ZC.2K?"4G":"6C 6Z",a.pK).4g(ZC.2K?"5V":"6l 7D",a.pI).4g(ZC.2K?"6h":ZC.1b[48],a.pB),ZC.2K||ZC.A4("."+a.K+"-2S-1N").4g("3I",a.V0).4g("9h",a.V0),a.pD=1n(e){ZC.2K&&(a.L7(),ZC.3o=!1,a.H.9j(),1c===a.H.DD||1c===ZC.1d(a.H.DD["3h-1Z"])||a.H.DD["3h-1Z"]||e.6S(),a.A.W1(e));1a t=l(e);if(t.2H&&a.A8&&a.A.A8&&a.A8.AM&&a.A.A8.g4(e),1c!==t&&"1H"===t.1J){1a i=ZC.2K?"6C":e.fS||e.1J;t["1U-6K"]||a.R9("1H",t.g2),a.SC(i,t)}},a.pE=1n(e){ZC.2K&&(a.H.dI||ZC.3o||(1o.SN(e),a.US(e)),a.A.P2(e)),a.A8&&a.A.A8&&a.A8.AM&&a.A.A8.g3(e),ZC.2K||a.L7();1a t=l(e);if(1c!==t){1a i=ZC.2K?"6l":e.fS||e.1J;ZC.AK(a.K+"-1H-"+t.1H.id)&&(ZC.AK(a.K+"-1H-"+t.1H.id).1I.3N="8K"),a.SC(i,t)}},a.ra=1n(e){1a t=l(e);t.2H&&a.A8&&a.A.A8&&a.A8.AM&&a.A.A8.hd(e),a.SC(ZC.1b[48],t)},a.US=1n(e){1a t=l(e);if("9h"!==e.1J){e.hz||a.L7("3I"),a.TU=a.TU||{},a.TU["pz"+t.e1]?(a.TU["pz"+t.e1]=1c,a.L7("3I")):(e.hz||(a.TU={}),a.TU["pz"+t.e1]=1,a.R9("1H",t.g2,"3I")),a.SC("3I",t);1a i=a.BW[t.g2];if(!i)1Q(t.1J){1i"2Y-5M":i={E4:a.J1.E4,FE:a.J1.FE};1p;1i"2Y-81":i={E4:a.KP.E4,FE:a.KP.FE};1p;1i"2Y-7b":i={E4:a.MZ.E4,FE:a.MZ.FE}}if(i&&i.E4&&"gS"!==i.E4)if(i.E4 3E 3M)1j(1a n=0;n<i.E4.1f;n++)1c!==ZC.1d(i.FE[n])&&(i.E4[n]=i.E4[n].1F("%id",a.A.K),i.E4[n]=i.E4[n].1F("%4y",a.K.1F(a.A.K+"-2Y-","")),a.TZ(e,i.E4[n],i.FE[n]));1u i.E4=i.E4.1F("%id",a.A.K),i.E4=i.E4.1F("%4y",a.K.1F(a.A.K+"-2Y-","")),a.TZ(e,i.E4,i.FE)}1u a.SC("9h",t)},ZC.A4("."+a.K+"-1H-1N").4g(ZC.2K?"4G":"6C 6Z",a.pD).4g(ZC.2K?"5V":"6l 7D",a.pE).4g(ZC.2K?"6h":ZC.1b[48],a.ra),ZC.2K||ZC.A4("."+a.K+"-1H-1N").4g("3I",a.US).4g("9h",a.US));1n n(e){1j(1a t=(e.9N||e.2X.id).1F(/\\-\\-\\d+/g,"").1F(a.K+"-2S-","").1F("-bN-1N","").1F("-1N",""),i=-1,n=1c,l=0,r=a.FG.1f;l<r;l++)if(a.FG[l]&&""+a.FG[l].H3==""+t){i=l,n=a.FG[l]3E QW?a.FG[l].BE:a.FG[l];1p}if(!n&&e.2X.bT("1U-jR"))1l{ip:e.2X.id,jR:!0,ev:e};if(-1===i)1l 1c;1a o={ip:t,io:i,2H:n.o.2H?1:0,2S:{id:t,2Z:i,2p:n.DH,x:n.iX,y:n.iY,1J:n.DN,uw:n.o["3e-1P"],2W:n.D,1s:n.I,1M:n.F,2e:n.AH,ux:n.L1,2f:n.AA,9K:n.JR},ev:e};1j(1a s in n.o)n.o.8d(s)&&"1U-"===s.2x(0,5)&&(o[s]=n.o[s]);1l o}1n l(n){1a l,r=n.9N||n.2X.id;if(r===a.K+"-5M-1N"||r===a.K+"-81-1N"||r===a.K+"-7b-1N"){1a o=1c,s=-1;1Q(l=r.1F(a.K+"-","").1F("-1N","")){1i"5M":o=a.J1,s=-1;1p;1i"81":o=a.KP,s=-2;1p;1i"7b":o=a.MZ,s=-3}1l{1J:"2Y-"+l,e1:o.K,g2:s,1E:o.AP,1H:{id:o.K,2Z:s,1E:o.AP},ev:n}}if(-1===r.1L("-1z")||-1===r.1L("-1P")&&-1===r.1L("-1R")){if(-1!==r.1L("-1V-3F-")){e=r.1F(a.K+ZC.1b[35],"").1F("-1V-3F-1N",""),t=e.2o("-2r-");1a C=a.AY.A7[ZC.1k(t[0])].FQ(ZC.1k(t[1]));1l C?{1J:ZC.1b[17],e1:"uv"+t.2M("1b"),3W:ZC.1k(t[0]),5W:ZC.1k(t[1]),1E:C.AE,1H:{id:"uv"+t.2M("1b"),1E:C.AE},ev:n}:1c}e=r.1F(a.K+"-1H-","").1F("-1N","");1j(1a A=-1,Z=1c,c=0,p=a.BW.1f;c<p;c++)if(""+a.BW[c].H3==""+e){A=c,Z=a.BW[c];1p}if(i=-1===A?"":a.BW[A].AP,-1===A)1l 1c;1a u={1J:"1H",e1:e,g2:A,1E:i,2H:Z.o.2H?1:0,1H:{id:e,2Z:A,2p:Z.DH,x:Z.iX+Z.BJ,y:Z.iY+Z.BC,1s:Z.I,1M:Z.F,1E:i},ev:n};1j(1a h in Z.o)Z.o.8d(h)&&"1U-"===h.2x(0,5)&&(u[h]=Z.o[h]);1l u}e=r.1F(a.K+"-","").1F("-1N","");1a 1b=(t=e.2o("-"))[1].2o("1b"),d=0;2===1b.1f?d=ZC.1k(1b[1]):3===1b.1f&&(d=ZC.1k(1b[2]));1a f,g=t[0].1F(/1b/g,"-"),B=a.BK(g);1l-1!==r.1L("-1P")?(l="1z-1P",f="18g"+t[1].1F("7J",""),i=B.BW[d]||B.W[d],"18c"===f&&(i=B.M.AP)):(l="1z-1R",f="18b"+t[1].1F("b4",""),i=B.E["wv"+d]||""),{1J:l,e1:f,g2:d,1z:g,1E:i,2H:B.o.2H||B.o.1P&&B.o.1P.2H?1:0,1H:{id:f,2Z:d,1E:i},ev:n}}},K1.5n.SC=1n(e,t){ZC.2E(1g.HU(),t),t.ev=ZC.A4.BX(t.ev),ZC.AO.C2("189"+e,1g.A,t)},K1.5n.S5=1n(e,t){ZC.2E(1g.HU(),t),t.ev=ZC.A4.BX(t.ev),ZC.AO.C2("186"+e,1g.A,t)},K1.5n.OJ=1n(e){1a t,i,a=1g;if("3b"==1y e){1a n={},l=e.2o(":");if(2===l.1f){n.1J=l[0];1j(1a r=0,o=(l=l[1].2o(/\\s|,|;/)).1f;r<o;r++){1a s=l[r].2o("=");n[s[0]]=s[1]}}e=n}1a C=[-1,-1];1Q(a.E.El=!0,e.1J){1i"1z":1a A,Z,c,p="",u=-1,h=1c;if(1c!==ZC.1d(t=e.8D)&&(p=t),1c!==ZC.1d(t=e.2Z)&&(u=ZC.1k(t)),1c!==ZC.1d(t=e[ZC.1b[9]])&&(h=ZC.1k(t)),i=1c,""===p&&(p=ZC.1b[50]),i=a.BK(p))1Q(i.H0&&-1!==u?c=i.H0(u):i.AX&&(1c!==ZC.1d(h)?c=i.AX(h):-1!==u&&(c=i.AX(i.W[u]))),a.AJ.3y){1i"7j":1i"8z":A=c[0],Z=c[1];1p;1i"xy":"k"===i.AF?(A=c,Z=i.iY,"2q"===i.B6&&(Z+=i.F)):"v"===i.AF&&(Z=c,A=i.iX,"5C"===i.B6&&(A+=i.I));1p;1i"yx":"k"===i.AF?(Z=c,A=i.iX,"5C"===i.B6&&(A+=i.I)):"v"===i.AF&&(A=c,Z=i.iY,"2q"===i.B6&&(Z+=i.F))}C=[A,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.8y.6i.4v()});a.QD=!0,2u.5E(1n(){A.2P(p)},33)}c=!0};if(A){1a E=!1,b=!1;1j(o=0,s=Z.1f;o<s;o++){if(1c!==ZC.1d(Z[o].jI)&&(C=a.o[Z[o].jI+"s"]),C)1j(p=0,u=C.1f;p<u;p++)1c!==ZC.1d(Z[o].id)&&1c!==ZC.1d(C[p].id)&&C[p].id===Z[o].id&&v(Z[o],C[p]);1c!==ZC.1d(Z[o].8y)?E=!0:b=!0,b&&E&&a.PE()}}1u if(i.6d)1j(p=0,u=C.1f;p<u;p++)C[p].6d===i.6d&&(Z.id=C[p].id,v(Z,C[p]));1u if(i.2p)1j(p=0,u=C.1f;p<u;p++)C[p].2p===i.2p&&(Z.id=C[p].id,v(Z,C[p]));1u 1j(e=Z.id||i.id,p=0,u=C.1f;p<u;p++)1c!==ZC.1d(C[p].id)&&1c!==ZC.1d(e)&&C[p].id===e&&(Z.id=e,v(Z,C[p]));!c||!d&&a.QD||a.QD||(a.O1(),a.PW(f))}i.5H&&"1n"==1y i.5H&&i.5H(i);1p;1i"17Z":(a=g.C7(i[ZC.1b[3]]))&&(a.O1(),a.PW(f)),i.5H&&"1n"==1y i.5H&&i.5H(i);1p;1i"17V":if(i["1O"]&&(i.2p=i["1O"]),l=[],(a=g.C7(i[ZC.1b[3]]))&&i.2p){n=i.1J||"1H",C=a.o[n+"s"]||[];1a m=i.2p 3E 3M?i.2p:[i.2p];1j(o=0,s=C.1f;o<s;o++)-1===ZC.AT(m,C[o].2p)&&-1===ZC.AT(m,C[o]["1O"])||1c===ZC.1d(C[o].id)||l.1h(C[o].id)}1l l;1i"wb":1i"wc":1a K={x:"iX",y:"iY",1s:"I",1M:"F",1r:"C0",iS:"B7",cr:"AZ",eJ:"BU",eK:"AQ",eI:"A0",eF:"AC",2e:"AH",1J:"DN",1E:"AP",6M:"DG",6I:"KU",w6:"EP",jN:"BJ",jX:"BC"};if(a=g.C7(i[ZC.1b[3]]),n=i.1J||"1H","wb"===t&&"1H"!==n||"wc"===t&&"2S"!==n)1l 1c;if(e=i.id||"",a&&""!==e){1b=[],"1H"===n?1b=a.BW:"2S"===n&&(1b=a.FG);1a D=1c;1j(o=0,s=1b.1f;o<s;o++)1b[o].H3===e&&(D=1b[o]);if(D){1a F={};if("2S"===n){if(D.M)1j(h in F.1H={},K)F.1H[h]=D.M[K[h]];D.BE&&(D=D.BE)}1j(h in K)F[h]=D[K[h]];1l F}}1l 1c;1i"17U":1o.dJ="5j",i.4D&&"7N"===i.4D&&(1o.dJ="7N");1p;1i"17T":ZC.bE=!1,i.4D&&"2L"===i.4D&&(ZC.bE=!0)}1l 1c},K1.5n.p7=1n(){1a e,t,i=1g,a=0;1j(e=0,t=i.BL.1f;e<t;e++)"k"===i.BL[e].AF&&i.o[i.BL[e].BD]&&i.o[i.BL[e].BD][ZC.1b[5]]&&(a=ZC.BN(a,i.o[i.BL[e].BD][ZC.1b[5]].1f));1j(e=0,t=i.AY.A7.1f;e<t;e++)1c!==ZC.1d(i.o[ZC.1b[11]][e])&&i.o[ZC.1b[11]][e][ZC.1b[5]]&&(a=ZC.BN(a,i.o[ZC.1b[11]][e][ZC.1b[5]].1f));1l a},K1.5n.UK=1n(){1a e,t=1g;if(t.HP)1j(1a i=t.p7(),a=0,n=t.BL.1f;a<n;a++)"k"===t.BL[a].AF&&(t.BL[a].D8?(e=(t.BL[a].F-t.BL[a].A6-t.BL[a].BV)/ZC.1k(t.HP["1X-9X"]),t.BL[a].OT=ZC.BN(0,t.BL[a].F-i*e)):(e=(t.BL[a].I-t.BL[a].A6-t.BL[a].BV)/ZC.1k(t.HP["1X-9X"]),t.BL[a].OT=ZC.BN(0,t.BL[a].I-i*e)),ZC.2t(t.HP["9b-1z"])&&(t.BL[a].OT=0),t.BL[a].A6=t.BL[a].tk+t.BL[a].OT,t.A.E[t.BL[a].BD+"-c4-2a-4c"]=t.BL[a].A6,t.BL[a].X=ZC.BN(0,t.BL[a].A1-t.HP["1X-9X"]+1),t.BL[a].GV())},K1.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.AO.hZ.1h("1o.1z."+s.K+"."+BD,""+DF[BD]))}1j(i=0,A5=s.AY.A7.1f;i<A5;i++)if(1c!==ZC.1d(s.o[ZC.1b[11]][i])){1a i1=1c;1c!==ZC.1d(G=DF["1B-"+i])?i1=G:1c!==ZC.1d(G=DF["1B"+i])&&(i1=G),"xy"===s.AJ.3y||"yx"===s.AJ.3y?(s.H.o[ZC.1b[16]][s.L][ZC.1b[11]][i][ZC.1b[5]].1h(i1),!k7&&s.H.o[ZC.1b[16]][s.L][ZC.1b[11]][i][ZC.1b[5]].1f>ZC.1k(s.HP["1X-9X"])&&s.H.o[ZC.1b[16]][s.L][ZC.1b[11]][i][ZC.1b[5]].6u(0,1)):s.H.o[ZC.1b[16]][s.L][ZC.1b[11]][i][ZC.1b[5]]=[i1],ZC.p2&&p3&&(G=DF["1B"+i],"4j"==1y G&&(G=G.2M("###")),ZC.AO.hZ.1h("1o.1B."+s.K+".1B"+i,""+G)),(s.o[ZC.1b[11]][i][ZC.1b[5]].1f>p6||1===s.MH[1])&&(ZC.AO.C2("16L",s.A,s.HU(),DF),s.H.o[ZC.1b[16]][s.L][ZC.1b[11]][i][ZC.1b[5]]=[])}MV=s.p7()}("9p"===s.MJ||s.GB)&&(1===s.MH[1]&&(s.MH[1]=0),(MV<=oV||0===oV)&&(s.MJ="c4",ZC.cP(1n(){ZC.AK(s.A.K+"-3Y")&&(ZC.AO.C2("17R",s.H,s.HU(),s.o),s.1q(),s.3j(!0),s.UK(),s.1t(!0,!0))})))};if("7h"===hT||"js"===hT){1a E4=s.HP.3R;ZC.ga[s.K]=2u.5E(1n(){if(1===s.MH[0]||1===s.MH[1])if(s.A.MP(s),"7h"===hT){1a F8=["gs-3b"===s.A.N6?"go="+1A.cX():"",1o.iq?"k1="+s.H.AB:""].2M("&");ZC.A4.ao({1J:"bY",3R:E4,eg:1n(e){s.A.S7.1U||"7h-g9"!==s.A.N6||e.cV(ZC.1b[45],"cU, 8B cT dN 6P:6P:6P dM")},1U:F8,pn:"1E",4L:1n(){},aB:1n(e){jc(e)}})}1u if("()"===E4.2x(E4.1f-2)||"7s:"===E4.2x(0,11))4M{1a EG=E4.1F("7s:","").1F("()","");7t(EG)&&7t(EG).4v(s,1n(e){jc(e)},s.HU())}4K(e){}},P1)}1u"hR"===hT&&ZC.hR&&(s.H.SM[s.K]?"jd"===s.HP.9T&&(ZC.ga[s.K]=2u.5E(1n(){s.H.SM[s.K].8t("1o.hP")},P1)):(ws=1m pq(s.HP.3R,"1o"),ws.Gu=1n(){ws.8t("1o."+s.HP.1J),ws.8t("1o."+s.HP.9T),ws.8t("1o.qF"),"jd"===s.HP.9T&&ws.8t("1o.hP")},ws.Gs=1n(e){1!==s.MH[0]&&1!==s.MH[1]||jc(e.1U)},s.H.SM[s.K]=ws))}}},1o.pu=1n(e,t,i){1a a;2g.cO("zc-5O")&&(e="zc-5O"),"3b"==1y(i=i||{})&&(i=3g.1q(i));1a n=1o.7d(e);if(n){1a l=n.C7(i[ZC.1b[3]]);1Q(t){1i"181":l.MH[1]=1,0===l.MH[0]&&ZC.cP(1n(){l.1q(),l.3j(!0),l.UK(),l.1t(!0,!0)});1p;1i"17M":1l l.HP.dL;1i"188":ZC.AO.C2("18a",n,l.HU()),l.o.cR=l.o.cR||{},l.o.cR.dL=i.dL||1;1p;1i"jb":1===l.MH[0]&&(ZC.AO.C2("17J",n,l.HU()),l.MH[0]=0,1c!==ZC.1d(a=n.SM[l.K])&&a.8t("1o.jb"));1p;1i"qF":0===l.MH[0]&&(ZC.AO.C2("17g",n,l.HU()),l.MH[0]=1,1c!==ZC.1d(a=n.SM[l.K])&&a.8t("1o.qF"),ZC.cP(1n(){l.1q(),l.3j(!0),l.UK(),l.1t(!0,!0)}))}}1l 1c},ZC.AO.qJ=1n(e){1j(1a t={},i=[],a=0,n=(i="4j"==1y e?e:3g.1q(e)).1f;a<n;a++)if(1c!==ZC.1d(e=i[a])){t["p"+a]={};1a l=[];if("4j"==1y e)l=e;1u if("3b"==1y e&&/\\d+\\-\\d+/.5Y(e)){1a r=e.2o("-");if(2===r.1f){l=[];1j(1a o=ZC.1k(r[0]);o<=ZC.1k(r[1]);o++)l.1h(o)}}1u l=[e];1j(1a s=0,C=l.1f;s<C;s++)t["p"+a]["n"+l[s]]=!0}1l t},K1.5n.qG=1n(){1a e,t=1g;1c!==ZC.1d(e=t.o.aX)&&(t.CV=ZC.AO.qJ(e),t.o.aX=1c)},1o.qH=1n(e,t,i){1a a,n,l,r,o,s,C,A,Z;2g.cO("zc-5O")&&(e="zc-5O"),"3b"==1y(i=i||{})&&(i=3g.1q(i));1a c=1o.7d(e);if(c)1Q(t){1i"17i":if(n=c.C7(i[ZC.1b[3]])){1j(n.CV={},l=0,r=n.AY.A7.1f;l<r;l++)n.K5[l]=!1;n.HH=!0,n.gf(),n.JS(!0,!0)}1p;1i"17j":if(n=c.C7(i[ZC.1b[3]])){1j(s=[],l=0,r=n.AY.A7.1f;l<r;l++)if(s[l]=1c,1c!==ZC.1d(n.CV["p"+l])){1a p=[];1j(C in n.CV["p"+l])n.CV["p"+l].8d(C)&&n.CV["p"+l][C]&&p.1h(ZC.1k(C.1F("n","")));s[l]=p}1l s}1l{};1i"17k":1a u={};s=[],1c!==ZC.1d(a=i.aX)&&(u=ZC.AO.qJ(a)),(n=c.C7(i[ZC.1b[3]]))&&(n.CV=u,n.HH=!0,n.gf(),n.JS(!0,!0));1p;1i"9Z":1i"qO":1a h=[],1b=1n(e){1a i=!1;1c!==ZC.1d(a=e.a2)&&(i=ZC.2t(a));1a n=c.C7(e[ZC.1b[3]]);if(n){1j(l=0,r=n.AY.A7.1f;l<r;l++)n.K5[l]=!1;1a s=1c,p=1c;if(1c!==ZC.1d(a=e.3W))if("4j"==1y a)s=a;1u if("3b"==1y a&&/\\d+\\-\\d+/.5Y(a)){if(2===(o=a.2o("-")).1f)1j(s=[],Z=ZC.1k(o[0]);Z<=ZC.1k(o[1]);Z++)s.1h(Z)}1u s=[a];if(1c!==ZC.1d(a=e.5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g>1))){1a a,n,l,r=i.9N||i.2X.id,o=ZC.2t(t.BB.BQ.o.r6);ZC.2K&&t.H.A8&&t.H.A8.5d();1a s="1P";-1!==r.1L("-1W-b4")&&(s="1R"),t.L7(),i.6S();1a C=t.BB.IK;"1P"===s?C=t.BB.RA:"1R"===s&&(C=t.BB.Q2),t.A.KC&&(C="3r"),t.E["1W-7S-7W"]=s;1a A=ZC.1k(r.1F(t.K+"-1W-7J","").1F(t.K+"-1W-b4","").1F("-1N",""));if(t.o[ZC.1b[11]]&&t.o[ZC.1b[11]][A]){if(1c!==ZC.1d(e=t.o[ZC.1b[11]][A]["1W-1P"])){1a Z=e.3R||"",c=e.2X||"";""!==Z&&t.TZ(i,Z,c)}t.o[ZC.1b[11]][A].2h=!0}1a p,u,h,1b=t.AY.A7[A].TC(i);1Q(1b.2h=ZC.2t(t.E["1B"+A+".2h"]),ZC.AO.C2("18B"+s+"18C",t.A,1b),C){2q:1p;1i"5d":1i"3r":if(i.Er){1a d=0;1j(a=0,n=t.AY.A7.1f;a<n;a++)if(a!==A&&(l=++d===n-1,t.PC({"bx-1W":o,JS:l,3W:a,"a2-8f":C}),t.BB.SF))1j(p=0,u=t.H.AI.1f;p<u;p++)(h=t.H.AI[p]).BB&&h.BB.SF&&h.BB.fY===t.BB.fY&&h.K!==t.K&&h.PC({"bx-1W":!0,JS:l,3W:a,"a2-8f":C})}1u if(t.PC({"bx-1W":o,JS:1,3W:A,"a2-8f":C}),t.BB.SF)1j(p=0,u=t.H.AI.1f;p<u;p++)(h=t.H.AI[p]).BB&&h.BB.SF&&h.BB.fY===t.BB.fY&&h.K!==t.K&&h.PC({"bx-1W":!0,JS:1,3W:A,"a2-8f":C})}"5d"===C&&t.E.El&&(t.O1(),t.PW())}},ZC.A4("."+t.K+"-1W-1P-1N").4g("6l 4G",t.SZ).4g("fX",t.9m).4g("ad",t.9m),ZC.A4("."+t.K+"-1W-1R-1N").4g("6l 4G",t.SZ).4g("fX",t.9m).4g("ad",t.9m),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(e);1a t=1g;t.AF="8Z",t.AY=1m zL(t)}NL(){1l""}F7(e){1Q(e){1i"m":1l 1m YJ(1g)}}NY(){1a e=1g,t=e.F7("m","1z");t.BD="1z",t.K=e.K+"-1z",e.BL.1h(t),1D.NY()}}1O Eb 2j K1{2G(e){1D(e);1a t=1g;if(t.AF="7j",t.AJ.3y="7j",t.AY=1m zR(t),-1!==ZC.AT(t.A.K,"q4")){1j(1a i=1,a=0;a<t.A.MF.eA.1f;a++)i=ZC.BN(i,t.A.MF.eA[a][ZC.1b[5]].1f);i=1A.46(2m/i).ac(),1c===ZC.1d(t.A.MF.1B)?t.A.MF.1B={77:"1N"}:ZC.2E({77:"1N"},t.A.MF.1B),1c===ZC.1d(t.A.MF["1z-k"])?t.A.MF["1z-k"]={77:"3A",5D:"%v\\Fj",6p:"0:Gk:"+i}:ZC.2E({77:"3A",5D:"%v\\Fj",6p:"0:Gk:"+i},t.A.MF["1z-k"],!0)}}NL(){1l""}F7(e){1a t=1g;1Q(e){1i"m":1l 1m YJ(t);1i"k":1l 1m vx(t);1i"v":1l 1m w4(t)}}NY(){1a e=1g,t=e.F7("k","1z-k");t.BD="1z-k",t.K=e.K+"-1z-k",e.BL.1h(t);1a i=e.F7("v",ZC.1b[52]);i.BD=ZC.1b[52],i.K=e.K+"-1z-v",e.BL.1h(i);1a a=e.F7("m","1z");a.BD="1z",a.K=e.K+"-1z",e.BL.1h(a),1D.NY()}}1O Gm 2j ln{2G(e){1D(e);1a t=1g;t.AF="8m",t.AY=1m zQ(t),t.AJ[ZC.1b[55]]=!1}}1O Gr 2j l2{2G(e){1D(e);1a t=1g;t.AF="8h",t.AJ.3y="yx",t.AY=1m zP(t),t.AJ[ZC.1b[55]]=!1}}1O Gt 2j NO{2G(e){1D(e);1a t=1g;t.AF="5N",t.AY=1m zO(t),t.AJ[ZC.1b[55]]=!1,t.AJ["4S-1Z"]=!0}UQ(e){1a t=1g;if("v"===e){1a i=[];if(t.o[ZC.1b[11]]&&t.o[ZC.1b[11]].1f)1j(1a a=0;a<t.o[ZC.1b[11]].1f;a++)i.1h(t.o[ZC.1b[11]][a].1E||"15H "+(a+1));1l i}}F7(e){1Q(e){1i"x":1a t=1m TI(1g);1l t.DJ=!0,t;1i"y":1a i=1m T9(1g);1l i.DJ=!0,i.1C({7i:1,"7o-7i":!0}),i}}}1O Gg 2j NO{2G(e){1D(e);1a t=1g;t.AF="au",t.AY=1m Dh(t),t.AJ[ZC.1b[55]]=!1,t.AJ["4S-cl"]=!1,t.AJ["4S-1Z"]=!1}F7(e,t){1Q(e){1i"x":1a i=1D.F7(e,t);1l i.DJ=!0,i;1i"y":1a a=1D.F7(e,t);1l a.DJ=!0,a}}UQ(e){if("v"===e){1j(1a t=[],i=0;i<1g.o[ZC.1b[11]].1f;i++)t.1h("Fp "+(i+1));1l t}}1t(){1j(1a e=1g,t=0,i=e.BL.1f;t<i;t++)"v"===e.BL[t].AF&&(e.BL[t].AR=!e.BL[t].AR);1D.1t()}}1O Fo 2j NO{2G(e){1D(e);1a t=1g;t.AF="af",t.AY=1m zN(t),t.AJ[ZC.1b[55]]=!1,t.AJ["4S-cl"]=!1,t.AJ["4S-1Z"]=!1}UQ(e){if("v"===e){1j(1a t=[],i=0;i<1g.o[ZC.1b[11]].1f;i++)t.1h("Fp "+(i+1));1l t}}F7(e){1Q(e){1i"x":1a t=1m VD(1g);1l t.DJ=!0,t;1i"y":1a i=1m VG(1g);1l i.DJ=!0,i}}}1O Fq 2j NO{2G(e){1D(e);1a t=1g;t.AF="7Y",t.AY=1m zM(t),t.AJ[ZC.1b[23]]=!0,t.AJ[ZC.1b[55]]=!1,t.AJ["4S-1Z"]=!0,t.AJ[ZC.1b[56]]=!0}F7(e,t){1Q(e){1i"x":1a i=1D.F7(e,t);1l i.DJ=!0,i;1i"y":1l 1D.F7(e,t)}}}1O Fs 2j K1{2G(e){1D(e);1a t=1g;t.AF="8z",t.AJ.3y="8z",t.AY=1m zK(t)}NL(){1l""}F7(e){1a t=1g;1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e),1c!==ZC.1d(e=a.o[t].1J)&&(C=e);1a A=a.HJ(C,t);A.OL=A.AF+"1B",A.L=t,A.JR=t,a.C.A.B9.2w(A.o,["("+A.AF+").1B"]),A.ey&&a.C.A.B9.2w(A.o,["("+A.ey+").1B"]),a.C.A.B9.2w(A.o,["("+A.AF+").1B.8y"]),1c!==ZC.1d(e=a.A.o.1B)&&A.1C(e),A.1C(a.o[t]),A.CB=a.A.CB,A.1q(),a.A7.1h(A)}1a Z={},c=[],p=[],u={},h={},1b=0,d=0;1j(t=0,i=a.A7.1f;t<i;t++)if(1c!==ZC.1d(a.A.A.E["g-"+a.A.L+"-p-"+t+".2h"])&&(a.C.E["1B"+t+".2h"]=a.A.A.E["g-"+a.A.L+"-p-"+t+".2h"]),!a.A7[t].J3&&(a.C.E["1B"+t+".2h"]||"5d"===a.C.7T())){a.A7[t].CB?(-1===(d=ZC.AT(p,a.A7[t].DV))&&(p.1h(a.A7[t].DV),d=p.1f-1),1c===ZC.1d(c[d])?c[d]=[t]:c[d].1h(t)):(p.1h(-1),d=p.1f-1,1c===ZC.1d(c[d])?c[d]=[t]:c[d].1h(t));1a f=a.A7[t].AF;if(a.A7[t].o.1J&&f!==a.A7[t].o.1J){1a g=f.1L("3d"),B=a.A7[t].o.1J.1L("3d");(-1===g&&-1!==B||-1===g&&-1===B)&&(f=a.A7[t].o.1J)}-1!==ZC.AT(["2V","ek","fO"],f)&&(f="v"+f),-1===ZC.AT(["5x","6b","8m","8h","7Y","6U","7z"],f)||a.A7[t].J3||(1c===ZC.1d(u[f])&&(u[f]=[]),1c===ZC.1d(h[f])&&(h[f]=[]),a.A7[t].CB?(1c===ZC.1d(Z[a.A7[t].DV])?Z[a.A7[t].DV]=1:Z[a.A7[t].DV]++,-1===(1b=ZC.AT(h[f],a.A7[t].DV))&&(h[f].1h(a.A7[t].DV),1b=h[f].1f-1),1c===ZC.1d(u[f][1b])?u[f][1b]=[t]:u[f][1b].1h(t)):(h[f].1h(-1),1b=h[f].1f-1,1c===ZC.1d(u[f][1b])?u[f][1b]=[t]:u[f][1b].1h(t)))}if(a.KF=c,a.K6=u,a.XB)1j(1a v in a.XB)a.XB[v].3Z();1j(a.kU=[],t=0;t<a.KF.1f;t++)a.kU.1h(a.KF[t][a.KF[t].1f-1])}1t(){1a e=1g;1n t(i){1a a=e.LW[i];(e.A7[a].IH||e.A7[a].E3.1f&&e.A.BI||"2b"!==e.A7[a].J2)&&(e.H.OD=!1),e.lu=!0;1a n=e.C.7T();e.C.AJ["3d"]?e.C.E["1B"+a+".2h"]&&(e.A7[a].1t(),e.H.XX()):(e.C.E["1B"+a+".2h"]||"5d"===n)&&(1y e.C.E["1B-"+a+"-gB-nV"]!==ZC.1b[31]&&(e.A7[a].U4=0),e.A7[a].1t(),e.A7[a].U4=0,e.H.XX(),e.C.E["1B"+a+".2h"]||"5d"!==n||(e.C.E["1B"+a+".2h"]=!0,e.A.PC({3W:a,"bx-1W":!0}))),e.C.E["1B-"+a+"-gB-nV"]=!1,i<e.A7.1f-1?e.C.LT?ZC.qx[e.C.K]=2u.5E(1n(){t(i+1)},10):e.A7.1f<=100&&t(i+1):(!e.C.LT||e.C.LT&&e.lu)&&e.fI()}if(e.HQ=[],e.A7.1f>0)if(e.A7.1f>100&&!e.C.LT)1j(1a i=0;i<e.A7.1f;i++)t(i);1u t(0);1u e.fI()}fI(){1a e,t=1g;t.S9=1c,t.W2=1c;1j(1a i=0;i<t.C.BL.1f;i++)t.C.BL[i].EQ=1c,t.C.BL[i].X0=1c;1n a(e){1a i=0,a=e.1L(ZC.1b[35]),n=e.1L("-2r-",a);1l-1!==a&&-1!==n&&(i=e.5w(a+14,n-a-14)),1y t.A7[i].E["z-9I"]!==ZC.1b[31]?t.A7[i].E["z-9I"]:i}(e=ZC.AK(t.C.A.K+"-3e"))&&!t.H.es&&(-1===ZC.AT(["5g","6A","8m","8h","7j","6U","7z","9z","aZ","7a","h7","15t"],t.C.AF)&&1!==1o.qs||t.HQ.3Z(1n(e,i){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1B.3y&&(1c===ZC.1d(e.A.o.1B["3Q-2f"])&&(e.A.o.1B["3Q-2f"]=-90),e.o.3Z(1n(e,t){1l t[ZC.1b[5]][0]-e[ZC.1b[5]][0]})),e.U7=[],e.KN=[],e.PH=[],e.YO={},1D.1q();1j(1a t=0,i=e.A7.1f;t<i;t++)1j(1a a=0,n=e.A7[t].S.1f;a<n;a++)e.A7[t].S[a]&&e.A7[t].S[a]&&(e.C.E["1B"+t+".2h"]||"5d"===e.C.7T())&&0===e.A7[t].S[a].AE&&e.A7[t].UC&&(e.KN[a]+=.sL*e.KN[a]);e.l3()}}1O zL 2j LR{2G(e){1D(e);1g.KN=[],1g.PH=[]}HJ(){1l 1m U3(1g)}1q(){1a e=1g;e.KN=[],e.PH=[],1D.1q();1j(1a t,i=e.A.BK("1z"),a=i.iX+i.I/2,n=1,l=0,r=e.A7.1f;l<r;l++)if(e.C.E["1B"+l+".2h"]||"5d"===e.C.7T())1j(1a o=0,s=e.A7[l].S.1f;o<s;o++)if(e.A7[l].S[o]){1a C=e.A7[l].S[o];1c===ZC.1d(e.PH[o])&&(e.PH[o]=e.A7[l].DK);1a A=e.PH[o],Z=A+2m*C.AE/e.KN[o];e.PH[o]=Z,C.B2=A,C.BH=Z;1a c=C.FJ(!0);if(c&&"in"!==c.o[ZC.1b[7]]){1a p=ZC.1k((A+Z)/2);t=((p>=0&&p<=90||p>=3V&&p<=2m?i.iX+i.I-(c.I+25):i.iX+(c.I+25))-a)/ZC.EE(p),n=ZC.CT(n,2*t/i.I),t=i.F/2-(c.F/2+10),n=ZC.CT(n,2*t/i.F)}}n=ZC.BN(.15,ZC.CT(.85,n)),"3i"===i.o["2e-7e"]&&(i.o["2e-7e"]=i.JP=n)}}1O zR 2j LR{2G(e){1D(e),1g.hm={}}HJ(){1l 1m XW(1g)}1t(){1g.hm={},1D.1t()}}1O zQ 2j la{HJ(){1l 1m TQ(1g)}}1O zP 2j l9{HJ(){1l 1m TT(1g)}}1O zO 2j LR{HJ(){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ZC.AO.GN(A.A7[e].nB[i],n);1a h=c/(4*1A.5y(p/1A.PI));1n 1b(e,t){1a i=ZC.2l(e[0]-t[0]),a=ZC.2l(e[1]-t[1]);1l 1A.5y(i*i+a*a)}1a d,f,g,B=[],v=[],E=[],b=[],m=1c;1j(A.O0=[],e=0,t=u;e<t;e++)1j(B[e]||(B[e]=[]),v[e]||(v[e]=[],E[e]=[]),A.DW[e]||(A.DW[e]=[]),C=A.A7[e].S,b=A.A7[e+1]&&e+1<3?A.A7[e+1].S:A.A7[0].S,i=0,a=C.1f;i<a;i++){A.O0[i]||(A.O0[i]=[]),A.XV[i]||(A.XV[i]={}),C[i].X7=b[i].AE,0===e?(d=h*1A.5y(C[i].AE/1A.PI),f=h*1A.5y(C[i].X7/1A.PI),B[e][i]=h*ZC.AN.l8(C[i].AE,C[i].X7,C[i].X8),v[e][i]=C[i].iX-ZC.BN(d,f)/2,E[e][i]=C[i].iY+C[i].F/4):1===e?(B[e][i]=h*ZC.AN.l8(C[i].AE,C[i].X7,C[i].X8),v[e][i]=v[0][i]+B[0][i],E[e][i]=E[0][i],2===u&&(g=(v[0][i]-d-(Z.GI-(v[1][i]+f)))/2,A.A7[e-1].S[i].iX-=g,v[1][i]-=g,A.DW[0][i].x-=g,A.O0[i][0][0]-=g,A.A7[e-1].S[i].iY=Z.iY+Z.GD/2,E[1][i]=Z.iY+Z.GD/2,A.DW[0][i].y=Z.iY+Z.GD/2)):2===e&&(B[e][i]=h*ZC.AN.l8(C[i].AE,C[i].X7,C[i].X8),r=(B[0][i]*B[0][i]-B[1][i]*B[1][i]+B[2][i]*B[2][i])/(2*B[0][i]),v[e][i]=v[0][i]+r,o=1A.5y(B[2][i]*B[2][i]-r*r),E[e][i]=E[0][i]-o,3===u&&(g=(v[0][i]-d-(Z.GI-(v[1][i]+f)))/2,A.A7[0].S[i].iX-=g,A.A7[1].S[i].iX-=g,A.DW[0][i].x-=g,A.DW[1][i].x-=g,A.O0[i][0][0]-=g,v[2][i]-=g)),C[i].iX=v[e][i]+Z.iX,C[i].iY=E[e][i],C[i].I=h*1A.5y(C[i].AE/1A.PI),C[i].F=h*1A.5y(C[i].AE/1A.PI),C[i].AH=h*1A.5y(C[i].AE/1A.PI),1c===ZC.1d(m)&&(m=C[i].AE/(1A.PI*C[i].AH*C[i].AH));1a K=h*1A.5y(C[i].AE/1A.PI),D=h*1A.5y(C[i].X7/1A.PI),F=K+D-B[e][i],I=(2*F*D-F*F)/(2*(K+D-F)),X=F-I;if(A.DW[e][i]={x:v[e][i],y:E[e][i],sz:C[i].AH,r1:K,r2:D,eo:X,ep:I},0===e?(o=1A.5y(K*K-(K-I)*(K-I)),A.O0[i].1h([v[0][i]+K-I,E[0][i]-o])):2===e&&(K=A.DW[1][i].r1,D=A.DW[1][i].r2,X=A.DW[1][i].eo,I=A.DW[1][i].ep,l=ZC.U6(1A.nP((E[1][i]-E[2][i])/B[1][i]))-ZC.U6(1A.l7((K-I)/K)),A.O0[i].1h([v[1][i]-K*ZC.EE(l)-g,E[1][i]-K*ZC.EK(l)]),K=A.DW[2][i].r1,D=A.DW[2][i].r2,X=A.DW[2][i].eo,I=A.DW[2][i].ep,l=ZC.U6(1A.nP((E[0][i]-E[2][i])/B[2][i]))-ZC.U6(1A.l7((D-X)/D)),A.O0[i].1h([v[0][i]+D*ZC.EE(l)-g,E[0][i]-D*ZC.EK(l)])),e===u-1)if(3===u){if(1c!==ZC.1d(A.A7[0].j4[i]))A.XV[i].1N=A.A7[0].j4[i];1u{1a x=[-1],y=[-1];x[1]=1b(A.O0[i][0],A.O0[i][2]),x[2]=1b(A.O0[i][0],A.O0[i][1]),x[3]=1b(A.O0[i][2],A.O0[i][1]),y[1]=A.DW[0][i].sz,y[2]=A.DW[1][i].sz,y[3]=A.DW[2][i].sz;1a Y=.25*1A.5y((x[1]+x[2]+x[3])*(x[1]+x[2]-x[3])*(x[1]+x[3]-x[2])*(x[2]+x[3]-x[1]));1j(s=1;s<=3;s++)Y+=y[s]*y[s]*1A.nP(x[s]/(2*y[s]))-x[s]/4*1A.5y(4*y[s]*y[s]-x[s]*x[s]);A.XV[i].1N=m*Y}A.DW[0][i].fK=ZC.AN.gY(A.DW[0][i].x,A.DW[0][i].y,A.DW[1][i].x,A.DW[1][i].y,A.DW[0][i].r1-(A.DW[0][i].eo+A.DW[0][i].ep)/2),A.DW[1][i].fK=ZC.AN.gY(A.DW[1][i].x,A.DW[1][i].y,A.DW[2][i].x,A.DW[2][i].y,-(A.DW[1][i].r1-(A.DW[1][i].eo+A.DW[1][i].ep)/2)),A.DW[2][i].fK=ZC.AN.gY(A.DW[2][i].x,A.DW[2][i].y,A.DW[0][i].x,A.DW[0][i].y,-(A.DW[2][i].r1-(A.DW[2][i].eo+A.DW[2][i].ep)/2)),A.XV[i].xy=[(A.O0[i][0][0]+A.O0[i][1][0]+A.O0[i][2][0])/3,(A.O0[i][0][1]+A.O0[i][1][1]+A.O0[i][2][1])/3]}1u A.DW[0][i].fK=ZC.AN.gY(A.DW[0][i].x,A.DW[0][i].y,A.DW[1][i].x,A.DW[1][i].y,A.DW[0][i].r1-(A.DW[0][i].eo+A.DW[0][i].ep)/2),A.DW[1][i].fK=[-6H,-6H]}if(3===u)1j(e=0,t=u;e<t;e++)1j(n=ZC.AO.P5(A.A7[e].o[ZC.1b[17]],A.A7[e].o),1c!==ZC.1d(n[ZC.1b[12]])&&-1!==n[ZC.1b[12]]||(n[ZC.1b[12]]=0),i=0,a=A.A7[e].S.1f;i<a;i++)A.XV[i].1N=ZC.AO.GN(A.XV[i].1N,n);1D.1t()}}1O IE 2j I2{2G(e){1D(e);1a t=1g;t.C=e.A,t.H=t.C.A,t.u6={},t.J3=!1,t.T2=3,t.l4=1,t.W=[],t.LJ={},t.S=[],t.AF="",t.ey=1c,t.ID=1c,t.RR=!1,t.J2="2b",t.OC="1B",t.VF=!0,t.T7=1c,t.TE=1c,t.UF={},t.A2=1c,t.G6=1c,t.PY=1c,t.PQ=1c,t.BO=1c,t.L=-1,t.BL=[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(1c!==i.S[e].BY?i.GM[t].iX=i.S[e].iX=i.B1.AX(i.S[e].BY):i.GM[t].iX=i.S[e].iX=i.B1.H0(e),i.CB&&"100%"===i.KW?i.GM[t].iY=i.S[e].iY=i.CH.AX(100*i.S[e].CL/i.A.F5[e]["%6n-"+i.DV]):i.GM[t].iY=i.S[e].iY=i.CH.AX(i.S[e].CL)):(1c!==i.S[e].BY?i.GM[t].iY=i.S[e].iY=i.B1.AX(i.S[e].BY):i.GM[t].iY=i.S[e].iY=i.B1.H0(e),i.CB&&"100%"===i.KW?i.GM[t].iX=i.S[e].iX=i.CH.AX(100*i.S[e].CL/i.A.F5[e]["%6n-"+i.DV]):i.GM[t].iX=i.S[e].iX=i.CH.AX(i.S[e].CL)):i.GM[t].RX(),i.GM[t].JF=i.S[e].JF,i.GM[t]):1c}TD(e,t){1a i=1g;i.K7[e]||(i.K7[e]=[]),(!i.IT||i.IT&&-1===ZC.AT(i.K7[e],t))&&i.K7[e].1h(t)}FY(){1l 1m MG(1g)}o0(){1l{}}NF(){1l 1g.YS("6W","lo","i"),1g.C.A.B9.nW(-1!==1g.lo?1g.lo:1g.L,1g.C.AF)}N7(){1a e=1g;if(e.BO[4]){1a t,i={};1j(1a a in e.BO[4])-1===(t=a.1L("."))?1c===ZC.1d(e.o[a])&&(i[a]=!0,e.o[a]=e.BO[4][a]):a.2x(0,t)===e.AF&&(1c===ZC.1d(e.o[a.2x(t+1)])||i[a.2x(t+1)])&&(e.o[a.2x(t+1)]=e.BO[4][a])}}HV(e,t){1a i,a,n=1g,l=!1,r="";if("2b"!==n.J2&&(n.C.K5[n.L]||n.C.KV)){1a o=!(e.E[ZC.1b[73]]||e.E[ZC.1b[72]]);n.C.CV["p"+n.L]&&n.C.CV["p"+n.L]["n"+e.L]?1o.3J.ld&&o&&n.UF[ZC.1b[73]]?(a=n.UF[ZC.1b[73]],l=!0):(r=ZC.1b[73],(a=1m DP(n)).1S(t),e.E[ZC.1b[73]]?a.OU=e.E[ZC.1b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C.2E(n.o["3I-1R"],n.o["dq-1R"])),n.KW=n.C.KW,n.4C([["bx","J3","b"],["az","fu","b"],[ZC.1b[25],"SR","ia"],[ZC.1b[12],"DU","ia"],["1X-6k","HZ","i"],["2A","RU","b"],["nz","CB","b"],["7H-1J","KW"],["ni","RM","b"],["1E","AP"],["2H-1E","K3"],["1W-1E","nm"],["u7","ZA"],["7H","DV","i"],["z-2Z","JR","i"],["77","CS"],["4D","aT"],["16V","YE","f"],["1X-cZ","N0"],["1X-np","S6"],["gm-np","YD","b"],["dG-7i","Y9","i"],["1Z-7i-iG","YV","i"],["3R","E4"],["2X","FE"],[ZC.1b[14],"SB"],[ZC.1b[13],"RL"],["5L","fr","b"],["8c","fj"],["5L-dv","U5"],["8u-an","tw","b"],["Ci","SD"],["av","T8"],["zh","QM","b"],["5U","I8","b"],["5U-1W","LG","b"],["2N-4D","li"],["9I-fZ","VF","b"],["17b","LY","b"],["z5-2Z","RB","i"],["z5-2a","RW","i"],["zd","GB","b"],["z8","LI","i"],["nY","JG","f"],["aX-4D","J2"],["6d-16E","RR","b"],["1T-4D","OC"],["16b-6p","Z4","ia"]]),n.oK=n.RM,!n.E["za-1q"]){1a l;if(ZC.6x(n.T8),n.I8&&(1c===ZC.1d(n.C.o.1W)||1c===ZC.1d(n.C.o.1W["5U-1W"]))&&ZC.1d(1c===n.o["5U-1W"])&&(n.LG=n.I8),1c!==ZC.1d(e=n.o.8y))n.GB=!0,1c!==ZC.1d(t=e.z8)&&(0===(t+"").1L("lG")&&1c!==ZC.1d(l=ZC.b5[(t+"").2x(10)])&&(t=l),n.LI=ZC.1k(t),0===n.LI&&(n.GB=!1)),1c!==ZC.1d(t=e.nY)&&(0===(t+"").1L("lG")&&1c!==ZC.1d(l=ZC.b5[(t+"").2x(10)])&&(t=l),n.JG=ZC.1Y(t)),1c!==ZC.1d(t=e.z6)&&(n.LB=ZC.1Y(t)),1c!==ZC.1d(t=e.9T)&&(0===(t+"").1L("lG")&&1c!==ZC.1d(l=ZC.b5[(t+"").2x(10)])&&(t=l),n.LE=ZC.1k(t)),1c!==ZC.1d(t=e.16j)&&(0===(t+"").1L("lG")&&1c!==ZC.1d(l=ZC.b5[(t+"").2x(10)])&&(t=l),n.U4=ZC.1k(t)),1c!==ZC.1d(t=e.16k)&&(n.FU=t);1j(1a r in n.JG<10&&(n.JG*=5I),n.LB<10&&(n.LB*=5I),1y PN!==ZC.1b[31]&&(n.JG=ZC.BN(PN.UG,n.JG)),("8u"===n.aT||1y PN===ZC.1b[31]||1o.4F.b5)&&(n.GB=!1),n.H.es&&(n.GB=!1),-1!==ZC.AT(["1w","1N","5x","6b","7Y","6v","5g","7j","5N"],n.AF)&&("8u"===n.aT?n.IT=!0:"5j"===n.aT||n.GB||-1!==3g.5b(n.o).1L(\'"an"\')||-1!==3g.5b(n.o).1L(\'"js-c8"\')||0!==n.T8.1f||-1!==n.H.E.4H.1L(\'"7f"\')||-1!==n.H.E.4H.1L(\'"Ci"\')||"2b"!==n.J2?n.IT=!1:n.IT=!0),n.o)if("1U-"===r.2x(0,5)){1a o=r.2x(5);n.LJ[o]=n.o[r]}1a s=n.H.B9;if(n.ID=1m CX(n),n.ID.1C(n.o),s.2w(n.ID.o,v(ZC.1b[71])),n.ID.1C(n.o[ZC.1b[71]]),1c!==ZC.1d(n.o[ZC.1b[71]])||"1w"!==n.AF&&"1N"!==n.AF||(n.ID.AM=!1),n.I8&&(n.SE=1m CX(n),s.2w(n.SE.o,v("5U-3X")),n.SE.1C(n.o),1c!==ZC.1d(e=n.o["5U-3X"])&&n.SE.1C(e),1c===ZC.1d(n.SE.o.3K)&&(n.SE.o.3K=!0)),1c!==ZC.1d(e=n.o[ZC.1b[73]])&&(n.T7=1m CX(n),s.2w(n.T7.o,v(ZC.1b[73])),n.T7.1C(e)),1c!==ZC.1d(e=n.o[ZC.1b[72]])&&(n.TE=1m CX(n),s.2w(n.TE.o,v(ZC.1b[72])),n.TE.1C(e)),n.A2=1m CX(n),s.2w(n.A2.o,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*e.E["z-5u"]+e.E["z-5u"],"z")).K=e.K+"-1P-",t.CG.2P(l)}}}gc(){if(1g.S)1j(1a e=0;e<1g.S.1f;e++)1g.S[e]&&1g.S[e].A&&ZC.AO.gc(1g.S[e],["Z","C6","o","JW","I4","A","C","H","N","NK"]);ZC.AO.gc(1g,["W","S","GM","K7","VJ","A8","Z","C6","V5","A2","UD","HB","G6","ID","KI","QL","B1","CH","S","GM","K7","JX","o","JW","I4","A","C","H"])}}1O WV 2j IE{2G(e){1D(e);1a t=1g;t.zT=!0,t.AF="xy",t.BL=[ZC.1b[50],ZC.1b[51]]}1t(){1D.1t()}}1O R5 2j WV{2G(e){1D(e);1a t=1g;t.AF="1w",t.CS="ab",t.Y=1,t.SU="6s",t.VJ=[],t.QF=!1,t.OZ=!1}FY(){1l 1m tI(1g)}1q(){1a e=1g;e.BO=e.NF(),e.C0=e.BO[0],e.B7=e.BO[1],e.N7(),1D.1q(),e.4C([["7i-4c","SU"],["gk-dG","QF","b"]]),e.B1=e.C.BK(e.BT("k")[0]),e.CH=e.C.BK(e.BT("v")[0])}1t(){1a e,t,i,a,n,l,r,o=1g;1D.1t(),o.VJ=[];1a s=o.OZ;if(o.KI=o.CK("bl",0),o.QL=ZC.P.E5(o.CK("bl",1),o.H.AB),!o.IT||o.C.AJ["3d"])o.OB(),o.D=1c;1u{o.VQ(),o.C6=o.CK("bl",0);1a C=!0;(1c!==ZC.1d(o.A2.o.2h)&&!ZC.2t(o.A2.o.2h)||1c!==ZC.1d(o.A.o.1J)&&"2b"===o.A2.o.1J)&&(C=!1);1a A=[],Z=[],c=[],p=!0,u=0,h=1c;a=0;1a 1b=-1,d=-1,f=o.A.A7[0].SD&&o.A.A7[0].SD.1f,g=o.Y,B=o.CS;if(o.Y>1&&"5a"===B&&(B="ab"),o.B1.EC&&o.EC){1j(i=o.Y,e=0,t=o.S.1f;e<t;e+=i)d-e<=o.Y&&(i=ZC.BN(1,d-e)),o.S[e]&&(o.B1.IQ.1f>0||ZC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0,t.op=!1,t.ZL=-1,t.CC=.1,t.CN=.1,t.EW=0,t.UC=!1,t.M6=[],t.PV="bg",t.mz=!0,t.QF=!1}1q(){1a e=1g;if(e.BO=e.NF(),e.C0=e.BO[0],e.B7=e.BO[1],e.BU=e.BO[1],e.A0=e.BO[1],e.AC=e.BO[2],e.N7(),1D.1q(),"18j"===e.CS&&(e.F1=e.CC=e.CN=0),e.4C([["6d-ko","mz","b"],["4m-cN","UC","b"],["2a-6p","M6"],["2V-8w","F1","fp"],["2V-1s","D1","fp"],["8b-1s","op","b"],["2V-1X-1s","ZL","fp"],["ko-8w-1K","CC","fp"],["ko-8w-2z","CN","fp"],["ko-iQ","EW","fp"],["gk-dG","QF","b"]]),e.mz||(e.EW=1),0===e.F1&&0===e.CC&&0===e.CN&&(e.FB=!1),e.B1=e.C.BK(e.BT("k")[0]),e.CH=e.C.BK(e.BT("v")[0]),1c!==ZC.1d(e.o.94)){1a t=e.o.94.2o("/");if(2===t.1f){1a i=ZC.1k(t[0]),a=ZC.1k(t[1]),n=e.CC;e.CC>=1&&(n=e.CC/e.B1.A9);1a l=e.CN;e.CN>=1&&(l=e.CN/e.B1.A9);1a r=1-n-l,o=ZC.4w(r/(3*a+1));e.CC=n+o+3*(i-1)*o,e.CN=1-e.CC-2*o}}}PO(){1a e,t=1g;if(t.RT)1l t.RT;if(t.o["8u-15R"]&&t.A.A7[0].RT)1l t.A.A7[0].RT;t.op&&(t.4C([["2V-1s","D1","fp"]]),t.D1=1A.46((t.B1.D8?t.B1.F:t.B1.I)*(t.D1/(t.B1.BS-t.B1.B8))));1a i,a=t.B1.A9*t.Y,n=0;1j(t.A.K6[t.AF]=t.A.K6[t.AF]||[],e=0;e<t.A.K6[t.AF].1f;e++){1a l=t.A.K6[t.AF][e][0];t.A.A7[l].BL[0]===t.BL[0]&&n++}if(t.LY)1j(n=0,e=0;e<t.A.A7.1f;e++)"2V"===t.A.A7[e].u9&&(n=ZC.BN(n,t.A.A7[e].S.1f));if(1c===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e)}}}1O S4 2j WV{2G(e,t){1D(e),1g.AF=t||"5g",1g.WB=1c,1g.WF=1c,1g.kV=1,1g.JP=1,1g.or="1N",1g.PV="ls"}FY(){1l 1m Ew(1g)}1q(){1a e=1g;e.BO=e.NF(),e.C0=e.BO[0],e.A0=e.BO[2],e.AC=e.BO[1],e.B7=e.BO[2],e.BU=e.BO[2],e.N7(),1D.1q(),e.4C([["2k-2e","WB","i"],["1X-2e","WF","i"],["16A","or"],["Br-6d","kV","i"],["2e-7e","JP","f"]]),e.B1=e.C.BK(e.BT("k")[0]),e.CH=e.C.BK(e.BT("v")[0]),1c===ZC.1d(e.WB)&&(e.WB=15),1c===ZC.1d(e.WF)&&(e.WF=.75*1A.2k(e.B1.A6,e.B1.BV,e.CH.A6,e.CH.BV),e.WF=ZC.BN(25,ZC.CT(50,e.WF)))}j9(e){1a t,i=1g,a=1c;1Q(e=ZC.BN(e,i.RP),t=i.X9===i.RP?e-i.RP:(e-i.RP)/(i.X9-i.RP),i.or){1i"9y":a=i.WB+i.JP*(i.WF-i.WB)*t;1p;1i"1N":1i"5y":a=i.WB+i.JP*(i.WF-i.WB)*1A.5y(t)}1l ZC.BN(i.WB,a)}1t(){1a e=1g;if(1D.1t(),e.KI=e.CK("bl",0),1c!==ZC.1d(e.WF)){e.X9=-ZC.3u,e.RP=ZC.3u;1j(1a t=e.A.A7,i=0,a=t.1f;i<a;i++)if(t[i].kV===e.kV)1j(1a n=0,l=t[i].S.1f;n<l;n++)e.X9=ZC.BN(e.X9,ZC.2l(t[i].S[n].SW)),e.RP=ZC.CT(e.RP,ZC.2l(t[i].S[n].SW))}e.OB(!0)}}1O WQ 2j IE{2G(e){1D(e);1a t=1g;t.AF="3P",t.BL=["1z",ZC.1b[52],"1z-r"],t.Q4=0,t.DK=0,t.UC=!1,t.mo=!0,t.C1=1c,t.PV="bg"}FY(){1l 1m Fi(1g)}1q(){1a e,t,i=1g;1c===ZC.1d(i.o[ZC.1b[17]])&&(i.o[ZC.1b[17]]={}),"9f"!==i.A.A.o.1J&&"oD"!==i.A.A.o.1J||(i.Q4=.35),i.BO=i.NF(),i.C0=i.BO[0],i.A0=i.BO[1],i.AC=i.BO[2],i.BU=i.BO[0],i.B7=i.BO[0],i.N7(),1D.1q(),i.C1=1m CX(i),i.C.A.B9.2w(i.C1.o,["2Y.1B.1V-3F.8W",i.AF+".1B.1V-3F.8W"]),1c!==ZC.1d(e=i.C.o.1B)&&1c!==ZC.1d(e[ZC.1b[17]])&&1c!==ZC.1d(t=e[ZC.1b[17]].8W)&&i.C1.1C(t),i.C1.1C(i.o[ZC.1b[17]].8W),i.4C([["2a","DQ","fp"],[ZC.1b[8],"Q4","fp"],["4m-cN","UC","b"],["sA","mo","b"],["3Q-2f","DK","i"]]),i.DK%=2m;1j(1a a=0,n=i.S.1f;a<n;a++)i.S[a]&&(i.S[a].CJ=i.Q4,i.S[a]&&(i.C.E["1B"+i.L+".2h"]||"5d"===i.C.7T())&&(1c===ZC.1d(i.A.KN[a])&&(i.A.KN[a]=0),i.A.KN[a]+=ZC.1Y(i.S[a].AE)))}1t(){1a e=1g;1D.1t(),e.KI=e.CK("bl",0),e.OB(!0)}}1O U3 2j IE{2G(e){1D(e);1a t=1g;t.AF="8Z",t.BL=["1z"],t.UJ=0,t.SV=0,t.DK=0,t.C1=1c,t.PV="bg",t.eN=1c}FY(){1l 1m yK(1g)}1q(){1a e,t,i=1g;i.BO=i.NF(),i.C0=i.BO[0],i.A0=i.BO[1],i.AC=i.BO[2],i.BU=i.BO[0],i.B7=i.BO[0],i.N7(),1D.1q(),i.U&&(i.C1=1m CX(i),i.C.A.B9.2w(i.C1.o,["2Y.1B.1V-3F.8W",i.AF+".1B.1V-3F.8W"]),1c!==ZC.1d(e=i.C.o.1B)&&1c!==ZC.1d(e[ZC.1b[17]])&&1c!==ZC.1d(t=e[ZC.1b[17]].8W)&&i.C1.1C(t),i.C1.1C(i.o[ZC.1b[17]].8W)),i.4C([["7u-4c","UJ","fp"],["2a","UJ","fp"],[ZC.1b[8],"UJ","fp"],["Aq-8w","SV","fp"],["3Q-2f","DK","i"],["Aq-16v","eN"]]),i.DK%=2m;1j(1a a=0,n=i.S.1f;a<n;a++)i.S[a]&&(i.C.E["1B"+i.L+".2h"]||"5d"===i.C.7T())&&(1c===ZC.1d(i.A.KN[a])&&(i.A.KN[a]=0),i.A.KN[a]+=ZC.1Y(i.S[a].AE))}1t(){1a e=1g;1D.1t(),e.KI=e.CK("bl",0),e.OB(!0)}}1O XW 2j IE{2G(e){1D(e);1a t=1g;t.AF="7j",t.T2=3,t.BL=["1z-k",ZC.1b[52],"1z"],t.HX=.5,t.CS="1w",t.sF=1c,t.XU=!1,t.D=[],t.AG=[]}FY(){1l 1m uQ(1g)}1q(){1a e=1g;e.BO=e.NF(),e.C0=e.BO[0],e.B7=e.BO[1],e.A0=e.BO[3],e.AC=e.BO[3],e.N7(),1D.1q(),e.kM(),e.4C([["6K-1N","XU","b"],["2n-1N","HX","f",0,1],["2f-8w","sF","f"]]),e.B1=e.C.BK("1z-k"),e.CH=e.C.BK(ZC.1b[52]),"5A"===e.CS&&(e.aT="5j",e.IT=!1)}1t(){1a e=1g;1D.1t(),e.B1.W.1f===e.W.1f&&-1===ZC.AT(e.W,1c)||(e.aT="5j",e.IT=!1),e.KI=ZC.AK(e.C.K+"-1B-"+e.L+"-bl-0-c"),e.lM=ZC.P.E5(e.CK("bl",0),e.H.AB),e.QL=ZC.P.E5(e.CK("bl",2),e.H.AB),e.OB(!0)}}1O nZ 2j h9{2G(e){1D(e);1a t=1g;t.F1=.2,t.CC=.28,t.CN=.28,t.EW=0,t.FI=1c,t.du=[],t.Q9=[],t.Bo=!0,t.PV="bg"}o0(e){1a t;if("7n"===e){if(1c!==ZC.1d(t=1g.FI.o.2H))1l t;if(1c!==ZC.1d(t=1g.FI.o["2H-1E"]))1l{1E:t}}1l{}}1q(){1a e,t=1g;if(t.BO=t.NF(),1D.1q(),1c!==ZC.1d(t.du=t.o.hj))1j(1a i=0,a=t.du.1f;i<a;i++)1c!==ZC.1d(t.du[i])?"3b"==1y t.du[i]?t.Q9[i]=ZC.AT(t.CH.JK,t.du[i]):t.Q9[i]=ZC.1Y(t.du[i]):t.Q9[i]=1c;t.FI=1m I2(t),t.FI.1S(t),t.FI.1C({"1T-1r":t.BO[3]}),t.FI.o["2H-1E"]="%2r-7n-1V",t.H.B9.2w(t.FI.o,["("+t.AF+").1B.7n"],!0,!0),1c!==ZC.1d(e=t.o.7n)&&t.FI.1C(e),t.FI.1q()}}1O TQ 2j nZ{2G(e){1D(e),1g.AF="8m"}FY(){1l 1m vG(1g)}}1O TT 2j nZ{2G(e){1D(e),1g.AF="8h"}FY(){1l 1m vN(1g)}}1O XY 2j WV{2G(e){1D(e);1a t=1g;t.AF="5N",t.CS="2n",t.sp="1B-1X",t.QG=.2,t.VC=1,t.PV="bg"}FY(){1l 1m vf(1g)}1q(){1a e=1g;e.BO=e.NF(),e.C0=e.BO[0],e.B7=e.BO[1],e.BU=e.BO[1],e.A0=e.BO[2],e.AC=e.BO[1],e.N7(),1D.1q(),e.4C([["2k-fV","QG","f",0,1],["1X-fV","VC","f",0,1],["d3","sp",""]]),e.QG>=e.VC&&(e.QG=.2,e.VC=1),e.B1=e.C.BK(e.BT("k")[0]),e.CH=e.C.BK(e.BT("v")[0])}1t(){1a e=1g;1D.1t(),e.KI=e.CK("bl",0),e.kf=e.kh=-ZC.3u,e.YT=e.WY=ZC.3u,e.sM=e.ti=0;1j(1a t=0,i=e.A.A7.1f;t<i;t++)1j(1a a=e.A.A7[t],n=0,l=a.S.1f;n<l;n++)if(a.S[n]){1a r=ZC.1Y(a.S[n].AE);a.L===e.L&&(e.kf=ZC.BN(e.kf,r),e.YT=ZC.CT(e.YT,r),e.sM+=r),e.kh=ZC.BN(e.kh,r),e.WY=ZC.CT(e.WY,r),e.ti+=r}e.OB()}}1O WX 2j WV{2G(e){1D(e);1a t=1g;t.L5=.1,t.NS=.1,t.M3=0,t.jP="4O",t.P3=[],t.W5=[],t.PV="bg"}1q(){1a e,t,i,a,n=1g;if(n.BO=n.NF(),n.C0=n.BO[0],n.B7=n.BO[1],n.BU=n.BO[1],n.A0=n.BO[2],n.AC=n.BO[1],n.N7(),1D.1q(),n.4C([["4c-1s","jP"],["2k-8g","M3","fp"],["8w-8s","L5","fp"],["8w-8g","NS","fp"],["2a","L5","fp"],["2a","NS","fp"]]),1c!==ZC.1d(i=n.o.8s))1j(i 3E 3M||(i=[i]),e=0,t=i.1f;e<t;e++){1a l=1m DR(n);l.o=i[e],l.1q(),n.P3.1h(l)}if(1c!==ZC.1d(a=n.o.8g))1j(a 3E 3M||(a=[a]),e=0,t=a.1f;e<t;e++){1a r=1m DR(n);r.o=a[e],r.1q(),n.W5.1h(r)}n.B1=n.C.BK(n.BT("k")[0]),n.CH=n.C.BK(n.BT("v")[0])}1t(){1a e=1g;1D.1t(),e.KI=e.CK("bl",0),e.OB()}}1O VR 2j WX{2G(e){1D(e),1g.AF="au"}FY(){1l 1m va(1g)}}1O VO 2j WX{2G(e){1D(e),1g.AF="af"}FY(){1l 1m uh(1g)}}1O VU 2j h9{2G(e){1D(e);1a t=1g;t.AF="7Y",t.CS="wi",t.N2={2e:0},t.PV="bg"}FY(){1l 1m uf(1g)}1q(){1D.1q()}1t(){1D.1t(),1g.9u()}9u(){1a e=1g,t=e.C.BK(e.BT("v")[0]),i=t.AX(t.H5);if(e.C.BI&&e.C.BI.IO&&e.RU){1j(1a a=e.C.Q,n=e.C.BI,l=[],r=[],o=!0,s=0,C=e.S.1f;s<C;s++)if(1c!==ZC.1d(e.S[s])&&1c!==ZC.1d(e.S[s].DL[2])){1a A=t.AX(e.S[s].DL[2]);o&&(r.1h([e.S[s].iX,i]),o=!1),l.1h([e.S[s].iX,A]),r.1h([e.S[s].iX,A])}r.1f&&r.1h([r[r.1f-1][0],i]);1a Z=e.ag(r),c=e.o.2A||{};if("1N"===(c.1J||"1N")){1a p=1m DR(e.A);p.1S(e),p.1C({"1T-1r":e.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.RM&&5*(i.B1.A1-i.B1.X)>l&&(i.Y=ZC.1k(5*(i.B1.A1-i.B1.X)/l));1a r=i.B1.EC;if(r&&i.QB[0]===ZC.3u&&i.QB[1]===-ZC.3u&&(r=!1),r)1j(e=0,t=i.S.1f;e<t;e++)i.S[e]&&ZC.DT(i.S[e].BY,i.B1.W[i.B1.X],i.B1.W[i.B1.A1])&&(i.S[e].Z=i.KI,i.S[e].MS="2k",i.S[e].1t(),i.S[e].MS="1X",i.S[e].1t(),4t i.S[e].E["cc.2Z"]);1u 1j(e=i.B1.X;e<=i.B1.A1;e+=i.Y)i.S[e]&&(i.S[e].MS="2k",i.S[e].1t(),i.S[e].MS="1X",i.S[e].1t(),4t i.S[e].E["cc.2Z"])}1t(){1a e=1g;1D.1t(),e.KI=e.CK("bl",0),e.lM=ZC.P.E5(e.CK("bl",1),e.H.AB),e.QL=ZC.P.E5(e.CK("bl",2),e.H.AB),e.OB(),e.D=1c,e.D3=1c,e.gu=1c,e.SJ=1c}}1O XT 2j WQ{2G(e){1D(e);1g.AF="7a",1g.NQ=-1}1q(){1D.1q(),1g.4C([["s5","NQ","ia"]])}FY(){1l 1m yk(1g)}}1O UZ 2j R1{2G(e){1D(e),1g.AF="6U"}FY(){1l 1m xq(1g)}1q(){1a e=1g;1D.1q(),1c===ZC.1d(e.o[ZC.1b[61]])&&(e.BU=e.BO[0]),1c===ZC.1d(e.o["1w-1r"])&&(e.B7=e.BO[0])}1t(){1D.1t(),1g.kK()}}1O WO 2j R6{2G(e){1D(e),1g.AF="7z"}FY(){1l 1m wT(1g)}1q(){1a e=1g;1D.1q(),1c===ZC.1d(e.o[ZC.1b[61]])&&(e.BU=e.BO[0]),1c===ZC.1d(e.o["1w-1r"])&&(e.B7=e.BO[0])}}1O V2 2j R5{2G(e){1D(e),1g.AF="92"}FY(){1l 1m yn(1g)}1q(){1a e=1g;1D.1q(),1c===ZC.1d(e.o[ZC.1b[61]])&&(e.BU=e.BO[1])}1t(){1D.1t(),1g.k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",S2],["%kv",PU],["%k",PU],["%2r-1V",CI],["%v",CI],["%2r-Cq-1V",s.AE],["%V",s.AE],["%2r-2Z",s.L],["%2r-x",s.iX],["%2r-y",s.iY],["%aI-1s",s.H.I],["%aI-1M",s.H.F],["%i",s.L],["%n",s.L],["%2r-gp",s.A.S.1f],["%N",s.A.S.1f]);1a Cr=8S["%1B-80"],gv=Cr+"",Cs=8S["%1B-dD"],gw=Cs+"",tu=ZC.1Y(8E.F5["%ba-"+s.L+"-"+s.A.DV+"-80"]||"0"),kr=tu+"",Cv=ZC.1Y(tu/8E.F5["%ba-"+s.L+"-"+s.A.DV+"-7H-1f"]),ks=5Q(Cv),Cn=5Q(8E.F5["%ba-"+s.L+"-"+s.A.DV+"-7H-1f"]),u2=0;1c!==ZC.1d(8E.F5)&&1c!==ZC.1d(8E.F5[s.L])&&(u2=ZC.1Y(8E.F5[s.L]["%6n-"+s.A.DV]||"0"));1a km=u2+"";gv=ZC.AO.GN(gv,BF),gw=ZC.AO.GN(gw,BF),km=ZC.AO.GN(km,BF),kr=ZC.AO.GN(kr,BF),ks=ZC.AO.GN(ks,BF),CQ.1h(["%2r-4L-8k",s.E["2r-4L-8k"]],["%2r-4L-rT",s.E["2r-4L-rT"]],["%7H-6n",kr],["%7H-dD",ks],["%7H-1f",Cn],["%6n",km],["%1B-2k-2Z",8S["%1B-2k-2Z"]],["%16R",8S["%1B-2k-2Z"]],["%1B-1X-2Z",8S["%1B-1X-2Z"]],["%16Q",8S["%1B-1X-2Z"]],["%1B-2k-1V",8S["%1B-2k-1V"]],["%16P",8S["%1B-2k-1V"]],["%1B-1X-1V",8S["%1B-1X-1V"]],["%16O",8S["%1B-1X-1V"]],["%1B-80",gv],["%16N",gv],["%1B-dD",gw],["%16M",gw],["%1B-6p",8S["%1B-6p"]],["%pv",8S["%1B-6p"]]);1a Cx=100*s.AE/8S["%1B-80"],Z1=Cx+"";1c!==ZC.1d(BF[ZC.1b[12]])&&(Z1=ZC.AO.GN(Z1,BF)),CQ.1h(["%1B-8i",Z1],["%16K",Z1]);1a ua=!1,WR,AV,J,BZ;1j(i=0,A5=CQ.1f;i<A5;i++)if("%8l"===CQ[i][0]){ua=!0;1p}if(!ua&&1c!==ZC.1d(s.A.A.F5)&&1c!==ZC.1d(s.A.A.F5[s.L])){1a JO=100*s.AE/s.A.A.F5[s.L]["%6n-"+s.A.DV],HN=JO+"";1c!==ZC.1d(BF[ZC.1b[12]])&&(HN=ZC.AO.GN(HN,BF)),CQ.1h(["%2r-8i-1V",HN],["%8l",HN])}1j(i=0;i<UE.1f;i++)CQ.1h(["%1B-1E-"+i,UE[i]],["%t"+i,UE[i]]);1j(CQ.1h(["%1B-1E",WN],["%t",WN],["%1B-u7",s.A.ZA],["%1B-2Z",s.A.L],["%p",s.A.L],["%1B-gp",8E.A7.1f],["%P",8E.A7.1f],["%id",s.H.K],["%4y",s.C.K.1F(s.H.K+"-2Y-","")]),-1!==AP.1L("%8c")&&(OX&&"cK"===BF.8c?(CQ.1h(["%8c","-"]),OX=!1):CQ.1h(["%8c",""])),CQ.1h(["%2r-x",s.iX],["%2r-y",s.iY],["%2r-1s",s.I],["%2r-1M",s.F],["%2r-2e",s.E["1R.2e"]||1]),1o.3J.Bw&&CQ.3Z(ZC.k6),7F=1m 5v("\\\\(([^(]+?)\\\\)\\\\(([0-9]*)\\\\)(\\\\(*)([0-9]*)(\\\\)*)");D2=7F.3n(AP);){WR="";1a CO=s.A.L,D6=s.L;""!==(G=D2[2])&&(CO=ZC.1k(G)),""!==(G=D2[4])&&(D6=ZC.1k(G)),1c!==(J=8E.A7[CO])&&(AV=J.FQ(D6,3),1c!==AV&&(WR=AV.EX(D2[1],EO))),AP=AP.1F(D2[0],WR)}if(-1!==AP.1L("%Bz-")){7F=1m 5v("%Bz-([a-zA-Z0-9-]+)");1j(1a ly=s.8a();D2=7F.3n(AP);)1c!==ZC.1d(ly[D2[1]])&&1c!==ZC.1d(s[ly[D2[1]]])&&(AP=AP.1F(D2[0],s[ly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6p("===a.2x(0,7)){1a Z=a.2x(7,a.1f).1F(")","").2o(",");-1!==ZC.AT(Z,l.AE)&&(r.AM=!0)}1u{1a c=a.2o(","),p={2k:"%1B-2k-1V",1X:"%1B-1X-1V",gB:"%1B-2k-2Z",7S:"%1B-1X-2Z"};1j(1a u in p)-1!==ZC.AT(c,u)&&(("gB"!==u&&"7S"!==u||l.L!==l.A.JX[p[u]])&&("2k"!==u&&"1X"!==u||l.AE!==l.A.JX[p[u]])||("4j"==1y A&&1c!==ZC.1d(A[u])&&(r.o.1E=A[u],r.1q()),r.AM=!0));-1!==ZC.AT(c,"4s")&&(r.AM=!0)}}}if(l.C.E["1B"+l.A.L+".2h"]||(r.E["2O-3N"]="2b"),e)1l r;if(r.AM&&1c!==ZC.1d(r.AP)&&""!==r.AP){1a h=l.HC(r);r.E.rZ=h,r.iX=h[0],r.iY=h[1];1a 1b={};if(-1!==r.iX&&-1!==r.iY){1a d=!1;if(1c!==ZC.1d(r.o.iQ)&&!ZC.2t(r.o.iQ)){1b={x:r.iX,y:r.iY,1s:r.I,1M:r.F};1j(1a f=0,g=l.A.A.YX.1f;f<g;f++)if(ZC.AN.Y4(1b,l.A.A.YX[f])){d=!0;1p}}d||(l.C.E["1B"+l.A.L+".2h"]||(r.E["2O-3N"]="2b"),r.E.s6="vb"+l.C.L,r.1t(),r.E9(),l.A.A.YX.1h(1b),!r.KC&&ZC.AK(l.H.K+"-3e")&&l.A.A.HQ.1h(ZC.AO.OA(l.C.K,r)))}}1l r}}}Gq(e){if(1c!==ZC.1d(e.o[ZC.1b[19]])){1a t=ZC.IL(e.o[ZC.1b[19]]);t<=1&&(t=1g.I*t),e.I=t}if(1c!==ZC.1d(e.o[ZC.1b[20]])){1a i=ZC.IL(e.o[ZC.1b[20]]);i<=1&&(i=1g.I*i),e.F=i}1l e}HC(e){1a t,i=1g,a=i.C.BK(i.A.BT("v")[0]),n=i.AE>=a.LH&&!a.AR||i.AE<a.LH&&a.AR?-1:1,l="3i";if(1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B(B)]=o.N[E7.GK[ZC.EB(B)]];if(1c===ZC.1d(o.C.EM)&&(o.C.EM={}),1c!==ZC.1d(o.C.EM[o.A.L+"-"+o.L]))1j(B in o.C.EM[o.A.L+"-"+o.L])u[E7.GK[ZC.EB(B)]]=o.C.EM[o.A.L+"-"+o.L][B];o.C.EM[o.A.L+"-"+o.L]={},ZC.2E(h,o.C.EM[o.A.L+"-"+o.L]);1a b=1m E7(u,h,o.A.JG,o.A.LB,E7.RQ[o.A.LE],1n(){c()});b.AV=o,b.OG=1n(){o.MO(ZC.P.E5(o.A.CK("bl",0),o.H.AB))},o.L4(b)}1u{1a m="3A"===l.DN?"3A":"2R";if(o.A.HI){1a K=1n(t,i){1a a=t.jy(!1),n=o.iX,r=o.iY;if(e){1a s=1m CA(o.C,n-ZC.AL.DZ,r-ZC.AL.E0,o.A.E["z-4c"]||0);n=ZC.4w(s.E8[0]),r=ZC.4w(s.E8[1]),o.E["dm"]=[n,r]}a.4l("5G","6Y("+ZC.1k(n-l.iX)+","+ZC.1k(r-l.iY)+") "+(a.bT("5G")||"")),a.4l("id",i),"5g"!==o.A.AF&&"6A"!==o.A.AF||a.4l("r",o.E["1R.2e"]),t.6r.3c(a)};l.ME&&K(o.A.RK,o.K+"-1R-sh-"+m),K(o.A.HI,o.K+"-1R-"+m),l.D7&&K(o.A.QN,o.K+"-1R-5e")}1u{l.1t();1a D=l.A0!==l.AC;if(!o.C.K5[o.A.L]&&o.A.YW&&!D)if("2F"===o.H.AB){if(-1===ZC.AT(["3P","9n","5q","fW","9k","8k","5F"],l.DN))if(o.A.HB=l,1o.3J.jA&&2g.dA){1j(1a F in o.H.G0)o.A.HI||(o.A.HI=o.H.G0[F].dA("#"+o.K+"-1R-"+m)),l.ME&&!o.A.RK&&(o.A.RK=o.H.G0[F].dA("#"+o.K+"-1R-sh-"+m)),l.D7&&!o.A.QN&&(o.A.QN=o.H.G0[F].dA("#"+o.K+"-1R-5e")||o.H.G0[F].dA("#"+o.K+"-1R-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r":"9B"===1g.A.CS?1g.A0:1g.B7,"1G-1r":"9B"===1g.A.CS?1g.A0:1g.B7,1r:1g.C0}}1t(){1a e,t,i=1g;1D.1t();1a a,n=i.A.QL,l=i.A.lM,r=i.A.B1,o=i.A.CH,s=i.A.S;i.2I(),i.CW=!1,i.C6=i.A.CK("bl",0);1a C,A,Z=[],c=[],p=[],u=[],h="5A"===i.A.CS;1n 1b(){if(i.A.S6>=i.A.S.1f&&i.A.YD){1a e=i.C.K+ZC.1b[34]+i.C.K+ZC.1b[35]+i.A.L+ZC.1b[6],t="",n="";-1!==ZC.AT(["1w","1N","5A"],i.A.CS)?""!==(n="5A"!==i.A.CS||i.A.XU?ZC.AN.Q7(ZC.AN.Z8(i.E.2W),4):ZC.AN.Q7(c,4))&&(t=ZC.P.GE("4z",i.A.E4,i.A.IV)+\'1O="\'+e+\'" id="\'+i.K+ZC.1b[30]+n+\'" />\'):-1!==ZC.AT(["9B","94","2V","9D","5N"],i.A.CS)&&(n=a.EY(),t=ZC.P.GE("4z",i.A.E4,i.A.IV)+\'1O="\'+e+\'" id="\'+i.K+ZC.1b[30]+n+\'" 1U-z-3Z="\'+(i.A.A.A7.1f-i.A.L)+\'" />\'),i.A.A.HQ.1h(t)}i.A.U&&i.A.E.k3!==i.K&&i.FJ()}1a d=i.N=i.A.HV(i,i);if(i.A.IH&&i.GU(d),-1!==ZC.AT(["1w","1N","5A"],i.A.CS)){Z=[],c=[],p=[],u=[];1a f=i.iX,g=i.iY,B=i.iX,v=i.iY;h&&(i.MS="1X",i.2I(),f=i.iX,g=i.iY,i.MS="2k",i.2I(),B=i.iX,v=i.iY),i.A.IT&&(i.A.D.1h([f,g]),i.A.AG.1h([f,g])),i.L>r.X?(A=s[i.L-1])&&(A.MS="1X",A.2I(),C=ZC.AN.JT(A.iX,A.iY,f,g),Z.1h(C),c.1h(C),h&&(A.MS="2k",A.2I(),C=ZC.AN.JT(A.iX,A.iY,B,v),p.1h(C),u.1h(C))):(A=s[r.A1])&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iX,N.iY,N.iX+N.I,N.iY+N.F],D.1t()),"1w"!==i.A.CS&&"1N"!==i.A.CS&&"5A"!==i.A.CS||(i.A.D[0]&&i.A.D.1h([i.A.D[0][0],i.A.D[0][1]]),ZC.CM.1t(n,d,i.A.D))),-1!==ZC.AT(["sB","6v","1N","1w"],i.A.CS))i.OM(!1,!0);1u if(-1!==ZC.AT(["9B","94","2V","5N","9D"],i.A.CS)){(a=1m DR(i.A)).K=i.K+"-3P",a.1S(d),a.Z=i.A.CK("bl",1),a.C6=i.A.CK("bl",0),b=(E=i.C.BK("1z")).iX+E.I/2,m=E.iY+E.F/2;1a O=.1*(K=r.EL/(r.W.1f-(2m===r.EL||r.DJ?0:1)));i.A.CB||(O=.1*K+.4*K*i.A.L/i.A.A.A7.1f),1c!==ZC.1d(e=i.A.sF)&&(O=e<1?K*e:e),Y=o.A6;1a S=i.A.A;i.A.CB&&1c!==ZC.1d(S.hm["7H"+i.L])&&(Y+=S.hm["7H"+i.L]);1a T=ZC.1k(o.SQ(i.CL));if(i.A.CB&&(S.hm["7H"+i.L]=T),X=r.DK+i.L*K-K/2+O+(r.DJ?K/2:0),x=r.DK+(i.L+1)*K-K/2-O+(r.DJ?K/2:0),y=T+o.A6,"5N"===i.A.CS||"9D"===i.A.CS){1a k=(ZC.CT(E.I/2,E.F/2)*E.JP-o.A6)/i.A.A.A7.1f;y=o.A6+i.A.L*k,Y=o.A6+(i.A.L+1)*k}i.c5({x:b,y:m,sz:y,sl:Y,as:X,ae:x}),a.iX=b,a.iY=m,a.DN="3P",a.B2=X,a.BH=x,a.AH=y,a.CJ=Y,a.1q(),a.IX=1n(e){1l i.IX(e)},a.DB()&&a.1q()}if(i.A.GB&&-1!==ZC.AT(["1w","1N","9B","94","2V","9D","5N"],i.A.CS)){1Q(i.A.CS){1i"1w":1i"1N":I={},(F=1m DR(i)).1S(d),F.K=i.K,F.Z=i.A.CK("bl",1),F.C6=i.A.CK("bl",0),F.D=Z,F.C5=0,I.2n=d.C5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t.NW=1c,t.QE=[],t.EA=1,t.B8=-1,t.BS=-1,t.SP=-1,t.H1=-1,t.HL=-1,t.C8="lb",t.EU=10,t.FF=1c,t.PA=1,t.Q8=!0,t.l0=!1,t.7G=[!1,!1],t.M1=1c,t.XC=1c,t.TN=!1,t.HZ=-1,t.ZI=!1,t.B6="2q",t.QX=!1,t.VW=!1,t.R8=1,t.dz="",t.iJ=!0}1q(){1D.1q();1a e,t=1g;if(1c!==ZC.1d(e=t.o.7i))if(ZC.PG(e))t.EA=ZC.1Y(e);1u{1a i=e.1F(/[0-9]/gi,""),a=5z(e.1F(/[^0-9]/gi,""),10);1Q(a=a||1,i){1i"mQ":t.EA=5I*a;1p;1i"iy":t.EA=5I*a*60;1p;1i"lL":t.EA=5I*a*60*60;1p;1i"dn":t.EA=5I*a*60*60*24;1p;1i"Aw":t.EA=5I*a*60*60*24*7;1p;1i"eL":t.EA=172*a;1p;1i"jS":t.EA=174*a}}if(1c!==ZC.1d(t.o.iG)&&1c===ZC.1d(t.o.5L)&&(t.o.5L=t.o.iG),t.4C([[ZC.1b[10],"BW"],["2H-1E","rj"],["5D","CF"],["2a-4c","A6","i"],["2a-4c","tk","i"],["2a-6i","BV","i"],["4Q-9X","GT","i"],["2Z","L","i"],["yE","AR","b"],["cl","H7","b"],["3G-176","YU","b"],["7o-7i","QX","b"],["3G-to","M0"],["d9-16W","ZI","b"],["3G-to-6p","NW"],["2C-iQ","l0","b"],["16D","TN","b"],["1X-cA","ED","i"],["1X-2C","ED","i"],["3Q-1V","H5","f"],[ZC.1b[12],"DU","ia"],[ZC.1b[14],"SB"],[ZC.1b[13],"RL"],["5L","fr","b"],["5L-dv","U5"],["8c","fj"],["az","fu","b"],[ZC.1b[25],"SR","ia"],["f9","C8"],["3a-16a","EU","fa"],["1z-7e","PA","fa"],["4m-cA","M1"],["1X-6k","HZ","i"],[ZC.1b[7],"B6"],["7e","R8","f"],["16c","dz"],["16e","VW","b"],["vn","DJ","b"],["iL","iJ","b"]]),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XC.1q(),t.DU=t.XC.DU,t.CF=t.XC.CF))}GV(){}T6(){}jw(){}H8(){}3j(){}6a(){}LS(){1a e,t=1g,i={8c:t.fj,"n6-8F":t.RL,"6k-8F":t.SB,6k:t.DU,"1X-6k":t.HZ,5L:t.fr,"5L-dv":t.U5,az:t.fu,"az-6k":t.SR};if(t.FF)1Q(t.FF.o.1J){1i"5B":i[ZC.1b[68]]=!0,1c!==ZC.1d(e=t.FF.o.1E)&&(t.FF.o.4s=e);1a a=t.W[t.A1]-t.W[t.X],n="",l="",r={},o=["sf","mQ","iy","lL","dn","eL","jS"];1j(1a s in o)r[o[s]]=ZC.HD["5B-rL"][o[s]];l=0<=a&&a<=5I?"sf":5I<a&&a<=j3?"mQ":j3<a&&a<=uW?"iy":uW<a&&a<=ug?"lL":ug<a&&a<=ul?"dn":ul<a&&a<=16l?"eL":"jS",n=1c!==ZC.1d(t.FF.o[l])?t.FF.o[l]:1c!==ZC.1d(t.FF.o.4s)?t.FF.o.4s:r[l],t.E.us=n,i[ZC.1b[67]]=t.E.us}1l i}Y5(){1j(1a e=1g,t=e.A.AY.A7,i=-1,a=0,n=t.1f;a<n;a++){1a l=t[a].BT(e.AF);if(-1!==ZC.AT(l,e.BD)){1Q(t[a].AF){1i"3P":1i"7a":1i"8Z":1i"5x":1i"6U":1i"6b":1i"7z":1i"8m":1i"8h":1i"1N":1i"88":1i"8z":1i"au":1i"af":1i"b6":i=t[a].A0;1p;1i"6v":1i"5g":i=-1!==t[a].A2.A0?t[a].A2.A0:t[a].A0;1p;2q:i=t[a].B7}1p}}1l i}1t(){1g.6a(),1g.A.AJ["3d"]||1D.1t()}MB(e,t,i,a){1a n=1g;if(1c===ZC.1d(a)&&(a=5),n.A.AJ["3d"]){1a l=1m CA(n.A,e.iX+e.I/2-ZC.AL.DZ,e.iY+e.F/2-ZC.AL.E0,0+e.t0);e.iX=l.E8[0]-e.I/2+("v"===i?"2q"===n.B6?-a:a:0),e.iY=l.E8[1]-e.F/2+("h"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?i.BS=t:i.BS=i.HL,i.Q3(i.B8,i.BS,1c===ZC.1d(e)&&1c===ZC.1d(t))}FO(L,J,EO,vE){1a s=1g,CU="";J?(CU=J.S[L].BY,s.FF&&"5B"===s.FF.o.1J||"8R"==1y CU||(1c!==ZC.1d(s.BW[CU])?CU=s.BW[CU]:1c!==ZC.1d(s.W[CU])&&(CU=s.W[CU]))):CU="3a"===s.C8&&vE?L+1:1c!==ZC.1d(s.BW[L])?s.BW[L]:s.W[L],"8R"==1y CU&&1c!==ZC.1d(s.IQ[CU])&&(CU=s.IQ[CU]);1a OX=ZC.PG(CU)&&ZC.1Y(CU)<0,BF=s.LS();if(ZC.2E(EO,BF),OX&&"cK"===BF.8c&&(CU=ZC.2l(ZC.1Y(CU))),BF.cf=s.A.UU,BF.cJ=s.A.NA,CU=ZC.AO.GN(CU,BF,s,!0),s.CF)if("()"===s.CF.2x(s.CF.1f-2)||"7s:"===s.CF.2x(0,11))4M{1a EG=s.CF.1F("7s:","").1F("()","");7t(EG)&&(CU=7t(EG).4v(s,CU))}4K(e){}1u CU=OX&&"cK"===BF.8c?"-"+s.CF.1F(/%v|%1z-1V/g,CU):s.CF.1F(/%v|%1z-1V/g,CU);1l CU}EX(e,t,i,a,n){1a l=1g,r=l.FO(t,i,a,n),o=[];o.1h(["%1z-1H",r],["%1z-2Z",t],["%1z-2L",t]),l.FF&&"5B"===l.FF.o.1J?o.1h(["%1z-1V",r],["%v",r]):"3a"===l.C8&&n?o.1h(["%1z-1V",1A.5k(l.EU,t)],["%v",1A.5k(l.EU,t)]):o.1h(["%1z-1V",ZC.7Q(l.W[t],"")],["%v",ZC.7Q(l.W[t],"")]),o.1h(["%l",r],["%t",r],["%i",t],["%c",t]),o.3Z(ZC.k6);1j(1a s=0,C=o.1f;s<C;s++){1a A=1m 5v(o[s][0],"g");e=e.1F(A,o[s][1])}1l e}T6(){1a e=1g,t=ZC.BN(e.W.1f,e.BW.1f),i=0;if(t>0&&e.BQ.AA%180==0){1j(1a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])&&c!==p&&(s&&C||(c-=c%r)),1c===ZC.1d(o.o["1X-1V"])&&c!==p&&(s&&C||(p=p-p%r+(p%r==0?0:r))),l=1A.4n(ZC.HO(r)/1A.bD);1a u,h=a[3];if(l<h&&l<0&&(h=l),"3a"===o.C8&&(h=ZC.BN(1,h)),o.W=[],s&&C){1a 1b=ZC.AO.YM(c,"%Y-%n-%d-%H-%i-%s",!1,0).2o("-"),d=!0,f=ZC.1k((""+o.o.7i).1F("eL"));0===f&&(f=1);1a g=ZC.1k(1b[1]),B=ZC.1k(1b[0]);1j(o.W.1h(c);d&&c!==p;){d=!1;1a v=ZC.1k(1b[2]);g+f>=12&&B++,g=(g+f)%12,(31===v&&(3===g||5===g||8===g||10===g)||v>28&&1===g)&&(v=1===g?B%4==0&&B%100!=0||B%sK==0?29:28:30);1a E=1m a1(B,g,v,1b[3],1b[4],1b[5]).bv();o.W.1h(E),E<p&&E<=t&&(d=!0)}}1u if(i){o.H1=e,o.HL=t,o.VK=ZC.1k((p-c)/r);1a b=(""+r).2o("."),m=1m 5Q(b[1]||"0").1f;1j(n=c;n<=p;n+=r){1a K,D;u=n;1a F=o.DU;if("3a"===o.C8)1j(1a I=!0;I;)I=!1,D=K=1A.5k(o.EU,u),K=ZC.1Y(ZC.bW(K,F)),D<1&&D!==K&&ZC.BN(D,K)/ZC.CT(D,K)>1.sL&&(I=!0,++F>ZC.CT(20,-1===o.HZ?99:o.HZ)&&(I=!1));1u K=1c!==F?ZC.1Y(ZC.bW(u,1A.1X(F,m))):ZC.1Y(ZC.bW(u,m));o.W.1h(K)}}1u 1j(r=ZC.1Y((t-e)/o.VK),n=0;n<=o.VK;n++)u=e+r*n,h<0&&(u=ZC.1Y(u.4x(-h))),o.W.1h(u);o.X=0,o.A1=o.W.1f-1,o.E6=0,o.EF=o.W.1f-1,o.B8=ZC.1Y(o.W[o.X]),o.BS=ZC.1Y(o.W[o.A1])}XG(e,t,i){1y i===ZC.1b[31]&&(i=!1);1a a=t-e,n=1A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ZC.1b[12]])&&(g=(n=(""+o).2o("."))[1]?n[1].1f:1A.4h(g/v),s.DU=ZC.2l(B-g)<=1?B:g)}}s.X=0,s.A1=s.W.1f-1,s.EA=o,A.1f>1?(s.B8=ZC.ds(s.W),s.BS=ZC.dr(s.W)):(s.B8=s.W[0],s.BS=s.W[s.W.1f-1]),"3a"===s.C8&&s.Q3(ZC.HO(s.B8,s.EU),ZC.HO(s.BS,s.EU),!1)}if(2===e){1a m={};1c===ZC.1d(s.o[ZC.1b[5]])&&(s.W=[],l=ZC.3u,r=-ZC.3u);1a K=[],D=s.A.AY.A7;1j(i=0,a=D.1f;i<a;i++)if(s.A.E["1B"+i+".2h"]||"5d"===s.A.7T()){1a F=D[i].BT();if(-1!==ZC.AT(F,s.BD))1j(1a I=-1!==ZC.AT(["5x","6b","6U","7z"],D[i].AF),X=[],x=0,y=D[i].W.1f;x<y;x++)if(D[i].S[x]){1a Y=1c===D[i].S[x].BY?x:D[i].S[x].BY;if(-1!==ZC.AT(X,Y))dk;X.1h(Y);1a L=D[i].M6&&1c!==ZC.1d(D[i].M6[x])?ZC.1Y(D[i].M6[x]):0;if(D[i].CB)1c===ZC.1d(m[D[i].DV])&&(m[D[i].DV]=[]),1c===ZC.1d(m[D[i].DV][Y])?D[i].S[x].AE>=0||!I?m[D[i].DV][Y]=[D[i].S[x].AE,0]:m[D[i].DV][Y]=[0,D[i].S[x].AE]:D[i].S[x].AE>=0||!I?m[D[i].DV][Y][0]+=D[i].S[x].AE:m[D[i].DV][Y][1]+=D[i].S[x].AE,D[i].S[x].AE>=0||!I?D[i].S[x].CL=m[D[i].DV][Y][0]:D[i].S[x].CL=m[D[i].DV][Y][1],1c===ZC.1d(s.o[ZC.1b[5]])&&K.1h(m[D[i].DV][Y][0]+L,m[D[i].DV][Y][1]+L);1u if(1c===ZC.1d(s.o[ZC.1b[5]])){K.1h(D[i].S[x].AE+L),0!==L&&K.1h(L);1j(1a w=0,M=D[i].S[x].DL.1f;w<M;w++)K.1h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7],"B6"],["16u-1z","Z5"],["1H-6f","MR"],["1H-ix","O9"],["5A","F6"]]),1c===ZC.1d(t.o.2n)&&(t.o.2n="1N"===t.AF?.25:.95),1c!==ZC.1d(e=t.o["1H-9Y"])&&("4j"==1y e&&e.1f?(t.PT[0]=ZC.1k(e[0]||"5"),t.PT[1]=ZC.1k(e[1]||"5")):t.PT[0]=t.PT[1]=ZC.1k(e||"5")),t.4C([["2n","C5","f",0,1]]),1c===ZC.1d(e=t.o.1H)&&1c===ZC.1d(t.o.1E)||(t.M=1m DP(t),t.A.A.A.B9.2w(t.M.o,["("+t.A.AF+").4B.1R.1H"]),1c!==ZC.1d(t.o.1E)&&t.M.1C({1E:t.o.1E}),t.M.1C(e),t.M.1q(),t.lP=[t.M.BJ,t.M.BC])}1t(){1a e,t,i,a,n,l,r,o=1g;if(o.F6)if(-1===o.A.BD.1L("1z-r")){if(o.AM){1a s,C,A,Z,c=o.A,p=o.A.A.Q.AQ,u=c.A.K+"-3z-"+("1v"===o.B6?"f":"b")+"l-0-c";o.Z=o.C6=ZC.AK(c.H.2Q()?c.H.K+"-3Y-c":u),e=ZC.P.E5(o.Z,c.H.AB),n=[];1a h,1b,d=0,f=0;o.BJ>-1&&o.BJ<1&&(o.BJ=1A.4h(o.BJ*c.A9)),o.BC>-1&&o.BC<1&&(o.BC=1A.4h(o.BC*c.A9)),o.M&&(o.M.Z=c.H.2Q()?c.H.mc():ZC.AK(c.A.K+"-3z-ml-0-c"),o.M.K=o.A.A.K+"-"+o.A.BD.1F(/\\-/g,"1b")+"-b4"+o.L,o.M.GJ=o.A.K+"-1R-1H "+o.A.A.K+"-1z-1R-1H zc-1z-1R-1H");1a g=1n(e,t){1a i;1l-1!==(t+"").1L("%")?(i=ZC.1Y(t.1F("%","")),i="k"===e.AF?ZC.1k(i*(e.EF-e.E6)/100):i*(e.HL-e.H1)/100):i=t,o.pr||"v"===e.AF?e.AX(i):e.H0(i)};if("4z"===o.AF){1a B,v,E,b;1j(1b=o.A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x:3,15P:4,163:5,162:6,161:7,15Z:8,15Y:9,15X:10,15W:11,15V:12,17d:13,15O:2,15z:3,15N:4,15M:5};1O PN 2j aA{2G(e){1D();1a t=1g;t.C=e,t.S0=!1,t.C4=1c,t.P8=[],t.PP={},t.lC=1c}pk(e,t){1a i=1g;1c===ZC.1d(i.PP[e.BD])&&(i.PP[e.BD]=e,e.M4=i,i.S0||(1c!==ZC.1d(t)&&t>0?2u.5E(1n(){i.4c()},t+1):i.4c()))}2P(e){1a t=1g;e.M4=t,e.XN>0?(t.P8.1h(e),2u.5E(1n(){e.BZ.TY=!0,t.S0||t.4c()},e.XN+1)):(e.BZ.TY=!0,t.P8.1h(e),t.S0||t.4c())}4c(){1a e=1g;e.S0=!0,ZC.AO.C2("15J",e.C.A,{id:e.C.A.K,4y:e.C.K});1a t=!0;!1n i(){t||e.7i(),t=!1,e.S0&&(e.C4=2u.iN(i))}()}7i(){1a e,t=1g,i=0;if(t.S0){1j(1a a=0,n=t.P8.1f;a<n;a++)i+=t.P8[a].6T();if("3f"===t.C.H.AB)if(t.C.H.KC)1c!==ZC.1d(e=ZC.AK(t.C.K+"-4k-bl-c"))&&e.9q("2d").q2(t.C.iX,t.C.iY,t.C.I,t.C.F);1u 1j(a=0,n=t.C.AY.A7.1f;a<n;a++)1j(1a l=0;l<t.C.AY.A7[a].T2;l++)1c!==ZC.1d(e=ZC.AK(t.C.K+"-1B-"+a+"-bl-"+l+"-c"))&&e.9q("2d").q2(t.C.iX,t.C.iY,t.C.I,t.C.F);1j(a=0,n=t.P8.1f;a<n;a++)0===t.P8[a].7i()&&(t.P8[a].BZ.TY=!1);1j(1a r in t.PP)1j(t.PP[r].iW||(i+=1),a=0,n=t.PP[r].P8.1f;a<n;a++)t.PP[r].P8[a].XJ===t.PP[r].jr?0===t.PP[r].P8[a].7i()&&(t.PP[r].P8[a].BZ.TY=!1):"3f"===t.C.H.AB&&t.PP[r].P8[a].1t();0===i&&(t.PP={},t.P8=[],t.8P())}}8P(e){1c===ZC.1d(e)&&(e=!1);1a t,i=1g;if(e&&(i.15B=!0),2u.o5(i.C4),i.C.Y3(),i.C.QD=!1,ZC.AK(i.C.H.K)){i.C.JQ(),2u.5E(1n(){(t=ZC.AK(i.C.A.K+"-3e"))&&i.C.AY.HQ&&(-1===ZC.AT(["5g","9z","8m","8h","7j"],i.C.AF)&&1!==1o.qs||i.C.AY.HQ.3Z(1n(e,t){1l ZC.AO.N5(e)>ZC.AO.N5(t)?1:-1}),t.4o+=i.C.AY.HQ.2M(""))},33),i.C.qv(),i.S0=!1;1j(1a a=0,n=i.P8.1f;a<n;a++)i.P8[a].TG=1c;if(i.P8=[],i.PP={},e||ZC.AO.C2("18m",i.C.A,{id:i.C.A.K,4y:i.C.K}),1c!==ZC.1d(i.lC))4M{i.lC()}4K(l){}}}}PN.UG=33,1n(){1j(1a e=["ms","z9","7x","o"],t=0,i=e.1f;t<i&&!2u.iN;++t)2u.iN=2u.191||2u[e[t]+"18R"],2u.18X=2u.18k||2u[e[t]+"17L"]||2u[e[t]+"17E"];2u.iN||(2u.iN=1n(e){1l 2u.5E(e,PN.UG)}),2u.o5||(2u.o5=1n(e){2u.iO(e)})}(),1o.3t(1c,"f6",1n(e,t){1j(1a i,a,n=0,l=t[ZC.1b[16]].1f;n<l;n++)if(t[ZC.1b[16]][n].1J&&-1!==ZC.AT(["3P","1w","bR","1N","bQ","2V","5x","6b","92","88","ek","6U","7z"],t[ZC.1b[16]][n].1J)&&t[ZC.1b[16]][n].Cp){1a r=t[ZC.1b[16]][n];ZC.6x(r);1a o=r.Cp||{};ZC.6x(o);1a s,C,A,Z=ZC.IL(o.kW||"10%"),c=o.17n||{1E:"17l"},p=o.d8||{},u=o[ZC.1b[8]]||"0.3",h=r[ZC.1b[11]]||[],1b=[];if("3P"===t[ZC.1b[16]][n].1J){1a d=0;1j(i=0;i<h.1f;i++)h[i][ZC.1b[5]]&&1c!==ZC.1d(h[i][ZC.1b[5]][0])&&(d+=h[i][ZC.1b[5]][0]);Z>0&&Z<1&&(Z*=d),s=[].4A(h);1a f=0,g="";1j(C=1,i=h.1f-1;i>=0;i--)h[i][ZC.1b[5]]&&1c!==ZC.1d(h[i][ZC.1b[5]][0])&&h[i][ZC.1b[5]][0]<Z&&(f+=h[i][ZC.1b[5]][0],g+=(h[i].1E||"z2 no."+C)+":"+h[i][ZC.1b[5]][0]+"<br>",h[i][ZC.1b[8]]=u,1b.1h(h[i]),h.6u(i,1),C++);f>0&&(C>2?(A={6p:[f],sA:!1,"1U-6d":[1],"2H-1E":g=g.2x(0,g.1f-4)},ZC.2E(c,A),h.1h(A),1o.3t(e.id,"v6",1n(t){if(t.iR.6d){1a i=1o.7d(t.id);if(!i)1l;1a a=1o.tC(i,t.4y);1j(1a n in a.tF())"3P-fA-"===n.2x(0,8)&&a.4l(n,1c);1o.3n(e.id,"eB",{1U:1b}),2u.5E(1n(){1a t=1o.3n(e.id,"sy",{4j:"2r",3W:0,5W:0}),i={id:"tm",x:t.x,y:t.y,1E:"< sY",bi:"c",4U:"iw"};ZC.2E(p,i),1o.3n(e.id,"rs",{1J:"1H",1U:i})},1)}}),1o.3t(e.id,"yo",1n(t){if("tm"===t.1H.id){1a i=1o.7d(t.id);if(!i)1l;1a a=1o.tC(i,t.4y);1j(1a n in a.tF())"3P-fA-"===n.2x(0,8)&&a.4l(n,1c);1o.3n(e.id,"rR",{1J:"1H",id:"tm"}),1o.3n(e.id,"eB",{1U:h})}})):r[ZC.1b[11]]=[].4A(s))}1u{1a B=0,v=[];1j(i=0;i<h.1f;i++){if(v[i]=0,h[i][ZC.1b[5]]&&h[i][ZC.1b[5]].1f)1j(a=0;a<h[i][ZC.1b[5]].1f;a++)v[i]+=ZC.2l(h[i][ZC.1b[5]][a]);B=ZC.BN(B,v[i])}Z>0&&Z<1&&(Z*=B),s=[].4A(h);1a E=[],b=[];1j(C=1,i=h.1f-1;i>=0;i--)if(v[i]<Z){if(h[i][ZC.1b[5]]&&h[i][ZC.1b[5]].1f)1j(a=0;a<h[i][ZC.1b[5]].1f;a++)E[a]=ZC.1Y(E[a]||"0"),E[a]+=h[i][ZC.1b[5]][a],b[a]=b[a]||"",b[a]+=(h[i].1E||"z2 no."+C)+":"+h[i][ZC.1b[5]][a]+"<br>";1b.1h(h[i]),h.6u(i,1),C++}if(E.1f)if(C>2){1j(a=0;a<b.1f;a++)b[a]=b[a].2x(0,b[a].1f-4);A={6p:E,sA:!1,"1U-6d":[1],"1U-tt-1E":b,"2H-1E":"%1U-tt-1E"},ZC.2E(c,A),h.1h(A),1o.3t(e.id,"v6",1n(t){if(t.iR.6d){if(!1o.7d(t.id))1l;1o.3n(e.id,"eB",{1U:1b}),2u.5E(1n(){1a t=1o.3n(e.id,"sy",{4j:"2v"}),i={id:"rQ",x:t.x+t.1s/2,y:t.y,1E:"< sY",bi:"c",4U:"iw"};ZC.2E(p,i),1o.3n(e.id,"rs",{1J:"1H",1U:i})},1)}}),1o.3t(e.id,"yo",1n(t){if("rQ"===t.1H.id){if(!1o.7d(t.id))1l;1o.3n(e.id,"rR",{1J:"1H",id:"rQ"}),1o.3n(e.id,"eB",{1U:h})}})}1u r[ZC.1b[11]]=[].4A(s)}}1l t});',62,4406,'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||var|_|null|_n_||length|this|push|case|for|_i_|return|new|function|zingchart|break|parse|color|width|paint|else|top|line||typeof|scale|Math|plot|append|super|text|replace|border|label|style|type|left|indexOf|height|area|class|item|switch|marker|copy|background|data|value|legend|max|_f_|scroll|||||||||||offset|none|bottom||size|angle|document|visible|guide|extends|min|_a_|360|alpha|split|cls|default|node|font|_b_|window|plotarea|load|substring|margin|right|preview|menu|items||_cp_|svg|constructor|tooltip|setup|objects|mobile|position|join|hover|css|add|usc|path|shape|fff|solid|bar|points|target|graph|index|||||||||||log|string|appendChild||map|canvas|JSON|page|auto|clear|fill|unbind|abs|exec|move|opacity|handle|remove|body|bind|MAX|clip|padding|align|layout|scales|circle|MAPTX|div||instanceof|box|zoom|center|click|DEV|shadow|vml|Array|display|handler|pie|ref|url|attr|update|255|270|plotindex|state|main|sort||||tick|||round||||enabled|stroke|start|html|image|cache|live|ceil|die|object|plots|setAttribute|show|floor|innerHTML|xmax|xmin|bugreport|all|delete|000|call|_x_|toFixed|graphid|poly|concat|SCALE|assign_a|mode|absolute|SKIP|touchstart|json|form|999|catch|error|try|viewsource|dynamic|mask|minor|out|enable|Number|cursor|createElement|maps|src|history|plotid|||||||||||spline|stringify|gradient|hide|imgfill|each|bubble|GESTURE|gui|normal|pow|_l_|front|prototype|row|inherit|rect|2px|ymax|ymin|depth|RegExp|substr|vbar|sqrt|parseInt|range|date|opposite|format|setTimeout|custom|transform|callback|1e3|toUpperCase|getNodeData|short|title|piano|fullscreen|inner|String|header|img|parseFloat|highlight|touchend|nodeindex|shapes|test|GUIDES|||||||||||build|hbar|shared|group|m_|placement|pool|touchmove|end|from|decimals|mouseup|_e|total|context|values|layer|parentNode|middle|table|splice|scatter|info|_todash_|arc|bold|hbubble|about|mousedown|repeat|order|print|loader|9999|callout|browser|active|paint_|fontSize|fontWeight|csv|00|fontFamily|ie67|preventDefault|status|vbar3d|distance|palette|off|translate|mouseover|||||trend||plotidx|aspect|outer|weight|pie3d|source|221F1F|getLoader|factor|override|ddd|http|step|radar|childNodes|init|hook|goal|fixed|touches|important|api|javascript|eval|slice|eachfn|close|webkit|nodeidx|hbar3d|zcv|span|arrow|mouseout|zoomx|oRE|aAutoFit|stack|true3d|item_|sFontWeight|href|button|flat|progress|D1D3D4|_c_|zoomy|last|getToggleAction|className|xls|trigger|isNaN|stock|1px|sum|subtitle|location|mousemove|cnt||tagName||area3d|ccc|getPMap|key|negation|hasOwnProperty|5px|action|exit|hbullet|percent|CSV|plus|npv|vbullet|pointer|void|hscatter|zidx|1e4|entry|send|fast|export|space|nbsp|animation|gauge|static|01|www|name|oPS|separator|diff|radial|333|images|block|val|_p_|pattern|zoomTo|stop|initcb|number|oPPI|after|navigator|kmin|connector|hidden|58595B|nestedpie|||line3d|eee|column||kmax|quirks|arguments||blocker|adjust|light|float|Object|ring|which|dblclick|family|hideCM|cross|apply|zc_legend_mousescroll|square|coords|ready|getContext|reverse|DAY|crosshair|paintPreview|locate|linear|children|radius|mixed|vertical|rose|dragged|matrix|getTooltipPosition|EVENTS|side|pointsarea|mid|FONTFAMILY|zIndex|rgb|overflow|targetid|oMask|destroy|footer|EVENT|rgba|method|change|png|clearInterval|ticks|tolerance|select|angleEnd|Date|toggle|frame|pages|_tx_|msie|atan|getInstance|filled|10px|segmented|toString|mousewheel||hfunnel|mapPointsToPreview|zindex|element|equal|input|behaviors||rules|ajax|root|down|complete|||vfunnel|styles|SEC|MIN|COLORS|exponent|ZCClass|success|multiple|setAttributeNS|async|version|rtl|pyramid|chart|message|setdata|gear|tdim|mdim|toLowerCase|removeChild|params|pageX|graphset|A1F|rel|scrollLeft|scrollTop|selection|NODE_EV|mixed3d|transparent|skip|tools|flash|marker_|ANIMATION|venn|icon|dark|wait|pstack|render||user||direction||SKIPTRACKERS|anchor|flatten|oblique||italic|TOUCHEVENTS|ic_line|open|angleStart||single|IMAGES|lineHeight|getTime||ignore||Function|output|_boxoverlap2_|ctx|LN10|objmove|resize|pageY|A0B|iYVal|theme|256|decoration|idx|gshape|facet1|facet2|varea|vline|_INFO_|getAttribute|togglePreviewMasks|Resource|_fixed_|textarea|GET|safe|facet3|com|iXVal|datalength|feed|setNodeData|SEQ|V3D|rule|axis|ie678|clientX|intersect|A5L||utc|drawImage|bounds|uid|plotset||zooming||xy_|||dashstyle|lineWidth|horizontal||CanvasCache|userAgent|fillStyle|||bYX|labels|A1P|BUILDCODE|fontStyle|paddingTop|tab|goforward|goback|not|timezone|currency|Image|tween|zero|getElementById|A04|keys|refresh|666|Jan|Thu|setRequestHeader|textAlign|random|000000|nodes|classic|power|setupcb|reference|A7A9AC|defaults|fire|viewimage|back|force|cccccc|MON|vector||||fromCharCode|Data|bandwidth|clientY|continue|bBS|3dxy|day||visibility|selected|A2D|A2B|stepped|A3L|unit|addPMap|||sMaster|querySelector|getElementsByTagName|4px|average|touch|A8F|sampling|baseVal|AAP|OBJECTMODE|md5|interval|GMT|1970|A1K|forw|sin|cos|preserve|curtain|paddingRight|paddingBottom|paddingLeft|moveTo|updates|raw|A1L|labelid|414042|globalAlpha|textDecoration|8C8C8C|collapsed|AB1|false|arrows|_pageX_|watermark|opacity2|A3M||_int_|beforeSend|jpeg|FSID|swipe|bar3d|||highlightItem|dx1|dx2|xmlns|A4Z|A1N||org||bidi|sep|sTypeX|LEGEND|series|setseriesdata|hideprogresslogo|cone|generated|backgroundColor2|reload|CACHECANVASTEXT|backgroundColor1|borderColor|borderWidth|month|cwidth|aBandWidths|A3D|setInterval|zoomin|A0H|A4Y|dotted|long|charAt|bIsBottom|A1Z|styleSheets|margins|A0L|license|zoomout|submit|download|application|dataparse|onreadystatechange|readyState|progression||found|jsonsource|originalsource|||IMG404|checked|VERSION|A0F|charCodeAt||dashdot||overscroll||dist|A5N||i18n|A09|head||||A3R|sel|widgets|nodeType|wrapper|viewall|A3T|pdf|A69|_end_|dashed|intxy|before|inactive|300|bullet|isFinite|lon|lat|xtype|1800|getstyle|ratio|rectangle|DOMMouseScroll|A59|point|A61|rotate|labelindex|onmouseout|onmouseover|getComputedStyle|SKIPMAPS|A63|z3d|headers|REFRESH_TICK|documentElement||contextmenu||clearPreview|A5F|encodeURIComponent||getElementsByClassName|smart|A2T|segment|parentElement|zcrandom|count|modal|3e6c7b|query|DEFAULT|A08|A45|A48|onload|XMLHttpRequest|1024|A2H|first|A56|AJAXEXPORT|totals|CSS|A2M|A07|A2Q|A6B|A2R|flags|b2D|exitfullscreen|A1C|A11|showguide|1e6|NULL|FONTSIZE|3dfacet|A1R|A4C|A1G|A5V|modules|LOCALSVGEXPORT|facet5|A9O|facet4|dataurl|zc_loader_mousewheel|AEZ|hmixed|nodekeyvalue|A2P|Close|events|ZingChart|onmousemove||A0S|nodata|insertBefore|addColorStop|goals|underline|ll_|A2N|0px|stroked|CANVASTEXT|setAnchor||A05||A9M|A9N|_r_|true|A1E|ctrlKey|A2V|GUIDE_EV|xydistance|_pageY_|clearGuide|_ang_|infotype|NODE_EV_CHART|html5|colors|Top|Bottom|Left|bRTL|legendminimize|getdata|lineTo|websockets|05|A1I|URL|protocol|post|titles|gap|storage|locale|A47|timeout|View|A4I|save|data_|callEvent|hasEvent|LICENSE||previewscale|A68||||keyvalue|setScrollingFlag||sTypeE|A7I|collapse|restore||shapeindex|shapeid|ZCOUTPUT|Right|||fit|lcoords|hand|alignment|minute|CDCDCD|aperture|A4B|cleanTouchEvents|dim|lstep|getBoundingClientRect|multiplier|MAX_VALUE|A1J|bNormalize|A0V|normalize|A4J|requestAnimFrame|clearTimeout|A2U|overlap|xdata|lineColor|applyJsRuleSvg|A3X|A5A|A3Y||||PATTERNS|A50|addEventListener|36e5|A9V|A1O|ffffff|ABF|A8G|getSize|A88|stopfeed|A54|pull||item_title|minimize|A8Q|_h_|_append_|_hex2rgb_|onerror|A3P|A22|A0U|A0T|A3E|A5O||A9Y|cancel|A2Z|A01|defaultView|cloneNode|A0P|DOMFRAGMENTS|clientLeft|clientTop|opera|parser|AA7|tap|pinch|objtype|_nfind_|A72|A75|EQUIV|offsetX|929497|A35|global|lowlevel|year|TOUCHZOOM|trapeze|595959|ActiveXObject|offsetY|undefined|TTLOCK|parsecb|zcoutput|isBold|vboxid|A7P|A4E|A2A|A13|_txp_|reset|transport|250|full|getFormatValue||A5U|A4D|A40|A1Y|currentStyle|palatte||A42|BLANK|bars|foreignObject|nulls|A66|A5I||connect||filter|ruler|Blob|contour|xml|toDataURL|A8C|evalFn|months|xlink|base64|ABU|iframe|THEME|sharedZScale|A4U|applyRGBA|stream|Series|A44|A0X|bPoly|exec_flash|oNode_|A27|A1W|threshold|A5T|A70|hasData|A12|A57|A36|parseLayout|A2E|A10|clientWidth|acos|A6U|A0O|A0N|lin||CACHESELECTION||PLOTSHLAYER|A1B||A46|plotdata|A21|nowrap|Download|A31|A78|A2C|A3O||markerbg||A5D|yall|PLOTSTATS|xall|oMap|relative|FSSTATUS|A37|onStop|A4Q|filename|A30|ANIMATION_|exportdata|days|369|A62|hour|A5G|setLineDash|A34|A0R|mini|A5Z|borderRight|bBind|5625|disableanimation|borderLeft|showhide|A1V|marginLeft|marginTop|A51|disabled|coord|AAB|A3N|attachEvent|blocked|PARSE3D|set|A2Y|wh_||AA0||extendAPI|A41|alignPosition|tip|A2S|_image|||A0W|A8B||defs|025||500|A00|empty|A32|textprint|65535|A4F|LICENSEKEY|A52|BODY|bound|A0Q|A02|setupPlotArea|fixPlacement|NODE_EV_TYPE|color2|A1Q|A0Y|Lucida|smooth|zc_guide_touchend|match|second|MAPSONBOTTOM|A03|aMDXY|ABD|A4A|A4T|col|A25|hideguide|A0Z|A8E|A1T|AA2|calculate|strokeStyle|thousands|butt|A20|closePath|A5W|A1S|A9R|||beginPath|A1X|serif|exact|downloadFile|A4S|mimeTypes|A6T|marginBottom||trackers|dot|setupDynamicPlotArea|iDragPos||focusposition|mso|atan2|exportdataurl|A19|stacked|nextSibling|AC8|A2K|A5P|autoFit|AB5|miter|A4O|A4M|Submit|marginRight|Your|en_us|sans|dash|asin|A3F|viewdatatable|dasharray|AA5|utf|run|AAA|Page|speed|A67|A2W|jpg|paintCANVASText|_sh_|465|clearAnimFrame|_oCtxNode|verticalAlign|charset|columns|bgc1|globalCompositeOperation|A4K|hidedatatable|||createObjectURL|A0E|ABR|oldcursor|2048|1999|A81||A8Y|bKeyWidth|GUIDETIMEOUT|AA1|bgc2||showZCAbout|A55|exportimageurl|fillText|A6M|A6I|AC5|createDocumentFragment|caption|ring3d|STACKINGLOGIC|A2F|CHECKDECIMALS|get|AAG|next|AB0|onloadend|xObj|200|stops|textContent|2e3|A93|sAlign|toggleMasks|menuid|A5X|A8P|vrange|A5E|ABA|A94|ACC|webstorage|AAO|office|zc_legend_mouseover|A4P|A3S|A90|AAC|A91|AC6|_POOL_|A6Y||wrapped|A5K|AA4|minvalue|e1eaec|A5J|A17||dataType|maxvalue|99999|WebSocket|A6P|AAM||AC0||loadModules||A7W|l_|F0F1F1|A0I|zc_legend_mouseout|A0K|A18|shader|676667|AB2|A16|D1D2D3|A0D|load_|A7X|s_|KEEPSOURCE|rotation|FFF|HTMLMODE|7CA82B|ABI|A96|kv_|A5S|clearLabelBoxes|ZINDEX|A5M|funnel|score|clearRect|MEDIARULES|polar|A6S|_width_|paintHistory|sync|file|null3d||A3G|A5R||GRAPHID|A97|AAN|C6C6C6|clear_|setseriesvalues|email|hideLayer_|A3Z|A2L|A6K|A6O|COPYDATA|SORTTRACKERS|mapshape|EDITSOURCE|A26|modify|ASYNC_TICK|useMap|scrollTo|A23|A3K|backgroundPosition|A3A|initObjectsLayers|startfeed|A7H|AB6|setmode|A4W|AEJ|ABS|1e9|_blank|deselect|ABZ|setScalesInfo|media|chkcapture|A28|SYNTAX|toggling|zoomto|RESOURCES|NOABOUT|A2G|legend_toggle_action|||chkdata|ABO|A1A|reorder|AB7|A1U|600|A0A||microsoft|||A2I|SPREADTYPE|zc_loader_touchstart_static|offsetWidth|A4X|Show||17px|customprogresslogo|logo|offsetHeight|Sans|customprogresstext|addobject||AAZ||dummy|||clearGenerated|cssFloat|A0C|A4R|styleFloat|A2J|A0G|getPropertyValue|A15|_nice_number_|02|SMARTDATELABELS|formats|_unbind_|AG5|A9W|unicode|navxy_btnback|removeobject|ABN|minus|changedTouches|pan|pointserror|mathpoints|A7S|positioninfo|||AC2|AC4|AEO|thickness|lbltype|yzoomed|xzoomed|ydist|_oMarker|xdist|JavaScript|ABC||msecond|AGC||14px|A53|||hasPassive|AAY|USERCSS|A7O|passive|over|A65||A8S||extension|8px|getobjectinfo||detach|dots|A5Y|Custom|schemas|A6V|appendToValueBox|srcElement|chars|bandspace|400|005|A6L|zcvml|low|A39|A3H|high|CMZINDEX|A4L|_window_onunload_|TIMEOUT|runtimeStyle|DEBOUNCESPEED|Back|statusText|AA6|fullscreenmode|A7Z|A6Q|areanode|_iX|A9K|A9T|resource|_cpa_|A14||A9Q|||hamburger|A5H||A60|AG0|A4N||navpie_btnback|polypoints||createPreviewMasks|viewasjpg||||A92|A2X|A84|||octet|b3D|oP0|getGraph|DownloadXLS|cylinder|getAttributes|A3C|A29|A3U|A6W|menuitemid|Loading|switchtolin|disablepagescroll|EXPORTURL|switchtolog|A6X|viewaspng|Wait|A6R|enablepagescroll|skipfs|switchto3d|A38|switchto2d|oPlot_|borderBottom|ABV|A7M|Guide|joined|backgroundColor|A6N|description|urn|sMetaType|bNpv|adj|ABB|About||A7T|26784e5|A6H|215|dataload|addRule|316224e5|createPattern|fillAngle|plot0||dominantBaseline|shockwave|dateformat||responseText|vb_|mapItem|size2|IGNORESUBUNIT|CHARTS|AAF|tile|childof|1089B3|legendmaximize|A8M|ACQ|LinScale|AC1|96C245|LogScale|e6e6e6|PageScroll|ABH|LITE|ABT|A7Q|A9A|12px|plot1|createRadialGradient|createLinearGradient|864e5|aaa|ACK|ABP|||||plot2|ShockwaveFlash|plot_click|bbox|IMG|f0f0f0|A6G||b6c8cf|getFullYear||A83|SwitchTo2D|SwitchTo3D|A89|FullScreen|paired||BugReport|ranged|star|clipPath|pop|flexible|guide_mouseout||layers||face|A8T|themesloaded|strong|ViewSource|lineCap|_title|svg0html|bKeep|heatmap|A6C|whiteSpace|rLen|1AB6E3|900|contextMenu|tspan|A6J|Menu|facet|coordsize|coordorigin|f6f6f6|A7N|969696|ABL|blur|pos|uniform|POST|FASTWIDTH|asc|ABG||A86|ABQ|calloutPosition|getPlacementInfo|A64|LOGO_ABOUT||getlabelinfo|getshapeinfo|msg||quadraticCurveTo|AB8||candlestick|6B7075|csvParser|prev|365|standard|preserveAspectRatio|SKIPOBJCOUNT|paintMarker|backEaseOut||xmiabt|A79|marker_text_|THEMES|AAS|detached|zcgraph|persistent|pagination|elasticEaseOut|bounceEaseOut|detail|SPREADFACTOR|connected|ACI|downloadxls|borderTop|SKIPPROGRESS|strongEaseOut|fromAPI|LOOKUPCSSTRANSFORM|MAXPOOLSIZE|_height_|f90|A5B|downloadcsv|A7A|alphabetic|ExportData|2654435769|DownloadCSV|ACA|skv|AC9|||endangle|startangle|oval|A3J|SaveAsImageJPG|sigma|ACD|gradientradial|hPos|A6E|vPos||A9B|forced|A5C||AB9|ASYNC|ViewDataTable|textBaseline|userSpaceOnUse|ACJ|facets|A6Z|ACW|toStaticHTML|ipad|AC3|AD3|MSIE|blank||AD8|compat|guide_mousemove|parent|ACH|oP3|A7E|maxindex|minindex|A7L|2c4a59|29A2CC|D31E1E|A7R|AREA|A14BC9|limit|compatMode|265E96|AD0|A05F18|Reload|Print|clippath|3dtx|ACZ|EF8535|0123456789abcdef|||ACO|bubblepie|initial|xdiff|iphone|sTypeN|downloadsvg|downloadpdf|AAV|AAX|regularEaseOut||pageXOffset|pageYOffset|skip_objects_tracking||elementFromPoint|A7K|fold|doubleclick|A7B|label_click|oP1|1023||MODULESDEP|oP2|ACS|_parent|_top||ACG|MODULESDIR|localhost|Helvetica|getxyinfo|gear6|mirrored|ALIAS|ABW|Arial|globals|stopPropagation|A4V|scalevalue|viewDataTable|querySelectorAll|innerWidth|clientHeight|Scale|scalename|A9E|Full|A7U|A7V|A33|A7Y|Hide|A7J||Switch|Item|Screen|ZCVRangePlotSet|cluster|delay|vmin|effect|moz|quick|downloadCSV||animate||downloadXLS|encoding|monotone|minValue|maxValue|minValue_|ADB|maxValue_|excel|A87|A85|createElementNS|Zoom|addplot|999999|AAQ|removeplot|actions|modifyplot|setnodevalue|AAE||AAT|addnode|source_hide|removenode|Table|senddata|scaletext|DELAYEDTRACKERS|A8V|A8L|A5Q|A8I|A7F|A8A|A7D|A7C|A8N|nodevalue|bXY|A8W|ACM|A74|A82|A6D|keyup||||A73|||||||A9C|vmax|AD4|A99||Error|mon|ABE|Send|Bug|addmenuitem|paintTransformDate|meta||msSaveBlob|toggleabout|band|AD1|||thead|origin|week|dataexport|getModules|setModule|||||||||||||||||||scope|||||||||||ExcelWorksheet|||||||overlaps|11px|Email|mozilla||A9F|Name|WorksheetOptions|ExcelWorksheets|sec|ExcelWorkbook|you|FFFFFF|getOptimalDateInterval|AA3|bUrl|indicator|sizing|tbody|FF00FF|QUOTEDVALUES|001|SORTTOKENS|response|AAU|prop||||||||||||||||||||||||||||||||||||hint|linecolor|A8H|backgroundcolor|star5||triangle|diamond|options|errors|filetype|responseType|graphidx|shortcut|A9S|getimagedata|nav|numeric|ABY|ABX||2000|ABK|pathname|AAI|clicknode|showtooltip|||||||||||||||||||||||||||||||||||||May|imggen|UTF|crossOrigin||anonymous|A9G|A7G|trident|A80|INPUT|_rgb2hex_|AAJ|dyn|AAK|A98|onunload|PATTERN_|A8X|alert|A9I|ABJ|A8D|sortFaces|defaultsurl|confirm|||||||||||||||Scroll||||||||||||||||||||||A71|AAL|jumped|rawsource||Parsed|FORM|originalEventZC|tilt|behavior|AD7|hooks|A0M|RESIZESPEED|child|0x|FSZINDEX|shiftKey|event|white|AD9|A6F|A76|A9L|ownerNode|backgroundImage|||||||||||||||||||support||||||||||||||||||screen|infoemail|Opera|youremail||6e4|author|AAR|A9D|xb0|emailmandatory|ACU|ZCVRangeGraph|removeEventListener|A8R|Step|A9X|_rcolor_|AA9|yourcomment|AAH|VML|gif|sendcapture|A4H|checkbox|||||||||||A58||||||||||||||||||||||||||A9H|State|sBId|comment||A9J|A8O|6px|ownerDocument|AAW|330|jsondata|A8K|SKIPCONTEXTMENU||Original|setupValueBoxWH|A8J|onmessage|AAD|onopen|xWR15D1fqTyEALRVtLBrU|4XAMkpkRRnMq7BojiP4tPB82JYwmUk|vk3JIhGITEQsUCtkgtslo4K1wwMRxPoBbAIXJ|kDDNP30|stylesheet|||||||||||||||||||||||Powered|||Q8b3mQmpqvevD3VGFhuVV95PaXnbXTkr6h5M7j0mP3UDxMNo6g3TgCkSe5tiKb2QU3ttxD8PRRN7pFxkFxB|||||||||||KogIo6YW9puMNDROzGSFyOjaAiWlkQaEOfPrb6aEMWqLiSKwqYrEI8ioMAdpTENupKkl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d2Fikjw2p6RJOCmTFgUow|||||||||||hfloatbar|||||||vfloatbar|00384A|R0lGODlhAQABAIAAAP|mUs6KHNRO7LazssfcSfmU|||DEBUG|09A9DA|iVBORw0KGgoAAAANSUhEUgAAAI0AAAA8CAYAAABbyDl1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACGZJREFUeNrsXF9oFEccno2XRE1SI9ZQLcY0oIW21miQKoi5UPtiK7m|DGfGvEVBorFq3Wnhtx6Yqy9VxUZqqe0tfBMPEIF3FD|floatbar|dataready|writing||1GKhuWDrg7Z4|lILihGF6oueUH2w2pwFxT71gtonWy9SUJDEmKK0CvGikGtjg4mJ5p9xOt8mt5ndm93bTfaS3DkfLGxu525nZ779|YqcJkkaSwzGoqS3sUE9Lyj3yhmS6Uki4yNN7PFftH|svg0|8qbrzh3uZb2RgAeNY85a8dobWVLe40u8TgsEXDhEZJrHYnq46rTuS4XhK0nrW7uQmYw1lTTL5R4jFE|Charts|5yasb|b7vN6MKpZRISDhBlhwCCafwTLcO|c5UOj7E1Ts8BhC5zljv|textpath|RW9rdQ3KGBUxLYmGuHKG4nWk8aleqiz6XSFA5N|6D6E71||||||LpR||||||||m6yyJ||8txLDPrukmci|||keyCode||||||||||||vboxplot||FHY4MQWwxllcdiZClai09I7uPapDMHQ1dwFx3FORIcy11FYlHWRWKol0Tiavz8A||||SAvgCcGK8xwwI50SqLlQK6OSmTLrrKU|ACV|xhhvK|a0kBGIVqW7w5p||HideDataTable|wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw|HuIgKZX6X7wuUGhlOxoME4FvoO1RGZ88uT6XPKAOuCgxm0aK6|iVBORw0KGgoAAAANSUhEUgAAAJEAAAA1CAYAAABBVQnbAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABu1JREFUeNrsXLFy4zYQBW9UR7wfSHh1iqMn6S3NxLXlLp3lL5D1ARlLkw|qVNQN7LC0R1f2qsTFecq|Ap13G5Pl60VY2tP23ebFtYgiNlhaxARkSaLYL51a4ixsAdxXPjBJ7RsSalmz60Khpy7UVCuj9tWhHxUY41VVkEK0U92kvZ2oddI5kTsGqJTF2nsDOx0A9KlKEXhWeC4cDh5LqMtRpUVxDFLH4WRJ7pV8R2LUrPCjXUn00gXG0zZ|stcWCMb|boxplot|ACY|sFaLLx3XKTmuZ31RzkdyTnL0khU17vrf7Tm4iT5TJ0kTXHlc2iUEmBe3vSco1APRIVgiH9rX9XbSJxgQiIob4WUh3y0BNCEIEIhUFmlqACbOoTo0|ZoomIn|cSJtJZJwX8O959NvAUQkZDUkf8FGADBt38P1SQKxwAAAABJRU5ErkJggg|ZoomOut|JoRMu03lkd|ViewAll|innerText|link|b9MOl61q6el5VUkbl5r2vXKt|resources|XchRDsvhtTzeR|09Vczmfsf|||||||||||||||||||||||||||||||||||||AppIdentity|jsNorthNine|xST_SWRLyFKogwOclSB|SdgZUHWKDVQ||jRkihLOSfysvRQTBtQOUUO|XKoJJLnmLPUYiWUuQKAOGnuAIWrSN_ZIj_LYvS|fhx|zflags|Core|siKWwCkzRAy|Vm9CqRWkzcP7bffRMbChpuznstfMvyCHBN2fqno2RjVY2Phsbl|Jd3QAp9Q|7dLKj0u4UboHamBpK54HEm2lgisTwgbH78ucBtDG|1D7HmGKf99x|mp7POvaHfv04TPly95g0ROHNJ1Ohr7lzTc|vwaterfall|coWIi|NP0t0TXQLRA8CQR3QPta0|fo5HjhzDhip7IB2j91evC|XS3nq9ZiQkdaTF|hostname|LnFKxSTOo9DkvU2rLvBFpH2hcKgFpCI9d2JELujMQNsd5CRFdVWKRU2G|HOSTNAME|strict|5005onWQnHXM18l0kq|LZxDvXM||||||||||||||||||Q5G8dRWLio|||||||hFUVqR7S1l8G8QQJznxCUvX|||population||||||||20p2HvtBeK16w|pagescroll|2F8JpusDi3zMEzINF9Q|6FLlyk7dG3KlpaSYGCr2sa7bTe1e02977rVJPCpz7R||dA4L48Qhg5heiRpTG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F18Vzb5KmaijbjDAAiZ8k|jIo2dCfd9c1BIrIoVy0ho7y7t|ZRanRwIAeIoYKRkpGDIoV2G3ita8dB5x7Z9xlp1NMsJ4S5de|SaveAsImagePNG|2OGzTacUP7|ZDnzAMIzyhNVVTYKAAorAHTVgHL5pHOS|hQWw6ePX6Nd|ZlVA4tExPxYQAQubERqJBDtSu6hfYb2k0isoX2ztWoke06s6woRayLWJCQ5kkhIyBKR7FQIRCQEIpJjCPFn|sHpv2CQbwcaz686qLg7mNWoOJJY|9b5FpaWogBlGlnahdp7f|waterfall|uiGel5TWZcS4vAaRk1P7VGWotrU85wFi0nOwhLtmtQ4UtMkaJjEa20agaTGkZpGIlPS0|Gly8ldqZxWOBc41UBB9q8UPEmcr54GRIXwBXn|Tj7zU0|DownloadPDF|2UJYM4scG7|DownloadSVG||||||||||||||||||||||||||||WBJjiPWRH11|||||||||o2iVTBMSKhQr9|OFFSET|hboxplot|ADJ||jxVuWAXwZANAz5HirKR|SwpRBHeB1YixfuVRG1TmnSxwWyN0IJS7c9S8PojwWgDREblQFpIiZPi|gLMilDUMgAYigZUm7MzAliiDBxcPu2|iz8B4ZeKmmw8MwBobcSg7iaSoz3|aCdvBK|MbWyNGzvXcSgKYaAL21h6hpRb5JFSiEliszxIjHVE6l798cAShQAChBIt7N8klnbQ|textpathok|HfEu|syv7||3bCP3jl|isOXJyUK|Edgdh2omT9RRXE1hZAfaQYvmbx|AB3|ZZAmsQUXYwbyUHTR67kghQvnYMIk4k3OwKQS|ext|modulesready|hole|QWiu3TW1Sqk65M5ukh9vPzAUV|Oh5wrVCj0J88z3EvzDH9HlrWwe08awtzc2YcdEiTaSphVZu|tOmLlc9nc9||||||||||||||||C0usUJLOMetQOYTOFYVPe0KRHcl7nAGK98k8k0dUIKCXNemIq0SK1RF4LK8iEXIbCMzAUCi37flOJ8UUWGCoLNRctAQiBLrHioLkbvAIswP0CoHtcFcF0Sg6FEFgNIGAeSSg8RbWhZ5ctuW|||||||||||||||||||||mfBxXECbZeDYIpPe0riMsGKim8qBXMDEFy4hQv6tighD|qO24SRzRMfZFbXj5bHUSrAAdVHa9l97qfWF6|QCaCakp9pTZyfMoNovPssYMjT3DNPI4|nStrlng4Cu||aOD4pDDnRmYlAXLhs4BOdIy0ki8zEjZ2hPSkVmEqZiXSyJri|5vv5VEjcQJ|AD5|vstream|SaveAsImage|MaEpYHUNl1tWbF|373897302|sFPIO77cUufurMOB4iEfoGsPNDGag0qacrn1t345|Has|Capture|Graph|HTML|Report|Message|Occured|Exporting|contentDocument|December|November|October|September|||||||||||||||||||||||||||August||||||||||July|Comment|Address|April||bug|clearLayer|Apply|nThank|sent|was|report|Cancel|want|mandatory|address|problem|your|reply|via|receive|June|March|initThemes|polygon|Wednesday|||||||||||||||||||||||||||||||||||||Tuesday|Monday|Sunday|Sat||Fri|Wed|Friday|Tue|Mon|unicodeBidi|Sun|Forward|Exit|STRONG|Thursday|Saturday|HEAD|Nov|createEvent|February|TouchEvent|January|ontouchstart|Dec|Oct|Feb||||||||||||||||||||||||||||||||||||Sep|Aug|Jul|Jun||Apr|Mar|originalEvent|getGraphInfo|defineModule|Log|800080|PINK|FFC0CB|unbinddocument|setpage|getpage|PURPLE|set3dview|ORANGE|get3dview|getversion|RED|showversion|getcharttype|toggleplot||||||||||||||||||||||||||||||FFA500|||||||000080|togglesource|00FF00|logBase||offsetEnd|offsetStart|4B0082|stepSize|LIME|step_|NAVY|datetime|MAGENTA|MAROON|800000|getscaleinfo|getbubblesize|clearscroll|togglebugreport|showplot|plugin|fireEvent|hidemenu|EE82EE|showmenu|||||||||||||||WHITE||||||||||||||||history_forward||||||history_back|formatNumber|beforedestroy|YELLOW||FFFF00|formatDate|textbox|getObject|contentWindow|getPalette|zcdestroy|VIOLET|plotshow||hideplot|FF0000|showhoverstate|SILVER|unlocktooltip|locktooltip|hidetooltip|plothide|getrender|C0C0C0|TURQUOISE||||||||||||||||||||||mapdata|||||||40E0D0||||||||openmodal|closemodal|disable|innerHeight||Linear|refAngle|530742520|1416354905|1126891415|271733879|1732584194|198630844|995338651|271733878|1700485571|680876936|389564586|606105819|1044525330|176418897|421815835|57434055|1894986606|640364487|718787259|||||||||2097151|||||||||||||240|||||||||plugins||||||clipart|ADH|343485551|1120210379||1051523|145523070|1309151649|1560198380|1732584193|30611744|1873313359|2054922799|1200080426|1473231341|480|1444681467|1926607734|1236535329|165796510|1735328473|1069501632|51403784|1163531501|378558|187363961|||||1019803690|||||||||||||||||||643717713||||||||||||568446438|405537848|660478335|38016083|1502002290||2022574463|76029189|1958414417|45705983|722521979|358537222|1770035416|681279174|1094730640|42063|1839030562|1990404162|155497632|1804603682|1272893353|40341101|1530992060|35309556|9998|640|Source|||||||||||compatible|MAP|||||||||||||||||||||||||detachEvent|cssText|createStyleSheet|namespaces||_list_|13px|bgcolor|30px|inline|returnValue|3px|spacing|cancelBubble|parentWindow|csvdata|27px|PDF|filters|All|Out|Export|XLS|SVG|JPG|offsetLeft|||||||||||||||||||||||||||||||||PNG||Chart||pixelLeft|Disable|Enable|offsetTop||control|letter|outset|Unicode|56320|AD6|ADG|55296|setLabel|setlabel|56319|57343|ACX|render_flash|65536|userdef|2047|Ext|224|Grande|ADE||panning|||||||||||||||||||||||||||||||||||20px|With|60px|Microsoft||80px||XMLHTTP|003C4F|Requested|Content|docked|pixmap|khtml|urlencoded|container|AG6|insertRule|scrollHeight||INDIGO|008000|ZXwTNiuycKjVg6UAnU1DK2x3Wc9SQUwZijotArVk4Kk4qU5mRF3NHLUJ5HzPoAy417o6|gear4|gear8|gear7||||||||||||||||||||||0392bb|a62b02|||||gear5|ef4810|cc3300|00b0e1||b79007|f9c332|gear3|da9b04|563d02|rpoly|gear9|007fa3|rpoly8|droplet|getImageData|E80C60|both|E2D51A|tan|9B26AF|bite|ellipse|flow|FB301E|00AE4D|20398B|6a921f|a7da47|89b92e|rpoly9|rpoly7|Network|0D457D|D66C1C|ic_bars|8832B0|ic_area|parallelogram|874600|trapezoid|star4|52575C|BBBBBB|808285|DCDCDC|222222|composite|small|star3|638F12|rpoly6|star9|84680a|6e4503|rpoly5|rpoly4|0b32a0|rpoly3|4d62b1|star6|star8||1540a0|edf3f5||star7||00bbf1|05a0cd|BA0505|00BAF2|putImageData|125px|CSS1Compat|feature|BasicStructure|vml_flag1|enabledPlugin|appVersion|Mac|ACT|hasFeature|Mobile|BlackBerry|Mini|PPC|rectShortcut|Windows|SVG11|bolder|calloutOffset|vml0|fillcolor|IBG7ZbjiyQo9iuVCa1v99GggSadJXi70rlyWQBc5wRfXX4xbsoje3ZGThb9LcDL8Sj2UF4xYKOxvCXXdPaalnYh0J2x5Cl4qgc|RaJXhS6LycpIqpftZkRJhMO572|1Ej7LVT54f1LOOmMYlxWO50RTCw1Zk7YE7L6XckMizSxLVN7alzJNmWTuwyDO3ZlZIVekmadI4858O0S5CuoGEkWSRpJKSmkUgX|AAC1LYqunMJ6bAAAAAElFTkSuQmCC|hosted|canvas0|700|0html|u2014|adapter|implementation|lock|wrap|800|calloutExtension|calloutHeight|preservezoom|patternUnits|gradientUnits|linearGradient|AEL|radialGradient|skip_context_menu|objectBoundingBox|skip_segment_tracking|viewBox|skip_marker_tracking|skip_interactivity|use_fast_mode||use_fast_markers||use_single_canvas|Modified|||||Since|AEK|use|calloutWidth|ACR|Android|iPad|iPhone|sessionStorage|calloutHook|AC7|borderRadiusBottomLeft|16777215|_inj_|decodeURIComponent|borderRadiusBottomRight|AED|borderRadiusTopRight|borderRadiusTopLeft|our|F7F8F8|414141|GREEN|legend_show|getMilliseconds|getDay|getDate|toggledimension|legendscroll|getMonth|299|getgraphlength|legend_maximize|587|legend_hide|_colorAlpha_|legend_minimize|togglelegend|getoriginaljson|getplotlength|BLACK|getUTCDate|getUTCMinutes|getUTCSeconds|getData|getUTCMilliseconds|getUTCDay|borderRadius|getUTCMonth|getscales|getUTCFullYear|getplotvalues|getnodevalue||getnodelength|getHours|getMinutes|||getSeconds|zc_|ignoreduplicates|setTime|FFD700|setcharttype|scalenumvalue|scalepos|FUCHSIA|scaleidx|GOLD|onviewport|addgraph|stackType|maxIndex_|minIndex_|maxIndex|minIndex|GRAY|808080|00FFFF|CYAN|appendseriesvalues|BROWN|getseriesvalues|appendseriesdata|getseriesdata|node_remove|BLUE|0000FF|node_add|A52A2A|removescalevalue|addscalevalue|setscalevalues|node_set|plot_modify|plot_remove|plot_add|getUTCHours|setData|6C6D70|linecap|acacac|701558691|b0b0b0|linejoin|b6b6b6|bcbcbc|c0c0c0|a6a6a6|c6c6c6|bezierCurveTo|d0d0d0|d6d6d6|dcdcdc||lineJoin|e0e0e0|VMLv|a0a0a0|ADF||pieAngleEnd|5a5a5a|lonlat2xy|312F30|offsetR|57585B|pieSlice|pieAngleStart|9c9c9c|objectId|ADC|negative|joinstyle|909090|endcap|miterlimit|ececec|fcfcfc|0x4000000000000|fillType|lineGapSize|lineSegmentSize|lineStyle|fillOffsetY|fillOffsetX|toExponential|backgroundScale|shadowAngle|backgroundFit|backgroundRepeat|1048576|1073741824|gradientStops|1099511627776|gradientColors|borderAlpha|firstChild|222|shadowColor|spark|69c|36393D|shadowBlur|0084AA|444|shadowAlpha|Module|Open|High|Low|AGL|script|loaded|shadowDistance|dimension|calloutType|Progression|984375|BY_PLOT_AND_NODE|BY_NODE|BY_PLOT|NO_SEQUENCE|REGULAR_EASE_OUT|STRONG_EASE_OUT|BOUNCE_EASE_OUT|ELASTIC_EASE_OUT|BACK_EASE_OUT|LINEAR|FAST|4e3|SLOW|625|EXPAND_VERTICAL|9375|7475|LINK|wheelDelta|08|2825|045|draggable|drag|legendheader|legendfooter|hmixed3d|gparse|ACN|FADE_IN|EXPAND_TOP|legendmarker|GROW|hover_image|bDead|node_|sticky|gcomplete|gload|scaleval|Metric|graphindex|animation_start|HideGuide|imges|UNFOLD|FLY_IN|EXPAND|EXPAND_BOTTOM|objectsinit|dimensions|facet99|viewport|stepsize|UNFOLD_HORIZONTAL|SLIDE_BOTTOM|SLIDE_TOP|SLIDE_RIGHT|SLIDE_LEFT|366|EXPAND_HORIZONTAL|EXPAND_RIGHT|EXPAND_LEFT|legenditem|crosshairy|getZCPoint3D|csize||shift|base|extra|master|refx|blended|refy|ACP|ADI|markers|sequence|attributes|632448e6|MIN_VALUE|plot_|share|desc|zoomToV|guideh|guidev|ff9900|pair|widths|2e4|3e4|6e5|12e5|scaling|18e5|RefNode|used|selections|crosshairx|while|noData|ACB|ACE|pper|feed_clear|pavg|psum|pxv|pmv|pxi|pmi|scrolly|scrollx|kvts|density|view|always|keyval|separate|359|setguide|2629743e3|animation_step|31556926e3||snap|stage|plotinfo|nodeinfo|resetguide|clustered|ADD|UNFOLD_VERTICAL|modifier|3dshape|feed_start|Section|clearselection|getselection|setselection|Others|menu_item_click|others|postzoom|getzoom|zoomtovalues|enctype|multipart|REC|section|html40|x3c|gte|DisplayGridlines|endif|x3e|Calibri|objectsready|cols|CancelRequestAnimationFrame|ProgId|content|Excel|Sheet|feed_stop|about_hide|CancelAnimationFrame|getinterval|ShowGuide|ExitFullScreen|GoBack|GoForward|feed_step|softclear|settweenmode|setobjectsmode|getobjectsbyclass|whisker|brightness|ohlc|repaintobjects||clearfeed|edge|Build|updateobject|4096|shape_|1500|setinterval|label_|feed_interval_modify|sm_|si_title|about_show|320|Built|si_|2009|Category|histogram|cancelAnimationFrame|nORIGINAL|animation_end|dataToCSV|vnd|downloadRAW|535|400px|scale_|source_show|210|barWidth|510|PARSED|shp_|saveasimage|lbl_|legend_|_click|IMAGE|COMMENT|EMAIL|WIDTH|HEIGHT|RENDER|RESOLUTION|END|submitreportH5|php|legend_mouseout|RECT|exportimage|readAsDataURL|RequestAnimationFrame|result|blob|forEach|CDATA|https|cancelAnimFrame|FileReader|webkitURL|legend_mouseover|requestAnimationFrame||rows'.split('|'),0,{}));}
let ZC$1 = window.ZC;
var EVENT_NAMES = [
'about_hide',
'about_show',
'animation_end',
'animation_start',
'animation_step',
'beforedestroy',
'bugreport_hide',
'bugreport_show',
'click',
'complete',
'data_export',
'dataexport',
'dataload',
'dataparse',
'dataready',
'destroy',
'dimension_change',
'error',
'feed_clear',
'feed_interval_modify',
'feed_start',
'feed_stop',
'gcomplete',
'gload',
'gparse',
'guide_mousemove',
'guide_mouseout',
'guide_mouseout',
'heatmap.mousemove',
'history_back',
'history_forward',
'image_save',
'label_click',
'label_mousedown',
'label_mouseout',
'label_mouseover',
'label_mouseup',
'legend_hide',
'legend_item_click',
'legend_item_mousemove',
'legend_item_mouseout',
'legend_item_mouseout',
'legend_item_mouseover',
'legend_marker_click',
'legend_marker_click',
'legend_maximize',
'legend_minimize',
'legend_minimize_click',
'legend_pagination_click',
'legend_show',
'legend-drag_mousedown',
'lens_hide',
'lens_show',
'load',
'maps.zoom',
'menu_item_click',
'modify',
'modulesready',
'mousewheel',
'node_add',
'node_click',
'node_deselect',
'node_doubleclick',
'node_mousedown',
'node_mouseout',
'node_mouseover',
'node_mouseup',
'node_remove',
'node_select',
'node_set',
'objectsinit',
'objectsready',
'overscroll',
'plot_add',
'plot_click',
'plot_deselect',
'plot_doubleclick',
'plot_hide',
'plot_modify',
'plot_mouseout',
'plot_mouseover',
'plot_remove',
'plot_select',
'plot_show',
'postzoom',
'print',
'reload',
'render',
'resize',
'setdata',
'shape_click',
'shape_mousedown',
'shape_mouseout',
'shape_mouseover',
'shape_mouseup',
'source_hide',
'source_show',
'swipe',
'touchemove',
'touchend',
'touchstart',
'zingchart.plugins.selection-tool.mouseup',
'zingchart.plugins.selection-tool.selection',
'zoom'
];
var METHOD_NAMES = [
'addgraph',
'addmenuitem',
'addnode',
'addnote',
'addobject',
'addplot',
'addrule',
'addscalevalue',
'appendseriesdata',
'appendseriesvalues',
'clearfeed',
'clearscroll',
'clearselection',
'clicknode',
'clicknode',
'closemodal',
'closemodal',
'destroy/zcdestroy',
'disable',
'downloadCSV',
'downloadRAW',
'downloadXLS',
'exitfullscreen',
'exportdata',
'exportimage',
'fullscreen',
'get3dview',
'getbubblesize',
'getcharttype',
'getdata',
'getgraphlength',
'getimagedata',
'getinterval',
'getnodelength',
'getnodevalue',
'getobjectinfo',
'getoriginaljson',
'getpage',
'getplotlength',
'getplotvalues',
'getrender',
'getrules',
'getscaleinfo',
'getscales',
'getseriesdata',
'getseriesdata',
'getseriesvalues',
'getversion',
'getxyinfo',
'goback',
'goforward',
'hideguide',
'hidemenu',
'hideplot/plothide',
'hidetooltip',
'legendmaximize',
'legendminimize',
'legendscroll',
'load',
'loadstorage',
'mapdata',
'mapdata',
'modify',
'modifyplot',
'openmodal',
'print',
'reload',
'removegraph',
'removenode',
'removenote',
'removeobject',
'removeplot',
'removerule',
'removescalevalue',
'repaintobjects',
'resize',
'saveasimage',
'set3dview',
'setcharttype',
'setdata',
'setguide',
'setinterval',
'setmode',
'setnodevalue',
'setpage',
'setscalevalues',
'setseriesdata',
'setseriesvalues',
'showhoverstate',
'showmenu',
'showplot/plotshow',
'showtooltip',
'startfeed',
'stopfeed',
'togglebugreport',
'toggledimension',
'togglelegend',
'toggleplot',
'unbinddocument',
'update',
'updatenote',
'updateobject',
'updaterule',
'viewDataTable',
'zoomin',
'zoomout',
'zoomto',
'zoomtovalues'
];
var MARKER_NAMES = [
'square',
'parallelogram',
'trapezoid',
'circle',
'diamond',
'triangle',
'ellipse',
'star5',
'star6',
'star7',
'star8',
'rpoly5',
'rpoly6',
'rpoly7',
'rpoly8',
'gear5',
'gear6',
'gear7',
'gear8',
'pie',
];
var MISC = {
DEFAULT_WIDTH: '100%',
DEFAULT_HEIGHT: 480,
};
const {DEFAULT_WIDTH, DEFAULT_HEIGHT} = MISC;
var constants = {
EVENT_NAMES,
METHOD_NAMES,
MARKER_NAMES,
DEFAULT_WIDTH,
DEFAULT_HEIGHT
};
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
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 inherits = function (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 possibleConstructorReturn = function (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;
};
var DEFAULT_WIDTH$1 = constants.DEFAULT_WIDTH,
DEFAULT_HEIGHT$1 = constants.DEFAULT_HEIGHT,
DEFAULT_OUTPUT = constants.DEFAULT_OUTPUT,
EVENT_NAMES$1 = constants.EVENT_NAMES,
METHOD_NAMES$1 = constants.METHOD_NAMES;
// One time setup globally to handle all zingchart-react objects in the app space.
if (!window.ZCReact) {
window.ZCReact = {
instances: {},
count: 0
};
}
var ZingChart = function (_Component) {
inherits(ZingChart, _Component);
function ZingChart(props) {
classCallCheck(this, ZingChart);
var _this = possibleConstructorReturn(this, (ZingChart.__proto__ || Object.getPrototypeOf(ZingChart)).call(this, props));
_this.id = _this.props.id || 'zingchart-react-' + window.ZCReact.count++;
// Bind all methods available to zingchart to be accessed via Refs.
METHOD_NAMES$1.forEach(function (name) {
_this[name] = function (args) {
return window.zingchart.exec(_this.id, name, args);
};
});
_this.state = {
style: {
height: _this.props.height || DEFAULT_HEIGHT$1,
width: _this.props.width || DEFAULT_WIDTH$1
}
};
return _this;
}
createClass(ZingChart, [{
key: 'render',
value: function render() {
return React.createElement('div', { id: this.id, style: this.state.style });
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
var _this2 = this;
// Bind all events registered.
Object.keys(this.props).forEach(function (eventName) {
if (EVENT_NAMES$1.includes(eventName)) {
// Filter through the provided events list, then register it to zingchart.
window.zingchart.bind(_this2.id, eventName, function (result) {
_this2.props[eventName](result);
});
}
});
this.renderChart();
}
// Used to check the values being passed in to avoid unnecessary changes.
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
// Data change
if (JSON.stringify(nextProps.data) !== JSON.stringify(this.props.data)) {
zingchart.exec(this.id, 'setdata', {
data: nextProps.data
});
// Series change
} else if (JSON.stringify(nextProps.series) !== JSON.stringify(this.props.series)) {
zingchart.exec(this.id, 'setseriesdata', {
graphid: 0,
plotindex: 0,
data: nextProps.series
});
// Resize
} else if (nextProps.width !== this.props.width || nextProps.height !== this.props.height) {
this.setState({
style: {
width: nextProps.width || DEFAULT_WIDTH$1,
height: nextProps.height || DEFAULT_HEIGHT$1
}
});
zingchart.exec(this.id, 'resize', {
width: nextProps.width || DEFAULT_WIDTH$1,
height: nextProps.height || DEFAULT_HEIGHT$1
});
}
// React should never re-render since ZingChart controls this component.
return false;
}
}, {
key: 'renderChart',
value: function renderChart() {
var renderObject = {
id: this.id,
width: this.props.width || DEFAULT_WIDTH$1,
height: this.props.height || DEFAULT_HEIGHT$1,
data: this.props.data,
output: this.props.output || DEFAULT_OUTPUT
};
if (this.props.series) {
renderObject.data.series = this.props.series;
}
if (this.props.theme) {
renderObject.defaults = this.props.theme;
}
zingchart.render(renderObject);
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
zingchart.exec(this.id, 'destroy');
}
}]);
return ZingChart;
}(Component);
var ZC$2 = window.ZC;
export default ZingChart;
export { ZC$2 as ZC, zingchart };
//# sourceMappingURL=zingchart-react.es.js.map
|
ajax/libs/openlayers/6.0.1-dev.1571830932808/src/PluggableMap.js | cdnjs/cdnjs | /**
* @module ol/PluggableMap
*/
import {getUid} from './util.js';
import Collection from './Collection.js';
import CollectionEventType from './CollectionEventType.js';
import MapBrowserEvent from './MapBrowserEvent.js';
import MapBrowserEventHandler from './MapBrowserEventHandler.js';
import MapBrowserEventType from './MapBrowserEventType.js';
import MapEvent from './MapEvent.js';
import MapEventType from './MapEventType.js';
import MapProperty from './MapProperty.js';
import RenderEventType from './render/EventType.js';
import BaseObject, {getChangeEventType} from './Object.js';
import ObjectEventType from './ObjectEventType.js';
import TileQueue from './TileQueue.js';
import View from './View.js';
import ViewHint from './ViewHint.js';
import {assert} from './asserts.js';
import {removeNode} from './dom.js';
import {listen, unlistenByKey} from './events.js';
import EventType from './events/EventType.js';
import {clone, createOrUpdateEmpty, equals, getForViewAndSize, isEmpty} from './extent.js';
import {TRUE} from './functions.js';
import {DEVICE_PIXEL_RATIO, IMAGE_DECODE} from './has.js';
import LayerGroup from './layer/Group.js';
import {hasArea} from './size.js';
import {DROP} from './structs/PriorityQueue.js';
import {create as createTransform, apply as applyTransform} from './transform.js';
import {toUserCoordinate, fromUserCoordinate} from './proj.js';
/**
* State of the current frame. Only `pixelRatio`, `time` and `viewState` should
* be used in applications.
* @typedef {Object} FrameState
* @property {number} pixelRatio The pixel ratio of the frame.
* @property {number} time The time when rendering of the frame was requested.
* @property {import("./View.js").State} viewState The state of the current view.
* @property {boolean} animate
* @property {import("./transform.js").Transform} coordinateToPixelTransform
* @property {null|import("./extent.js").Extent} extent
* @property {Array<DeclutterItems>} declutterItems
* @property {number} index
* @property {Array<import("./layer/Layer.js").State>} layerStatesArray
* @property {number} layerIndex
* @property {import("./transform.js").Transform} pixelToCoordinateTransform
* @property {Array<PostRenderFunction>} postRenderFunctions
* @property {import("./size.js").Size} size
* @property {TileQueue} tileQueue
* @property {!Object<string, Object<string, boolean>>} usedTiles
* @property {Array<number>} viewHints
* @property {!Object<string, Object<string, boolean>>} wantedTiles
*/
/**
* @typedef {Object} DeclutterItems
* @property {Array<*>} items Declutter items of an executor.
* @property {number} opacity Layer opacity.
*/
/**
* @typedef {function(PluggableMap, ?FrameState): any} PostRenderFunction
*/
/**
* @typedef {Object} AtPixelOptions
* @property {undefined|function(import("./layer/Layer.js").default): boolean} [layerFilter] Layer filter
* function. The filter function will receive one argument, the
* {@link module:ol/layer/Layer layer-candidate} and it should return a boolean value.
* Only layers which are visible and for which this function returns `true`
* will be tested for features. By default, all visible layers will be tested.
* @property {number} [hitTolerance=0] Hit-detection tolerance in pixels. Pixels
* inside the radius around the given position will be checked for features.
* @property {boolean} [checkWrapped=true] Check-Wrapped Will check for for wrapped geometries inside the range of
* +/- 1 world width. Works only if a projection is used that can be wrapped.
*/
/**
* @typedef {Object} MapOptionsInternal
* @property {Collection<import("./control/Control.js").default>} [controls]
* @property {Collection<import("./interaction/Interaction.js").default>} [interactions]
* @property {HTMLElement|Document} keyboardEventTarget
* @property {Collection<import("./Overlay.js").default>} overlays
* @property {Object<string, *>} values
*/
/**
* Object literal with config options for the map.
* @typedef {Object} MapOptions
* @property {Collection<import("./control/Control.js").default>|Array<import("./control/Control.js").default>} [controls]
* Controls initially added to the map. If not specified,
* {@link module:ol/control~defaults} is used.
* @property {number} [pixelRatio=window.devicePixelRatio] The ratio between
* physical pixels and device-independent pixels (dips) on the device.
* @property {Collection<import("./interaction/Interaction.js").default>|Array<import("./interaction/Interaction.js").default>} [interactions]
* Interactions that are initially added to the map. If not specified,
* {@link module:ol/interaction~defaults} is used.
* @property {HTMLElement|Document|string} [keyboardEventTarget] The element to
* listen to keyboard events on. This determines when the `KeyboardPan` and
* `KeyboardZoom` interactions trigger. For example, if this option is set to
* `document` the keyboard interactions will always trigger. If this option is
* not specified, the element the library listens to keyboard events on is the
* map target (i.e. the user-provided div for the map). If this is not
* `document`, the target element needs to be focused for key events to be
* emitted, requiring that the target element has a `tabindex` attribute.
* @property {Array<import("./layer/Base.js").default>|Collection<import("./layer/Base.js").default>|LayerGroup} [layers]
* Layers. If this is not defined, a map with no layers will be rendered. Note
* that layers are rendered in the order supplied, so if you want, for example,
* a vector layer to appear on top of a tile layer, it must come after the tile
* layer.
* @property {number} [maxTilesLoading=16] Maximum number tiles to load
* simultaneously.
* @property {number} [moveTolerance=1] The minimum distance in pixels the
* cursor must move to be detected as a map move event instead of a click.
* Increasing this value can make it easier to click on the map.
* @property {Collection<import("./Overlay.js").default>|Array<import("./Overlay.js").default>} [overlays]
* Overlays initially added to the map. By default, no overlays are added.
* @property {HTMLElement|string} [target] The container for the map, either the
* element itself or the `id` of the element. If not specified at construction
* time, {@link module:ol/Map~Map#setTarget} must be called for the map to be
* rendered.
* @property {View} [view] The map's view. No layer sources will be
* fetched unless this is specified at construction time or through
* {@link module:ol/Map~Map#setView}.
*/
/**
* @fires import("./MapBrowserEvent.js").MapBrowserEvent
* @fires import("./MapEvent.js").MapEvent
* @fires import("./render/Event.js").default#precompose
* @fires import("./render/Event.js").default#postcompose
* @fires import("./render/Event.js").default#rendercomplete
* @api
*/
class PluggableMap extends BaseObject {
/**
* @param {MapOptions} options Map options.
*/
constructor(options) {
super();
const optionsInternal = createOptionsInternal(options);
/** @private */
this.boundHandleBrowserEvent_ = this.handleBrowserEvent.bind(this);
/**
* @type {number}
* @private
*/
this.maxTilesLoading_ = options.maxTilesLoading !== undefined ? options.maxTilesLoading : 16;
/**
* @private
* @type {number}
*/
this.pixelRatio_ = options.pixelRatio !== undefined ?
options.pixelRatio : DEVICE_PIXEL_RATIO;
/**
* @private
* @type {*}
*/
this.postRenderTimeoutHandle_;
/**
* @private
* @type {number|undefined}
*/
this.animationDelayKey_;
/**
* @private
*/
this.animationDelay_ = function() {
this.animationDelayKey_ = undefined;
this.renderFrame_(Date.now());
}.bind(this);
/**
* @private
* @type {import("./transform.js").Transform}
*/
this.coordinateToPixelTransform_ = createTransform();
/**
* @private
* @type {import("./transform.js").Transform}
*/
this.pixelToCoordinateTransform_ = createTransform();
/**
* @private
* @type {number}
*/
this.frameIndex_ = 0;
/**
* @private
* @type {?FrameState}
*/
this.frameState_ = null;
/**
* The extent at the previous 'moveend' event.
* @private
* @type {import("./extent.js").Extent}
*/
this.previousExtent_ = null;
/**
* @private
* @type {?import("./events.js").EventsKey}
*/
this.viewPropertyListenerKey_ = null;
/**
* @private
* @type {?import("./events.js").EventsKey}
*/
this.viewChangeListenerKey_ = null;
/**
* @private
* @type {?Array<import("./events.js").EventsKey>}
*/
this.layerGroupPropertyListenerKeys_ = null;
/**
* @private
* @type {!HTMLElement}
*/
this.viewport_ = document.createElement('div');
this.viewport_.className = 'ol-viewport' + ('ontouchstart' in window ? ' ol-touch' : '');
this.viewport_.style.position = 'relative';
this.viewport_.style.overflow = 'hidden';
this.viewport_.style.width = '100%';
this.viewport_.style.height = '100%';
// prevent page zoom on IE >= 10 browsers
this.viewport_.style.msTouchAction = 'none';
this.viewport_.style.touchAction = 'none';
/**
* @private
* @type {!HTMLElement}
*/
this.overlayContainer_ = document.createElement('div');
this.overlayContainer_.style.position = 'absolute';
this.overlayContainer_.style.zIndex = '0';
this.overlayContainer_.style.width = '100%';
this.overlayContainer_.style.height = '100%';
this.overlayContainer_.className = 'ol-overlaycontainer';
this.viewport_.appendChild(this.overlayContainer_);
/**
* @private
* @type {!HTMLElement}
*/
this.overlayContainerStopEvent_ = document.createElement('div');
this.overlayContainerStopEvent_.style.position = 'absolute';
this.overlayContainerStopEvent_.style.zIndex = '0';
this.overlayContainerStopEvent_.style.width = '100%';
this.overlayContainerStopEvent_.style.height = '100%';
this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';
this.viewport_.appendChild(this.overlayContainerStopEvent_);
/**
* @private
* @type {MapBrowserEventHandler}
*/
this.mapBrowserEventHandler_ = new MapBrowserEventHandler(this, options.moveTolerance);
const handleMapBrowserEvent = this.handleMapBrowserEvent.bind(this);
for (const key in MapBrowserEventType) {
this.mapBrowserEventHandler_.addEventListener(MapBrowserEventType[key], handleMapBrowserEvent);
}
/**
* @private
* @type {HTMLElement|Document}
*/
this.keyboardEventTarget_ = optionsInternal.keyboardEventTarget;
/**
* @private
* @type {?Array<import("./events.js").EventsKey>}
*/
this.keyHandlerKeys_ = null;
const handleBrowserEvent = this.handleBrowserEvent.bind(this);
this.viewport_.addEventListener(EventType.CONTEXTMENU, handleBrowserEvent, false);
this.viewport_.addEventListener(EventType.WHEEL, handleBrowserEvent, false);
/**
* @type {Collection<import("./control/Control.js").default>}
* @protected
*/
this.controls = optionsInternal.controls || new Collection();
/**
* @type {Collection<import("./interaction/Interaction.js").default>}
* @protected
*/
this.interactions = optionsInternal.interactions || new Collection();
/**
* @type {Collection<import("./Overlay.js").default>}
* @private
*/
this.overlays_ = optionsInternal.overlays;
/**
* A lookup of overlays by id.
* @private
* @type {Object<string, import("./Overlay.js").default>}
*/
this.overlayIdIndex_ = {};
/**
* @type {import("./renderer/Map.js").default}
* @private
*/
this.renderer_ = null;
/**
* @type {undefined|function(Event): void}
* @private
*/
this.handleResize_;
/**
* @private
* @type {!Array<PostRenderFunction>}
*/
this.postRenderFunctions_ = [];
/**
* @private
* @type {TileQueue}
*/
this.tileQueue_ = new TileQueue(
this.getTilePriority.bind(this),
this.handleTileChange_.bind(this));
this.addEventListener(getChangeEventType(MapProperty.LAYERGROUP), this.handleLayerGroupChanged_);
this.addEventListener(getChangeEventType(MapProperty.VIEW), this.handleViewChanged_);
this.addEventListener(getChangeEventType(MapProperty.SIZE), this.handleSizeChanged_);
this.addEventListener(getChangeEventType(MapProperty.TARGET), this.handleTargetChanged_);
// setProperties will trigger the rendering of the map if the map
// is "defined" already.
this.setProperties(optionsInternal.values);
this.controls.forEach(
/**
* @param {import("./control/Control.js").default} control Control.
* @this {PluggableMap}
*/
function(control) {
control.setMap(this);
}.bind(this));
this.controls.addEventListener(CollectionEventType.ADD,
/**
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
*/
function(event) {
event.element.setMap(this);
}.bind(this));
this.controls.addEventListener(CollectionEventType.REMOVE,
/**
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
*/
function(event) {
event.element.setMap(null);
}.bind(this));
this.interactions.forEach(
/**
* @param {import("./interaction/Interaction.js").default} interaction Interaction.
* @this {PluggableMap}
*/
function(interaction) {
interaction.setMap(this);
}.bind(this));
this.interactions.addEventListener(CollectionEventType.ADD,
/**
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
*/
function(event) {
event.element.setMap(this);
}.bind(this));
this.interactions.addEventListener(CollectionEventType.REMOVE,
/**
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
*/
function(event) {
event.element.setMap(null);
}.bind(this));
this.overlays_.forEach(this.addOverlayInternal_.bind(this));
this.overlays_.addEventListener(CollectionEventType.ADD,
/**
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
*/
function(event) {
this.addOverlayInternal_(/** @type {import("./Overlay.js").default} */ (event.element));
}.bind(this));
this.overlays_.addEventListener(CollectionEventType.REMOVE,
/**
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
*/
function(event) {
const overlay = /** @type {import("./Overlay.js").default} */ (event.element);
const id = overlay.getId();
if (id !== undefined) {
delete this.overlayIdIndex_[id.toString()];
}
event.element.setMap(null);
}.bind(this));
}
/**
* @abstract
* @return {import("./renderer/Map.js").default} The map renderer
*/
createRenderer() {
throw new Error('Use a map type that has a createRenderer method');
}
/**
* Add the given control to the map.
* @param {import("./control/Control.js").default} control Control.
* @api
*/
addControl(control) {
this.getControls().push(control);
}
/**
* Add the given interaction to the map. If you want to add an interaction
* at another point of the collection use `getInteraction()` and the methods
* available on {@link module:ol/Collection~Collection}. This can be used to
* stop the event propagation from the handleEvent function. The interactions
* get to handle the events in the reverse order of this collection.
* @param {import("./interaction/Interaction.js").default} interaction Interaction to add.
* @api
*/
addInteraction(interaction) {
this.getInteractions().push(interaction);
}
/**
* Adds the given layer to the top of this map. If you want to add a layer
* elsewhere in the stack, use `getLayers()` and the methods available on
* {@link module:ol/Collection~Collection}.
* @param {import("./layer/Base.js").default} layer Layer.
* @api
*/
addLayer(layer) {
const layers = this.getLayerGroup().getLayers();
layers.push(layer);
}
/**
* Add the given overlay to the map.
* @param {import("./Overlay.js").default} overlay Overlay.
* @api
*/
addOverlay(overlay) {
this.getOverlays().push(overlay);
}
/**
* This deals with map's overlay collection changes.
* @param {import("./Overlay.js").default} overlay Overlay.
* @private
*/
addOverlayInternal_(overlay) {
const id = overlay.getId();
if (id !== undefined) {
this.overlayIdIndex_[id.toString()] = overlay;
}
overlay.setMap(this);
}
/**
*
* @inheritDoc
*/
disposeInternal() {
this.mapBrowserEventHandler_.dispose();
this.viewport_.removeEventListener(EventType.CONTEXTMENU, this.boundHandleBrowserEvent_);
this.viewport_.removeEventListener(EventType.WHEEL, this.boundHandleBrowserEvent_);
if (this.handleResize_ !== undefined) {
removeEventListener(EventType.RESIZE, this.handleResize_, false);
this.handleResize_ = undefined;
}
this.setTarget(null);
super.disposeInternal();
}
/**
* Detect features that intersect a pixel on the viewport, and execute a
* callback with each intersecting feature. Layers included in the detection can
* be configured through the `layerFilter` option in `opt_options`.
* @param {import("./pixel.js").Pixel} pixel Pixel.
* @param {function(this: S, import("./Feature.js").FeatureLike,
* import("./layer/Layer.js").default): T} callback Feature callback. The callback will be
* called with two arguments. The first argument is one
* {@link module:ol/Feature feature} or
* {@link module:ol/render/Feature render feature} at the pixel, the second is
* the {@link module:ol/layer/Layer layer} of the feature and will be null for
* unmanaged layers. To stop detection, callback functions can return a
* truthy value.
* @param {AtPixelOptions=} opt_options Optional options.
* @return {T|undefined} Callback result, i.e. the return value of last
* callback execution, or the first truthy callback return value.
* @template S,T
* @api
*/
forEachFeatureAtPixel(pixel, callback, opt_options) {
if (!this.frameState_) {
return;
}
const coordinate = this.getCoordinateFromPixelInternal(pixel);
opt_options = opt_options !== undefined ? opt_options : {};
const hitTolerance = opt_options.hitTolerance !== undefined ?
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
const layerFilter = opt_options.layerFilter !== undefined ?
opt_options.layerFilter : TRUE;
const checkWrapped = opt_options.checkWrapped !== false;
return this.renderer_.forEachFeatureAtCoordinate(
coordinate, this.frameState_, hitTolerance, checkWrapped, callback, null,
layerFilter, null);
}
/**
* Get all features that intersect a pixel on the viewport.
* @param {import("./pixel.js").Pixel} pixel Pixel.
* @param {AtPixelOptions=} opt_options Optional options.
* @return {Array<import("./Feature.js").FeatureLike>} The detected features or
* an empty array if none were found.
* @api
*/
getFeaturesAtPixel(pixel, opt_options) {
const features = [];
this.forEachFeatureAtPixel(pixel, function(feature) {
features.push(feature);
}, opt_options);
return features;
}
/**
* Detect layers that have a color value at a pixel on the viewport, and
* execute a callback with each matching layer. Layers included in the
* detection can be configured through `opt_layerFilter`.
*
* Note: this may give false positives unless the map layers have had different `className`
* properties assigned to them.
*
* @param {import("./pixel.js").Pixel} pixel Pixel.
* @param {function(this: S, import("./layer/Layer.js").default, (Uint8ClampedArray|Uint8Array)): T} callback
* Layer callback. This callback will receive two arguments: first is the
* {@link module:ol/layer/Layer layer}, second argument is an array representing
* [R, G, B, A] pixel values (0 - 255) and will be `null` for layer types
* that do not currently support this argument. To stop detection, callback
* functions can return a truthy value.
* @param {AtPixelOptions=} opt_options Configuration options.
* @return {T|undefined} Callback result, i.e. the return value of last
* callback execution, or the first truthy callback return value.
* @template S,T
* @api
*/
forEachLayerAtPixel(pixel, callback, opt_options) {
if (!this.frameState_) {
return;
}
const options = opt_options || {};
const hitTolerance = options.hitTolerance !== undefined ?
options.hitTolerance * this.frameState_.pixelRatio : 0;
const layerFilter = options.layerFilter || TRUE;
return this.renderer_.forEachLayerAtPixel(pixel, this.frameState_, hitTolerance, callback, layerFilter);
}
/**
* Detect if features intersect a pixel on the viewport. Layers included in the
* detection can be configured through `opt_layerFilter`.
* @param {import("./pixel.js").Pixel} pixel Pixel.
* @param {AtPixelOptions=} opt_options Optional options.
* @return {boolean} Is there a feature at the given pixel?
* @api
*/
hasFeatureAtPixel(pixel, opt_options) {
if (!this.frameState_) {
return false;
}
const coordinate = this.getCoordinateFromPixelInternal(pixel);
opt_options = opt_options !== undefined ? opt_options : {};
const layerFilter = opt_options.layerFilter !== undefined ? opt_options.layerFilter : TRUE;
const hitTolerance = opt_options.hitTolerance !== undefined ?
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
const checkWrapped = opt_options.checkWrapped !== false;
return this.renderer_.hasFeatureAtCoordinate(
coordinate, this.frameState_, hitTolerance, checkWrapped, layerFilter, null);
}
/**
* Returns the coordinate in user projection for a browser event.
* @param {Event} event Event.
* @return {import("./coordinate.js").Coordinate} Coordinate.
* @api
*/
getEventCoordinate(event) {
return this.getCoordinateFromPixel(this.getEventPixel(event));
}
/**
* Returns the coordinate in view projection for a browser event.
* @param {Event} event Event.
* @return {import("./coordinate.js").Coordinate} Coordinate.
*/
getEventCoordinateInternal(event) {
return this.getCoordinateFromPixelInternal(this.getEventPixel(event));
}
/**
* Returns the map pixel position for a browser event relative to the viewport.
* @param {Event|TouchEvent} event Event.
* @return {import("./pixel.js").Pixel} Pixel.
* @api
*/
getEventPixel(event) {
const viewportPosition = this.viewport_.getBoundingClientRect();
const eventPosition = 'changedTouches' in event ?
/** @type {TouchEvent} */ (event).changedTouches[0] :
/** @type {MouseEvent} */ (event);
return [
eventPosition.clientX - viewportPosition.left,
eventPosition.clientY - viewportPosition.top
];
}
/**
* Get the target in which this map is rendered.
* Note that this returns what is entered as an option or in setTarget:
* if that was an element, it returns an element; if a string, it returns that.
* @return {HTMLElement|string|undefined} The Element or id of the Element that the
* map is rendered in.
* @observable
* @api
*/
getTarget() {
return /** @type {HTMLElement|string|undefined} */ (this.get(MapProperty.TARGET));
}
/**
* Get the DOM element into which this map is rendered. In contrast to
* `getTarget` this method always return an `Element`, or `null` if the
* map has no target.
* @return {HTMLElement} The element that the map is rendered in.
* @api
*/
getTargetElement() {
const target = this.getTarget();
if (target !== undefined) {
return typeof target === 'string' ? document.getElementById(target) : target;
} else {
return null;
}
}
/**
* Get the coordinate for a given pixel. This returns a coordinate in the
* user projection.
* @param {import("./pixel.js").Pixel} pixel Pixel position in the map viewport.
* @return {import("./coordinate.js").Coordinate} The coordinate for the pixel position.
* @api
*/
getCoordinateFromPixel(pixel) {
return toUserCoordinate(this.getCoordinateFromPixelInternal(pixel), this.getView().getProjection());
}
/**
* Get the coordinate for a given pixel. This returns a coordinate in the
* map view projection.
* @param {import("./pixel.js").Pixel} pixel Pixel position in the map viewport.
* @return {import("./coordinate.js").Coordinate} The coordinate for the pixel position.
*/
getCoordinateFromPixelInternal(pixel) {
const frameState = this.frameState_;
if (!frameState) {
return null;
} else {
return applyTransform(frameState.pixelToCoordinateTransform, pixel.slice());
}
}
/**
* Get the map controls. Modifying this collection changes the controls
* associated with the map.
* @return {Collection<import("./control/Control.js").default>} Controls.
* @api
*/
getControls() {
return this.controls;
}
/**
* Get the map overlays. Modifying this collection changes the overlays
* associated with the map.
* @return {Collection<import("./Overlay.js").default>} Overlays.
* @api
*/
getOverlays() {
return this.overlays_;
}
/**
* Get an overlay by its identifier (the value returned by overlay.getId()).
* Note that the index treats string and numeric identifiers as the same. So
* `map.getOverlayById(2)` will return an overlay with id `'2'` or `2`.
* @param {string|number} id Overlay identifier.
* @return {import("./Overlay.js").default} Overlay.
* @api
*/
getOverlayById(id) {
const overlay = this.overlayIdIndex_[id.toString()];
return overlay !== undefined ? overlay : null;
}
/**
* Get the map interactions. Modifying this collection changes the interactions
* associated with the map.
*
* Interactions are used for e.g. pan, zoom and rotate.
* @return {Collection<import("./interaction/Interaction.js").default>} Interactions.
* @api
*/
getInteractions() {
return this.interactions;
}
/**
* Get the layergroup associated with this map.
* @return {LayerGroup} A layer group containing the layers in this map.
* @observable
* @api
*/
getLayerGroup() {
return (
/** @type {LayerGroup} */ (this.get(MapProperty.LAYERGROUP))
);
}
/**
* Get the collection of layers associated with this map.
* @return {!Collection<import("./layer/Base.js").default>} Layers.
* @api
*/
getLayers() {
const layers = this.getLayerGroup().getLayers();
return layers;
}
/**
* @return {boolean} Layers have sources that are still loading.
*/
getLoading() {
const layerStatesArray = this.getLayerGroup().getLayerStatesArray();
for (let i = 0, ii = layerStatesArray.length; i < ii; ++i) {
const layer = layerStatesArray[i].layer;
const source = /** @type {import("./layer/Layer.js").default} */ (layer).getSource();
if (source && source.loading) {
return true;
}
}
return false;
}
/**
* Get the pixel for a coordinate. This takes a coordinate in the user
* projection and returns the corresponding pixel.
* @param {import("./coordinate.js").Coordinate} coordinate A map coordinate.
* @return {import("./pixel.js").Pixel} A pixel position in the map viewport.
* @api
*/
getPixelFromCoordinate(coordinate) {
const viewCoordinate = fromUserCoordinate(coordinate, this.getView().getProjection());
return this.getPixelFromCoordinateInternal(viewCoordinate);
}
/**
* Get the pixel for a coordinate. This takes a coordinate in the map view
* projection and returns the corresponding pixel.
* @param {import("./coordinate.js").Coordinate} coordinate A map coordinate.
* @return {import("./pixel.js").Pixel} A pixel position in the map viewport.
*/
getPixelFromCoordinateInternal(coordinate) {
const frameState = this.frameState_;
if (!frameState) {
return null;
} else {
return applyTransform(frameState.coordinateToPixelTransform, coordinate.slice(0, 2));
}
}
/**
* Get the map renderer.
* @return {import("./renderer/Map.js").default} Renderer
*/
getRenderer() {
return this.renderer_;
}
/**
* Get the size of this map.
* @return {import("./size.js").Size|undefined} The size in pixels of the map in the DOM.
* @observable
* @api
*/
getSize() {
return (
/** @type {import("./size.js").Size|undefined} */ (this.get(MapProperty.SIZE))
);
}
/**
* Get the view associated with this map. A view manages properties such as
* center and resolution.
* @return {View} The view that controls this map.
* @observable
* @api
*/
getView() {
return (
/** @type {View} */ (this.get(MapProperty.VIEW))
);
}
/**
* Get the element that serves as the map viewport.
* @return {HTMLElement} Viewport.
* @api
*/
getViewport() {
return this.viewport_;
}
/**
* Get the element that serves as the container for overlays. Elements added to
* this container will let mousedown and touchstart events through to the map,
* so clicks and gestures on an overlay will trigger {@link module:ol/MapBrowserEvent~MapBrowserEvent}
* events.
* @return {!HTMLElement} The map's overlay container.
*/
getOverlayContainer() {
return this.overlayContainer_;
}
/**
* Get the element that serves as a container for overlays that don't allow
* event propagation. Elements added to this container won't let mousedown and
* touchstart events through to the map, so clicks and gestures on an overlay
* don't trigger any {@link module:ol/MapBrowserEvent~MapBrowserEvent}.
* @return {!HTMLElement} The map's overlay container that stops events.
*/
getOverlayContainerStopEvent() {
return this.overlayContainerStopEvent_;
}
/**
* @param {import("./Tile.js").default} tile Tile.
* @param {string} tileSourceKey Tile source key.
* @param {import("./coordinate.js").Coordinate} tileCenter Tile center.
* @param {number} tileResolution Tile resolution.
* @return {number} Tile priority.
*/
getTilePriority(tile, tileSourceKey, tileCenter, tileResolution) {
// Filter out tiles at higher zoom levels than the current zoom level, or that
// are outside the visible extent.
const frameState = this.frameState_;
if (!frameState || !(tileSourceKey in frameState.wantedTiles)) {
return DROP;
}
if (!frameState.wantedTiles[tileSourceKey][tile.getKey()]) {
return DROP;
}
// Prioritize the highest zoom level tiles closest to the focus.
// Tiles at higher zoom levels are prioritized using Math.log(tileResolution).
// Within a zoom level, tiles are prioritized by the distance in pixels between
// the center of the tile and the center of the viewport. The factor of 65536
// means that the prioritization should behave as desired for tiles up to
// 65536 * Math.log(2) = 45426 pixels from the focus.
const center = frameState.viewState.center;
const deltaX = tileCenter[0] - center[0];
const deltaY = tileCenter[1] - center[1];
return 65536 * Math.log(tileResolution) +
Math.sqrt(deltaX * deltaX + deltaY * deltaY) / tileResolution;
}
/**
* @param {Event} browserEvent Browser event.
* @param {string=} opt_type Type.
*/
handleBrowserEvent(browserEvent, opt_type) {
const type = opt_type || browserEvent.type;
const mapBrowserEvent = new MapBrowserEvent(type, this, browserEvent);
this.handleMapBrowserEvent(mapBrowserEvent);
}
/**
* @param {MapBrowserEvent} mapBrowserEvent The event to handle.
*/
handleMapBrowserEvent(mapBrowserEvent) {
if (!this.frameState_) {
// With no view defined, we cannot translate pixels into geographical
// coordinates so interactions cannot be used.
return;
}
let target = mapBrowserEvent.originalEvent.target;
while (target instanceof HTMLElement) {
if (target.parentElement === this.overlayContainerStopEvent_) {
return;
}
target = target.parentElement;
}
mapBrowserEvent.frameState = this.frameState_;
const interactionsArray = this.getInteractions().getArray();
if (this.dispatchEvent(mapBrowserEvent) !== false) {
for (let i = interactionsArray.length - 1; i >= 0; i--) {
const interaction = interactionsArray[i];
if (!interaction.getActive()) {
continue;
}
const cont = interaction.handleEvent(mapBrowserEvent);
if (!cont) {
break;
}
}
}
}
/**
* @protected
*/
handlePostRender() {
const frameState = this.frameState_;
// Manage the tile queue
// Image loads are expensive and a limited resource, so try to use them
// efficiently:
// * When the view is static we allow a large number of parallel tile loads
// to complete the frame as quickly as possible.
// * When animating or interacting, image loads can cause janks, so we reduce
// the maximum number of loads per frame and limit the number of parallel
// tile loads to remain reactive to view changes and to reduce the chance of
// loading tiles that will quickly disappear from view.
const tileQueue = this.tileQueue_;
if (!tileQueue.isEmpty()) {
let maxTotalLoading = this.maxTilesLoading_;
let maxNewLoads = maxTotalLoading;
if (frameState) {
const hints = frameState.viewHints;
if (hints[ViewHint.ANIMATING] || hints[ViewHint.INTERACTING]) {
const lowOnFrameBudget = !IMAGE_DECODE && Date.now() - frameState.time > 8;
maxTotalLoading = lowOnFrameBudget ? 0 : 8;
maxNewLoads = lowOnFrameBudget ? 0 : 2;
}
}
if (tileQueue.getTilesLoading() < maxTotalLoading) {
tileQueue.reprioritize(); // FIXME only call if view has changed
tileQueue.loadMoreTiles(maxTotalLoading, maxNewLoads);
}
}
if (frameState && this.hasListener(RenderEventType.RENDERCOMPLETE) && !frameState.animate &&
!this.tileQueue_.getTilesLoading() && !this.getLoading()) {
this.renderer_.dispatchRenderEvent(RenderEventType.RENDERCOMPLETE, frameState);
}
const postRenderFunctions = this.postRenderFunctions_;
for (let i = 0, ii = postRenderFunctions.length; i < ii; ++i) {
postRenderFunctions[i](this, frameState);
}
postRenderFunctions.length = 0;
}
/**
* @private
*/
handleSizeChanged_() {
if (this.getView()) {
this.getView().resolveConstraints(0);
}
this.render();
}
/**
* @private
*/
handleTargetChanged_() {
// target may be undefined, null, a string or an Element.
// If it's a string we convert it to an Element before proceeding.
// If it's not now an Element we remove the viewport from the DOM.
// If it's an Element we append the viewport element to it.
let targetElement;
if (this.getTarget()) {
targetElement = this.getTargetElement();
}
if (this.keyHandlerKeys_) {
for (let i = 0, ii = this.keyHandlerKeys_.length; i < ii; ++i) {
unlistenByKey(this.keyHandlerKeys_[i]);
}
this.keyHandlerKeys_ = null;
}
if (!targetElement) {
if (this.renderer_) {
clearTimeout(this.postRenderTimeoutHandle_);
this.postRenderFunctions_.length = 0;
this.renderer_.dispose();
this.renderer_ = null;
}
if (this.animationDelayKey_) {
cancelAnimationFrame(this.animationDelayKey_);
this.animationDelayKey_ = undefined;
}
removeNode(this.viewport_);
if (this.handleResize_ !== undefined) {
removeEventListener(EventType.RESIZE, this.handleResize_, false);
this.handleResize_ = undefined;
}
} else {
targetElement.appendChild(this.viewport_);
if (!this.renderer_) {
this.renderer_ = this.createRenderer();
}
const keyboardEventTarget = !this.keyboardEventTarget_ ?
targetElement : this.keyboardEventTarget_;
this.keyHandlerKeys_ = [
listen(keyboardEventTarget, EventType.KEYDOWN, this.handleBrowserEvent, this),
listen(keyboardEventTarget, EventType.KEYPRESS, this.handleBrowserEvent, this)
];
if (!this.handleResize_) {
this.handleResize_ = this.updateSize.bind(this);
window.addEventListener(EventType.RESIZE, this.handleResize_, false);
}
}
this.updateSize();
// updateSize calls setSize, so no need to call this.render
// ourselves here.
}
/**
* @private
*/
handleTileChange_() {
this.render();
}
/**
* @private
*/
handleViewPropertyChanged_() {
this.render();
}
/**
* @private
*/
handleViewChanged_() {
if (this.viewPropertyListenerKey_) {
unlistenByKey(this.viewPropertyListenerKey_);
this.viewPropertyListenerKey_ = null;
}
if (this.viewChangeListenerKey_) {
unlistenByKey(this.viewChangeListenerKey_);
this.viewChangeListenerKey_ = null;
}
const view = this.getView();
if (view) {
this.viewport_.setAttribute('data-view', getUid(view));
this.viewPropertyListenerKey_ = listen(
view, ObjectEventType.PROPERTYCHANGE,
this.handleViewPropertyChanged_, this);
this.viewChangeListenerKey_ = listen(
view, EventType.CHANGE,
this.handleViewPropertyChanged_, this);
view.resolveConstraints(0);
}
this.render();
}
/**
* @private
*/
handleLayerGroupChanged_() {
if (this.layerGroupPropertyListenerKeys_) {
this.layerGroupPropertyListenerKeys_.forEach(unlistenByKey);
this.layerGroupPropertyListenerKeys_ = null;
}
const layerGroup = this.getLayerGroup();
if (layerGroup) {
this.layerGroupPropertyListenerKeys_ = [
listen(
layerGroup, ObjectEventType.PROPERTYCHANGE,
this.render, this),
listen(
layerGroup, EventType.CHANGE,
this.render, this)
];
}
this.render();
}
/**
* @return {boolean} Is rendered.
*/
isRendered() {
return !!this.frameState_;
}
/**
* Requests an immediate render in a synchronous manner.
* @api
*/
renderSync() {
if (this.animationDelayKey_) {
cancelAnimationFrame(this.animationDelayKey_);
}
this.animationDelay_();
}
/**
* Redraws all text after new fonts have loaded
*/
redrawText() {
const layerStates = this.getLayerGroup().getLayerStatesArray();
for (let i = 0, ii = layerStates.length; i < ii; ++i) {
const layer = layerStates[i].layer;
if (layer.hasRenderer()) {
layer.getRenderer().handleFontsChanged();
}
}
}
/**
* Request a map rendering (at the next animation frame).
* @api
*/
render() {
if (this.renderer_ && this.animationDelayKey_ === undefined) {
this.animationDelayKey_ = requestAnimationFrame(this.animationDelay_);
}
}
/**
* Remove the given control from the map.
* @param {import("./control/Control.js").default} control Control.
* @return {import("./control/Control.js").default|undefined} The removed control (or undefined
* if the control was not found).
* @api
*/
removeControl(control) {
return this.getControls().remove(control);
}
/**
* Remove the given interaction from the map.
* @param {import("./interaction/Interaction.js").default} interaction Interaction to remove.
* @return {import("./interaction/Interaction.js").default|undefined} The removed interaction (or
* undefined if the interaction was not found).
* @api
*/
removeInteraction(interaction) {
return this.getInteractions().remove(interaction);
}
/**
* Removes the given layer from the map.
* @param {import("./layer/Base.js").default} layer Layer.
* @return {import("./layer/Base.js").default|undefined} The removed layer (or undefined if the
* layer was not found).
* @api
*/
removeLayer(layer) {
const layers = this.getLayerGroup().getLayers();
return layers.remove(layer);
}
/**
* Remove the given overlay from the map.
* @param {import("./Overlay.js").default} overlay Overlay.
* @return {import("./Overlay.js").default|undefined} The removed overlay (or undefined
* if the overlay was not found).
* @api
*/
removeOverlay(overlay) {
return this.getOverlays().remove(overlay);
}
/**
* @param {number} time Time.
* @private
*/
renderFrame_(time) {
const size = this.getSize();
const view = this.getView();
const previousFrameState = this.frameState_;
/** @type {?FrameState} */
let frameState = null;
if (size !== undefined && hasArea(size) && view && view.isDef()) {
const viewHints = view.getHints(this.frameState_ ? this.frameState_.viewHints : undefined);
const viewState = view.getState();
frameState = {
animate: false,
coordinateToPixelTransform: this.coordinateToPixelTransform_,
declutterItems: previousFrameState ? previousFrameState.declutterItems : [],
extent: getForViewAndSize(viewState.center, viewState.resolution, viewState.rotation, size),
index: this.frameIndex_++,
layerIndex: 0,
layerStatesArray: this.getLayerGroup().getLayerStatesArray(),
pixelRatio: this.pixelRatio_,
pixelToCoordinateTransform: this.pixelToCoordinateTransform_,
postRenderFunctions: [],
size: size,
tileQueue: this.tileQueue_,
time: time,
usedTiles: {},
viewState: viewState,
viewHints: viewHints,
wantedTiles: {}
};
}
this.frameState_ = frameState;
this.renderer_.renderFrame(frameState);
if (frameState) {
if (frameState.animate) {
this.render();
}
Array.prototype.push.apply(this.postRenderFunctions_, frameState.postRenderFunctions);
if (previousFrameState) {
const moveStart = !this.previousExtent_ ||
(!isEmpty(this.previousExtent_) &&
!equals(frameState.extent, this.previousExtent_));
if (moveStart) {
this.dispatchEvent(
new MapEvent(MapEventType.MOVESTART, this, previousFrameState));
this.previousExtent_ = createOrUpdateEmpty(this.previousExtent_);
}
}
const idle = this.previousExtent_ &&
!frameState.viewHints[ViewHint.ANIMATING] &&
!frameState.viewHints[ViewHint.INTERACTING] &&
!equals(frameState.extent, this.previousExtent_);
if (idle) {
this.dispatchEvent(new MapEvent(MapEventType.MOVEEND, this, frameState));
clone(frameState.extent, this.previousExtent_);
}
}
this.dispatchEvent(new MapEvent(MapEventType.POSTRENDER, this, frameState));
this.postRenderTimeoutHandle_ = setTimeout(this.handlePostRender.bind(this), 0);
}
/**
* Sets the layergroup of this map.
* @param {LayerGroup} layerGroup A layer group containing the layers in this map.
* @observable
* @api
*/
setLayerGroup(layerGroup) {
this.set(MapProperty.LAYERGROUP, layerGroup);
}
/**
* Set the size of this map.
* @param {import("./size.js").Size|undefined} size The size in pixels of the map in the DOM.
* @observable
* @api
*/
setSize(size) {
this.set(MapProperty.SIZE, size);
}
/**
* Set the target element to render this map into.
* @param {HTMLElement|string|undefined} target The Element or id of the Element
* that the map is rendered in.
* @observable
* @api
*/
setTarget(target) {
this.set(MapProperty.TARGET, target);
}
/**
* Set the view for this map.
* @param {View} view The view that controls this map.
* @observable
* @api
*/
setView(view) {
this.set(MapProperty.VIEW, view);
}
/**
* Force a recalculation of the map viewport size. This should be called when
* third-party code changes the size of the map viewport.
* @api
*/
updateSize() {
const targetElement = this.getTargetElement();
if (!targetElement) {
this.setSize(undefined);
} else {
const computedStyle = getComputedStyle(targetElement);
this.setSize([
targetElement.offsetWidth -
parseFloat(computedStyle['borderLeftWidth']) -
parseFloat(computedStyle['paddingLeft']) -
parseFloat(computedStyle['paddingRight']) -
parseFloat(computedStyle['borderRightWidth']),
targetElement.offsetHeight -
parseFloat(computedStyle['borderTopWidth']) -
parseFloat(computedStyle['paddingTop']) -
parseFloat(computedStyle['paddingBottom']) -
parseFloat(computedStyle['borderBottomWidth'])
]);
}
}
}
/**
* @param {MapOptions} options Map options.
* @return {MapOptionsInternal} Internal map options.
*/
function createOptionsInternal(options) {
/**
* @type {HTMLElement|Document}
*/
let keyboardEventTarget = null;
if (options.keyboardEventTarget !== undefined) {
keyboardEventTarget = typeof options.keyboardEventTarget === 'string' ?
document.getElementById(options.keyboardEventTarget) :
options.keyboardEventTarget;
}
/**
* @type {Object<string, *>}
*/
const values = {};
const layerGroup = options.layers && typeof /** @type {?} */ (options.layers).getLayers === 'function' ?
/** @type {LayerGroup} */ (options.layers) : new LayerGroup({layers: /** @type {Collection} */ (options.layers)});
values[MapProperty.LAYERGROUP] = layerGroup;
values[MapProperty.TARGET] = options.target;
values[MapProperty.VIEW] = options.view !== undefined ?
options.view : new View();
let controls;
if (options.controls !== undefined) {
if (Array.isArray(options.controls)) {
controls = new Collection(options.controls.slice());
} else {
assert(typeof /** @type {?} */ (options.controls).getArray === 'function',
47); // Expected `controls` to be an array or an `import("./Collection.js").Collection`
controls = /** @type {Collection} */ (options.controls);
}
}
let interactions;
if (options.interactions !== undefined) {
if (Array.isArray(options.interactions)) {
interactions = new Collection(options.interactions.slice());
} else {
assert(typeof /** @type {?} */ (options.interactions).getArray === 'function',
48); // Expected `interactions` to be an array or an `import("./Collection.js").Collection`
interactions = /** @type {Collection} */ (options.interactions);
}
}
let overlays;
if (options.overlays !== undefined) {
if (Array.isArray(options.overlays)) {
overlays = new Collection(options.overlays.slice());
} else {
assert(typeof /** @type {?} */ (options.overlays).getArray === 'function',
49); // Expected `overlays` to be an array or an `import("./Collection.js").Collection`
overlays = options.overlays;
}
} else {
overlays = new Collection();
}
return {
controls: controls,
interactions: interactions,
keyboardEventTarget: keyboardEventTarget,
overlays: overlays,
values: values
};
}
export default PluggableMap;
|
ajax/libs/forerunnerdb/1.3.24/fdb-core+views.js | iwdmb/cdnjs | (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
var Core = _dereq_('../lib/Core'),
View = _dereq_('../lib/View');
if (typeof window !== 'undefined') {
window.ForerunnerDB = Core;
}
module.exports = Core;
},{"../lib/Core":5,"../lib/View":24}],2:[function(_dereq_,module,exports){
"use strict";
/**
* Creates an always-sorted multi-key bucket that allows ForerunnerDB to
* know the index that a document will occupy in an array with minimal
* processing, speeding up things like sorted views.
*/
var Shared = _dereq_('./Shared');
/**
* The active bucket class.
* @param {object} orderBy An order object.
* @constructor
*/
var ActiveBucket = function (orderBy) {
var sortKey;
this._primaryKey = '_id';
this._keyArr = [];
this._data = [];
this._objLookup = {};
this._count = 0;
for (sortKey in orderBy) {
if (orderBy.hasOwnProperty(sortKey)) {
this._keyArr.push({
key: sortKey,
dir: orderBy[sortKey]
});
}
}
};
Shared.addModule('ActiveBucket', ActiveBucket);
Shared.synthesize(ActiveBucket.prototype, 'primaryKey');
Shared.mixin(ActiveBucket.prototype, 'Mixin.Sorting');
/**
* Quicksorts a single document into the passed array and
* returns the index that the document should occupy.
* @param {object} obj The document to calculate index for.
* @param {array} arr The array the document index will be
* calculated for.
* @param {string} item The string key representation of the
* document whose index is being calculated.
* @param {function} fn The comparison function that is used
* to determine if a document is sorted below or above the
* document we are calculating the index for.
* @returns {number} The index the document should occupy.
*/
ActiveBucket.prototype.qs = function (obj, arr, item, fn) {
// If the array is empty then return index zero
if (!arr.length) {
return 0;
}
var lastMidwayIndex = -1,
midwayIndex,
lookupItem,
result,
start = 0,
end = arr.length - 1;
// Loop the data until our range overlaps
while (end >= start) {
// Calculate the midway point (divide and conquer)
midwayIndex = Math.floor((start + end) / 2);
if (lastMidwayIndex === midwayIndex) {
// No more items to scan
break;
}
// Get the item to compare against
lookupItem = arr[midwayIndex];
if (lookupItem !== undefined) {
// Compare items
result = fn(this, obj, item, lookupItem);
if (result > 0) {
start = midwayIndex + 1;
}
if (result < 0) {
end = midwayIndex - 1;
}
}
lastMidwayIndex = midwayIndex;
}
if (result > 0) {
return midwayIndex + 1;
} else {
return midwayIndex;
}
};
/**
* Calculates the sort position of an item against another item.
* @param {object} sorter An object or instance that contains
* sortAsc and sortDesc methods.
* @param {object} obj The document to compare.
* @param {string} a The first key to compare.
* @param {string} b The second key to compare.
* @returns {number} Either 1 for sort a after b or -1 to sort
* a before b.
* @private
*/
ActiveBucket.prototype._sortFunc = function (sorter, obj, a, b) {
var aVals = a.split('.:.'),
bVals = b.split('.:.'),
arr = sorter._keyArr,
count = arr.length,
index,
sortType,
castType;
for (index = 0; index < count; index++) {
sortType = arr[index];
castType = typeof obj[sortType.key];
if (castType === 'number') {
aVals[index] = Number(aVals[index]);
bVals[index] = Number(bVals[index]);
}
// Check for non-equal items
if (aVals[index] !== bVals[index]) {
// Return the sorted items
if (sortType.dir === 1) {
return sorter.sortAsc(aVals[index], bVals[index]);
}
if (sortType.dir === -1) {
return sorter.sortDesc(aVals[index], bVals[index]);
}
}
}
};
/**
* Inserts a document into the active bucket.
* @param {object} obj The document to insert.
* @returns {number} The index the document now occupies.
*/
ActiveBucket.prototype.insert = function (obj) {
var key,
keyIndex;
key = this.documentKey(obj);
keyIndex = this._data.indexOf(key);
if (keyIndex === -1) {
// Insert key
keyIndex = this.qs(obj, this._data, key, this._sortFunc);
this._data.splice(keyIndex, 0, key);
} else {
this._data.splice(keyIndex, 0, key);
}
this._objLookup[obj[this._primaryKey]] = key;
this._count++;
return keyIndex;
};
/**
* Removes a document from the active bucket.
* @param {object} obj The document to remove.
* @returns {boolean} True if the document was removed
* successfully or false if it wasn't found in the active
* bucket.
*/
ActiveBucket.prototype.remove = function (obj) {
var key,
keyIndex;
key = this._objLookup[obj[this._primaryKey]];
if (key) {
keyIndex = this._data.indexOf(key);
if (keyIndex > -1) {
this._data.splice(keyIndex, 1);
delete this._objLookup[obj[this._primaryKey]];
this._count--;
return true;
} else {
return false;
}
}
return false;
};
/**
* Get the index that the passed document currently occupies
* or the index it will occupy if added to the active bucket.
* @param {object} obj The document to get the index for.
* @returns {number} The index.
*/
ActiveBucket.prototype.index = function (obj) {
var key,
keyIndex;
key = this.documentKey(obj);
keyIndex = this._data.indexOf(key);
if (keyIndex === -1) {
// Get key index
keyIndex = this.qs(obj, this._data, key, this._sortFunc);
}
return keyIndex;
};
/**
* The key that represents the passed document.
* @param {object} obj The document to get the key for.
* @returns {string} The document key.
*/
ActiveBucket.prototype.documentKey = function (obj) {
var key = '',
arr = this._keyArr,
count = arr.length,
index,
sortType;
for (index = 0; index < count; index++) {
sortType = arr[index];
if (key) {
key += '.:.';
}
key += obj[sortType.key];
}
// Add the unique identifier on the end of the key
key += '.:.' + obj[this._primaryKey];
return key;
};
/**
* Get the number of documents currently indexed in the active
* bucket instance.
* @returns {number} The number of documents.
*/
ActiveBucket.prototype.count = function () {
return this._count;
};
Shared.finishModule('ActiveBucket');
module.exports = ActiveBucket;
},{"./Shared":23}],3:[function(_dereq_,module,exports){
"use strict";
/**
* The main collection class. Collections store multiple documents and
* can operate on them using the query language to insert, read, update
* and delete.
*/
var Shared,
Core,
Metrics,
KeyValueStore,
Path,
IndexHashMap,
IndexBinaryTree,
Crc;
Shared = _dereq_('./Shared');
/**
* Collection object used to store data.
* @constructor
*/
var Collection = function (name) {
this.init.apply(this, arguments);
};
Collection.prototype.init = function (name) {
this._primaryKey = '_id';
this._primaryIndex = new KeyValueStore('primary');
this._primaryCrc = new KeyValueStore('primaryCrc');
this._crcLookup = new KeyValueStore('crcLookup');
this._name = name;
this._data = [];
this._groups = [];
this._metrics = new Metrics();
this._deferQueue = {
insert: [],
update: [],
remove: [],
upsert: []
};
this._deferThreshold = {
insert: 100,
update: 100,
remove: 100,
upsert: 100
};
this._deferTime = {
insert: 1,
update: 1,
remove: 1,
upsert: 1
};
// Set the subset to itself since it is the root collection
this._subsetOf(this);
};
Shared.addModule('Collection', Collection);
Shared.mixin(Collection.prototype, 'Mixin.Common');
Shared.mixin(Collection.prototype, 'Mixin.Events');
Shared.mixin(Collection.prototype, 'Mixin.ChainReactor');
Shared.mixin(Collection.prototype, 'Mixin.CRUD');
Shared.mixin(Collection.prototype, 'Mixin.Constants');
Shared.mixin(Collection.prototype, 'Mixin.Triggers');
Shared.mixin(Collection.prototype, 'Mixin.Sorting');
Shared.mixin(Collection.prototype, 'Mixin.Matching');
Metrics = _dereq_('./Metrics');
KeyValueStore = _dereq_('./KeyValueStore');
Path = _dereq_('./Path');
IndexHashMap = _dereq_('./IndexHashMap');
IndexBinaryTree = _dereq_('./IndexBinaryTree');
Crc = _dereq_('./Crc');
Core = Shared.modules.Core;
/**
* Returns a checksum of a string.
* @param {String} string The string to checksum.
* @return {String} The checksum generated.
*/
Collection.prototype.crc = Crc;
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(Collection.prototype, 'state');
/**
* Gets / sets the name of the collection.
* @param {String=} val The name of the collection to set.
* @returns {*}
*/
Shared.synthesize(Collection.prototype, 'name');
/**
* Get the internal data
* @returns {Array}
*/
Collection.prototype.data = function () {
return this._data;
};
/**
* Drops a collection and all it's stored data from the database.
* @returns {boolean} True on success, false on failure.
*/
Collection.prototype.drop = function () {
if (this._state !== 'dropped') {
if (this._db && this._db._collection && this._name) {
if (this.debug()) {
console.log('Dropping collection ' + this._name);
}
this._state = 'dropped';
this.emit('drop', this);
delete this._db._collection[this._name];
if (this._groups && this._groups.length) {
var groupArr = [],
i;
// Copy the group array because if we call removeCollection on a group
// it will alter the groups array of this collection mid-loop!
for (i = 0; i < this._groups.length; i++) {
groupArr.push(this._groups[i]);
}
// Loop any groups we are part of and remove ourselves from them
for (i = 0; i < groupArr.length; i++) {
this._groups[i].removeCollection(this);
}
}
delete this._primaryKey;
delete this._primaryIndex;
delete this._primaryCrc;
delete this._crcLookup;
delete this._name;
delete this._data;
delete this._groups;
delete this._metrics;
return true;
}
} else {
return true;
}
return false;
};
/**
* Gets / sets the primary key for this collection.
* @param {String=} keyName The name of the primary key.
* @returns {*}
*/
Collection.prototype.primaryKey = function (keyName) {
if (keyName !== undefined) {
if (this._primaryKey !== keyName) {
this._primaryKey = keyName;
// Set the primary key index primary key
this._primaryIndex.primaryKey(keyName);
// Rebuild the primary key index
this.rebuildPrimaryKeyIndex();
}
return this;
}
return this._primaryKey;
};
/**
* Handles insert events and routes changes to binds and views as required.
* @param {Array} inserted An array of inserted documents.
* @param {Array} failed An array of documents that failed to insert.
* @private
*/
Collection.prototype._onInsert = function (inserted, failed) {
this.emit('insert', inserted, failed);
};
/**
* Handles update events and routes changes to binds and views as required.
* @param {Array} items An array of updated documents.
* @private
*/
Collection.prototype._onUpdate = function (items) {
this.emit('update', items);
};
/**
* Handles remove events and routes changes to binds and views as required.
* @param {Array} items An array of removed documents.
* @private
*/
Collection.prototype._onRemove = function (items) {
this.emit('remove', items);
};
/**
* Gets / sets the db instance this class instance belongs to.
* @param {Core=} db The db instance.
* @returns {*}
*/
Shared.synthesize(Collection.prototype, 'db', function (db) {
if (db) {
if (this.primaryKey() === '_id') {
// Set primary key to the db's key by default
this.primaryKey(db.primaryKey());
}
}
return this.$super.apply(this, arguments);
});
/**
* Sets the collection's data to the array of documents passed.
* @param data
* @param options Optional options object.
* @param callback Optional callback function.
*/
Collection.prototype.setData = function (data, options, callback) {
if (data) {
var op = this._metrics.create('setData');
op.start();
options = this.options(options);
this.preSetData(data, options, callback);
if (options.$decouple) {
data = this.decouple(data);
}
if (!(data instanceof Array)) {
data = [data];
}
op.time('transformIn');
data = this.transformIn(data);
op.time('transformIn');
var oldData = [].concat(this._data);
this._dataReplace(data);
// Update the primary key index
op.time('Rebuild Primary Key Index');
this.rebuildPrimaryKeyIndex(options);
op.time('Rebuild Primary Key Index');
// Rebuild all other indexes
op.time('Rebuild All Other Indexes');
this._rebuildIndexes();
op.time('Rebuild All Other Indexes');
op.time('Resolve chains');
this.chainSend('setData', data, {oldData: oldData});
op.time('Resolve chains');
op.stop();
this.emit('setData', this._data, oldData);
}
if (callback) { callback(false); }
return this;
};
/**
* Drops and rebuilds the primary key index for all documents in the collection.
* @param {Object=} options An optional options object.
* @private
*/
Collection.prototype.rebuildPrimaryKeyIndex = function (options) {
options = options || {
$ensureKeys: undefined,
$violationCheck: undefined
};
var ensureKeys = options && options.$ensureKeys !== undefined ? options.$ensureKeys : true,
violationCheck = options && options.$violationCheck !== undefined ? options.$violationCheck : true,
arr,
arrCount,
arrItem,
pIndex = this._primaryIndex,
crcIndex = this._primaryCrc,
crcLookup = this._crcLookup,
pKey = this._primaryKey,
jString;
// Drop the existing primary index
pIndex.truncate();
crcIndex.truncate();
crcLookup.truncate();
// Loop the data and check for a primary key in each object
arr = this._data;
arrCount = arr.length;
while (arrCount--) {
arrItem = arr[arrCount];
if (ensureKeys) {
// Make sure the item has a primary key
this.ensurePrimaryKey(arrItem);
}
if (violationCheck) {
// Check for primary key violation
if (!pIndex.uniqueSet(arrItem[pKey], arrItem)) {
// Primary key violation
throw('ForerunnerDB.Collection "' + this.name() + '": Call to setData on collection failed because your data violates the primary key unique constraint. One or more documents are using the same primary key: ' + arrItem[this._primaryKey]);
}
} else {
pIndex.set(arrItem[pKey], arrItem);
}
// Generate a CRC string
jString = JSON.stringify(arrItem);
crcIndex.set(arrItem[pKey], jString);
crcLookup.set(jString, arrItem);
}
};
/**
* Checks for a primary key on the document and assigns one if none
* currently exists.
* @param {Object} obj The object to check a primary key against.
* @private
*/
Collection.prototype.ensurePrimaryKey = function (obj) {
if (obj[this._primaryKey] === undefined) {
// Assign a primary key automatically
obj[this._primaryKey] = this.objectId();
}
};
/**
* Clears all data from the collection.
* @returns {Collection}
*/
Collection.prototype.truncate = function () {
this.emit('truncate', this._data);
// Clear all the data from the collection
this._data.length = 0;
// Re-create the primary index data
this._primaryIndex = new KeyValueStore('primary');
this._primaryCrc = new KeyValueStore('primaryCrc');
this._crcLookup = new KeyValueStore('crcLookup');
this.deferEmit('change', {type: 'truncate'});
return this;
};
/**
* Modifies an existing document or documents in a collection. This will update
* all matches for 'query' with the data held in 'update'. It will not overwrite
* the matched documents with the update document.
*
* @param {Object} obj The document object to upsert or an array containing
* documents to upsert.
*
* If the document contains a primary key field (based on the collections's primary
* key) then the database will search for an existing document with a matching id.
* If a matching document is found, the document will be updated. Any keys that
* match keys on the existing document will be overwritten with new data. Any keys
* that do not currently exist on the document will be added to the document.
*
* If the document does not contain an id or the id passed does not match an existing
* document, an insert is performed instead. If no id is present a new primary key
* id is provided for the item.
*
* @param {Function=} callback Optional callback method.
* @returns {Object} An object containing two keys, "op" contains either "insert" or
* "update" depending on the type of operation that was performed and "result"
* contains the return data from the operation used.
*/
Collection.prototype.upsert = function (obj, callback) {
if (obj) {
var queue = this._deferQueue.upsert,
deferThreshold = this._deferThreshold.upsert;
var returnData = {},
query,
i;
// Determine if the object passed is an array or not
if (obj instanceof Array) {
if (obj.length > deferThreshold) {
// Break up upsert into blocks
this._deferQueue.upsert = queue.concat(obj);
// Fire off the insert queue handler
this.processQueue('upsert', callback);
return {};
} else {
// Loop the array and upsert each item
returnData = [];
for (i = 0; i < obj.length; i++) {
returnData.push(this.upsert(obj[i]));
}
if (callback) { callback(); }
return returnData;
}
}
// Determine if the operation is an insert or an update
if (obj[this._primaryKey]) {
// Check if an object with this primary key already exists
query = {};
query[this._primaryKey] = obj[this._primaryKey];
if (this._primaryIndex.lookup(query)[0]) {
// The document already exists with this id, this operation is an update
returnData.op = 'update';
} else {
// No document with this id exists, this operation is an insert
returnData.op = 'insert';
}
} else {
// The document passed does not contain an id, this operation is an insert
returnData.op = 'insert';
}
switch (returnData.op) {
case 'insert':
returnData.result = this.insert(obj);
break;
case 'update':
returnData.result = this.update(query, obj);
break;
default:
break;
}
return returnData;
} else {
if (callback) { callback(); }
}
return {};
};
/**
* Modifies an existing document or documents in a collection. This will update
* all matches for 'query' with the data held in 'update'. It will not overwrite
* the matched documents with the update document.
*
* @param {Object} query The query that must be matched for a document to be
* operated on.
* @param {Object} update The object containing updated key/values. Any keys that
* match keys on the existing document will be overwritten with this data. Any
* keys that do not currently exist on the document will be added to the document.
* @param {Object=} options An options object.
* @returns {Array} The items that were updated.
*/
Collection.prototype.update = function (query, update, options) {
// Decouple the update data
update = this.decouple(update);
// Handle transform
update = this.transformIn(update);
if (this.debug()) {
console.log('Updating some collection data for collection "' + this.name() + '"');
}
var self = this,
op = this._metrics.create('update'),
dataSet,
updated,
updateCall = function (originalDoc) {
var newDoc = self.decouple(originalDoc),
triggerOperation,
result;
if (self.willTrigger(self.TYPE_UPDATE, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_UPDATE, self.PHASE_AFTER)) {
triggerOperation = {
type: 'update',
query: self.decouple(query),
update: self.decouple(update),
options: self.decouple(options),
op: op
};
// Update newDoc with the update criteria so we know what the data will look
// like AFTER the update is processed
result = self.updateObject(newDoc, triggerOperation.update, triggerOperation.query, triggerOperation.options, '');
if (self.processTrigger(triggerOperation, self.TYPE_UPDATE, self.PHASE_BEFORE, originalDoc, newDoc) !== false) {
// No triggers complained so let's execute the replacement of the existing
// object with the new one
result = self.updateObject(originalDoc, newDoc, triggerOperation.query, triggerOperation.options, '');
// NOTE: If for some reason we would only like to fire this event if changes are actually going
// to occur on the object from the proposed update then we can add "result &&" to the if
self.processTrigger(triggerOperation, self.TYPE_UPDATE, self.PHASE_AFTER, originalDoc, newDoc);
} else {
// Trigger cancelled operation so tell result that it was not updated
result = false;
}
} else {
// No triggers complained so let's execute the replacement of the existing
// object with the new one
result = self.updateObject(originalDoc, update, query, options, '');
}
return result;
};
op.start();
op.time('Retrieve documents to update');
dataSet = this.find(query, {$decouple: false});
op.time('Retrieve documents to update');
if (dataSet.length) {
op.time('Update documents');
updated = dataSet.filter(updateCall);
op.time('Update documents');
if (updated.length) {
op.time('Resolve chains');
this.chainSend('update', {
query: query,
update: update,
dataSet: dataSet
}, options);
op.time('Resolve chains');
this._onUpdate(updated);
this.deferEmit('change', {type: 'update', data: updated});
}
}
op.stop();
// TODO: Should we decouple the updated array before return by default?
return updated || [];
};
Collection.prototype._replaceObj = function (currentObj, newObj) {
var i;
// Check if the new document has a different primary key value from the existing one
// Remove item from indexes
this._removeFromIndexes(currentObj);
// Remove existing keys from current object
for (i in currentObj) {
if (currentObj.hasOwnProperty(i)) {
delete currentObj[i];
}
}
// Add new keys to current object
for (i in newObj) {
if (newObj.hasOwnProperty(i)) {
currentObj[i] = newObj[i];
}
}
// Update the item in the primary index
if (!this._insertIntoIndexes(currentObj)) {
throw('ForerunnerDB.Collection "' + this.name() + '": Primary key violation in update! Key violated: ' + currentObj[this._primaryKey]);
}
// Update the object in the collection data
//this._data.splice(this._data.indexOf(currentObj), 1, newObj);
return true;
};
/**
* Helper method to update a document from it's id.
* @param {String} id The id of the document.
* @param {Object} update The object containing the key/values to update to.
* @returns {Array} The items that were updated.
*/
Collection.prototype.updateById = function (id, update) {
var searchObj = {};
searchObj[this._primaryKey] = id;
return this.update(searchObj, update);
};
/**
* Internal method for document updating.
* @param {Object} doc The document to update.
* @param {Object} update The object with key/value pairs to update the document with.
* @param {Object} query The query object that we need to match to perform an update.
* @param {Object} options An options object.
* @param {String} path The current recursive path.
* @param {String} opType The type of update operation to perform, if none is specified
* default is to set new data against matching fields.
* @returns {Boolean} True if the document was updated with new / changed data or
* false if it was not updated because the data was the same.
* @private
*/
Collection.prototype.updateObject = function (doc, update, query, options, path, opType) {
// TODO: This method is long, try to break it into smaller pieces
update = this.decouple(update);
// Clear leading dots from path
path = path || '';
if (path.substr(0, 1) === '.') { path = path.substr(1, path.length -1); }
//var oldDoc = this.decouple(doc),
var updated = false,
recurseUpdated = false,
operation,
tmpArray,
tmpIndex,
tmpCount,
tempIndex,
pathInstance,
sourceIsArray,
updateIsArray,
i;
// Loop each key in the update object
for (i in update) {
if (update.hasOwnProperty(i)) {
// Reset operation flag
operation = false;
// Check if the property starts with a dollar (function)
if (i.substr(0, 1) === '$') {
// Check for commands
switch (i) {
case '$key':
case '$index':
// Ignore some operators
operation = true;
break;
default:
operation = true;
// Now run the operation
recurseUpdated = this.updateObject(doc, update[i], query, options, path, i);
updated = updated || recurseUpdated;
break;
}
}
// Check if the key has a .$ at the end, denoting an array lookup
if (this._isPositionalKey(i)) {
operation = true;
// Modify i to be the name of the field
i = i.substr(0, i.length - 2);
pathInstance = new Path(path + '.' + i);
// Check if the key is an array and has items
if (doc[i] && doc[i] instanceof Array && doc[i].length) {
tmpArray = [];
// Loop the array and find matches to our search
for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) {
if (this._match(doc[i][tmpIndex], pathInstance.value(query)[0], '', {})) {
tmpArray.push(tmpIndex);
}
}
// Loop the items that matched and update them
for (tmpIndex = 0; tmpIndex < tmpArray.length; tmpIndex++) {
recurseUpdated = this.updateObject(doc[i][tmpArray[tmpIndex]], update[i + '.$'], query, options, path + '.' + i, opType);
updated = updated || recurseUpdated;
}
}
}
if (!operation) {
if (!opType && typeof(update[i]) === 'object') {
if (doc[i] !== null && typeof(doc[i]) === 'object') {
// Check if we are dealing with arrays
sourceIsArray = doc[i] instanceof Array;
updateIsArray = update[i] instanceof Array;
if (sourceIsArray || updateIsArray) {
// Check if the update is an object and the doc is an array
if (!updateIsArray && sourceIsArray) {
// Update is an object, source is an array so match the array items
// with our query object to find the one to update inside this array
// Loop the array and find matches to our search
for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) {
recurseUpdated = this.updateObject(doc[i][tmpIndex], update[i], query, options, path + '.' + i, opType);
updated = updated || recurseUpdated;
}
} else {
// Either both source and update are arrays or the update is
// an array and the source is not, so set source to update
if (doc[i] !== update[i]) {
this._updateProperty(doc, i, update[i]);
updated = true;
}
}
} else {
// The doc key is an object so traverse the
// update further
recurseUpdated = this.updateObject(doc[i], update[i], query, options, path + '.' + i, opType);
updated = updated || recurseUpdated;
}
} else {
if (doc[i] !== update[i]) {
this._updateProperty(doc, i, update[i]);
updated = true;
}
}
} else {
switch (opType) {
case '$inc':
this._updateIncrement(doc, i, update[i]);
updated = true;
break;
case '$push':
// Check if the target key is undefined and if so, create an array
if (doc[i] === undefined) {
// Initialise a new array
this._updateProperty(doc, i, []);
}
// Check that the target key is an array
if (doc[i] instanceof Array) {
// Check for a $position modifier with an $each
if (update[i].$position !== undefined && update[i].$each instanceof Array) {
// Grab the position to insert at
tempIndex = update[i].$position;
// Loop the each array and push each item
tmpCount = update[i].$each.length;
for (tmpIndex = 0; tmpIndex < tmpCount; tmpIndex++) {
this._updateSplicePush(doc[i], tempIndex + tmpIndex, update[i].$each[tmpIndex]);
}
} else if (update[i].$each instanceof Array) {
// Do a loop over the each to push multiple items
tmpCount = update[i].$each.length;
for (tmpIndex = 0; tmpIndex < tmpCount; tmpIndex++) {
this._updatePush(doc[i], update[i].$each[tmpIndex]);
}
} else {
// Do a standard push
this._updatePush(doc[i], update[i]);
}
updated = true;
} else {
throw('ForerunnerDB.Collection "' + this.name() + '": Cannot push to a key that is not an array! (' + i + ')');
}
break;
case '$pull':
if (doc[i] instanceof Array) {
tmpArray = [];
// Loop the array and find matches to our search
for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) {
if (this._match(doc[i][tmpIndex], update[i], '', {})) {
tmpArray.push(tmpIndex);
}
}
tmpCount = tmpArray.length;
// Now loop the pull array and remove items to be pulled
while (tmpCount--) {
this._updatePull(doc[i], tmpArray[tmpCount]);
updated = true;
}
}
break;
case '$pullAll':
if (doc[i] instanceof Array) {
if (update[i] instanceof Array) {
tmpArray = doc[i];
tmpCount = tmpArray.length;
if (tmpCount > 0) {
// Now loop the pull array and remove items to be pulled
while (tmpCount--) {
for (tempIndex = 0; tempIndex < update[i].length; tempIndex++) {
if (tmpArray[tmpCount] === update[i][tempIndex]) {
this._updatePull(doc[i], tmpCount);
tmpCount--;
updated = true;
}
}
if (tmpCount < 0) {
break;
}
}
}
} else {
throw('ForerunnerDB.Collection "' + this.name() + '": Cannot pullAll without being given an array of values to pull! (' + i + ')');
}
}
break;
case '$addToSet':
// Check if the target key is undefined and if so, create an array
if (doc[i] === undefined) {
// Initialise a new array
this._updateProperty(doc, i, []);
}
// Check that the target key is an array
if (doc[i] instanceof Array) {
// Loop the target array and check for existence of item
var targetArr = doc[i],
targetArrIndex,
targetArrCount = targetArr.length,
objHash,
addObj = true,
optionObj = (options && options.$addToSet),
hashMode,
pathSolver;
// Check if we have an options object for our operation
if (update[i].$key) {
hashMode = false;
pathSolver = new Path(update[i].$key);
objHash = pathSolver.value(update[i])[0];
// Remove the key from the object before we add it
delete update[i].$key;
} else if (optionObj && optionObj.key) {
hashMode = false;
pathSolver = new Path(optionObj.key);
objHash = pathSolver.value(update[i])[0];
} else {
objHash = JSON.stringify(update[i]);
hashMode = true;
}
for (targetArrIndex = 0; targetArrIndex < targetArrCount; targetArrIndex++) {
if (hashMode) {
// Check if objects match via a string hash (JSON)
if (JSON.stringify(targetArr[targetArrIndex]) === objHash) {
// The object already exists, don't add it
addObj = false;
break;
}
} else {
// Check if objects match based on the path
if (objHash === pathSolver.value(targetArr[targetArrIndex])[0]) {
// The object already exists, don't add it
addObj = false;
break;
}
}
}
if (addObj) {
this._updatePush(doc[i], update[i]);
updated = true;
}
} else {
throw('ForerunnerDB.Collection "' + this.name() + '": Cannot addToSet on a key that is not an array! (' + i + ')');
}
break;
case '$splicePush':
// Check if the target key is undefined and if so, create an array
if (doc[i] === undefined) {
// Initialise a new array
this._updateProperty(doc, i, []);
}
// Check that the target key is an array
if (doc[i] instanceof Array) {
tempIndex = update.$index;
if (tempIndex !== undefined) {
delete update.$index;
// Check for out of bounds index
if (tempIndex > doc[i].length) {
tempIndex = doc[i].length;
}
this._updateSplicePush(doc[i], tempIndex, update[i]);
updated = true;
} else {
throw('ForerunnerDB.Collection "' + this.name() + '": Cannot splicePush without a $index integer value!');
}
} else {
throw('ForerunnerDB.Collection "' + this.name() + '": Cannot splicePush with a key that is not an array! (' + i + ')');
}
break;
case '$move':
if (doc[i] instanceof Array) {
// Loop the array and find matches to our search
for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) {
if (this._match(doc[i][tmpIndex], update[i], '', {})) {
var moveToIndex = update.$index;
if (moveToIndex !== undefined) {
delete update.$index;
this._updateSpliceMove(doc[i], tmpIndex, moveToIndex);
updated = true;
} else {
throw('ForerunnerDB.Collection "' + this.name() + '": Cannot move without a $index integer value!');
}
break;
}
}
} else {
throw('ForerunnerDB.Collection "' + this.name() + '": Cannot move on a key that is not an array! (' + i + ')');
}
break;
case '$mul':
this._updateMultiply(doc, i, update[i]);
updated = true;
break;
case '$rename':
this._updateRename(doc, i, update[i]);
updated = true;
break;
case '$unset':
this._updateUnset(doc, i);
updated = true;
break;
case '$pop':
if (doc[i] instanceof Array) {
if (this._updatePop(doc[i], update[i])) {
updated = true;
}
} else {
throw('ForerunnerDB.Collection "' + this.name() + '": Cannot pop from a key that is not an array! (' + i + ')');
}
break;
default:
if (doc[i] !== update[i]) {
this._updateProperty(doc, i, update[i]);
updated = true;
}
break;
}
}
}
}
}
return updated;
};
/**
* Determines if the passed key has an array positional mark (a dollar at the end
* of its name).
* @param {String} key The key to check.
* @returns {Boolean} True if it is a positional or false if not.
* @private
*/
Collection.prototype._isPositionalKey = function (key) {
return key.substr(key.length - 2, 2) === '.$';
};
/**
* Updates a property on an object depending on if the collection is
* currently running data-binding or not.
* @param {Object} doc The object whose property is to be updated.
* @param {String} prop The property to update.
* @param {*} val The new value of the property.
* @private
*/
Collection.prototype._updateProperty = function (doc, prop, val) {
doc[prop] = val;
if (this.debug()) {
console.log('ForerunnerDB.Collection: Setting non-data-bound document property "' + prop + '" for collection "' + this.name() + '"');
}
};
/**
* Increments a value for a property on a document by the passed number.
* @param {Object} doc The document to modify.
* @param {String} prop The property to modify.
* @param {Number} val The amount to increment by.
* @private
*/
Collection.prototype._updateIncrement = function (doc, prop, val) {
doc[prop] += val;
};
/**
* Changes the index of an item in the passed array.
* @param {Array} arr The array to modify.
* @param {Number} indexFrom The index to move the item from.
* @param {Number} indexTo The index to move the item to.
* @private
*/
Collection.prototype._updateSpliceMove = function (arr, indexFrom, indexTo) {
arr.splice(indexTo, 0, arr.splice(indexFrom, 1)[0]);
if (this.debug()) {
console.log('ForerunnerDB.Collection: Moving non-data-bound document array index from "' + indexFrom + '" to "' + indexTo + '" for collection "' + this.name() + '"');
}
};
/**
* Inserts an item into the passed array at the specified index.
* @param {Array} arr The array to insert into.
* @param {Number} index The index to insert at.
* @param {Object} doc The document to insert.
* @private
*/
Collection.prototype._updateSplicePush = function (arr, index, doc) {
if (arr.length > index) {
arr.splice(index, 0, doc);
} else {
arr.push(doc);
}
};
/**
* Inserts an item at the end of an array.
* @param {Array} arr The array to insert the item into.
* @param {Object} doc The document to insert.
* @private
*/
Collection.prototype._updatePush = function (arr, doc) {
arr.push(doc);
};
/**
* Removes an item from the passed array.
* @param {Array} arr The array to modify.
* @param {Number} index The index of the item in the array to remove.
* @private
*/
Collection.prototype._updatePull = function (arr, index) {
arr.splice(index, 1);
};
/**
* Multiplies a value for a property on a document by the passed number.
* @param {Object} doc The document to modify.
* @param {String} prop The property to modify.
* @param {Number} val The amount to multiply by.
* @private
*/
Collection.prototype._updateMultiply = function (doc, prop, val) {
doc[prop] *= val;
};
/**
* Renames a property on a document to the passed property.
* @param {Object} doc The document to modify.
* @param {String} prop The property to rename.
* @param {Number} val The new property name.
* @private
*/
Collection.prototype._updateRename = function (doc, prop, val) {
doc[val] = doc[prop];
delete doc[prop];
};
/**
* Deletes a property on a document.
* @param {Object} doc The document to modify.
* @param {String} prop The property to delete.
* @private
*/
Collection.prototype._updateUnset = function (doc, prop) {
delete doc[prop];
};
/**
* Pops an item from the array stack.
* @param {Object} doc The document to modify.
* @param {Number=} val Optional, if set to 1 will pop, if set to -1 will shift.
* @return {Boolean}
* @private
*/
Collection.prototype._updatePop = function (doc, val) {
var updated = false;
if (doc.length > 0) {
if (val === 1) {
doc.pop();
updated = true;
} else if (val === -1) {
doc.shift();
updated = true;
}
}
return updated;
};
/**
* Removes any documents from the collection that match the search query
* key/values.
* @param {Object} query The query object.
* @param {Object=} options An options object.
* @param {Function=} callback A callback method.
* @returns {Array} An array of the documents that were removed.
*/
Collection.prototype.remove = function (query, options, callback) {
var self = this,
dataSet,
index,
arrIndex,
returnArr,
removeMethod,
triggerOperation,
doc,
newDoc;
if (query instanceof Array) {
returnArr = [];
for (arrIndex = 0; arrIndex < query.length; arrIndex++) {
returnArr.push(this.remove(query[arrIndex], {noEmit: true}));
}
if (!options || (options && !options.noEmit)) {
this._onRemove(returnArr);
}
if (callback) { callback(false, returnArr); }
return returnArr;
} else {
dataSet = this.find(query, {$decouple: false});
if (dataSet.length) {
removeMethod = function (dataItem) {
// Remove the item from the collection's indexes
self._removeFromIndexes(dataItem);
// Remove data from internal stores
index = self._data.indexOf(dataItem);
self._dataRemoveAtIndex(index);
};
// Remove the data from the collection
for (var i = 0; i < dataSet.length; i++) {
doc = dataSet[i];
if (self.willTrigger(self.TYPE_REMOVE, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_REMOVE, self.PHASE_AFTER)) {
triggerOperation = {
type: 'remove'
};
newDoc = self.decouple(doc);
if (self.processTrigger(triggerOperation, self.TYPE_REMOVE, self.PHASE_BEFORE, newDoc, newDoc) !== false) {
// The trigger didn't ask to cancel so execute the removal method
removeMethod(doc);
self.processTrigger(triggerOperation, self.TYPE_REMOVE, self.PHASE_AFTER, newDoc, newDoc);
}
} else {
// No triggers to execute
removeMethod(doc);
}
}
//op.time('Resolve chains');
this.chainSend('remove', {
query: query,
dataSet: dataSet
}, options);
//op.time('Resolve chains');
if (!options || (options && !options.noEmit)) {
this._onRemove(dataSet);
}
this.deferEmit('change', {type: 'remove', data: dataSet});
}
if (callback) { callback(false, dataSet); }
return dataSet;
}
};
/**
* Helper method that removes a document that matches the given id.
* @param {String} id The id of the document to remove.
* @returns {Array} An array of documents that were removed.
*/
Collection.prototype.removeById = function (id) {
var searchObj = {};
searchObj[this._primaryKey] = id;
return this.remove(searchObj);
};
/**
* Queues an event to be fired. This has automatic de-bouncing so that any
* events of the same type that occur within 100 milliseconds of a previous
* one will all be wrapped into a single emit rather than emitting tons of
* events for lots of chained inserts etc.
* @private
*/
Collection.prototype.deferEmit = function () {
var self = this,
args;
if (!this._noEmitDefer && (!this._db || (this._db && !this._db._noEmitDefer))) {
args = arguments;
// Check for an existing timeout
if (this._changeTimeout) {
clearTimeout(this._changeTimeout);
}
// Set a timeout
this._changeTimeout = setTimeout(function () {
if (self.debug()) { console.log('ForerunnerDB.Collection: Emitting ' + args[0]); }
self.emit.apply(self, args);
}, 100);
} else {
this.emit.apply(this, arguments);
}
};
/**
* Processes a deferred action queue.
* @param {String} type The queue name to process.
* @param {Function} callback A method to call when the queue has processed.
*/
Collection.prototype.processQueue = function (type, callback) {
var queue = this._deferQueue[type],
deferThreshold = this._deferThreshold[type],
deferTime = this._deferTime[type];
if (queue.length) {
var self = this,
dataArr;
// Process items up to the threshold
if (queue.length) {
if (queue.length > deferThreshold) {
// Grab items up to the threshold value
dataArr = queue.splice(0, deferThreshold);
} else {
// Grab all the remaining items
dataArr = queue.splice(0, queue.length);
}
this[type](dataArr);
}
// Queue another process
setTimeout(function () {
self.processQueue(type, callback);
}, deferTime);
} else {
if (callback) { callback(); }
}
};
/**
* Inserts a document or array of documents into the collection.
* @param {Object||Array} data Either a document object or array of document
* @param {Number=} index Optional index to insert the record at.
* @param {Function=} callback Optional callback called once action is complete.
* objects to insert into the collection.
*/
Collection.prototype.insert = function (data, index, callback) {
if (typeof(index) === 'function') {
callback = index;
index = this._data.length;
} else if (index === undefined) {
index = this._data.length;
}
data = this.transformIn(data);
return this._insertHandle(data, index, callback);
};
/**
* Inserts a document or array of documents into the collection.
* @param {Object||Array} data Either a document object or array of document
* @param {Number=} index Optional index to insert the record at.
* @param {Function=} callback Optional callback called once action is complete.
* objects to insert into the collection.
*/
Collection.prototype._insertHandle = function (data, index, callback) {
var //self = this,
queue = this._deferQueue.insert,
deferThreshold = this._deferThreshold.insert,
//deferTime = this._deferTime.insert,
inserted = [],
failed = [],
insertResult,
i;
if (data instanceof Array) {
// Check if there are more insert items than the insert defer
// threshold, if so, break up inserts so we don't tie up the
// ui or thread
if (data.length > deferThreshold) {
// Break up insert into blocks
this._deferQueue.insert = queue.concat(data);
// Fire off the insert queue handler
this.processQueue('insert', callback);
return;
} else {
// Loop the array and add items
for (i = 0; i < data.length; i++) {
insertResult = this._insert(data[i], index + i);
if (insertResult === true) {
inserted.push(data[i]);
} else {
failed.push({
doc: data[i],
reason: insertResult
});
}
}
}
} else {
// Store the data item
insertResult = this._insert(data, index);
if (insertResult === true) {
inserted.push(data);
} else {
failed.push({
doc: data,
reason: insertResult
});
}
}
//op.time('Resolve chains');
this.chainSend('insert', data, {index: index});
//op.time('Resolve chains');
this._onInsert(inserted, failed);
if (callback) { callback(); }
this.deferEmit('change', {type: 'insert', data: inserted});
return {
inserted: inserted,
failed: failed
};
};
/**
* Internal method to insert a document into the collection. Will
* check for index violations before allowing the document to be inserted.
* @param {Object} doc The document to insert after passing index violation
* tests.
* @param {Number=} index Optional index to insert the document at.
* @returns {Boolean|Object} True on success, false if no document passed,
* or an object containing details about an index violation if one occurred.
* @private
*/
Collection.prototype._insert = function (doc, index) {
if (doc) {
var self = this,
indexViolation,
triggerOperation,
insertMethod,
newDoc;
this.ensurePrimaryKey(doc);
// Check indexes are not going to be broken by the document
indexViolation = this.insertIndexViolation(doc);
insertMethod = function (doc) {
// Add the item to the collection's indexes
self._insertIntoIndexes(doc);
// Check index overflow
if (index > self._data.length) {
index = self._data.length;
}
// Insert the document
self._dataInsertAtIndex(index, doc);
};
if (!indexViolation) {
if (self.willTrigger(self.TYPE_INSERT, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_INSERT, self.PHASE_AFTER)) {
triggerOperation = {
type: 'insert'
};
if (self.processTrigger(triggerOperation, self.TYPE_INSERT, self.PHASE_BEFORE, {}, doc) !== false) {
insertMethod(doc);
if (self.willTrigger(self.TYPE_INSERT, self.PHASE_AFTER)) {
// Clone the doc so that the programmer cannot update the internal document
// on the "after" phase trigger
newDoc = self.decouple(doc);
self.processTrigger(triggerOperation, self.TYPE_INSERT, self.PHASE_AFTER, {}, newDoc);
}
} else {
// The trigger just wants to cancel the operation
return false;
}
} else {
// No triggers to execute
insertMethod(doc);
}
return true;
} else {
return 'Index violation in index: ' + indexViolation;
}
}
return 'No document passed to insert';
};
/**
* Inserts a document into the internal collection data array at
* Inserts a document into the internal collection data array at
* the specified index.
* @param {number} index The index to insert at.
* @param {object} doc The document to insert.
* @private
*/
Collection.prototype._dataInsertAtIndex = function (index, doc) {
this._data.splice(index, 0, doc);
};
/**
* Removes a document from the internal collection data array at
* the specified index.
* @param {number} index The index to remove from.
* @private
*/
Collection.prototype._dataRemoveAtIndex = function (index) {
this._data.splice(index, 1);
};
/**
* Replaces all data in the collection's internal data array with
* the passed array of data.
* @param {array} data The array of data to replace existing data with.
* @private
*/
Collection.prototype._dataReplace = function (data) {
// Clear the array - using a while loop with pop is by far the
// fastest way to clear an array currently
while (this._data.length) {
this._data.pop();
}
// Append new items to the array
this._data = this._data.concat(data);
};
/**
* Inserts a document into the collection indexes.
* @param {Object} doc The document to insert.
* @private
*/
Collection.prototype._insertIntoIndexes = function (doc) {
var arr = this._indexByName,
arrIndex,
violated,
jString = JSON.stringify(doc);
// Insert to primary key index
violated = this._primaryIndex.uniqueSet(doc[this._primaryKey], doc);
this._primaryCrc.uniqueSet(doc[this._primaryKey], jString);
this._crcLookup.uniqueSet(jString, doc);
// Insert into other indexes
for (arrIndex in arr) {
if (arr.hasOwnProperty(arrIndex)) {
arr[arrIndex].insert(doc);
}
}
return violated;
};
/**
* Removes a document from the collection indexes.
* @param {Object} doc The document to remove.
* @private
*/
Collection.prototype._removeFromIndexes = function (doc) {
var arr = this._indexByName,
arrIndex,
jString = JSON.stringify(doc);
// Remove from primary key index
this._primaryIndex.unSet(doc[this._primaryKey]);
this._primaryCrc.unSet(doc[this._primaryKey]);
this._crcLookup.unSet(jString);
// Remove from other indexes
for (arrIndex in arr) {
if (arr.hasOwnProperty(arrIndex)) {
arr[arrIndex].remove(doc);
}
}
};
/**
* Rebuild collection indexes.
* @private
*/
Collection.prototype._rebuildIndexes = function () {
var arr = this._indexByName,
arrIndex;
// Remove from other indexes
for (arrIndex in arr) {
if (arr.hasOwnProperty(arrIndex)) {
arr[arrIndex].rebuild();
}
}
};
/**
* Returns the index of the document identified by the passed item's primary key.
* @param {Object} item The item whose primary key should be used to lookup.
* @returns {Number} The index the item with the matching primary key is occupying.
*/
Collection.prototype.indexOfDocById = function (item) {
return this._data.indexOf(
this._primaryIndex.get(
item[this._primaryKey]
)
);
};
/**
* Uses the passed query to generate a new collection with results
* matching the query parameters.
*
* @param query
* @param options
* @returns {*}
*/
Collection.prototype.subset = function (query, options) {
var result = this.find(query, options);
return new Collection()
._subsetOf(this)
.primaryKey(this._primaryKey)
.setData(result);
};
/**
* Gets the collection that this collection is a subset of.
* @returns {Collection}
*/
Collection.prototype.subsetOf = function () {
return this.__subsetOf;
};
/**
* Sets the collection that this collection is a subset of.
* @param {Collection} collection The collection to set as the parent of this subset.
* @returns {*} This object for chaining.
* @private
*/
Collection.prototype._subsetOf = function (collection) {
this.__subsetOf = collection;
return this;
};
/**
* Find the distinct values for a specified field across a single collection and
* returns the results in an array.
* @param {String} key The field path to return distinct values for e.g. "person.name".
* @param {Object=} query The query to use to filter the documents used to return values from.
* @param {Object=} options The query options to use when running the query.
* @returns {Array}
*/
Collection.prototype.distinct = function (key, query, options) {
var data = this.find(query, options),
pathSolver = new Path(key),
valueUsed = {},
distinctValues = [],
value,
i;
// Loop the data and build array of distinct values
for (i = 0; i < data.length; i++) {
value = pathSolver.value(data[i])[0];
if (value && !valueUsed[value]) {
valueUsed[value] = true;
distinctValues.push(value);
}
}
return distinctValues;
};
/**
* Helper method to find a document by it's id.
* @param {String} id The id of the document.
* @param {Object=} options The options object, allowed keys are sort and limit.
* @returns {Array} The items that were updated.
*/
Collection.prototype.findById = function (id, options) {
var searchObj = {};
searchObj[this._primaryKey] = id;
return this.find(searchObj, options)[0];
};
/**
* Finds all documents that contain the passed string or search object
* regardless of where the string might occur within the document. This
* will match strings from the start, middle or end of the document's
* string (partial match).
* @param search The string to search for. Case sensitive.
* @param options A standard find() options object.
* @returns {Array} An array of documents that matched the search string.
*/
Collection.prototype.peek = function (search, options) {
// Loop all items
var arr = this._data,
arrCount = arr.length,
arrIndex,
arrItem,
tempColl = new Collection(),
typeOfSearch = typeof search;
if (typeOfSearch === 'string') {
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
// Get json representation of object
arrItem = JSON.stringify(arr[arrIndex]);
// Check if string exists in object json
if (arrItem.indexOf(search) > -1) {
// Add this item to the temp collection
tempColl.insert(arr[arrIndex]);
}
}
return tempColl.find({}, options);
} else {
return this.find(search, options);
}
};
/**
* Provides a query plan / operations log for a query.
* @param {Object} query The query to execute.
* @param {Object=} options Optional options object.
* @returns {Object} The query plan.
*/
Collection.prototype.explain = function (query, options) {
var result = this.find(query, options);
return result.__fdbOp._data;
};
/**
* Generates an options object with default values or adds default
* values to a passed object if those values are not currently set
* to anything.
* @param {object=} obj Optional options object to modify.
* @returns {object} The options object.
*/
Collection.prototype.options = function (obj) {
obj = obj || {};
obj.$decouple = obj.$decouple !== undefined ? obj.$decouple : true;
obj.$explain = obj.$explain !== undefined ? obj.$explain : false;
return obj;
};
/**
* Queries the collection based on the query object passed.
* @param {Object} query The query key/values that a document must match in
* order for it to be returned in the result array.
* @param {Object=} options An optional options object.
*
* @returns {Array} The results array from the find operation, containing all
* documents that matched the query.
*/
Collection.prototype.find = function (query, options) {
// TODO: This method is quite long, break into smaller pieces
query = query || {};
options = this.options(options);
var op = this._metrics.create('find'),
pk = this.primaryKey(),
self = this,
analysis,
//finalQuery,
scanLength,
requiresTableScan = true,
resultArr,
joinCollectionIndex,
joinIndex,
joinCollection = {},
joinQuery,
joinPath,
joinCollectionName,
joinCollectionInstance,
joinMatch,
joinMatchIndex,
joinSearch,
joinMulti,
joinRequire,
joinFindResults,
resultCollectionName,
resultIndex,
resultRemove = [],
index,
i, j, k,
fieldListOn = [],
fieldListOff = [],
elemMatchPathSolver,
elemMatchSubArr,
elemMatchSpliceArr,
matcherTmpOptions = {},
result,
matcher = function (doc) {
return self._match(doc, query, 'and', matcherTmpOptions);
};
op.start();
if (query) {
// Get query analysis to execute best optimised code path
op.time('analyseQuery');
analysis = this._analyseQuery(query, options, op);
op.time('analyseQuery');
op.data('analysis', analysis);
if (analysis.hasJoin && analysis.queriesJoin) {
// The query has a join and tries to limit by it's joined data
// Get an instance reference to the join collections
op.time('joinReferences');
for (joinIndex = 0; joinIndex < analysis.joinsOn.length; joinIndex++) {
joinCollectionName = analysis.joinsOn[joinIndex];
joinPath = new Path(analysis.joinQueries[joinCollectionName]);
joinQuery = joinPath.value(query)[0];
joinCollection[analysis.joinsOn[joinIndex]] = this._db.collection(analysis.joinsOn[joinIndex]).subset(joinQuery);
}
op.time('joinReferences');
}
// Check if an index lookup can be used to return this result
if (analysis.indexMatch.length && (!options || (options && !options.$skipIndex))) {
op.data('index.potential', analysis.indexMatch);
op.data('index.used', analysis.indexMatch[0].index);
// Get the data from the index
op.time('indexLookup');
resultArr = analysis.indexMatch[0].lookup;
op.time('indexLookup');
// Check if the index coverage is all keys, if not we still need to table scan it
if (analysis.indexMatch[0].keyData.totalKeyCount === analysis.indexMatch[0].keyData.score) {
// Require a table scan to find relevant documents
requiresTableScan = false;
}
} else {
op.flag('usedIndex', false);
}
if (requiresTableScan) {
if (resultArr && resultArr.length) {
scanLength = resultArr.length;
op.time('tableScan: ' + scanLength);
// Filter the source data and return the result
resultArr = resultArr.filter(matcher);
} else {
// Filter the source data and return the result
scanLength = this._data.length;
op.time('tableScan: ' + scanLength);
resultArr = this._data.filter(matcher);
}
// Order the array if we were passed a sort clause
if (options.$orderBy) {
op.time('sort');
resultArr = this.sort(options.$orderBy, resultArr);
op.time('sort');
}
op.time('tableScan: ' + scanLength);
}
if (options.$limit && resultArr && resultArr.length > options.$limit) {
resultArr.length = options.$limit;
op.data('limit', options.$limit);
}
if (options.$decouple) {
// Now decouple the data from the original objects
op.time('decouple');
resultArr = this.decouple(resultArr);
op.time('decouple');
op.data('flag.decouple', true);
}
// Now process any joins on the final data
if (options.$join) {
for (joinCollectionIndex = 0; joinCollectionIndex < options.$join.length; joinCollectionIndex++) {
for (joinCollectionName in options.$join[joinCollectionIndex]) {
if (options.$join[joinCollectionIndex].hasOwnProperty(joinCollectionName)) {
// Set the key to store the join result in to the collection name by default
resultCollectionName = joinCollectionName;
// Get the join collection instance from the DB
joinCollectionInstance = this._db.collection(joinCollectionName);
// Get the match data for the join
joinMatch = options.$join[joinCollectionIndex][joinCollectionName];
// Loop our result data array
for (resultIndex = 0; resultIndex < resultArr.length; resultIndex++) {
// Loop the join conditions and build a search object from them
joinSearch = {};
joinMulti = false;
joinRequire = false;
for (joinMatchIndex in joinMatch) {
if (joinMatch.hasOwnProperty(joinMatchIndex)) {
// Check the join condition name for a special command operator
if (joinMatchIndex.substr(0, 1) === '$') {
// Special command
switch (joinMatchIndex) {
case '$as':
// Rename the collection when stored in the result document
resultCollectionName = joinMatch[joinMatchIndex];
break;
case '$multi':
// Return an array of documents instead of a single matching document
joinMulti = joinMatch[joinMatchIndex];
break;
case '$require':
// Remove the result item if no matching join data is found
joinRequire = joinMatch[joinMatchIndex];
break;
/*default:
// Check for a double-dollar which is a back-reference to the root collection item
if (joinMatchIndex.substr(0, 3) === '$$.') {
// Back reference
// TODO: Support complex joins
}
break;*/
}
} else {
// TODO: Could optimise this by caching path objects
// Get the data to match against and store in the search object
joinSearch[joinMatchIndex] = new Path(joinMatch[joinMatchIndex]).value(resultArr[resultIndex])[0];
}
}
}
// Do a find on the target collection against the match data
joinFindResults = joinCollectionInstance.find(joinSearch);
// Check if we require a joined row to allow the result item
if (!joinRequire || (joinRequire && joinFindResults[0])) {
// Join is not required or condition is met
resultArr[resultIndex][resultCollectionName] = joinMulti === false ? joinFindResults[0] : joinFindResults;
} else {
// Join required but condition not met, add item to removal queue
resultRemove.push(resultArr[resultIndex]);
}
}
}
}
}
op.data('flag.join', true);
}
// Process removal queue
if (resultRemove.length) {
op.time('removalQueue');
for (i = 0; i < resultRemove.length; i++) {
index = resultArr.indexOf(resultRemove[i]);
if (index > -1) {
resultArr.splice(index, 1);
}
}
op.time('removalQueue');
}
if (options.$transform) {
op.time('transform');
for (i = 0; i < resultArr.length; i++) {
resultArr.splice(i, 1, options.$transform(resultArr[i]));
}
op.time('transform');
op.data('flag.transform', true);
}
// Process transforms
if (this._transformEnabled && this._transformOut) {
op.time('transformOut');
resultArr = this.transformOut(resultArr);
op.time('transformOut');
}
op.data('results', resultArr.length);
} else {
resultArr = [];
}
// Generate a list of fields to limit data by
// Each property starts off being enabled by default (= 1) then
// if any property is explicitly specified as 1 then all switch to
// zero except _id.
//
// Any that are explicitly set to zero are switched off.
op.time('scanFields');
for (i in options) {
if (options.hasOwnProperty(i) && i.indexOf('$') !== 0) {
if (options[i] === 1) {
fieldListOn.push(i);
} else if (options[i] === 0) {
fieldListOff.push(i);
}
}
}
op.time('scanFields');
// Limit returned fields by the options data
if (fieldListOn.length || fieldListOff.length) {
op.data('flag.limitFields', true);
op.data('limitFields.on', fieldListOn);
op.data('limitFields.off', fieldListOff);
op.time('limitFields');
// We have explicit fields switched on or off
for (i = 0; i < resultArr.length; i++) {
result = resultArr[i];
for (j in result) {
if (result.hasOwnProperty(j)) {
if (fieldListOn.length) {
// We have explicit fields switched on so remove all fields
// that are not explicitly switched on
// Check if the field name is not the primary key
if (j !== pk) {
if (fieldListOn.indexOf(j) === -1) {
// This field is not in the on list, remove it
delete result[j];
}
}
}
if (fieldListOff.length) {
// We have explicit fields switched off so remove fields
// that are explicitly switched off
if (fieldListOff.indexOf(j) > -1) {
// This field is in the off list, remove it
delete result[j];
}
}
}
}
}
op.time('limitFields');
}
// Now run any projections on the data required
if (options.$elemMatch) {
op.data('flag.elemMatch', true);
op.time('projection-elemMatch');
for (i in options.$elemMatch) {
if (options.$elemMatch.hasOwnProperty(i)) {
elemMatchPathSolver = new Path(i);
// Loop the results array
for (j = 0; j < resultArr.length; j++) {
elemMatchSubArr = elemMatchPathSolver.value(resultArr[j])[0];
// Check we have a sub-array to loop
if (elemMatchSubArr && elemMatchSubArr.length) {
// Loop the sub-array and check for projection query matches
for (k = 0; k < elemMatchSubArr.length; k++) {
// Check if the current item in the sub-array matches the projection query
if (self._match(elemMatchSubArr[k], options.$elemMatch[i], '', {})) {
// The item matches the projection query so set the sub-array
// to an array that ONLY contains the matching item and then
// exit the loop since we only want to match the first item
elemMatchPathSolver.set(resultArr[j], i, [elemMatchSubArr[k]]);
break;
}
}
}
}
}
}
op.time('projection-elemMatch');
}
if (options.$elemsMatch) {
op.data('flag.elemsMatch', true);
op.time('projection-elemsMatch');
for (i in options.$elemsMatch) {
if (options.$elemsMatch.hasOwnProperty(i)) {
elemMatchPathSolver = new Path(i);
// Loop the results array
for (j = 0; j < resultArr.length; j++) {
elemMatchSubArr = elemMatchPathSolver.value(resultArr[j])[0];
// Check we have a sub-array to loop
if (elemMatchSubArr && elemMatchSubArr.length) {
elemMatchSpliceArr = [];
// Loop the sub-array and check for projection query matches
for (k = 0; k < elemMatchSubArr.length; k++) {
// Check if the current item in the sub-array matches the projection query
if (self._match(elemMatchSubArr[k], options.$elemsMatch[i], '', {})) {
// The item matches the projection query so add it to the final array
elemMatchSpliceArr.push(elemMatchSubArr[k]);
}
}
// Now set the final sub-array to the matched items
elemMatchPathSolver.set(resultArr[j], i, elemMatchSpliceArr);
}
}
}
}
op.time('projection-elemsMatch');
}
op.stop();
resultArr.__fdbOp = op;
return resultArr;
};
/**
* Gets the index in the collection data array of the first item matched by
* the passed query object.
* @param {Object} query The query to run to find the item to return the index of.
* @returns {Number}
*/
Collection.prototype.indexOf = function (query) {
var item = this.find(query, {$decouple: false})[0];
if (item) {
return this._data.indexOf(item);
}
};
/**
* Gets / sets the collection transform options.
* @param {Object} obj A collection transform options object.
* @returns {*}
*/
Collection.prototype.transform = function (obj) {
if (obj !== undefined) {
if (typeof obj === "object") {
if (obj.enabled !== undefined) {
this._transformEnabled = obj.enabled;
}
if (obj.dataIn !== undefined) {
this._transformIn = obj.dataIn;
}
if (obj.dataOut !== undefined) {
this._transformOut = obj.dataOut;
}
} else {
this._transformEnabled = obj !== false;
}
return this;
}
return {
enabled: this._transformEnabled,
dataIn: this._transformIn,
dataOut: this._transformOut
};
};
/**
* Transforms data using the set transformIn method.
* @param {Object} data The data to transform.
* @returns {*}
*/
Collection.prototype.transformIn = function (data) {
if (this._transformEnabled && this._transformIn) {
if (data instanceof Array) {
var finalArr = [], i;
for (i = 0; i < data.length; i++) {
finalArr[i] = this._transformIn(data[i]);
}
return finalArr;
} else {
return this._transformIn(data);
}
}
return data;
};
/**
* Transforms data using the set transformOut method.
* @param {Object} data The data to transform.
* @returns {*}
*/
Collection.prototype.transformOut = function (data) {
if (this._transformEnabled && this._transformOut) {
if (data instanceof Array) {
var finalArr = [], i;
for (i = 0; i < data.length; i++) {
finalArr[i] = this._transformOut(data[i]);
}
return finalArr;
} else {
return this._transformOut(data);
}
}
return data;
};
/**
* Sorts an array of documents by the given sort path.
* @param {*} sortObj The keys and orders the array objects should be sorted by.
* @param {Array} arr The array of documents to sort.
* @returns {Array}
*/
Collection.prototype.sort = function (sortObj, arr) {
// Make sure we have an array object
arr = arr || [];
var sortArr = [],
sortKey,
sortSingleObj;
for (sortKey in sortObj) {
if (sortObj.hasOwnProperty(sortKey)) {
sortSingleObj = {};
sortSingleObj[sortKey] = sortObj[sortKey];
sortSingleObj.___fdbKey = sortKey;
sortArr.push(sortSingleObj);
}
}
if (sortArr.length < 2) {
// There is only one sort criteria, do a simple sort and return it
return this._sort(sortObj, arr);
} else {
return this._bucketSort(sortArr, arr);
}
};
/**
* Takes array of sort paths and sorts them into buckets before returning final
* array fully sorted by multi-keys.
* @param keyArr
* @param arr
* @returns {*}
* @private
*/
Collection.prototype._bucketSort = function (keyArr, arr) {
var keyObj = keyArr.shift(),
arrCopy,
buckets,
i,
finalArr = [];
if (keyArr.length > 0) {
// Sort array by bucket key
arr = this._sort(keyObj, arr);
// Split items into buckets
buckets = this.bucket(keyObj.___fdbKey, arr);
// Loop buckets and sort contents
for (i in buckets) {
if (buckets.hasOwnProperty(i)) {
arrCopy = [].concat(keyArr);
finalArr = finalArr.concat(this._bucketSort(arrCopy, buckets[i]));
}
}
return finalArr;
} else {
return this._sort(keyObj, arr);
}
};
/**
* Sorts array by individual sort path.
* @param key
* @param arr
* @returns {Array|*}
* @private
*/
Collection.prototype._sort = function (key, arr) {
var self = this,
sorterMethod,
pathSolver = new Path(),
dataPath = pathSolver.parse(key, true)[0];
pathSolver.path(dataPath.path);
if (dataPath.value === 1) {
// Sort ascending
sorterMethod = function (a, b) {
var valA = pathSolver.value(a)[0],
valB = pathSolver.value(b)[0];
return self.sortAsc(valA, valB);
};
} else if (dataPath.value === -1) {
// Sort descending
sorterMethod = function (a, b) {
var valA = pathSolver.value(a)[0],
valB = pathSolver.value(b)[0];
return self.sortDesc(valA, valB);
};
} else {
throw('ForerunnerDB.Collection "' + this.name() + '": $orderBy clause has invalid direction: ' + dataPath.value + ', accepted values are 1 or -1 for ascending or descending!');
}
return arr.sort(sorterMethod);
};
/**
* Takes an array of objects and returns a new object with the array items
* split into buckets by the passed key.
* @param {String} key The key to split the array into buckets by.
* @param {Array} arr An array of objects.
* @returns {Object}
*/
Collection.prototype.bucket = function (key, arr) {
var i,
buckets = {};
for (i = 0; i < arr.length; i++) {
buckets[arr[i][key]] = buckets[arr[i][key]] || [];
buckets[arr[i][key]].push(arr[i]);
}
return buckets;
};
/**
* Internal method that takes a search query and options and returns an object
* containing details about the query which can be used to optimise the search.
*
* @param query
* @param options
* @param op
* @returns {Object}
* @private
*/
Collection.prototype._analyseQuery = function (query, options, op) {
var analysis = {
queriesOn: [this._name],
indexMatch: [],
hasJoin: false,
queriesJoin: false,
joinQueries: {},
query: query,
options: options
},
joinCollectionIndex,
joinCollectionName,
joinCollections = [],
joinCollectionReferences = [],
queryPath,
index,
indexMatchData,
indexRef,
indexRefName,
indexLookup,
pathSolver,
queryKeyCount,
i;
// Check if the query is a primary key lookup
op.time('checkIndexes');
pathSolver = new Path();
queryKeyCount = pathSolver.countKeys(query);
if (queryKeyCount) {
if (query[this._primaryKey] !== undefined) {
// Return item via primary key possible
op.time('checkIndexMatch: Primary Key');
analysis.indexMatch.push({
lookup: this._primaryIndex.lookup(query, options),
keyData: {
matchedKeys: [this._primaryKey],
totalKeyCount: queryKeyCount,
score: 1
},
index: this._primaryIndex
});
op.time('checkIndexMatch: Primary Key');
}
// Check if an index can speed up the query
for (i in this._indexById) {
if (this._indexById.hasOwnProperty(i)) {
indexRef = this._indexById[i];
indexRefName = indexRef.name();
op.time('checkIndexMatch: ' + indexRefName);
indexMatchData = indexRef.match(query, options);
if (indexMatchData.score > 0) {
// This index can be used, store it
indexLookup = indexRef.lookup(query, options);
analysis.indexMatch.push({
lookup: indexLookup,
keyData: indexMatchData,
index: indexRef
});
}
op.time('checkIndexMatch: ' + indexRefName);
if (indexMatchData.score === queryKeyCount) {
// Found an optimal index, do not check for any more
break;
}
}
}
op.time('checkIndexes');
// Sort array descending on index key count (effectively a measure of relevance to the query)
if (analysis.indexMatch.length > 1) {
op.time('findOptimalIndex');
analysis.indexMatch.sort(function (a, b) {
if (a.keyData.score > b.keyData.score) {
// This index has a higher score than the other
return -1;
}
if (a.keyData.score < b.keyData.score) {
// This index has a lower score than the other
return 1;
}
// The indexes have the same score but can still be compared by the number of records
// they return from the query. The fewer records they return the better so order by
// record count
if (a.keyData.score === b.keyData.score) {
return a.lookup.length - b.lookup.length;
}
});
op.time('findOptimalIndex');
}
}
// Check for join data
if (options.$join) {
analysis.hasJoin = true;
// Loop all join operations
for (joinCollectionIndex = 0; joinCollectionIndex < options.$join.length; joinCollectionIndex++) {
// Loop the join collections and keep a reference to them
for (joinCollectionName in options.$join[joinCollectionIndex]) {
if (options.$join[joinCollectionIndex].hasOwnProperty(joinCollectionName)) {
joinCollections.push(joinCollectionName);
// Check if the join uses an $as operator
if ('$as' in options.$join[joinCollectionIndex][joinCollectionName]) {
joinCollectionReferences.push(options.$join[joinCollectionIndex][joinCollectionName].$as);
} else {
joinCollectionReferences.push(joinCollectionName);
}
}
}
}
// Loop the join collection references and determine if the query references
// any of the collections that are used in the join. If there no queries against
// joined collections the find method can use a code path optimised for this.
// Queries against joined collections requires the joined collections to be filtered
// first and then joined so requires a little more work.
for (index = 0; index < joinCollectionReferences.length; index++) {
// Check if the query references any collection data that the join will create
queryPath = this._queryReferencesCollection(query, joinCollectionReferences[index], '');
if (queryPath) {
analysis.joinQueries[joinCollections[index]] = queryPath;
analysis.queriesJoin = true;
}
}
analysis.joinsOn = joinCollections;
analysis.queriesOn = analysis.queriesOn.concat(joinCollections);
}
return analysis;
};
/**
* Checks if the passed query references this collection.
* @param query
* @param collection
* @param path
* @returns {*}
* @private
*/
Collection.prototype._queryReferencesCollection = function (query, collection, path) {
var i;
for (i in query) {
if (query.hasOwnProperty(i)) {
// Check if this key is a reference match
if (i === collection) {
if (path) { path += '.'; }
return path + i;
} else {
if (typeof(query[i]) === 'object') {
// Recurse
if (path) { path += '.'; }
path += i;
return this._queryReferencesCollection(query[i], collection, path);
}
}
}
}
return false;
};
/**
* Returns the number of documents currently in the collection.
* @returns {Number}
*/
Collection.prototype.count = function (query, options) {
if (!query) {
return this._data.length;
} else {
// Run query and return count
return this.find(query, options).length;
}
};
/**
* Finds sub-documents from the collection's documents.
* @param match
* @param path
* @param subDocQuery
* @param subDocOptions
* @returns {*}
*/
Collection.prototype.findSub = function (match, path, subDocQuery, subDocOptions) {
var pathHandler = new Path(path),
docArr = this.find(match),
docCount = docArr.length,
docIndex,
subDocArr,
subDocCollection = this._db.collection('__FDB_temp_' + this.objectId()),
subDocResults,
resultObj = {
parents: docCount,
subDocTotal: 0,
subDocs: [],
pathFound: false,
err: ''
};
for (docIndex = 0; docIndex < docCount; docIndex++) {
subDocArr = pathHandler.value(docArr[docIndex])[0];
if (subDocArr) {
subDocCollection.setData(subDocArr);
subDocResults = subDocCollection.find(subDocQuery, subDocOptions);
if (subDocOptions.returnFirst && subDocResults.length) {
return subDocResults[0];
}
resultObj.subDocs.push(subDocResults);
resultObj.subDocTotal += subDocResults.length;
resultObj.pathFound = true;
}
}
// Drop the sub-document collection
subDocCollection.drop();
// Check if the call should not return stats, if so return only subDocs array
if (subDocOptions.noStats) {
return resultObj.subDocs;
}
if (!resultObj.pathFound) {
resultObj.err = 'No objects found in the parent documents with a matching path of: ' + path;
}
return resultObj;
};
/**
* Checks that the passed document will not violate any index rules if
* inserted into the collection.
* @param {Object} doc The document to check indexes against.
* @returns {Boolean} Either false (no violation occurred) or true if
* a violation was detected.
*/
Collection.prototype.insertIndexViolation = function (doc) {
var indexViolated,
arr = this._indexByName,
arrIndex,
arrItem;
// Check the item's primary key is not already in use
if (this._primaryIndex.get(doc[this._primaryKey])) {
indexViolated = this._primaryIndex;
} else {
// Check violations of other indexes
for (arrIndex in arr) {
if (arr.hasOwnProperty(arrIndex)) {
arrItem = arr[arrIndex];
if (arrItem.unique()) {
if (arrItem.violation(doc)) {
indexViolated = arrItem;
break;
}
}
}
}
}
return indexViolated ? indexViolated.name() : false;
};
/**
* Creates an index on the specified keys.
* @param {Object} keys The object containing keys to index.
* @param {Object} options An options object.
* @returns {*}
*/
Collection.prototype.ensureIndex = function (keys, options) {
this._indexByName = this._indexByName || {};
this._indexById = this._indexById || {};
var index,
time = {
start: new Date().getTime()
};
if (options) {
switch (options.type) {
case 'hashed':
index = new IndexHashMap(keys, options, this);
break;
case 'btree':
index = new IndexBinaryTree(keys, options, this);
break;
default:
// Default
index = new IndexHashMap(keys, options, this);
break;
}
} else {
// Default
index = new IndexHashMap(keys, options, this);
}
// Check the index does not already exist
if (this._indexByName[index.name()]) {
// Index already exists
return {
err: 'Index with that name already exists'
};
}
if (this._indexById[index.id()]) {
// Index already exists
return {
err: 'Index with those keys already exists'
};
}
// Create the index
index.rebuild();
// Add the index
this._indexByName[index.name()] = index;
this._indexById[index.id()] = index;
time.end = new Date().getTime();
time.total = time.end - time.start;
this._lastOp = {
type: 'ensureIndex',
stats: {
time: time
}
};
return {
index: index,
id: index.id(),
name: index.name(),
state: index.state()
};
};
/**
* Gets an index by it's name.
* @param {String} name The name of the index to retreive.
* @returns {*}
*/
Collection.prototype.index = function (name) {
if (this._indexByName) {
return this._indexByName[name];
}
};
/**
* Gets the last reporting operation's details such as run time.
* @returns {Object}
*/
Collection.prototype.lastOp = function () {
return this._metrics.list();
};
/**
* Generates a difference object that contains insert, update and remove arrays
* representing the operations to execute to make this collection have the same
* data as the one passed.
* @param {Collection} collection The collection to diff against.
* @returns {{}}
*/
Collection.prototype.diff = function (collection) {
var diff = {
insert: [],
update: [],
remove: []
};
var pm = this.primaryKey(),
arr,
arrIndex,
arrItem,
arrCount;
// Check if the primary key index of each collection can be utilised
if (pm !== collection.primaryKey()) {
throw('ForerunnerDB.Collection "' + this.name() + '": Collection diffing requires that both collections have the same primary key!');
}
// Use the collection primary key index to do the diff (super-fast)
arr = collection._data;
// Check if we have an array or another collection
while (arr && !(arr instanceof Array)) {
// We don't have an array, assign collection and get data
collection = arr;
arr = collection._data;
}
arrCount = arr.length;
// Loop the collection's data array and check for matching items
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
arrItem = arr[arrIndex];
// Check for a matching item in this collection
if (this._primaryIndex.get(arrItem[pm])) {
// Matching item exists, check if the data is the same
if (this._primaryCrc.get(arrItem[pm]) !== collection._primaryCrc.get(arrItem[pm])) {
// The documents exist in both collections but data differs, update required
diff.update.push(arrItem);
}
} else {
// The document is missing from this collection, insert required
diff.insert.push(arrItem);
}
}
// Now loop this collection's data and check for matching items
arr = this._data;
arrCount = arr.length;
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
arrItem = arr[arrIndex];
if (!collection._primaryIndex.get(arrItem[pm])) {
// The document does not exist in the other collection, remove required
diff.remove.push(arrItem);
}
}
return diff;
};
/**
* Get a collection by name. If the collection does not already exist
* then one is created for that name automatically.
* @param {String} collectionName The name of the collection.
* @param {String=} primaryKey Optional primary key to specify the primary key field on the collection
* objects. Defaults to "_id".
* @returns {Collection}
*/
Core.prototype.collection = function (collectionName, primaryKey) {
if (collectionName) {
if (!this._collection[collectionName]) {
if (this.debug()) {
console.log('Creating collection ' + collectionName);
}
}
this._collection[collectionName] = this._collection[collectionName] || new Collection(collectionName).db(this);
if (primaryKey !== undefined) {
this._collection[collectionName].primaryKey(primaryKey);
}
return this._collection[collectionName];
} else {
throw('ForerunnerDB.Core "' + this.name() + '": Cannot get collection with undefined name!');
}
};
/**
* Determine if a collection with the passed name already exists.
* @param {String} viewName The name of the collection to check for.
* @returns {boolean}
*/
Core.prototype.collectionExists = function (viewName) {
return Boolean(this._collection[viewName]);
};
/**
* Returns an array of collections the DB currently has.
* @param {String|RegExp=} search The optional search string or regular expression to use
* to match collection names against.
* @returns {Array} An array of objects containing details of each collection
* the database is currently managing.
*/
Core.prototype.collections = function (search) {
var arr = [],
i;
if (search) {
if (!(search instanceof RegExp)) {
// Turn the search into a regular expression
search = new RegExp(search);
}
}
for (i in this._collection) {
if (this._collection.hasOwnProperty(i)) {
if (search) {
if (search.exec(i)) {
arr.push({
name: i,
count: this._collection[i].count()
});
}
} else {
arr.push({
name: i,
count: this._collection[i].count()
});
}
}
}
return arr;
};
Shared.finishModule('Collection');
module.exports = Collection;
},{"./Crc":6,"./IndexBinaryTree":7,"./IndexHashMap":8,"./KeyValueStore":9,"./Metrics":10,"./Path":21,"./Shared":23}],4:[function(_dereq_,module,exports){
"use strict";
// Import external names locally
var Shared,
Core,
CoreInit,
Collection;
Shared = _dereq_('./Shared');
var CollectionGroup = function () {
this.init.apply(this, arguments);
};
CollectionGroup.prototype.init = function (name) {
var self = this;
self._name = name;
self._data = new Collection('__FDB__cg_data_' + self._name);
self._collections = [];
self._view = [];
};
Shared.addModule('CollectionGroup', CollectionGroup);
Shared.mixin(CollectionGroup.prototype, 'Mixin.Common');
Shared.mixin(CollectionGroup.prototype, 'Mixin.ChainReactor');
Shared.mixin(CollectionGroup.prototype, 'Mixin.Constants');
Shared.mixin(CollectionGroup.prototype, 'Mixin.Triggers');
Collection = _dereq_('./Collection');
Core = Shared.modules.Core;
CoreInit = Shared.modules.Core.prototype.init;
CollectionGroup.prototype.on = function () {
this._data.on.apply(this._data, arguments);
};
CollectionGroup.prototype.off = function () {
this._data.off.apply(this._data, arguments);
};
CollectionGroup.prototype.emit = function () {
this._data.emit.apply(this._data, arguments);
};
/**
* Gets / sets the primary key for this collection group.
* @param {String=} keyName The name of the primary key.
* @returns {*}
*/
CollectionGroup.prototype.primaryKey = function (keyName) {
if (keyName !== undefined) {
this._primaryKey = keyName;
return this;
}
return this._primaryKey;
};
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(CollectionGroup.prototype, 'state');
/**
* Gets / sets the db instance the collection group belongs to.
* @param {Core=} db The db instance.
* @returns {*}
*/
Shared.synthesize(CollectionGroup.prototype, 'db');
CollectionGroup.prototype.addCollection = function (collection) {
if (collection) {
if (this._collections.indexOf(collection) === -1) {
//var self = this;
// Check for compatible primary keys
if (this._collections.length) {
if (this._primaryKey !== collection.primaryKey()) {
throw('ForerunnerDB.CollectionGroup "' + this.name() + '": All collections in a collection group must have the same primary key!');
}
} else {
// Set the primary key to the first collection added
this.primaryKey(collection.primaryKey());
}
// Add the collection
this._collections.push(collection);
collection._groups.push(this);
collection.chain(this);
// Add collection's data
this._data.insert(collection.find());
}
}
return this;
};
CollectionGroup.prototype.removeCollection = function (collection) {
if (collection) {
var collectionIndex = this._collections.indexOf(collection),
groupIndex;
if (collectionIndex !== -1) {
collection.unChain(this);
this._collections.splice(collectionIndex, 1);
groupIndex = collection._groups.indexOf(this);
if (groupIndex !== -1) {
collection._groups.splice(groupIndex, 1);
}
}
if (this._collections.length === 0) {
// Wipe the primary key
delete this._primaryKey;
}
}
return this;
};
CollectionGroup.prototype._chainHandler = function (chainPacket) {
//sender = chainPacket.sender;
switch (chainPacket.type) {
case 'setData':
// Decouple the data to ensure we are working with our own copy
chainPacket.data = this.decouple(chainPacket.data);
// Remove old data
this._data.remove(chainPacket.options.oldData);
// Add new data
this._data.insert(chainPacket.data);
break;
case 'insert':
// Decouple the data to ensure we are working with our own copy
chainPacket.data = this.decouple(chainPacket.data);
// Add new data
this._data.insert(chainPacket.data);
break;
case 'update':
// Update data
this._data.update(chainPacket.data.query, chainPacket.data.update, chainPacket.options);
break;
case 'remove':
this._data.remove(chainPacket.data.query, chainPacket.options);
break;
default:
break;
}
};
CollectionGroup.prototype.insert = function () {
this._collectionsRun('insert', arguments);
};
CollectionGroup.prototype.update = function () {
this._collectionsRun('update', arguments);
};
CollectionGroup.prototype.updateById = function () {
this._collectionsRun('updateById', arguments);
};
CollectionGroup.prototype.remove = function () {
this._collectionsRun('remove', arguments);
};
CollectionGroup.prototype._collectionsRun = function (type, args) {
for (var i = 0; i < this._collections.length; i++) {
this._collections[i][type].apply(this._collections[i], args);
}
};
CollectionGroup.prototype.find = function (query, options) {
return this._data.find(query, options);
};
/**
* Helper method that removes a document that matches the given id.
* @param {String} id The id of the document to remove.
*/
CollectionGroup.prototype.removeById = function (id) {
// Loop the collections in this group and apply the remove
for (var i = 0; i < this._collections.length; i++) {
this._collections[i].removeById(id);
}
};
/**
* Uses the passed query to generate a new collection with results
* matching the query parameters.
*
* @param query
* @param options
* @returns {*}
*/
CollectionGroup.prototype.subset = function (query, options) {
var result = this.find(query, options);
return new Collection()
._subsetOf(this)
.primaryKey(this._primaryKey)
.setData(result);
};
/**
* Drops a collection group from the database.
* @returns {boolean} True on success, false on failure.
*/
CollectionGroup.prototype.drop = function () {
if (this._state !== 'dropped') {
var i,
collArr,
viewArr;
if (this._debug) {
console.log('Dropping collection group ' + this._name);
}
this._state = 'dropped';
if (this._collections && this._collections.length) {
collArr = [].concat(this._collections);
for (i = 0; i < collArr.length; i++) {
this.removeCollection(collArr[i]);
}
}
if (this._view && this._view.length) {
viewArr = [].concat(this._view);
for (i = 0; i < viewArr.length; i++) {
this._removeView(viewArr[i]);
}
}
this.emit('drop', this);
}
return true;
};
// Extend DB to include collection groups
Core.prototype.init = function () {
this._collectionGroup = {};
CoreInit.apply(this, arguments);
};
Core.prototype.collectionGroup = function (collectionGroupName) {
if (collectionGroupName) {
this._collectionGroup[collectionGroupName] = this._collectionGroup[collectionGroupName] || new CollectionGroup(collectionGroupName).db(this);
return this._collectionGroup[collectionGroupName];
} else {
// Return an object of collection data
return this._collectionGroup;
}
};
/**
* Returns an array of collection groups the DB currently has.
* @returns {Array} An array of objects containing details of each collection group
* the database is currently managing.
*/
Core.prototype.collectionGroups = function () {
var arr = [],
i;
for (i in this._collectionGroup) {
if (this._collectionGroup.hasOwnProperty(i)) {
arr.push({
name: i
});
}
}
return arr;
};
module.exports = CollectionGroup;
},{"./Collection":3,"./Shared":23}],5:[function(_dereq_,module,exports){
/*
License
Copyright (c) 2015 Irrelon Software Limited
http://www.irrelon.com
http://www.forerunnerdb.com
Please visit the license page to see latest license information:
http://www.forerunnerdb.com/licensing.html
*/
"use strict";
var Shared,
Collection,
Metrics,
Crc,
Overload;
Shared = _dereq_('./Shared');
Overload = _dereq_('./Overload');
/**
* The main ForerunnerDB core object.
* @constructor
*/
var Core = function (name) {
this.init.apply(this, arguments);
};
Core.prototype.init = function (name) {
this._primaryKey = '_id';
this._name = name;
this._collection = {};
this._debug = {};
};
Core.prototype.moduleLoaded = new Overload({
/**
* Checks if a module has been loaded into the database.
* @param {String} moduleName The name of the module to check for.
* @returns {Boolean} True if the module is loaded, false if not.
*/
'string': function (moduleName) {
if (moduleName !== undefined) {
moduleName = moduleName.replace(/ /g, '');
var modules = moduleName.split(','),
index;
for (index = 0; index < modules.length; index++) {
if (!Shared.modules[modules[index]]) {
return false;
}
}
return true;
}
return false;
},
/**
* Checks if a module is loaded and if so calls the passed
* callback method.
* @param {String} moduleName The name of the module to check for.
* @param {Function} callback The callback method to call if module is loaded.
*/
'string, function': function (moduleName, callback) {
if (moduleName !== undefined) {
moduleName = moduleName.replace(/ /g, '');
var modules = moduleName.split(','),
index;
for (index = 0; index < modules.length; index++) {
if (!Shared.modules[modules[index]]) {
return false;
}
}
callback();
}
},
/**
* Checks if a module is loaded and if so calls the passed
* success method, otherwise calls the failure method.
* @param {String} moduleName The name of the module to check for.
* @param {Function} success The callback method to call if module is loaded.
* @param {Function} failure The callback method to call if module not loaded.
*/
'string, function, function': function (moduleName, success, failure) {
if (moduleName !== undefined) {
moduleName = moduleName.replace(/ /g, '');
var modules = moduleName.split(','),
index;
for (index = 0; index < modules.length; index++) {
if (!Shared.modules[modules[index]]) {
failure();
return false;
}
}
success();
}
}
});
/**
* Checks version against the string passed and if it matches (or partially matches)
* then the callback is called.
* @param {String} val The version to check against.
* @param {Function} callback The callback to call if match is true.
* @returns {Boolean}
*/
Core.prototype.version = function (val, callback) {
if (val !== undefined) {
if (Shared.version.indexOf(val) === 0) {
if (callback) { callback(); }
return true;
}
return false;
}
return Shared.version;
};
// Expose moduleLoaded method to non-instantiated object ForerunnerDB
Core.moduleLoaded = Core.prototype.moduleLoaded;
// Expose version method to non-instantiated object ForerunnerDB
Core.version = Core.prototype.version;
// Provide public access to the Shared object
Core.shared = Shared;
Core.prototype.shared = Shared;
Shared.addModule('Core', Core);
Shared.mixin(Core.prototype, 'Mixin.Common');
Shared.mixin(Core.prototype, 'Mixin.ChainReactor');
Shared.mixin(Core.prototype, 'Mixin.Constants');
Collection = _dereq_('./Collection.js');
Metrics = _dereq_('./Metrics.js');
Crc = _dereq_('./Crc.js');
Core.prototype._isServer = false;
/**
* Gets / sets the default primary key for new collections.
* @param {String=} val The name of the primary key to set.
* @returns {*}
*/
Shared.synthesize(Core.prototype, 'primaryKey');
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(Core.prototype, 'state');
/**
* Gets / sets the name of the database.
* @param {String=} val The name of the database to set.
* @returns {*}
*/
Shared.synthesize(Core.prototype, 'name');
/**
* Returns true if ForerunnerDB is running on a client browser.
* @returns {boolean}
*/
Core.prototype.isClient = function () {
return !this._isServer;
};
/**
* Returns true if ForerunnerDB is running on a server.
* @returns {boolean}
*/
Core.prototype.isServer = function () {
return this._isServer;
};
/**
* Returns a checksum of a string.
* @param {String} string The string to checksum.
* @return {String} The checksum generated.
*/
Core.prototype.crc = Crc;
/**
* Checks if the database is running on a client (browser) or
* a server (node.js).
* @returns {Boolean} Returns true if running on a browser.
*/
Core.prototype.isClient = function () {
return !this._isServer;
};
/**
* Checks if the database is running on a client (browser) or
* a server (node.js).
* @returns {Boolean} Returns true if running on a server.
*/
Core.prototype.isServer = function () {
return this._isServer;
};
/**
* Converts a normal javascript array of objects into a DB collection.
* @param {Array} arr An array of objects.
* @returns {Collection} A new collection instance with the data set to the
* array passed.
*/
Core.prototype.arrayToCollection = function (arr) {
return new Collection().setData(arr);
};
/**
* Registers an event listener against an event name.
* @param {String} event The name of the event to listen for.
* @param {Function} listener The listener method to call when
* the event is fired.
* @returns {*}
*/
Core.prototype.on = function(event, listener) {
this._listeners = this._listeners || {};
this._listeners[event] = this._listeners[event] || [];
this._listeners[event].push(listener);
return this;
};
/**
* De-registers an event listener from an event name.
* @param {String} event The name of the event to stop listening for.
* @param {Function} listener The listener method passed to on() when
* registering the event listener.
* @returns {*}
*/
Core.prototype.off = function(event, listener) {
if (event in this._listeners) {
var arr = this._listeners[event],
index = arr.indexOf(listener);
if (index > -1) {
arr.splice(index, 1);
}
}
return this;
};
/**
* Emits an event by name with the given data.
* @param {String} event The name of the event to emit.
* @param {*=} data The data to emit with the event.
* @returns {*}
*/
Core.prototype.emit = function(event, data) {
this._listeners = this._listeners || {};
if (event in this._listeners) {
var arr = this._listeners[event],
arrCount = arr.length,
arrIndex;
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
arr[arrIndex].apply(this, Array.prototype.slice.call(arguments, 1));
}
}
return this;
};
/**
* Find all documents across all collections in the database that match the passed
* string or search object.
* @param search String or search object.
* @returns {Array}
*/
Core.prototype.peek = function (search) {
var i,
coll,
arr = [],
typeOfSearch = typeof search;
// Loop collections
for (i in this._collection) {
if (this._collection.hasOwnProperty(i)) {
coll = this._collection[i];
if (typeOfSearch === 'string') {
arr = arr.concat(coll.peek(search));
} else {
arr = arr.concat(coll.find(search));
}
}
}
return arr;
};
/**
* Find all documents across all collections in the database that match the passed
* string or search object and return them in an object where each key is the name
* of the collection that the document was matched in.
* @param search String or search object.
* @returns {object}
*/
Core.prototype.peekCat = function (search) {
var i,
coll,
cat = {},
arr,
typeOfSearch = typeof search;
// Loop collections
for (i in this._collection) {
if (this._collection.hasOwnProperty(i)) {
coll = this._collection[i];
if (typeOfSearch === 'string') {
arr = coll.peek(search);
if (arr && arr.length) {
cat[coll.name()] = arr;
}
} else {
arr = coll.find(search);
if (arr && arr.length) {
cat[coll.name()] = arr;
}
}
}
}
return cat;
};
/**
* Drops all collections in the database.
* @param {Function=} callback Optional callback method.
*/
Core.prototype.drop = function (callback) {
if (this._state !== 'dropped') {
var arr = this.collections(),
arrCount = arr.length,
arrIndex,
finishCount = 0,
afterDrop = function () {
finishCount++;
if (finishCount === arrCount) {
if (callback) {
callback();
}
}
};
this._state = 'dropped';
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
this.collection(arr[arrIndex].name).drop(afterDrop);
delete this._collection[arr[arrIndex].name];
}
this.emit('drop', this);
}
return true;
};
module.exports = Core;
},{"./Collection.js":3,"./Crc.js":6,"./Metrics.js":10,"./Overload":20,"./Shared":23}],6:[function(_dereq_,module,exports){
"use strict";
var crcTable = (function () {
var crcTable = [],
c, n, k;
for (n = 0; n < 256; n++) {
c = n;
for (k = 0; k < 8; k++) {
c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); // jshint ignore:line
}
crcTable[n] = c;
}
return crcTable;
}());
module.exports = function(str) {
var crc = 0 ^ (-1), // jshint ignore:line
i;
for (i = 0; i < str.length; i++) {
crc = (crc >>> 8) ^ crcTable[(crc ^ str.charCodeAt(i)) & 0xFF]; // jshint ignore:line
}
return (crc ^ (-1)) >>> 0; // jshint ignore:line
};
},{}],7:[function(_dereq_,module,exports){
"use strict";
/*
name
id
rebuild
state
match
lookup
*/
var Shared = _dereq_('./Shared'),
Path = _dereq_('./Path'),
btree = function () {};
/**
* The index class used to instantiate hash map indexes that the database can
* use to speed up queries on collections and views.
* @constructor
*/
var IndexBinaryTree = function () {
this.init.apply(this, arguments);
};
IndexBinaryTree.prototype.init = function (keys, options, collection) {
this._btree = new (btree.create(2, this.sortAsc))();
this._size = 0;
this._id = this._itemKeyHash(keys, keys);
this.unique(options && options.unique ? options.unique : false);
if (keys !== undefined) {
this.keys(keys);
}
if (collection !== undefined) {
this.collection(collection);
}
this.name(options && options.name ? options.name : this._id);
};
Shared.addModule('IndexBinaryTree', IndexBinaryTree);
Shared.mixin(IndexBinaryTree.prototype, 'Mixin.ChainReactor');
Shared.mixin(IndexBinaryTree.prototype, 'Mixin.Sorting');
IndexBinaryTree.prototype.id = function () {
return this._id;
};
IndexBinaryTree.prototype.state = function () {
return this._state;
};
IndexBinaryTree.prototype.size = function () {
return this._size;
};
Shared.synthesize(IndexBinaryTree.prototype, 'data');
Shared.synthesize(IndexBinaryTree.prototype, 'name');
Shared.synthesize(IndexBinaryTree.prototype, 'collection');
Shared.synthesize(IndexBinaryTree.prototype, 'type');
Shared.synthesize(IndexBinaryTree.prototype, 'unique');
IndexBinaryTree.prototype.keys = function (val) {
if (val !== undefined) {
this._keys = val;
// Count the keys
this._keyCount = (new Path()).parse(this._keys).length;
return this;
}
return this._keys;
};
IndexBinaryTree.prototype.rebuild = function () {
// Do we have a collection?
if (this._collection) {
// Get sorted data
var collection = this._collection.subset({}, {
$decouple: false,
$orderBy: this._keys
}),
collectionData = collection.find(),
dataIndex,
dataCount = collectionData.length;
// Clear the index data for the index
this._btree = new (btree.create(2, this.sortAsc))();
if (this._unique) {
this._uniqueLookup = {};
}
// Loop the collection data
for (dataIndex = 0; dataIndex < dataCount; dataIndex++) {
this.insert(collectionData[dataIndex]);
}
}
this._state = {
name: this._name,
keys: this._keys,
indexSize: this._size,
built: new Date(),
updated: new Date(),
ok: true
};
};
IndexBinaryTree.prototype.insert = function (dataItem, options) {
var uniqueFlag = this._unique,
uniqueHash,
dataItemHash = this._itemKeyHash(dataItem, this._keys),
keyArr;
if (uniqueFlag) {
uniqueHash = this._itemHash(dataItem, this._keys);
this._uniqueLookup[uniqueHash] = dataItem;
}
// We store multiple items that match a key inside an array
// that is then stored against that key in the tree...
// Check if item exists for this key already
keyArr = this._btree.get(dataItemHash);
// Check if the array exists
if (keyArr === undefined) {
// Generate an array for this key first
keyArr = [];
// Put the new array into the tree under the key
this._btree.put(dataItemHash, keyArr);
}
// Push the item into the array
keyArr.push(dataItem);
this._size++;
};
IndexBinaryTree.prototype.remove = function (dataItem, options) {
var uniqueFlag = this._unique,
uniqueHash,
dataItemHash = this._itemKeyHash(dataItem, this._keys),
keyArr,
itemIndex;
if (uniqueFlag) {
uniqueHash = this._itemHash(dataItem, this._keys);
delete this._uniqueLookup[uniqueHash];
}
// Try and get the array for the item hash key
keyArr = this._btree.get(dataItemHash);
if (keyArr !== undefined) {
// The key array exits, remove the item from the key array
itemIndex = keyArr.indexOf(dataItem);
if (itemIndex > -1) {
// Check the length of the array
if (keyArr.length === 1) {
// This item is the last in the array, just kill the tree entry
this._btree.del(dataItemHash);
} else {
// Remove the item
keyArr.splice(itemIndex, 1);
}
this._size--;
}
}
};
IndexBinaryTree.prototype.violation = function (dataItem) {
// Generate item hash
var uniqueHash = this._itemHash(dataItem, this._keys);
// Check if the item breaks the unique constraint
return Boolean(this._uniqueLookup[uniqueHash]);
};
IndexBinaryTree.prototype.hashViolation = function (uniqueHash) {
// Check if the item breaks the unique constraint
return Boolean(this._uniqueLookup[uniqueHash]);
};
IndexBinaryTree.prototype.lookup = function (query) {
return this._data[this._itemHash(query, this._keys)] || [];
};
IndexBinaryTree.prototype.match = function (query, options) {
// Check if the passed query has data in the keys our index
// operates on and if so, is the query sort matching our order
var pathSolver = new Path();
var indexKeyArr = pathSolver.parseArr(this._keys),
queryArr = pathSolver.parseArr(query),
matchedKeys = [],
matchedKeyCount = 0,
i;
// Loop the query array and check the order of keys against the
// index key array to see if this index can be used
for (i = 0; i < indexKeyArr.length; i++) {
if (queryArr[i] === indexKeyArr[i]) {
matchedKeyCount++;
matchedKeys.push(queryArr[i]);
} else {
// Query match failed - this is a hash map index so partial key match won't work
return {
matchedKeys: [],
totalKeyCount: queryArr.length,
score: 0
};
}
}
return {
matchedKeys: matchedKeys,
totalKeyCount: queryArr.length,
score: matchedKeyCount
};
//return pathSolver.countObjectPaths(this._keys, query);
};
IndexBinaryTree.prototype._itemHash = function (item, keys) {
var path = new Path(),
pathData,
hash = '',
k;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
if (hash) { hash += '_'; }
hash += path.value(item, pathData[k].path).join(':');
}
return hash;
};
IndexBinaryTree.prototype._itemKeyHash = function (item, keys) {
var path = new Path(),
pathData,
hash = '',
k;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
if (hash) { hash += '_'; }
hash += path.keyValue(item, pathData[k].path);
}
return hash;
};
IndexBinaryTree.prototype._itemHashArr = function (item, keys) {
var path = new Path(),
pathData,
//hash = '',
hashArr = [],
valArr,
i, k, j;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
valArr = path.value(item, pathData[k].path);
for (i = 0; i < valArr.length; i++) {
if (k === 0) {
// Setup the initial hash array
hashArr.push(valArr[i]);
} else {
// Loop the hash array and concat the value to it
for (j = 0; j < hashArr.length; j++) {
hashArr[j] = hashArr[j] + '_' + valArr[i];
}
}
}
}
return hashArr;
};
Shared.finishModule('IndexBinaryTree');
module.exports = IndexBinaryTree;
},{"./Path":21,"./Shared":23}],8:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared'),
Path = _dereq_('./Path');
/**
* The index class used to instantiate hash map indexes that the database can
* use to speed up queries on collections and views.
* @constructor
*/
var IndexHashMap = function () {
this.init.apply(this, arguments);
};
IndexHashMap.prototype.init = function (keys, options, collection) {
this._crossRef = {};
this._size = 0;
this._id = this._itemKeyHash(keys, keys);
this.data({});
this.unique(options && options.unique ? options.unique : false);
if (keys !== undefined) {
this.keys(keys);
}
if (collection !== undefined) {
this.collection(collection);
}
this.name(options && options.name ? options.name : this._id);
};
Shared.addModule('IndexHashMap', IndexHashMap);
Shared.mixin(IndexHashMap.prototype, 'Mixin.ChainReactor');
IndexHashMap.prototype.id = function () {
return this._id;
};
IndexHashMap.prototype.state = function () {
return this._state;
};
IndexHashMap.prototype.size = function () {
return this._size;
};
Shared.synthesize(IndexHashMap.prototype, 'data');
Shared.synthesize(IndexHashMap.prototype, 'name');
Shared.synthesize(IndexHashMap.prototype, 'collection');
Shared.synthesize(IndexHashMap.prototype, 'type');
Shared.synthesize(IndexHashMap.prototype, 'unique');
IndexHashMap.prototype.keys = function (val) {
if (val !== undefined) {
this._keys = val;
// Count the keys
this._keyCount = (new Path()).parse(this._keys).length;
return this;
}
return this._keys;
};
IndexHashMap.prototype.rebuild = function () {
// Do we have a collection?
if (this._collection) {
// Get sorted data
var collection = this._collection.subset({}, {
$decouple: false,
$orderBy: this._keys
}),
collectionData = collection.find(),
dataIndex,
dataCount = collectionData.length;
// Clear the index data for the index
this._data = {};
if (this._unique) {
this._uniqueLookup = {};
}
// Loop the collection data
for (dataIndex = 0; dataIndex < dataCount; dataIndex++) {
this.insert(collectionData[dataIndex]);
}
}
this._state = {
name: this._name,
keys: this._keys,
indexSize: this._size,
built: new Date(),
updated: new Date(),
ok: true
};
};
IndexHashMap.prototype.insert = function (dataItem, options) {
var uniqueFlag = this._unique,
uniqueHash,
itemHashArr,
hashIndex;
if (uniqueFlag) {
uniqueHash = this._itemHash(dataItem, this._keys);
this._uniqueLookup[uniqueHash] = dataItem;
}
// Generate item hash
itemHashArr = this._itemHashArr(dataItem, this._keys);
// Get the path search results and store them
for (hashIndex = 0; hashIndex < itemHashArr.length; hashIndex++) {
this.pushToPathValue(itemHashArr[hashIndex], dataItem);
}
};
IndexHashMap.prototype.remove = function (dataItem, options) {
var uniqueFlag = this._unique,
uniqueHash,
itemHashArr,
hashIndex;
if (uniqueFlag) {
uniqueHash = this._itemHash(dataItem, this._keys);
delete this._uniqueLookup[uniqueHash];
}
// Generate item hash
itemHashArr = this._itemHashArr(dataItem, this._keys);
// Get the path search results and store them
for (hashIndex = 0; hashIndex < itemHashArr.length; hashIndex++) {
this.pullFromPathValue(itemHashArr[hashIndex], dataItem);
}
};
IndexHashMap.prototype.violation = function (dataItem) {
// Generate item hash
var uniqueHash = this._itemHash(dataItem, this._keys);
// Check if the item breaks the unique constraint
return Boolean(this._uniqueLookup[uniqueHash]);
};
IndexHashMap.prototype.hashViolation = function (uniqueHash) {
// Check if the item breaks the unique constraint
return Boolean(this._uniqueLookup[uniqueHash]);
};
IndexHashMap.prototype.pushToPathValue = function (hash, obj) {
var pathValArr = this._data[hash] = this._data[hash] || [];
// Make sure we have not already indexed this object at this path/value
if (pathValArr.indexOf(obj) === -1) {
// Index the object
pathValArr.push(obj);
// Record the reference to this object in our index size
this._size++;
// Cross-reference this association for later lookup
this.pushToCrossRef(obj, pathValArr);
}
};
IndexHashMap.prototype.pullFromPathValue = function (hash, obj) {
var pathValArr = this._data[hash],
indexOfObject;
// Make sure we have already indexed this object at this path/value
indexOfObject = pathValArr.indexOf(obj);
if (indexOfObject > -1) {
// Un-index the object
pathValArr.splice(indexOfObject, 1);
// Record the reference to this object in our index size
this._size--;
// Remove object cross-reference
this.pullFromCrossRef(obj, pathValArr);
}
// Check if we should remove the path value array
if (!pathValArr.length) {
// Remove the array
delete this._data[hash];
}
};
IndexHashMap.prototype.pull = function (obj) {
// Get all places the object has been used and remove them
var id = obj[this._collection.primaryKey()],
crossRefArr = this._crossRef[id],
arrIndex,
arrCount = crossRefArr.length,
arrItem;
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
arrItem = crossRefArr[arrIndex];
// Remove item from this index lookup array
this._pullFromArray(arrItem, obj);
}
// Record the reference to this object in our index size
this._size--;
// Now remove the cross-reference entry for this object
delete this._crossRef[id];
};
IndexHashMap.prototype._pullFromArray = function (arr, obj) {
var arrCount = arr.length;
while (arrCount--) {
if (arr[arrCount] === obj) {
arr.splice(arrCount, 1);
}
}
};
IndexHashMap.prototype.pushToCrossRef = function (obj, pathValArr) {
var id = obj[this._collection.primaryKey()],
crObj;
this._crossRef[id] = this._crossRef[id] || [];
// Check if the cross-reference to the pathVal array already exists
crObj = this._crossRef[id];
if (crObj.indexOf(pathValArr) === -1) {
// Add the cross-reference
crObj.push(pathValArr);
}
};
IndexHashMap.prototype.pullFromCrossRef = function (obj, pathValArr) {
var id = obj[this._collection.primaryKey()];
delete this._crossRef[id];
};
IndexHashMap.prototype.lookup = function (query) {
return this._data[this._itemHash(query, this._keys)] || [];
};
IndexHashMap.prototype.match = function (query, options) {
// Check if the passed query has data in the keys our index
// operates on and if so, is the query sort matching our order
var pathSolver = new Path();
var indexKeyArr = pathSolver.parseArr(this._keys),
queryArr = pathSolver.parseArr(query),
matchedKeys = [],
matchedKeyCount = 0,
i;
// Loop the query array and check the order of keys against the
// index key array to see if this index can be used
for (i = 0; i < indexKeyArr.length; i++) {
if (queryArr[i] === indexKeyArr[i]) {
matchedKeyCount++;
matchedKeys.push(queryArr[i]);
} else {
// Query match failed - this is a hash map index so partial key match won't work
return {
matchedKeys: [],
totalKeyCount: queryArr.length,
score: 0
};
}
}
return {
matchedKeys: matchedKeys,
totalKeyCount: queryArr.length,
score: matchedKeyCount
};
//return pathSolver.countObjectPaths(this._keys, query);
};
IndexHashMap.prototype._itemHash = function (item, keys) {
var path = new Path(),
pathData,
hash = '',
k;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
if (hash) { hash += '_'; }
hash += path.value(item, pathData[k].path).join(':');
}
return hash;
};
IndexHashMap.prototype._itemKeyHash = function (item, keys) {
var path = new Path(),
pathData,
hash = '',
k;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
if (hash) { hash += '_'; }
hash += path.keyValue(item, pathData[k].path);
}
return hash;
};
IndexHashMap.prototype._itemHashArr = function (item, keys) {
var path = new Path(),
pathData,
//hash = '',
hashArr = [],
valArr,
i, k, j;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
valArr = path.value(item, pathData[k].path);
for (i = 0; i < valArr.length; i++) {
if (k === 0) {
// Setup the initial hash array
hashArr.push(valArr[i]);
} else {
// Loop the hash array and concat the value to it
for (j = 0; j < hashArr.length; j++) {
hashArr[j] = hashArr[j] + '_' + valArr[i];
}
}
}
}
return hashArr;
};
Shared.finishModule('IndexHashMap');
module.exports = IndexHashMap;
},{"./Path":21,"./Shared":23}],9:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared');
/**
* The key value store class used when storing basic in-memory KV data,
* and can be queried for quick retrieval. Mostly used for collection
* primary key indexes and lookups.
* @param {String=} name Optional KV store name.
* @constructor
*/
var KeyValueStore = function (name) {
this.init.apply(this, arguments);
};
KeyValueStore.prototype.init = function (name) {
this._name = name;
this._data = {};
this._primaryKey = '_id';
};
Shared.addModule('KeyValueStore', KeyValueStore);
Shared.mixin(KeyValueStore.prototype, 'Mixin.ChainReactor');
/**
* Get / set the name of the key/value store.
* @param {String} val The name to set.
* @returns {*}
*/
Shared.synthesize(KeyValueStore.prototype, 'name');
/**
* Get / set the primary key.
* @param {String} key The key to set.
* @returns {*}
*/
KeyValueStore.prototype.primaryKey = function (key) {
if (key !== undefined) {
this._primaryKey = key;
return this;
}
return this._primaryKey;
};
/**
* Removes all data from the store.
* @returns {*}
*/
KeyValueStore.prototype.truncate = function () {
this._data = {};
return this;
};
/**
* Sets data against a key in the store.
* @param {String} key The key to set data for.
* @param {*} value The value to assign to the key.
* @returns {*}
*/
KeyValueStore.prototype.set = function (key, value) {
this._data[key] = value ? value : true;
return this;
};
/**
* Gets data stored for the passed key.
* @param {String} key The key to get data for.
* @returns {*}
*/
KeyValueStore.prototype.get = function (key) {
return this._data[key];
};
/**
* Get / set the primary key.
* @param {*} obj A lookup query, can be a string key, an array of string keys,
* an object with further query clauses or a regular expression that should be
* run against all keys.
* @returns {*}
*/
KeyValueStore.prototype.lookup = function (obj) {
var pKeyVal = obj[this._primaryKey],
arrIndex,
arrCount,
lookupItem,
result;
if (pKeyVal instanceof Array) {
// An array of primary keys, find all matches
arrCount = pKeyVal.length;
result = [];
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
lookupItem = this._data[pKeyVal[arrIndex]];
if (lookupItem) {
result.push(lookupItem);
}
}
return result;
} else if (pKeyVal instanceof RegExp) {
// Create new data
result = [];
for (arrIndex in this._data) {
if (this._data.hasOwnProperty(arrIndex)) {
if (pKeyVal.test(arrIndex)) {
result.push(this._data[arrIndex]);
}
}
}
return result;
} else if (typeof pKeyVal === 'object') {
// The primary key clause is an object, now we have to do some
// more extensive searching
if (pKeyVal.$ne) {
// Create new data
result = [];
for (arrIndex in this._data) {
if (this._data.hasOwnProperty(arrIndex)) {
if (arrIndex !== pKeyVal.$ne) {
result.push(this._data[arrIndex]);
}
}
}
return result;
}
if (pKeyVal.$in && (pKeyVal.$in instanceof Array)) {
// Create new data
result = [];
for (arrIndex in this._data) {
if (this._data.hasOwnProperty(arrIndex)) {
if (pKeyVal.$in.indexOf(arrIndex) > -1) {
result.push(this._data[arrIndex]);
}
}
}
return result;
}
if (pKeyVal.$nin && (pKeyVal.$nin instanceof Array)) {
// Create new data
result = [];
for (arrIndex in this._data) {
if (this._data.hasOwnProperty(arrIndex)) {
if (pKeyVal.$nin.indexOf(arrIndex) === -1) {
result.push(this._data[arrIndex]);
}
}
}
return result;
}
if (pKeyVal.$or && (pKeyVal.$or instanceof Array)) {
// Create new data
result = [];
for (arrIndex = 0; arrIndex < pKeyVal.$or.length; arrIndex++) {
result = result.concat(this.lookup(pKeyVal.$or[arrIndex]));
}
return result;
}
} else {
// Key is a basic lookup from string
lookupItem = this._data[pKeyVal];
if (lookupItem !== undefined) {
return [lookupItem];
} else {
return [];
}
}
};
/**
* Removes data for the given key from the store.
* @param {String} key The key to un-set.
* @returns {*}
*/
KeyValueStore.prototype.unSet = function (key) {
delete this._data[key];
return this;
};
/**
* Sets data for the give key in the store only where the given key
* does not already have a value in the store.
* @param {String} key The key to set data for.
* @param {*} value The value to assign to the key.
* @returns {Boolean} True if data was set or false if data already
* exists for the key.
*/
KeyValueStore.prototype.uniqueSet = function (key, value) {
if (this._data[key] === undefined) {
this._data[key] = value;
return true;
}
return false;
};
Shared.finishModule('KeyValueStore');
module.exports = KeyValueStore;
},{"./Shared":23}],10:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared'),
Operation = _dereq_('./Operation');
/**
* The metrics class used to store details about operations.
* @constructor
*/
var Metrics = function () {
this.init.apply(this, arguments);
};
Metrics.prototype.init = function () {
this._data = [];
};
Shared.addModule('Metrics', Metrics);
Shared.mixin(Metrics.prototype, 'Mixin.ChainReactor');
/**
* Creates an operation within the metrics instance and if metrics
* are currently enabled (by calling the start() method) the operation
* is also stored in the metrics log.
* @param {String} name The name of the operation.
* @returns {Operation}
*/
Metrics.prototype.create = function (name) {
var op = new Operation(name);
if (this._enabled) {
this._data.push(op);
}
return op;
};
/**
* Starts logging operations.
* @returns {Metrics}
*/
Metrics.prototype.start = function () {
this._enabled = true;
return this;
};
/**
* Stops logging operations.
* @returns {Metrics}
*/
Metrics.prototype.stop = function () {
this._enabled = false;
return this;
};
/**
* Clears all logged operations.
* @returns {Metrics}
*/
Metrics.prototype.clear = function () {
this._data = [];
return this;
};
/**
* Returns an array of all logged operations.
* @returns {Array}
*/
Metrics.prototype.list = function () {
return this._data;
};
Shared.finishModule('Metrics');
module.exports = Metrics;
},{"./Operation":19,"./Shared":23}],11:[function(_dereq_,module,exports){
"use strict";
var CRUD = {
preSetData: function () {
},
postSetData: function () {
}
};
module.exports = CRUD;
},{}],12:[function(_dereq_,module,exports){
"use strict";
// TODO: Document the methods in this mixin
var ChainReactor = {
chain: function (obj) {
this._chain = this._chain || [];
var index = this._chain.indexOf(obj);
if (index === -1) {
this._chain.push(obj);
}
},
unChain: function (obj) {
if (this._chain) {
var index = this._chain.indexOf(obj);
if (index > -1) {
this._chain.splice(index, 1);
}
}
},
chainSend: function (type, data, options) {
if (this._chain) {
var arr = this._chain,
count = arr.length,
index;
for (index = 0; index < count; index++) {
arr[index].chainReceive(this, type, data, options);
}
}
},
chainReceive: function (sender, type, data, options) {
var chainPacket = {
sender: sender,
type: type,
data: data,
options: options
};
// Fire our internal handler
if (!this._chainHandler || (this._chainHandler && !this._chainHandler(chainPacket))) {
// Propagate the message down the chain
this.chainSend(chainPacket.type, chainPacket.data, chainPacket.options);
}
}
};
module.exports = ChainReactor;
},{}],13:[function(_dereq_,module,exports){
"use strict";
var idCounter = 0,
Overload = _dereq_('./Overload'),
Common;
Common = {
/**
* Returns a non-referenced version of the passed object / array.
* @param {Object} data The object or array to return as a non-referenced version.
* @param {Number=} copies Optional number of copies to produce. If specified, the return
* value will be an array of decoupled objects, each distinct from the other.
* @returns {*}
*/
decouple: function (data, copies) {
if (data !== undefined) {
if (!copies) {
return JSON.parse(JSON.stringify(data));
} else {
var i,
json = JSON.stringify(data),
copyArr = [];
for (i = 0; i < copies; i++) {
copyArr.push(JSON.parse(json));
}
return copyArr;
}
}
return undefined;
},
/**
* Generates a new 16-character hexadecimal unique ID or
* generates a new 16-character hexadecimal ID based on
* the passed string. Will always generate the same ID
* for the same string.
* @param {String=} str A string to generate the ID from.
* @return {String}
*/
objectId: function (str) {
var id,
pow = Math.pow(10, 17);
if (!str) {
idCounter++;
id = (idCounter + (
Math.random() * pow +
Math.random() * pow +
Math.random() * pow +
Math.random() * pow
)).toString(16);
} else {
var val = 0,
count = str.length,
i;
for (i = 0; i < count; i++) {
val += str.charCodeAt(i) * pow;
}
id = val.toString(16);
}
return id;
},
/**
* Gets / sets debug flag that can enable debug message output to the
* console if required.
* @param {Boolean} val The value to set debug flag to.
* @return {Boolean} True if enabled, false otherwise.
*/
/**
* Sets debug flag for a particular type that can enable debug message
* output to the console if required.
* @param {String} type The name of the debug type to set flag for.
* @param {Boolean} val The value to set debug flag to.
* @return {Boolean} True if enabled, false otherwise.
*/
debug: new Overload([
function () {
return this._debug && this._debug.all;
},
function (val) {
if (val !== undefined) {
if (typeof val === 'boolean') {
this._debug = this._debug || {};
this._debug.all = val;
this.chainSend('debug', this._debug);
return this;
} else {
return (this._debug && this._debug[val]) || (this._db && this._db._debug && this._db._debug[val]) || (this._debug && this._debug.all);
}
}
return this._debug && this._debug.all;
},
function (type, val) {
if (type !== undefined) {
if (val !== undefined) {
this._debug = this._debug || {};
this._debug[type] = val;
this.chainSend('debug', this._debug);
return this;
}
return (this._debug && this._debug[val]) || (this._db && this._db._debug && this._db._debug[type]);
}
return this._debug && this._debug.all;
}
])
};
module.exports = Common;
},{"./Overload":20}],14:[function(_dereq_,module,exports){
"use strict";
var Constants = {
TYPE_INSERT: 0,
TYPE_UPDATE: 1,
TYPE_REMOVE: 2,
PHASE_BEFORE: 0,
PHASE_AFTER: 1
};
module.exports = Constants;
},{}],15:[function(_dereq_,module,exports){
"use strict";
var Overload = _dereq_('./Overload');
var Events = {
on: new Overload({
/**
* Attach an event listener to the passed event.
* @param {String} event The name of the event to listen for.
* @param {Function} listener The method to call when the event is fired.
*/
'string, function': function (event, listener) {
this._listeners = this._listeners || {};
this._listeners[event] = this._listeners[event] || {};
this._listeners[event]['*'] = this._listeners[event]['*'] || [];
this._listeners[event]['*'].push(listener);
return this;
},
/**
* Attach an event listener to the passed event only if the passed
* id matches the document id for the event being fired.
* @param {String} event The name of the event to listen for.
* @param {*} id The document id to match against.
* @param {Function} listener The method to call when the event is fired.
*/
'string, *, function': function (event, id, listener) {
this._listeners = this._listeners || {};
this._listeners[event] = this._listeners[event] || {};
this._listeners[event][id] = this._listeners[event][id] || [];
this._listeners[event][id].push(listener);
return this;
}
}),
off: new Overload({
'string': function (event) {
if (this._listeners && this._listeners[event] && event in this._listeners) {
delete this._listeners[event];
}
return this;
},
'string, function': function (event, listener) {
var arr,
index;
if (typeof(listener) === 'string') {
if (this._listeners && this._listeners[event] && this._listeners[event][listener]) {
delete this._listeners[event][listener];
}
} else {
if (event in this._listeners) {
arr = this._listeners[event]['*'];
index = arr.indexOf(listener);
if (index > -1) {
arr.splice(index, 1);
}
}
}
return this;
},
'string, *, function': function (event, id, listener) {
if (this._listeners && event in this._listeners && id in this.listeners[event]) {
var arr = this._listeners[event][id],
index = arr.indexOf(listener);
if (index > -1) {
arr.splice(index, 1);
}
}
},
'string, *': function (event, id) {
if (this._listeners && event in this._listeners && id in this._listeners[event]) {
// Kill all listeners for this event id
delete this._listeners[event][id];
}
}
}),
emit: function (event, data) {
this._listeners = this._listeners || {};
if (event in this._listeners) {
var arrIndex,
arrCount;
// Handle global emit
if (this._listeners[event]['*']) {
var arr = this._listeners[event]['*'];
arrCount = arr.length;
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
arr[arrIndex].apply(this, Array.prototype.slice.call(arguments, 1));
}
}
// Handle individual emit
if (data instanceof Array) {
// Check if the array is an array of objects in the collection
if (data[0] && data[0][this._primaryKey]) {
// Loop the array and check for listeners against the primary key
var listenerIdArr = this._listeners[event],
listenerIdCount,
listenerIdIndex;
arrCount = data.length;
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
if (listenerIdArr[data[arrIndex][this._primaryKey]]) {
// Emit for this id
listenerIdCount = listenerIdArr[data[arrIndex][this._primaryKey]].length;
for (listenerIdIndex = 0; listenerIdIndex < listenerIdCount; listenerIdIndex++) {
listenerIdArr[data[arrIndex][this._primaryKey]][listenerIdIndex].apply(this, Array.prototype.slice.call(arguments, 1));
}
}
}
}
}
}
return this;
}
};
module.exports = Events;
},{"./Overload":20}],16:[function(_dereq_,module,exports){
"use strict";
var Matching = {
/**
* Internal method that checks a document against a test object.
* @param {*} source The source object or value to test against.
* @param {*} test The test object or value to test with.
* @param {String=} opToApply The special operation to apply to the test such
* as 'and' or an 'or' operator.
* @param {Object=} options An object containing options to apply to the
* operation such as limiting the fields returned etc.
* @returns {Boolean} True if the test was positive, false on negative.
* @private
*/
_match: function (source, test, opToApply, options) {
// TODO: This method is quite long, break into smaller pieces
var operation,
applyOp,
recurseVal,
tmpIndex,
sourceType = typeof source,
testType = typeof test,
matchedAll = true,
opResult,
substringCache,
i;
options = options || {};
// Check if options currently holds a root query object
if (!options.$rootQuery) {
// Root query not assigned, hold the root query
options.$rootQuery = test;
}
// Check if the comparison data are both strings or numbers
if ((sourceType === 'string' || sourceType === 'number') && (testType === 'string' || testType === 'number')) {
// The source and test data are flat types that do not require recursive searches,
// so just compare them and return the result
if (sourceType === 'number') {
// Number comparison
if (source !== test) {
matchedAll = false;
}
} else {
// String comparison
if (source.localeCompare(test)) {
matchedAll = false;
}
}
} else {
for (i in test) {
if (test.hasOwnProperty(i)) {
// Reset operation flag
operation = false;
substringCache = i.substr(0, 2);
// Check if the property is a comment (ignorable)
if (substringCache === '//') {
// Skip this property
continue;
}
// Check if the property starts with a dollar (function)
if (substringCache.indexOf('$') === 0) {
// Ask the _matchOp method to handle the operation
opResult = this._matchOp(i, source, test[i], options);
// Check the result of the matchOp operation
// If the result is -1 then no operation took place, otherwise the result
// will be a boolean denoting a match (true) or no match (false)
if (opResult > -1) {
if (opResult) {
if (opToApply === 'or') {
return true;
}
} else {
// Set the matchedAll flag to the result of the operation
// because the operation did not return true
matchedAll = opResult;
}
// Record that an operation was handled
operation = true;
}
}
// Check for regex
if (!operation && test[i] instanceof RegExp) {
operation = true;
if (typeof(source) === 'object' && source[i] !== undefined && test[i].test(source[i])) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
}
if (!operation) {
// Check if our query is an object
if (typeof(test[i]) === 'object') {
// Because test[i] is an object, source must also be an object
// Check if our source data we are checking the test query against
// is an object or an array
if (source[i] !== undefined) {
if (source[i] instanceof Array && !(test[i] instanceof Array)) {
// The source data is an array, so check each item until a
// match is found
recurseVal = false;
for (tmpIndex = 0; tmpIndex < source[i].length; tmpIndex++) {
recurseVal = this._match(source[i][tmpIndex], test[i], applyOp, options);
if (recurseVal) {
// One of the array items matched the query so we can
// include this item in the results, so break now
break;
}
}
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
} else if (!(source[i] instanceof Array) && test[i] instanceof Array) {
// The test key data is an array and the source key data is not so check
// each item in the test key data to see if the source item matches one
// of them. This is effectively an $in search.
recurseVal = false;
for (tmpIndex = 0; tmpIndex < test[i].length; tmpIndex++) {
recurseVal = this._match(source[i], test[i][tmpIndex], applyOp, options);
if (recurseVal) {
// One of the array items matched the query so we can
// include this item in the results, so break now
break;
}
}
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
} else if (typeof(source) === 'object') {
// Recurse down the object tree
recurseVal = this._match(source[i], test[i], applyOp, options);
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
} else {
recurseVal = this._match(undefined, test[i], applyOp, options);
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
}
} else {
// First check if the test match is an $exists
if (test[i] && test[i].$exists !== undefined) {
// Push the item through another match recurse
recurseVal = this._match(undefined, test[i], applyOp, options);
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
} else {
matchedAll = false;
}
}
} else {
// Check if the prop matches our test value
if (source && source[i] === test[i]) {
if (opToApply === 'or') {
return true;
}
} else if (source && source[i] && source[i] instanceof Array && test[i] && typeof(test[i]) !== "object") {
// We are looking for a value inside an array
// The source data is an array, so check each item until a
// match is found
recurseVal = false;
for (tmpIndex = 0; tmpIndex < source[i].length; tmpIndex++) {
recurseVal = this._match(source[i][tmpIndex], test[i], applyOp, options);
if (recurseVal) {
// One of the array items matched the query so we can
// include this item in the results, so break now
break;
}
}
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
} else {
matchedAll = false;
}
}
}
if (opToApply === 'and' && !matchedAll) {
return false;
}
}
}
}
return matchedAll;
},
/**
* Internal method, performs a matching process against a query operator such as $gt or $nin.
* @param {String} key The property name in the test that matches the operator to perform
* matching against.
* @param {*} source The source data to match the query against.
* @param {*} test The query to match the source against.
* @param {Object=} options An options object.
* @returns {*}
* @private
*/
_matchOp: function (key, source, test, options) {
// Check for commands
switch (key) {
case '$gt':
// Greater than
return source > test;
case '$gte':
// Greater than or equal
return source >= test;
case '$lt':
// Less than
return source < test;
case '$lte':
// Less than or equal
return source <= test;
case '$exists':
// Property exists
return (source === undefined) !== test;
case '$ne': // Not equals
return source != test; // jshint ignore:line
case '$or':
// Match true on ANY check to pass
for (var orIndex = 0; orIndex < test.length; orIndex++) {
if (this._match(source, test[orIndex], 'and', options)) {
return true;
}
}
return false;
case '$and':
// Match true on ALL checks to pass
for (var andIndex = 0; andIndex < test.length; andIndex++) {
if (!this._match(source, test[andIndex], 'and', options)) {
return false;
}
}
return true;
case '$in': // In
// Check that the in test is an array
if (test instanceof Array) {
var inArr = test,
inArrCount = inArr.length,
inArrIndex;
for (inArrIndex = 0; inArrIndex < inArrCount; inArrIndex++) {
if (inArr[inArrIndex] === source) {
return true;
}
}
return false;
} else {
throw('ForerunnerDB.Mixin.Matching "' + this.name() + '": Cannot use an $in operator on a non-array key: ' + key);
}
break;
case '$nin': // Not in
// Check that the not-in test is an array
if (test instanceof Array) {
var notInArr = test,
notInArrCount = notInArr.length,
notInArrIndex;
for (notInArrIndex = 0; notInArrIndex < notInArrCount; notInArrIndex++) {
if (notInArr[notInArrIndex] === source) {
return false;
}
}
return true;
} else {
throw('ForerunnerDB.Mixin.Matching "' + this.name() + '": Cannot use a $nin operator on a non-array key: ' + key);
}
break;
case '$distinct':
// Ensure options holds a distinct lookup
options.$rootQuery['//distinctLookup'] = options.$rootQuery['//distinctLookup'] || {};
for (var distinctProp in test) {
if (test.hasOwnProperty(distinctProp)) {
options.$rootQuery['//distinctLookup'][distinctProp] = options.$rootQuery['//distinctLookup'][distinctProp] || {};
// Check if the options distinct lookup has this field's value
if (options.$rootQuery['//distinctLookup'][distinctProp][source[distinctProp]]) {
// Value is already in use
return false;
} else {
// Set the value in the lookup
options.$rootQuery['//distinctLookup'][distinctProp][source[distinctProp]] = true;
// Allow the item in the results
return true;
}
}
}
break;
}
return -1;
}
};
module.exports = Matching;
},{}],17:[function(_dereq_,module,exports){
"use strict";
var Sorting = {
/**
* Sorts the passed value a against the passed value b ascending.
* @param {*} a The first value to compare.
* @param {*} b The second value to compare.
* @returns {*} 1 if a is sorted after b, -1 if a is sorted before b.
*/
sortAsc: function (a, b) {
if (typeof(a) === 'string' && typeof(b) === 'string') {
return a.localeCompare(b);
} else {
if (a > b) {
return 1;
} else if (a < b) {
return -1;
}
}
return 0;
},
/**
* Sorts the passed value a against the passed value b descending.
* @param {*} a The first value to compare.
* @param {*} b The second value to compare.
* @returns {*} 1 if a is sorted after b, -1 if a is sorted before b.
*/
sortDesc: function (a, b) {
if (typeof(a) === 'string' && typeof(b) === 'string') {
return b.localeCompare(a);
} else {
if (a > b) {
return -1;
} else if (a < b) {
return 1;
}
}
return 0;
}
};
module.exports = Sorting;
},{}],18:[function(_dereq_,module,exports){
"use strict";
var Triggers = {
/**
* Add a trigger by id.
* @param {String} id The id of the trigger. This must be unique to the type and
* phase of the trigger. Only one trigger may be added with this id per type and
* phase.
* @param {Number} type The type of operation to apply the trigger to. See
* Mixin.Constants for constants to use.
* @param {Number} phase The phase of an operation to fire the trigger on. See
* Mixin.Constants for constants to use.
* @param {Function} method The method to call when the trigger is fired.
* @returns {boolean} True if the trigger was added successfully, false if not.
*/
addTrigger: function (id, type, phase, method) {
var self = this,
triggerIndex;
// Check if the trigger already exists
triggerIndex = self._triggerIndexOf(id, type, phase);
if (triggerIndex === -1) {
// The trigger does not exist, create it
self._trigger = self._trigger || {};
self._trigger[type] = self._trigger[type] || {};
self._trigger[type][phase] = self._trigger[type][phase] || [];
self._trigger[type][phase].push({
id: id,
method: method
});
return true;
}
return false;
},
/**
*
* @param {String} id The id of the trigger to remove.
* @param {Number} type The type of operation to remove the trigger from. See
* Mixin.Constants for constants to use.
* @param {Number} phase The phase of the operation to remove the trigger from.
* See Mixin.Constants for constants to use.
* @returns {boolean} True if removed successfully, false if not.
*/
removeTrigger: function (id, type, phase) {
var self = this,
triggerIndex;
// Check if the trigger already exists
triggerIndex = self._triggerIndexOf(id, type, phase);
if (triggerIndex > -1) {
// The trigger does not exist, create it
self._trigger[type][phase].splice(triggerIndex, 1);
}
return false;
},
/**
* Checks if a trigger will fire based on the type and phase provided.
* @param {Number} type The type of operation. See Mixin.Constants for
* constants to use.
* @param {Number} phase The phase of the operation. See Mixin.Constants
* for constants to use.
* @returns {Boolean} True if the trigger will fire, false otherwise.
*/
willTrigger: function (type, phase) {
return this._trigger && this._trigger[type] && this._trigger[type][phase] && this._trigger[type][phase].length;
},
/**
* Processes trigger actions based on the operation, type and phase.
* @param {Object} operation Operation data to pass to the trigger.
* @param {Number} type The type of operation. See Mixin.Constants for
* constants to use.
* @param {Number} phase The phase of the operation. See Mixin.Constants
* for constants to use.
* @param {Object} oldDoc The document snapshot before operations are
* carried out against the data.
* @param {Object} newDoc The document snapshot after operations are
* carried out against the data.
* @returns {boolean}
*/
processTrigger: function (operation, type, phase, oldDoc, newDoc) {
var self = this,
triggerArr,
triggerIndex,
triggerCount,
triggerItem,
response;
if (self._trigger && self._trigger[type] && self._trigger[type][phase]) {
triggerArr = self._trigger[type][phase];
triggerCount = triggerArr.length;
for (triggerIndex = 0; triggerIndex < triggerCount; triggerIndex++) {
triggerItem = triggerArr[triggerIndex];
if (this.debug()) {
var typeName,
phaseName;
switch (type) {
case this.TYPE_INSERT:
typeName = 'insert';
break;
case this.TYPE_UPDATE:
typeName = 'update';
break;
case this.TYPE_REMOVE:
typeName = 'remove';
break;
default:
typeName = '';
break;
}
switch (phase) {
case this.PHASE_BEFORE:
phaseName = 'before';
break;
case this.PHASE_AFTER:
phaseName = 'after';
break;
default:
phaseName = '';
break;
}
//console.log('Triggers: Processing trigger "' + id + '" for ' + typeName + ' in phase "' + phaseName + '"');
}
// Run the trigger's method and store the response
response = triggerItem.method.call(self, operation, oldDoc, newDoc);
// Check the response for a non-expected result (anything other than
// undefined, true or false is considered a throwable error)
if (response === false) {
// The trigger wants us to cancel operations
return false;
}
if (response !== undefined && response !== true && response !== false) {
// Trigger responded with error, throw the error
throw('ForerunnerDB.Mixin.Triggers: Trigger error: ' + response);
}
}
// Triggers all ran without issue, return a success (true)
return true;
}
},
/**
* Returns the index of a trigger by id based on type and phase.
* @param {String} id The id of the trigger to find the index of.
* @param {Number} type The type of operation. See Mixin.Constants for
* constants to use.
* @param {Number} phase The phase of the operation. See Mixin.Constants
* for constants to use.
* @returns {number}
* @private
*/
_triggerIndexOf: function (id, type, phase) {
var self = this,
triggerArr,
triggerCount,
triggerIndex;
if (self._trigger && self._trigger[type] && self._trigger[type][phase]) {
triggerArr = self._trigger[type][phase];
triggerCount = triggerArr.length;
for (triggerIndex = 0; triggerIndex < triggerCount; triggerIndex++) {
if (triggerArr[triggerIndex].id === id) {
return triggerIndex;
}
}
}
return -1;
}
};
module.exports = Triggers;
},{}],19:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared'),
Path = _dereq_('./Path');
/**
* The operation class, used to store details about an operation being
* performed by the database.
* @param {String} name The name of the operation.
* @constructor
*/
var Operation = function (name) {
this.pathSolver = new Path();
this.counter = 0;
this.init.apply(this, arguments);
};
Operation.prototype.init = function (name) {
this._data = {
operation: name, // The name of the operation executed such as "find", "update" etc
index: {
potential: [], // Indexes that could have potentially been used
used: false // The index that was picked to use
},
steps: [], // The steps taken to generate the query results,
time: {
startMs: 0,
stopMs: 0,
totalMs: 0,
process: {}
},
flag: {}, // An object with flags that denote certain execution paths
log: [] // Any extra data that might be useful such as warnings or helpful hints
};
};
Shared.addModule('Operation', Operation);
Shared.mixin(Operation.prototype, 'Mixin.ChainReactor');
/**
* Starts the operation timer.
*/
Operation.prototype.start = function () {
this._data.time.startMs = new Date().getTime();
};
/**
* Adds an item to the operation log.
* @param {String} event The item to log.
* @returns {*}
*/
Operation.prototype.log = function (event) {
if (event) {
var lastLogTime = this._log.length > 0 ? this._data.log[this._data.log.length - 1].time : 0,
logObj = {
event: event,
time: new Date().getTime(),
delta: 0
};
this._data.log.push(logObj);
if (lastLogTime) {
logObj.delta = logObj.time - lastLogTime;
}
return this;
}
return this._data.log;
};
/**
* Called when starting and ending a timed operation, used to time
* internal calls within an operation's execution.
* @param {String} section An operation name.
* @returns {*}
*/
Operation.prototype.time = function (section) {
if (section !== undefined) {
var process = this._data.time.process,
processObj = process[section] = process[section] || {};
if (!processObj.startMs) {
// Timer started
processObj.startMs = new Date().getTime();
processObj.stepObj = {
name: section
};
this._data.steps.push(processObj.stepObj);
} else {
processObj.stopMs = new Date().getTime();
processObj.totalMs = processObj.stopMs - processObj.startMs;
processObj.stepObj.totalMs = processObj.totalMs;
delete processObj.stepObj;
}
return this;
}
return this._data.time;
};
/**
* Used to set key/value flags during operation execution.
* @param {String} key
* @param {String} val
* @returns {*}
*/
Operation.prototype.flag = function (key, val) {
if (key !== undefined && val !== undefined) {
this._data.flag[key] = val;
} else if (key !== undefined) {
return this._data.flag[key];
} else {
return this._data.flag;
}
};
Operation.prototype.data = function (path, val, noTime) {
if (val !== undefined) {
// Assign value to object path
this.pathSolver.set(this._data, path, val);
return this;
}
return this.pathSolver.get(this._data, path);
};
Operation.prototype.pushData = function (path, val, noTime) {
// Assign value to object path
this.pathSolver.push(this._data, path, val);
};
/**
* Stops the operation timer.
*/
Operation.prototype.stop = function () {
this._data.time.stopMs = new Date().getTime();
this._data.time.totalMs = this._data.time.stopMs - this._data.time.startMs;
};
Shared.finishModule('Operation');
module.exports = Operation;
},{"./Path":21,"./Shared":23}],20:[function(_dereq_,module,exports){
"use strict";
/**
* Allows a method to accept overloaded calls with different parameters controlling
* which passed overload function is called.
* @param {Object} def
* @returns {Function}
* @constructor
*/
var Overload = function (def) {
if (def) {
var index,
count,
tmpDef,
defNewKey,
sigIndex,
signatures;
if (!(def instanceof Array)) {
tmpDef = {};
// Def is an object, make sure all prop names are devoid of spaces
for (index in def) {
if (def.hasOwnProperty(index)) {
defNewKey = index.replace(/ /g, '');
// Check if the definition array has a * string in it
if (defNewKey.indexOf('*') === -1) {
// No * found
tmpDef[defNewKey] = def[index];
} else {
// A * was found, generate the different signatures that this
// definition could represent
signatures = this.generateSignaturePermutations(defNewKey);
for (sigIndex = 0; sigIndex < signatures.length; sigIndex++) {
if (!tmpDef[signatures[sigIndex]]) {
tmpDef[signatures[sigIndex]] = def[index];
}
}
}
}
}
def = tmpDef;
}
return function () {
var arr = [],
lookup,
type;
// Check if we are being passed a key/function object or an array of functions
if (def instanceof Array) {
// We were passed an array of functions
count = def.length;
for (index = 0; index < count; index++) {
if (def[index].length === arguments.length) {
return def[index].apply(this, arguments);
}
}
} else {
// Generate lookup key from arguments
// Copy arguments to an array
for (index = 0; index < arguments.length; index++) {
type = typeof arguments[index];
// Handle detecting arrays
if (type === 'object' && arguments[index] instanceof Array) {
type = 'array';
}
// Add the type to the argument types array
arr.push(type);
}
lookup = arr.join(',');
// Check for an exact lookup match
if (def[lookup]) {
return def[lookup].apply(this, arguments);
} else {
for (index = arr.length; index >= 0; index--) {
// Get the closest match
lookup = arr.slice(0, index).join(',');
if (def[lookup + ',...']) {
// Matched against arguments + "any other"
return def[lookup + ',...'].apply(this, arguments);
}
}
}
}
throw('ForerunnerDB.Overload "' + this.name() + '": Overloaded method does not have a matching signature for the passed arguments: ' + JSON.stringify(arr));
};
}
return function () {};
};
/**
* Generates an array of all the different definition signatures that can be
* created from the passed string with a catch-all wildcard *. E.g. it will
* convert the signature: string,*,string to all potentials:
* string,string,string
* string,number,string
* string,object,string,
* string,function,string,
* string,undefined,string
*
* @param {String} str Signature string with a wildcard in it.
* @returns {Array} An array of signature strings that are generated.
*/
Overload.prototype.generateSignaturePermutations = function (str) {
var signatures = [],
newSignature,
types = ['string', 'object', 'number', 'function', 'undefined'],
index;
if (str.indexOf('*') > -1) {
// There is at least one "any" type, break out into multiple keys
// We could do this at query time with regular expressions but
// would be significantly slower
for (index = 0; index < types.length; index++) {
newSignature = str.replace('*', types[index]);
signatures = signatures.concat(this.generateSignaturePermutations(newSignature));
}
} else {
signatures.push(str);
}
return signatures;
};
module.exports = Overload;
},{}],21:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared');
/**
* Path object used to resolve object paths and retrieve data from
* objects by using paths.
* @param {String=} path The path to assign.
* @constructor
*/
var Path = function (path) {
this.init.apply(this, arguments);
};
Path.prototype.init = function (path) {
if (path) {
this.path(path);
}
};
Shared.addModule('Path', Path);
Shared.mixin(Path.prototype, 'Mixin.ChainReactor');
/**
* Gets / sets the given path for the Path instance.
* @param {String=} path The path to assign.
*/
Path.prototype.path = function (path) {
if (path !== undefined) {
this._path = this.clean(path);
this._pathParts = this._path.split('.');
return this;
}
return this._path;
};
/**
* Tests if the passed object has the paths that are specified and that
* a value exists in those paths.
* @param {Object} testKeys The object describing the paths to test for.
* @param {Object} testObj The object to test paths against.
* @returns {Boolean} True if the object paths exist.
*/
Path.prototype.hasObjectPaths = function (testKeys, testObj) {
var result = true,
i;
for (i in testKeys) {
if (testKeys.hasOwnProperty(i)) {
if (testObj[i] === undefined) {
return false;
}
if (typeof testKeys[i] === 'object') {
// Recurse object
result = this.hasObjectPaths(testKeys[i], testObj[i]);
// Should we exit early?
if (!result) {
return false;
}
}
}
}
return result;
};
/**
* Counts the total number of key endpoints in the passed object.
* @param {Object} testObj The object to count key endpoints for.
* @returns {Number} The number of endpoints.
*/
Path.prototype.countKeys = function (testObj) {
var totalKeys = 0,
i;
for (i in testObj) {
if (testObj.hasOwnProperty(i)) {
if (testObj[i] !== undefined) {
if (typeof testObj[i] !== 'object') {
totalKeys++;
} else {
totalKeys += this.countKeys(testObj[i]);
}
}
}
}
return totalKeys;
};
/**
* Tests if the passed object has the paths that are specified and that
* a value exists in those paths and if so returns the number matched.
* @param {Object} testKeys The object describing the paths to test for.
* @param {Object} testObj The object to test paths against.
* @returns {Object} Stats on the matched keys
*/
Path.prototype.countObjectPaths = function (testKeys, testObj) {
var matchData,
matchedKeys = {},
matchedKeyCount = 0,
totalKeyCount = 0,
i;
for (i in testObj) {
if (testObj.hasOwnProperty(i)) {
if (typeof testObj[i] === 'object') {
// The test / query object key is an object, recurse
matchData = this.countObjectPaths(testKeys[i], testObj[i]);
matchedKeys[i] = matchData.matchedKeys;
totalKeyCount += matchData.totalKeyCount;
matchedKeyCount += matchData.matchedKeyCount;
} else {
// The test / query object has a property that is not an object so add it as a key
totalKeyCount++;
// Check if the test keys also have this key and it is also not an object
if (testKeys && testKeys[i] && typeof testKeys[i] !== 'object') {
matchedKeys[i] = true;
matchedKeyCount++;
} else {
matchedKeys[i] = false;
}
}
}
}
return {
matchedKeys: matchedKeys,
matchedKeyCount: matchedKeyCount,
totalKeyCount: totalKeyCount
};
};
/**
* Takes a non-recursive object and converts the object hierarchy into
* a path string.
* @param {Object} obj The object to parse.
* @param {Boolean=} withValue If true will include a 'value' key in the returned
* object that represents the value the object path points to.
* @returns {Object}
*/
Path.prototype.parse = function (obj, withValue) {
var paths = [],
path = '',
resultData,
i, k;
for (i in obj) {
if (obj.hasOwnProperty(i)) {
// Set the path to the key
path = i;
if (typeof(obj[i]) === 'object') {
if (withValue) {
resultData = this.parse(obj[i], withValue);
for (k = 0; k < resultData.length; k++) {
paths.push({
path: path + '.' + resultData[k].path,
value: resultData[k].value
});
}
} else {
resultData = this.parse(obj[i]);
for (k = 0; k < resultData.length; k++) {
paths.push({
path: path + '.' + resultData[k].path
});
}
}
} else {
if (withValue) {
paths.push({
path: path,
value: obj[i]
});
} else {
paths.push({
path: path
});
}
}
}
}
return paths;
};
/**
* Takes a non-recursive object and converts the object hierarchy into
* an array of path strings that allow you to target all possible paths
* in an object.
*
* @returns {Array}
*/
Path.prototype.parseArr = function (obj, options) {
options = options || {};
return this._parseArr(obj, '', [], options);
};
Path.prototype._parseArr = function (obj, path, paths, options) {
var i,
newPath = '';
path = path || '';
paths = paths || [];
for (i in obj) {
if (obj.hasOwnProperty(i)) {
if (!options.ignore || (options.ignore && !options.ignore.test(i))) {
if (path) {
newPath = path + '.' + i;
} else {
newPath = i;
}
if (typeof(obj[i]) === 'object') {
this._parseArr(obj[i], newPath, paths, options);
} else {
paths.push(newPath);
}
}
}
}
return paths;
};
/**
* Gets the value(s) that the object contains for the currently assigned path string.
* @param {Object} obj The object to evaluate the path against.
* @param {String=} path A path to use instead of the existing one passed in path().
* @returns {Array} An array of values for the given path.
*/
Path.prototype.value = function (obj, path) {
if (obj !== undefined && typeof obj === 'object') {
var pathParts,
arr,
arrCount,
objPart,
objPartParent,
valuesArr = [],
i, k;
if (path !== undefined) {
path = this.clean(path);
pathParts = path.split('.');
}
arr = pathParts || this._pathParts;
arrCount = arr.length;
objPart = obj;
for (i = 0; i < arrCount; i++) {
objPart = objPart[arr[i]];
if (objPartParent instanceof Array) {
// Search inside the array for the next key
for (k = 0; k < objPartParent.length; k++) {
valuesArr = valuesArr.concat(this.value(objPartParent, k + '.' + arr[i]));
}
return valuesArr;
} else {
if (!objPart || typeof(objPart) !== 'object') {
break;
}
}
objPartParent = objPart;
}
return [objPart];
} else {
return [];
}
};
/**
* Sets a value on an object for the specified path.
* @param {Object} obj The object to update.
* @param {String} path The path to update.
* @param {*} val The value to set the object path to.
* @returns {*}
*/
Path.prototype.set = function (obj, path, val) {
if (obj !== undefined && path !== undefined) {
var pathParts,
part;
path = this.clean(path);
pathParts = path.split('.');
part = pathParts.shift();
if (pathParts.length) {
// Generate the path part in the object if it does not already exist
obj[part] = obj[part] || {};
// Recurse
this.set(obj[part], pathParts.join('.'), val);
} else {
// Set the value
obj[part] = val;
}
}
return obj;
};
Path.prototype.get = function (obj, path) {
return this.value(obj, path)[0];
};
/**
* Push a value to an array on an object for the specified path.
* @param {Object} obj The object to update.
* @param {String} path The path to the array to push to.
* @param {*} val The value to push to the array at the object path.
* @returns {*}
*/
Path.prototype.push = function (obj, path, val) {
if (obj !== undefined && path !== undefined) {
var pathParts,
part;
path = this.clean(path);
pathParts = path.split('.');
part = pathParts.shift();
if (pathParts.length) {
// Generate the path part in the object if it does not already exist
obj[part] = obj[part] || {};
// Recurse
this.set(obj[part], pathParts.join('.'), val);
} else {
// Set the value
obj[part] = obj[part] || [];
if (obj[part] instanceof Array) {
obj[part].push(val);
} else {
throw('ForerunnerDB.Path: Cannot push to a path whose endpoint is not an array!');
}
}
}
return obj;
};
/**
* Gets the value(s) that the object contains for the currently assigned path string
* with their associated keys.
* @param {Object} obj The object to evaluate the path against.
* @param {String=} path A path to use instead of the existing one passed in path().
* @returns {Array} An array of values for the given path with the associated key.
*/
Path.prototype.keyValue = function (obj, path) {
var pathParts,
arr,
arrCount,
objPart,
objPartParent,
objPartHash,
i;
if (path !== undefined) {
path = this.clean(path);
pathParts = path.split('.');
}
arr = pathParts || this._pathParts;
arrCount = arr.length;
objPart = obj;
for (i = 0; i < arrCount; i++) {
objPart = objPart[arr[i]];
if (!objPart || typeof(objPart) !== 'object') {
objPartHash = arr[i] + ':' + objPart;
break;
}
objPartParent = objPart;
}
return objPartHash;
};
/**
* Removes leading period (.) from string and returns it.
* @param {String} str The string to clean.
* @returns {*}
*/
Path.prototype.clean = function (str) {
if (str.substr(0, 1) === '.') {
str = str.substr(1, str.length -1);
}
return str;
};
Shared.finishModule('Path');
module.exports = Path;
},{"./Shared":23}],22:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared');
var ReactorIO = function (reactorIn, reactorOut, reactorProcess) {
if (reactorIn && reactorOut && reactorProcess) {
this._reactorIn = reactorIn;
this._reactorOut = reactorOut;
this._chainHandler = reactorProcess;
if (!reactorIn.chain || !reactorOut.chainReceive) {
throw('ForerunnerDB.ReactorIO: ReactorIO requires passed in and out objects to implement the ChainReactor mixin!');
}
// Register the reactorIO with the input
reactorIn.chain(this);
// Register the output with the reactorIO
this.chain(reactorOut);
} else {
throw('ForerunnerDB.ReactorIO: ReactorIO requires an in, out and process argument to instantiate!');
}
};
Shared.addModule('ReactorIO', ReactorIO);
ReactorIO.prototype.drop = function () {
if (this._state !== 'dropped') {
this._state = 'dropped';
// Remove links
if (this._reactorIn) {
this._reactorIn.unChain(this);
}
if (this._reactorOut) {
this.unChain(this._reactorOut);
}
delete this._reactorIn;
delete this._reactorOut;
delete this._chainHandler;
this.emit('drop', this);
}
return true;
};
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(ReactorIO.prototype, 'state');
Shared.mixin(ReactorIO.prototype, 'Mixin.ChainReactor');
Shared.mixin(ReactorIO.prototype, 'Mixin.Events');
Shared.finishModule('ReactorIO');
module.exports = ReactorIO;
},{"./Shared":23}],23:[function(_dereq_,module,exports){
"use strict";
var Shared = {
version: '1.3.24',
modules: {},
_synth: {},
/**
* Adds a module to ForerunnerDB.
* @param {String} name The name of the module.
* @param {Function} module The module class.
*/
addModule: function (name, module) {
this.modules[name] = module;
this.emit('moduleLoad', [name, module]);
},
/**
* Called by the module once all processing has been completed. Used to determine
* if the module is ready for use by other modules.
* @param {String} name The name of the module.
*/
finishModule: function (name) {
if (this.modules[name]) {
this.modules[name]._fdbFinished = true;
this.emit('moduleFinished', [name, this.modules[name]]);
} else {
throw('ForerunnerDB.Shared: finishModule called on a module that has not been registered with addModule(): ' + name);
}
},
/**
* Will call your callback method when the specified module has loaded. If the module
* is already loaded the callback is called immediately.
* @param {String} name The name of the module.
* @param {Function} callback The callback method to call when the module is loaded.
*/
moduleFinished: function (name, callback) {
if (this.modules[name] && this.modules[name]._fdbFinished) {
callback(name, this.modules[name]);
} else {
this.on('moduleFinished', callback);
}
},
/**
* Determines if a module has been added to ForerunnerDB or not.
* @param {String} name The name of the module.
* @returns {Boolean} True if the module exists or false if not.
*/
moduleExists: function (name) {
return Boolean(this.modules[name]);
},
/**
* Adds the properties and methods defined in the mixin to the passed object.
* @param {Object} obj The target object to add mixin key/values to.
* @param {String} mixinName The name of the mixin to add to the object.
*/
mixin: function (obj, mixinName) {
var system = this.mixins[mixinName];
if (system) {
for (var i in system) {
if (system.hasOwnProperty(i)) {
obj[i] = system[i];
}
}
} else {
throw('ForerunnerDB.Shared: Cannot find mixin named: ' + mixinName);
}
},
/**
* Generates a generic getter/setter method for the passed method name.
* @param {Object} obj The object to add the getter/setter to.
* @param {String} name The name of the getter/setter to generate.
* @param {Function=} extend A method to call before executing the getter/setter.
* The existing getter/setter can be accessed from the extend method via the
* $super e.g. this.$super();
*/
synthesize: function (obj, name, extend) {
this._synth[name] = this._synth[name] || function (val) {
if (val !== undefined) {
this['_' + name] = val;
return this;
}
return this['_' + name];
};
if (extend) {
var self = this;
obj[name] = function () {
var tmp = this.$super,
ret;
this.$super = self._synth[name];
ret = extend.apply(this, arguments);
this.$super = tmp;
return ret;
};
} else {
obj[name] = this._synth[name];
}
},
/**
* Allows a method to be overloaded.
* @param arr
* @returns {Function}
* @constructor
*/
overload: _dereq_('./Overload'),
/**
* Define the mixins that other modules can use as required.
*/
mixins: {
'Mixin.Common': _dereq_('./Mixin.Common'),
'Mixin.Events': _dereq_('./Mixin.Events'),
'Mixin.ChainReactor': _dereq_('./Mixin.ChainReactor'),
'Mixin.CRUD': _dereq_('./Mixin.CRUD'),
'Mixin.Constants': _dereq_('./Mixin.Constants'),
'Mixin.Triggers': _dereq_('./Mixin.Triggers'),
'Mixin.Sorting': _dereq_('./Mixin.Sorting'),
'Mixin.Matching': _dereq_('./Mixin.Matching')
}
};
// Add event handling to shared
Shared.mixin(Shared, 'Mixin.Events');
module.exports = Shared;
},{"./Mixin.CRUD":11,"./Mixin.ChainReactor":12,"./Mixin.Common":13,"./Mixin.Constants":14,"./Mixin.Events":15,"./Mixin.Matching":16,"./Mixin.Sorting":17,"./Mixin.Triggers":18,"./Overload":20}],24:[function(_dereq_,module,exports){
"use strict";
// Import external names locally
var Shared,
Core,
Collection,
CollectionGroup,
CollectionInit,
CoreInit,
ReactorIO,
ActiveBucket;
Shared = _dereq_('./Shared');
/**
* The view constructor.
* @param name
* @param query
* @param options
* @constructor
*/
var View = function (name, query, options) {
this.init.apply(this, arguments);
};
View.prototype.init = function (name, query, options) {
var self = this;
this._name = name;
this._groups = [];
this._listeners = {};
this._querySettings = {};
this._debug = {};
this.query(query, false);
this.queryOptions(options, false);
this._collectionDroppedWrap = function () {
self._collectionDropped.apply(self, arguments);
};
this._privateData = new Collection('__FDB__view_privateData_' + this._name);
};
Shared.addModule('View', View);
Shared.mixin(View.prototype, 'Mixin.Common');
Shared.mixin(View.prototype, 'Mixin.ChainReactor');
Shared.mixin(View.prototype, 'Mixin.Constants');
Shared.mixin(View.prototype, 'Mixin.Triggers');
Collection = _dereq_('./Collection');
CollectionGroup = _dereq_('./CollectionGroup');
ActiveBucket = _dereq_('./ActiveBucket');
ReactorIO = _dereq_('./ReactorIO');
CollectionInit = Collection.prototype.init;
Core = Shared.modules.Core;
CoreInit = Core.prototype.init;
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(View.prototype, 'state');
Shared.synthesize(View.prototype, 'name');
/**
* Executes an insert against the view's underlying data-source.
*/
View.prototype.insert = function () {
this._from.insert.apply(this._from, arguments);
};
/**
* Executes an update against the view's underlying data-source.
*/
View.prototype.update = function () {
this._from.update.apply(this._from, arguments);
};
/**
* Executes an updateById against the view's underlying data-source.
*/
View.prototype.updateById = function () {
this._from.updateById.apply(this._from, arguments);
};
/**
* Executes a remove against the view's underlying data-source.
*/
View.prototype.remove = function () {
this._from.remove.apply(this._from, arguments);
};
/**
* Queries the view data. See Collection.find() for more information.
* @returns {*}
*/
View.prototype.find = function (query, options) {
return this.publicData().find(query, options);
};
/**
* Gets the module's internal data collection.
* @returns {Collection}
*/
View.prototype.data = function () {
return this._privateData;
};
/**
* Sets the collection from which the view will assemble its data.
* @param {Collection} collection The collection to use to assemble view data.
* @returns {View}
*/
View.prototype.from = function (collection) {
var self = this;
if (collection !== undefined) {
// Check if we have an existing from
if (this._from) {
// Remove the listener to the drop event
this._from.off('drop', this._collectionDroppedWrap);
delete this._from;
}
if (typeof(collection) === 'string') {
collection = this._db.collection(collection);
}
this._from = collection;
// Create a new reactor IO graph node that intercepts chain packets from the
// view's "from" collection and determines how they should be interpreted by
// this view. If the view does not have a query then this reactor IO will
// simply pass along the chain packet without modifying it.
this._io = new ReactorIO(collection, this, function (chainPacket) {
var data,
diff,
query,
filteredData,
doSend,
pk,
i;
// Check if we have a constraining query
if (self._querySettings.query) {
if (chainPacket.type === 'insert') {
data = chainPacket.data;
// Check if the data matches our query
if (data instanceof Array) {
filteredData = [];
for (i = 0; i < data.length; i++) {
if (self._privateData._match(data[i], self._querySettings.query, 'and', {})) {
filteredData.push(data[i]);
doSend = true;
}
}
} else {
if (self._privateData._match(data, self._querySettings.query, 'and', {})) {
filteredData = data;
doSend = true;
}
}
if (doSend) {
this.chainSend('insert', filteredData);
}
return true;
}
if (chainPacket.type === 'update') {
// Do a DB diff between this view's data and the underlying collection it reads from
// to see if something has changed
diff = self._privateData.diff(self._from.subset(self._querySettings.query, self._querySettings.options));
if (diff.insert.length || diff.remove.length) {
// Now send out new chain packets for each operation
if (diff.insert.length) {
this.chainSend('insert', diff.insert);
}
if (diff.update.length) {
pk = self._privateData.primaryKey();
for (i = 0; i < diff.update.length; i++) {
query = {};
query[pk] = diff.update[i][pk];
this.chainSend('update', {
query: query,
update: diff.update[i]
});
}
}
if (diff.remove.length) {
pk = self._privateData.primaryKey();
var $or = [],
removeQuery = {
query: {
$or: $or
}
};
for (i = 0; i < diff.remove.length; i++) {
$or.push({_id: diff.remove[i][pk]});
}
this.chainSend('remove', removeQuery);
}
// Return true to stop further propagation of the chain packet
return true;
} else {
// Returning false informs the chain reactor to continue propagation
// of the chain packet down the graph tree
return false;
}
}
}
// Returning false informs the chain reactor to continue propagation
// of the chain packet down the graph tree
return false;
});
var collData = collection.find(this._querySettings.query, this._querySettings.options);
this._transformPrimaryKey(collection.primaryKey());
this._transformSetData(collData);
this._privateData.primaryKey(collection.primaryKey());
this._privateData.setData(collData);
if (this._querySettings.options && this._querySettings.options.$orderBy) {
this.rebuildActiveBucket(this._querySettings.options.$orderBy);
} else {
this.rebuildActiveBucket();
}
}
return this;
};
View.prototype._collectionDropped = function (collection) {
if (collection) {
// Collection was dropped, remove from view
delete this._from;
}
};
View.prototype.ensureIndex = function () {
return this._privateData.ensureIndex.apply(this._privateData, arguments);
};
View.prototype._chainHandler = function (chainPacket) {
var //self = this,
arr,
count,
index,
insertIndex,
//tempData,
//dataIsArray,
updates,
//finalUpdates,
primaryKey,
tQuery,
item,
currentIndex,
i;
switch (chainPacket.type) {
case 'setData':
if (this.debug()) {
console.log('ForerunnerDB.View: Setting data on view "' + this.name() + '" in underlying (internal) view collection "' + this._privateData.name() + '"');
}
// Get the new data from our underlying data source sorted as we want
var collData = this._from.find(this._querySettings.query, this._querySettings.options);
// Modify transform data
this._transformSetData(collData);
this._privateData.setData(collData);
break;
case 'insert':
if (this.debug()) {
console.log('ForerunnerDB.View: Inserting some data on view "' + this.name() + '" in underlying (internal) view collection "' + this._privateData.name() + '"');
}
// Decouple the data to ensure we are working with our own copy
chainPacket.data = this.decouple(chainPacket.data);
// Make sure we are working with an array
if (!(chainPacket.data instanceof Array)) {
chainPacket.data = [chainPacket.data];
}
if (this._querySettings.options && this._querySettings.options.$orderBy) {
// Loop the insert data and find each item's index
arr = chainPacket.data;
count = arr.length;
for (index = 0; index < count; index++) {
insertIndex = this._activeBucket.insert(arr[index]);
// Modify transform data
this._transformInsert(chainPacket.data, insertIndex);
this._privateData._insertHandle(chainPacket.data, insertIndex);
}
} else {
// Set the insert index to the passed index, or if none, the end of the view data array
insertIndex = this._privateData._data.length;
// Modify transform data
this._transformInsert(chainPacket.data, insertIndex);
this._privateData._insertHandle(chainPacket.data, insertIndex);
}
break;
case 'update':
if (this.debug()) {
console.log('ForerunnerDB.View: Updating some data on view "' + this.name() + '" in underlying (internal) view collection "' + this._privateData.name() + '"');
}
primaryKey = this._privateData.primaryKey();
// Do the update
updates = this._privateData.update(
chainPacket.data.query,
chainPacket.data.update,
chainPacket.data.options
);
if (this._querySettings.options && this._querySettings.options.$orderBy) {
// TODO: This would be a good place to improve performance by somehow
// TODO: inspecting the change that occurred when update was performed
// TODO: above and determining if it affected the order clause keys
// TODO: and if not, skipping the active bucket updates here
// Loop the updated items and work out their new sort locations
count = updates.length;
for (index = 0; index < count; index++) {
item = updates[index];
// Remove the item from the active bucket (via it's id)
this._activeBucket.remove(item);
// Get the current location of the item
currentIndex = this._privateData._data.indexOf(item);
// Add the item back in to the active bucket
insertIndex = this._activeBucket.insert(item);
if (currentIndex !== insertIndex) {
// Move the updated item to the new index
this._privateData._updateSpliceMove(this._privateData._data, currentIndex, insertIndex);
}
}
}
if (this._transformEnabled && this._transformIn) {
primaryKey = this._publicData.primaryKey();
for (i = 0; i < updates.length; i++) {
tQuery = {};
item = updates[i];
tQuery[primaryKey] = item[primaryKey];
this._transformUpdate(tQuery, item);
}
}
break;
case 'remove':
if (this.debug()) {
console.log('ForerunnerDB.View: Removing some data on view "' + this.name() + '" in underlying (internal) view collection "' + this._privateData.name() + '"');
}
// Modify transform data
this._transformRemove(chainPacket.data.query, chainPacket.options);
this._privateData.remove(chainPacket.data.query, chainPacket.options);
break;
default:
break;
}
};
View.prototype.on = function () {
this._privateData.on.apply(this._privateData, arguments);
};
View.prototype.off = function () {
this._privateData.off.apply(this._privateData, arguments);
};
View.prototype.emit = function () {
this._privateData.emit.apply(this._privateData, arguments);
};
/**
* Find the distinct values for a specified field across a single collection and
* returns the results in an array.
* @param {String} key The field path to return distinct values for e.g. "person.name".
* @param {Object=} query The query to use to filter the documents used to return values from.
* @param {Object=} options The query options to use when running the query.
* @returns {Array}
*/
View.prototype.distinct = function (key, query, options) {
return this._privateData.distinct.apply(this._privateData, arguments);
};
/**
* Gets the primary key for this view from the assigned collection.
* @returns {String}
*/
View.prototype.primaryKey = function () {
return this._privateData.primaryKey();
};
/**
* Drops a view and all it's stored data from the database.
* @returns {boolean} True on success, false on failure.
*/
View.prototype.drop = function () {
if (this._state !== 'dropped') {
if (this._from) {
this._from.off('drop', this._collectionDroppedWrap);
this._from._removeView(this);
if (this.debug() || (this._db && this._db.debug())) {
console.log('ForerunnerDB.View: Dropping view ' + this._name);
}
this._state = 'dropped';
// Clear io and chains
if (this._io) {
this._io.drop();
}
// Drop the view's internal collection
if (this._privateData) {
this._privateData.drop();
}
if (this._db && this._name) {
delete this._db._view[this._name];
}
this.emit('drop', this);
delete this._chain;
delete this._from;
delete this._privateData;
delete this._io;
delete this._groups;
delete this._listeners;
delete this._querySettings;
delete this._db;
return true;
}
} else {
return true;
}
return false;
};
/**
* Gets / sets the DB the view is bound against. Automatically set
* when the db.oldView(viewName) method is called.
* @param db
* @returns {*}
*/
View.prototype.db = function (db) {
if (db !== undefined) {
this._db = db;
this.privateData().db(db);
this.publicData().db(db);
return this;
}
return this._db;
};
/**
* Gets / sets the query that the view uses to build it's data set.
* @param {Object=} query
* @param {Boolean=} options An options object.
* @param {Boolean=} refresh Whether to refresh the view data after
* this operation. Defaults to true.
* @returns {*}
*/
View.prototype.queryData = function (query, options, refresh) {
if (query !== undefined) {
this._querySettings.query = query;
}
if (options !== undefined) {
this._querySettings.options = options;
}
if (query !== undefined || options !== undefined) {
if (refresh === undefined || refresh === true) {
this.refresh();
}
return this;
}
return this._querySettings;
};
/**
* Add data to the existing query.
* @param {Object} obj The data whose keys will be added to the existing
* query object.
* @param {Boolean} overwrite Whether or not to overwrite data that already
* exists in the query object. Defaults to true.
* @param {Boolean=} refresh Whether or not to refresh the view data set
* once the operation is complete. Defaults to true.
*/
View.prototype.queryAdd = function (obj, overwrite, refresh) {
this._querySettings.query = this._querySettings.query || {};
var query = this._querySettings.query,
i;
if (obj !== undefined) {
// Loop object properties and add to existing query
for (i in obj) {
if (obj.hasOwnProperty(i)) {
if (query[i] === undefined || (query[i] !== undefined && overwrite !== false)) {
query[i] = obj[i];
}
}
}
}
if (refresh === undefined || refresh === true) {
this.refresh();
}
};
/**
* Remove data from the existing query.
* @param {Object} obj The data whose keys will be removed from the existing
* query object.
* @param {Boolean=} refresh Whether or not to refresh the view data set
* once the operation is complete. Defaults to true.
*/
View.prototype.queryRemove = function (obj, refresh) {
var query = this._querySettings.query,
i;
if (obj !== undefined) {
// Loop object properties and add to existing query
for (i in obj) {
if (obj.hasOwnProperty(i)) {
delete query[i];
}
}
}
if (refresh === undefined || refresh === true) {
this.refresh();
}
};
/**
* Gets / sets the query being used to generate the view data.
* @param {Object=} query The query to set.
* @param {Boolean=} refresh Whether to refresh the view data after
* this operation. Defaults to true.
* @returns {*}
*/
View.prototype.query = function (query, refresh) {
if (query !== undefined) {
this._querySettings.query = query;
if (refresh === undefined || refresh === true) {
this.refresh();
}
return this;
}
return this._querySettings.query;
};
/**
* Gets / sets the orderBy clause in the query options for the view.
* @param {Object=} val The order object.
* @returns {*}
*/
View.prototype.orderBy = function (val) {
if (val !== undefined) {
var queryOptions = this.queryOptions() || {};
queryOptions.$orderBy = val;
this.queryOptions(queryOptions);
return this;
}
return (this.queryOptions() || {}).$orderBy;
};
/**
* Gets / sets the query options used when applying sorting etc to the
* view data set.
* @param {Object=} options An options object.
* @param {Boolean=} refresh Whether to refresh the view data after
* this operation. Defaults to true.
* @returns {*}
*/
View.prototype.queryOptions = function (options, refresh) {
if (options !== undefined) {
this._querySettings.options = options;
if (options.$decouple === undefined) { options.$decouple = true; }
if (refresh === undefined || refresh === true) {
this.refresh();
} else {
this.rebuildActiveBucket(options.$orderBy);
}
return this;
}
return this._querySettings.options;
};
View.prototype.rebuildActiveBucket = function (orderBy) {
if (orderBy) {
var arr = this._privateData._data,
arrCount = arr.length;
// Build a new active bucket
this._activeBucket = new ActiveBucket(orderBy);
this._activeBucket.primaryKey(this._privateData.primaryKey());
// Loop the current view data and add each item
for (var i = 0; i < arrCount; i++) {
this._activeBucket.insert(arr[i]);
}
} else {
// Remove any existing active bucket
delete this._activeBucket;
}
};
/**
* Refreshes the view data such as ordering etc.
*/
View.prototype.refresh = function () {
if (this._from) {
var pubData = this.publicData();
// Re-grab all the data for the view from the collection
this._privateData.remove();
pubData.remove();
this._privateData.insert(this._from.find(this._querySettings.query, this._querySettings.options));
/*if (pubData._linked) {
// Update data and observers
//var transformedData = this._privateData.find();
// TODO: Shouldn't this data get passed into a transformIn first?
// TODO: This breaks linking because its passing decoupled data and overwriting non-decoupled data
// TODO: Is this even required anymore? After commenting it all seems to work
// TODO: Might be worth setting up a test to check trasforms and linking then remove this if working?
//jQuery.observable(pubData._data).refresh(transformedData);
}*/
}
if (this._querySettings.options && this._querySettings.options.$orderBy) {
this.rebuildActiveBucket(this._querySettings.options.$orderBy);
} else {
this.rebuildActiveBucket();
}
return this;
};
/**
* Returns the number of documents currently in the view.
* @returns {Number}
*/
View.prototype.count = function () {
return this._privateData && this._privateData._data ? this._privateData._data.length : 0;
};
// Call underlying
View.prototype.subset = function () {
return this.publicData().subset.apply(this._privateData, arguments);
};
/**
* Takes the passed data and uses it to set transform methods and globally
* enable or disable the transform system for the view.
* @param {Object} obj The new transform system settings "enabled", "dataIn" and "dataOut":
* {
* "enabled": true,
* "dataIn": function (data) { return data; },
* "dataOut": function (data) { return data; }
* }
* @returns {*}
*/
View.prototype.transform = function (obj) {
if (obj !== undefined) {
if (typeof obj === "object") {
if (obj.enabled !== undefined) {
this._transformEnabled = obj.enabled;
}
if (obj.dataIn !== undefined) {
this._transformIn = obj.dataIn;
}
if (obj.dataOut !== undefined) {
this._transformOut = obj.dataOut;
}
} else {
this._transformEnabled = obj !== false;
}
// Update the transformed data object
this._transformPrimaryKey(this.privateData().primaryKey());
this._transformSetData(this.privateData().find());
return this;
}
return {
enabled: this._transformEnabled,
dataIn: this._transformIn,
dataOut: this._transformOut
};
};
/**
* Returns the non-transformed data the view holds as a collection
* reference.
* @return {Collection} The non-transformed collection reference.
*/
View.prototype.privateData = function () {
return this._privateData;
};
/**
* Returns a data object representing the public data this view
* contains. This can change depending on if transforms are being
* applied to the view or not.
*
* If no transforms are applied then the public data will be the
* same as the private data the view holds. If transforms are
* applied then the public data will contain the transformed version
* of the private data.
*
* The public data collection is also used by data binding to only
* changes to the publicData will show in a data-bound element.
*/
View.prototype.publicData = function () {
if (this._transformEnabled) {
return this._publicData;
} else {
return this._privateData;
}
};
/**
* Updates the public data object to match data from the private data object
* by running private data through the dataIn method provided in
* the transform() call.
* @private
*/
View.prototype._transformSetData = function (data) {
if (this._transformEnabled) {
// Clear existing data
this._publicData = new Collection('__FDB__view_publicData_' + this._name);
this._publicData.db(this._privateData._db);
this._publicData.transform({
enabled: true,
dataIn: this._transformIn,
dataOut: this._transformOut
});
this._publicData.setData(data);
}
};
View.prototype._transformInsert = function (data, index) {
if (this._transformEnabled && this._publicData) {
this._publicData.insert(data, index);
}
};
View.prototype._transformUpdate = function (query, update, options) {
if (this._transformEnabled && this._publicData) {
this._publicData.update(query, update, options);
}
};
View.prototype._transformRemove = function (query, options) {
if (this._transformEnabled && this._publicData) {
this._publicData.remove(query, options);
}
};
View.prototype._transformPrimaryKey = function (key) {
if (this._transformEnabled && this._publicData) {
this._publicData.primaryKey(key);
}
};
// Extend collection with view init
Collection.prototype.init = function () {
this._view = [];
CollectionInit.apply(this, arguments);
};
/**
* Creates a view and assigns the collection as its data source.
* @param {String} name The name of the new view.
* @param {Object} query The query to apply to the new view.
* @param {Object} options The options object to apply to the view.
* @returns {*}
*/
Collection.prototype.view = function (name, query, options) {
if (this._db && this._db._view ) {
if (!this._db._view[name]) {
var view = new View(name, query, options)
.db(this._db)
.from(this);
this._view = this._view || [];
this._view.push(view);
return view;
} else {
throw('ForerunnerDB.Collection "' + this.name() + '": Cannot create a view using this collection because a view with this name already exists: ' + name);
}
}
};
/**
* Adds a view to the internal view lookup.
* @param {View} view The view to add.
* @returns {Collection}
* @private
*/
Collection.prototype._addView = CollectionGroup.prototype._addView = function (view) {
if (view !== undefined) {
this._view.push(view);
}
return this;
};
/**
* Removes a view from the internal view lookup.
* @param {View} view The view to remove.
* @returns {Collection}
* @private
*/
Collection.prototype._removeView = CollectionGroup.prototype._removeView = function (view) {
if (view !== undefined) {
var index = this._view.indexOf(view);
if (index > -1) {
this._view.splice(index, 1);
}
}
return this;
};
// Extend DB with views init
Core.prototype.init = function () {
this._view = {};
CoreInit.apply(this, arguments);
};
/**
* Gets a view by it's name.
* @param {String} viewName The name of the view to retrieve.
* @returns {*}
*/
Core.prototype.view = function (viewName) {
if (!this._view[viewName]) {
if (this.debug() || (this._db && this._db.debug())) {
console.log('Core.View: Creating view ' + viewName);
}
}
this._view[viewName] = this._view[viewName] || new View(viewName).db(this);
return this._view[viewName];
};
/**
* Determine if a view with the passed name already exists.
* @param {String} viewName The name of the view to check for.
* @returns {boolean}
*/
Core.prototype.viewExists = function (viewName) {
return Boolean(this._view[viewName]);
};
/**
* Returns an array of views the DB currently has.
* @returns {Array} An array of objects containing details of each view
* the database is currently managing.
*/
Core.prototype.views = function () {
var arr = [],
i;
for (i in this._view) {
if (this._view.hasOwnProperty(i)) {
arr.push({
name: i,
count: this._view[i].count()
});
}
}
return arr;
};
Shared.finishModule('View');
module.exports = View;
},{"./ActiveBucket":2,"./Collection":3,"./CollectionGroup":4,"./ReactorIO":22,"./Shared":23}]},{},[1]);
|
node_modules/bs-recipes/recipes/webpack.react-hot-loader/app/js/main.js | cratia-devel/angular2-tour-of-heroes | import React from 'react';
// It's important to not define HelloWorld component right in this file
// because in that case it will do full page reload on change
import HelloWorld from './HelloWorld.jsx';
React.render(<HelloWorld />, document.getElementById('react-root'));
|
src/browser/intl/SwitchLocale.js | redcom/doctori-romani-in-berlin | // @flow
import type { State } from '../../common/types';
import React from 'react';
import { Box, Button } from '../../common/components';
import { compose } from 'ramda';
import { connect } from 'react-redux';
import { setCurrentLocale } from '../../common/intl/actions';
type SwitchLocaleProps = {
currentLocale: string,
locales: Array<string>,
setCurrentLocale: typeof setCurrentLocale,
};
const SwitchLocale = (
{ currentLocale, locales, setCurrentLocale }: SwitchLocaleProps,
) => (
<Box
flexDirection="row"
flexWrap="wrap"
marginBottom={1}
marginHorizontal={-0.25}
>
{locales.map((locale) => (
<Button
outline={locale !== currentLocale}
key={locale}
marginHorizontal={0.25}
onClick={() => setCurrentLocale(locale)}
primary
>
{locale}
</Button>
))}
</Box>
);
export default compose(
connect(
(state: State) => ({
currentLocale: state.intl.currentLocale,
locales: state.intl.locales,
}),
{ setCurrentLocale },
),
)(SwitchLocale);
|
static/src/routes.js | mortbauer/webapp | import React from 'react';
import { Route } from 'react-router';
/* containers */
import { App } from 'containers/App';
import { HomeContainer } from 'containers/HomeContainer';
import LoginView from 'components/LoginView'
import RegisterView from 'components/RegisterView'
import ProtectedView from 'components/ProtectedView'
import Analytics from 'components/Analytics'
import NotFound from 'components/NotFound'
import TransactionView from 'components/Transactions';
import {DetermineAuth} from 'components/DetermineAuth';
import {requireAuthentication} from 'components/AuthenticatedComponent';
import {requireNoAuthentication} from 'components/notAuthenticatedComponent';
export default (
<Route path="/" component={App}>
<Route path="transactions" component={requireAuthentication(TransactionView)}/>
<Route path="main" component={requireAuthentication(ProtectedView)}/>
<Route path="login" component={requireNoAuthentication(LoginView)}/>
<Route path="register" component={requireNoAuthentication(RegisterView)}/>
<Route path="home" component={requireNoAuthentication(HomeContainer)}/>
<Route path="analytics" component={requireAuthentication(Analytics)}/>
<Route path="*" component={DetermineAuth(NotFound)}/>
</Route>
);
|
packages/material-ui-icons/src/VpnLock.js | allanalexandre/material-ui | import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path d="M22 4v-.5C22 2.12 20.88 1 19.5 1S17 2.12 17 3.5V4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h5c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zm-.8 0h-3.4v-.5c0-.94.76-1.7 1.7-1.7s1.7.76 1.7 1.7V4zm-2.28 8c.04.33.08.66.08 1 0 2.08-.8 3.97-2.1 5.39-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H7v-2h2c.55 0 1-.45 1-1V8h2c1.1 0 2-.9 2-2V3.46c-.95-.3-1.95-.46-3-.46C5.48 3 1 7.48 1 13s4.48 10 10 10 10-4.48 10-10c0-.34-.02-.67-.05-1h-2.03zM10 20.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L8 16v1c0 1.1.9 2 2 2v1.93z" /><path fill="none" d="M0 0h24v24H0z" /></React.Fragment>
, 'VpnLock');
|
__tests__/index.android.js | codeestX/MoeFM | import 'react-native';
import React from 'react';
import Index from '../index.android.js';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
it('renders correctly', () => {
const tree = renderer.create(
<Index />
);
});
|
enterprise-modules/status-bar/dist/status-bar.esm.min.js | ceolter/ag-grid | /**
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v25.1.0
* @link http://www.ag-grid.com/
' * @license Commercial
*/
/**
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v25.1.0
* @link http://www.ag-grid.com/
' * @license Commercial
*/
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function t(t){return null==t||""===t?null:t}function e(t,e){return void 0===e&&(e=!1),null!=t&&(""!==t||e)}function o(t){return!e(t)}function n(t){return null==t||0===t.length}function i(t){return null!=t&&"function"==typeof t.toString?t.toString():null}function r(t){if(void 0!==t){if(null===t||""===t)return null;if("number"==typeof t)return isNaN(t)?void 0:t;var e=parseInt(t,10);return isNaN(e)?void 0:e}}function s(t){if(void 0!==t)return null!==t&&""!==t&&("boolean"==typeof t?t:/true/i.test(t))}function a(t,e,o){if(null==t)return null;if(!Array.isArray(t))return a(l(t),e,o);for(var n=t,i=null,r=0;r<n.length;r++){var s=n[r];if("string"==typeof e){if(s[e]===o){i=s;break}}else if(e(s)){i=s;break}}return i}function l(t){if(t instanceof Set||t instanceof Map){var e=[];return t.forEach((function(t){return e.push(t)})),e}return Object.keys(t).map((function(e){return t[e]}))}var p=Object.freeze({__proto__:null,makeNull:t,exists:e,missing:o,missingOrEmpty:n,toStringOrNull:i,attrToNumber:r,attrToBoolean:s,attrToString:function(t){if(null!=t&&""!==t)return t},referenceCompare:function(t,e){return null==t&&null==e||(null!=t||null==e)&&((null==t||null!=e)&&t===e)},jsonEquals:function(t,e){return(t?JSON.stringify(t):null)===(e?JSON.stringify(e):null)},defaultComparator:function(t,e,o){void 0===o&&(o=!1);var n=null==t,i=null==e;if(t&&t.toNumber&&(t=t.toNumber()),e&&e.toNumber&&(e=e.toNumber()),n&&i)return 0;if(n)return-1;if(i)return 1;function r(t,e){return t>e?1:t<e?-1:0}if("string"!=typeof t)return r(t,e);if(!o)return r(t,e);try{return t.localeCompare(e)}catch(o){return r(t,e)}},find:a,values:l}),u=function(){function t(){this.existingKeys={}}return t.prototype.addExistingKeys=function(t){for(var e=0;e<t.length;e++)this.existingKeys[t[e]]=!0},t.prototype.getUniqueKey=function(t,e){t=i(t);for(var o=0;;){var n=void 0;if(t?(n=t,0!==o&&(n+="_"+o)):e?(n=e,0!==o&&(n+="_"+o)):n=""+o,!this.existingKeys[n])return this.existingKeys[n]=!0,n;o++}},t}();
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function c(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];for(var n=0;n<t.length;n++){var i=t[n];if(e(i))return i}return null}function d(t){if(t&&t.length)return t[t.length-1]}function h(t,e,o){return null==t&&null==e||null!=t&&null!=e&&t.length===e.length&&R(t,(function(t,n){return o?o(t,e[n]):e[n]===t}))}function f(t){return t.sort((function(t,e){return t-e}))}function g(t,e){var o=t.indexOf(e);o>=0&&t.splice(o,1)}function y(t,e){P(e,(function(e){return g(t,e)}))}function v(t,e,o){t.splice(o,0,e)}function m(t,e,o){y(t,e),P(e.slice().reverse(),(function(e){return v(t,e,o)}))}function C(t,e){return t.indexOf(e)>-1}function w(t,e){null!=e&&null!=t&&P(e,(function(e){return t.push(e)}))}function E(t,e){for(var o=0;o<t.length;o++)if(e(t[o],o,t))return o;return-1}function R(t,e){if(null==t)return!0;for(var o=0;o<t.length;o++)if(!e(t[o],o))return!1;return!0}function O(t,e){if(null==t)return!1;for(var o=0;o<t.length;o++)if(e(t[o],o))return!0;return!1}function P(t,e){if(null!=t)for(var o=0;o<t.length;o++)e(t[o],o)}function S(t,e){if(null==t)return null;for(var o=[],n=0;n<t.length;n++)o.push(e(t[n],n));return o}function b(t,e){if(null==t)return null;for(var o=[],n=0;n<t.length;n++)e(t[n],n)&&o.push(t[n]);return o}var D=Object.freeze({__proto__:null,firstExistingValue:c,anyExists:function(t){return t&&null!=c(t)},existsAndNotEmpty:function(t){return null!=t&&t.length>0},last:d,areEqual:h,compareArrays:function(t,e){return h(t,e)},shallowCompare:function(t,e){return h(t,e)},sortNumerically:f,removeRepeatsFromArray:function(t,e){if(t)for(var o=t.length-2;o>=0;o--){var n=t[o]===e,i=t[o+1]===e;n&&i&&t.splice(o+1,1)}},removeFromArray:g,removeAllFromArray:y,insertIntoArray:v,insertArrayIntoArray:function(t,e,o){if(null!=t&&null!=e)for(var n=e.length-1;n>=0;n--){v(t,e[n],o)}},moveInArray:m,includes:C,flatten:function(t){return[].concat.apply([],t)},pushAll:w,toStrings:function(t){return S(t,i)},findIndex:E,every:R,some:O,forEach:P,forEachReverse:function(t,e){if(null!=t)for(var o=t.length-1;o>=0;o--)e(t[o],o)},map:S,filter:b,reduce:function(t,e,o){if(null==t||null==o)return null;for(var n=o,i=0;i<t.length;i++)n=e(n,t[i],i);return n},forEachSnapshotFirst:function(t,e){t&&t.slice(0).forEach(e)}});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function A(t,e){null!=t&&(Array.isArray(t)?P(t,(function(t,o){return e(""+o,t)})):P(Object.keys(t),(function(o){return e(o,t[o])})))}function T(t){for(var e={},o=Object.keys(t),n=0;n<o.length;n++){var i=o[n],r=t[i];e[i]=r}return e}function _(t,e){if(t){var o=t,n={};return Object.keys(o).forEach((function(t){if(!(e&&e.indexOf(t)>=0)){var i=o[t],r=W(i)&&i.constructor===Object;n[t]=r?_(i):i}})),n}}function F(t,e){return t[e]}function N(t,e,o){t[e]=o}function L(t,e,o,n){var i=F(t,o);void 0!==i&&N(e,o,n?n(i):i)}function I(t){var e={};return t.filter((function(t){return null!=t})).forEach((function(t){P(Object.keys(t),(function(t){return e[t]=null}))})),Object.keys(e)}function G(t,o,n,i){void 0===n&&(n=!0),void 0===i&&(i=!1),e(o)&&A(o,(function(e,o){var r=t[e];if(r!==o){if(i)if(null==r&&null!=o)"object"==typeof o&&o.constructor===Object&&(r={},t[e]=r);W(o)&&W(r)&&!Array.isArray(r)?G(r,o,n,i):(n||void 0!==o)&&(t[e]=o)}}))}function M(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];return P(e,(function(e){return A(e,(function(e,o){return t[e]=o}))})),t}function x(t,e,o){if(null==t)return o;for(var n=e.split("."),i=t;n.length>1;)if(null==(i=i[n.shift()]))return o;var r=i[n[0]];return null!=r?r:o}function V(t,e,o){if(e&&t){if(!o)return t[e];for(var n=e.split("."),i=t,r=0;r<n.length;r++){if(null==i)return;i=i[n[r]]}return i}}function H(t,e){Object.keys(t).forEach((function(e){"object"==typeof t[e]&&(t[e]=void 0)}));var o=Object.getPrototypeOf(t),n={};Object.keys(o).forEach((function(t){if("function"==typeof o[t]){n[t]={value:function(){console.warn("AG Grid: "+e+" function "+t+"() cannot be called as the grid has been destroyed.\n Please don't call grid API functions on destroyed grids - as a matter of fact you shouldn't\n be keeping the API reference, your application has a memory leak! Remove the API reference\n when the grid is destroyed.")},writable:!0}}})),Object.defineProperties(t,n)}function W(t){return"object"==typeof t&&null!==t}var k=Object.freeze({__proto__:null,iterateObject:A,cloneObject:T,deepCloneObject:function(t){return JSON.parse(JSON.stringify(t))},deepCloneDefinition:_,getProperty:F,setProperty:N,copyPropertiesIfPresent:function(t,e){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];P(o,(function(o){return L(t,e,o)}))},copyPropertyIfPresent:L,getAllKeysInObjects:I,getAllValuesInObject:function(t){if(!t)return[];if("function"==typeof Object.values)return Object.values(t);var e=[];for(var o in t)t.hasOwnProperty(o)&&t.propertyIsEnumerable(o)&&e.push(t[o]);return e},mergeDeep:G,assign:M,missingOrEmptyObject:function(t){return o(t)||0===Object.keys(t).length},get:x,set:function(t,e,o){if(null!=t){for(var n=e.split("."),i=t;n.length>1;)if(null==(i=i[n.shift()]))return;i[n[0]]=o}},deepFreeze:function t(e){return Object.freeze(e),P(l(e),(function(e){(W(e)||"function"==typeof e)&&t(e)})),e},getValueUsingField:V,removeAllReferences:H,isNonNullObject:W}),B=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,j=/([^\s,]+)/g,U={};
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function z(t,e){U[e]||(t(),U[e]=!0)}function K(t){if(t.name)return t.name;var e=/function\s+([^\(]+)/.exec(t.toString());return e&&2===e.length?e[1].trim():null}function Y(t){return!!(t&&t.constructor&&t.call&&t.apply)}function q(t){Q(t,400)}function X(t){Q(t,0)}function Q(t,e){void 0===e&&(e=0),t.length>0&&window.setTimeout((function(){return t.forEach((function(t){return t()}))}),e)}function $(t,e,o){var n;return void 0===o&&(o=!1),function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var s=this,a=o&&!n;window.clearTimeout(n),n=window.setTimeout((function(){n=null,o||t.apply(s,i)}),e),a&&t.apply(s,i)}}function Z(t){t&&t()}var J=Object.freeze({__proto__:null,doOnce:z,getFunctionName:K,getFunctionParameters:function(t){var e=t.toString().replace(B,"");return e.slice(e.indexOf("(")+1,e.indexOf(")")).match(j)||[]},isFunction:Y,executeInAWhile:q,executeNextVMTurn:X,executeAfter:Q,debounce:$,compose:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.reduce((function(t,e){return e(t)}),e)}},callIfPresent:Z});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function tt(t,e,o){var n=lt(t.constructor);n.preConstructMethods||(n.preConstructMethods=[]),n.preConstructMethods.push(e)}function et(t,e,o){var n=lt(t.constructor);n.postConstructMethods||(n.postConstructMethods=[]),n.postConstructMethods.push(e)}function ot(t,e,o){var n=lt(t.constructor);n.preDestroyMethods||(n.preDestroyMethods=[]),n.preDestroyMethods.push(e)}function nt(t){return function(e){lt(e).beanName=t}}function it(t){return function(e,o,n){st(e,t,!1,e,o,null)}}function rt(t){return function(e,o,n){st(e,t,!0,e,o,null)}}function st(t,e,o,n,i,r){if(null!==e)if("number"!=typeof r){var s=lt(t.constructor);s.agClassAttributes||(s.agClassAttributes=[]),s.agClassAttributes.push({attributeName:i,beanName:e,optional:o})}else console.error("AG Grid: Autowired should be on an attribute");else console.error("AG Grid: Autowired name should not be null")}function at(t){return function(e,o,n){var i,r="function"==typeof e?e:e.constructor;if("number"==typeof n){var s=void 0;o?(i=lt(r),s=o):(i=lt(r),s="agConstructor"),i.autowireMethods||(i.autowireMethods={}),i.autowireMethods[s]||(i.autowireMethods[s]={}),i.autowireMethods[s][n]=t}}}function lt(t){return t.hasOwnProperty("__agBeanMetaData")||(t.__agBeanMetaData={}),t.__agBeanMetaData}
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/var pt,ut=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ct=function(t,e){return function(o,n){e(o,n,t)}},dt=function(){function t(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}return t.prototype.setBeans=function(t,e,o,n){if(void 0===n&&(n=null),this.logger=t.create("EventService"),this.frameworkOverrides=o,n){var i=e.useAsyncEvents();this.addGlobalListener(n,i)}},t.prototype.getListeners=function(t,e){var o=e?this.allAsyncListeners:this.allSyncListeners,n=o.get(t);return n||(n=new Set,o.set(t,n)),n},t.prototype.addEventListener=function(t,e,o){void 0===o&&(o=!1),this.getListeners(t,o).add(e)},t.prototype.removeEventListener=function(t,e,o){void 0===o&&(o=!1),this.getListeners(t,o).delete(e)},t.prototype.addGlobalListener=function(t,e){void 0===e&&(e=!1),(e?this.globalAsyncListeners:this.globalSyncListeners).add(t)},t.prototype.removeGlobalListener=function(t,e){void 0===e&&(e=!1),(e?this.globalAsyncListeners:this.globalSyncListeners).delete(t)},t.prototype.dispatchEvent=function(t){this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0},t.prototype.dispatchEventOnce=function(t){this.firedEvents[t.type]||this.dispatchEvent(t)},t.prototype.dispatchToListeners=function(t,e){var o=this,n=t.type;this.getListeners(n,e).forEach((function(n){e?o.dispatchAsync((function(){return n(t)})):n(t)})),(e?this.globalAsyncListeners:this.globalSyncListeners).forEach((function(i){e?o.dispatchAsync((function(){return o.frameworkOverrides.dispatchEvent(n,(function(){return i(n,t)}))})):o.frameworkOverrides.dispatchEvent(n,(function(){return i(n,t)}))}))},t.prototype.dispatchAsync=function(t){this.asyncFunctionsQueue.push(t),this.scheduled||(window.setTimeout(this.flushAsyncQueue.bind(this),0),this.scheduled=!0)},t.prototype.flushAsyncQueue=function(){this.scheduled=!1;var t=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],t.forEach((function(t){return t()}))},ut([ct(0,at("loggerFactory")),ct(1,at("gridOptionsWrapper")),ct(2,at("frameworkOverrides")),ct(3,at("globalEventListener"))],t.prototype,"setBeans",null),t=ut([nt("eventService")],t)}(),ht=function(){function t(){}return t.ROW_BUFFER_SIZE=10,t.LAYOUT_INTERVAL=500,t.BATCH_WAIT_MILLIS=50,t.EXPORT_TYPE_DRAG_COPY="dragCopy",t.EXPORT_TYPE_CLIPBOARD="clipboard",t.EXPORT_TYPE_EXCEL="excel",t.EXPORT_TYPE_CSV="csv",t.ROW_MODEL_TYPE_INFINITE="infinite",t.ROW_MODEL_TYPE_VIEWPORT="viewport",t.ROW_MODEL_TYPE_CLIENT_SIDE="clientSide",t.ROW_MODEL_TYPE_SERVER_SIDE="serverSide",t.ALWAYS="always",t.ONLY_WHEN_GROUPING="onlyWhenGrouping",t.PINNED_TOP="top",t.PINNED_BOTTOM="bottom",t.DOM_LAYOUT_NORMAL="normal",t.DOM_LAYOUT_PRINT="print",t.DOM_LAYOUT_AUTO_HEIGHT="autoHeight",t.GROUP_AUTO_COLUMN_ID="ag-Grid-AutoColumn",t.SOURCE_PASTE="paste",t.PINNED_RIGHT="right",t.PINNED_LEFT="left",t.SORT_ASC="asc",t.SORT_DESC="desc",t.INPUT_SELECTOR="input, select, button, textarea",t.FOCUSABLE_SELECTOR="[tabindex], input, select, button, textarea",t.FOCUSABLE_EXCLUDE=".ag-hidden, .ag-hidden *, [disabled], .ag-disabled, .ag-disabled *",t}();!function(t){t.CommunityCoreModule="@ag-grid-community/core",t.CommunityAllModules="@ag-grid-community/all",t.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",t.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",t.CsvExportModule="@ag-grid-community/csv-export",t.EnterpriseCoreModule="@ag-grid-enterprise/core",t.EnterpriseAllModules="@ag-grid-enterprise/all",t.RowGroupingModule="@ag-grid-enterprise/row-grouping",t.ColumnToolPanelModule="@ag-grid-enterprise/column-tool-panel",t.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",t.MenuModule="@ag-grid-enterprise/menu",t.SetFilterModule="@ag-grid-enterprise/set-filter",t.MultiFilterModule="@ag-grid-enterprise/multi-filter",t.StatusBarModule="@ag-grid-enterprise/status-bar",t.SideBarModule="@ag-grid-enterprise/side-bar",t.RangeSelectionModule="@ag-grid-enterprise/range-selection",t.MasterDetailModule="@ag-grid-enterprise/master-detail",t.RichSelectModule="@ag-grid-enterprise/rich-select",t.GridChartsModule="@ag-grid-enterprise/charts",t.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",t.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",t.ExcelExportModule="@ag-grid-enterprise/excel-export",t.ClipboardModule="@ag-grid-enterprise/clipboard",t.DateTimeCellEditorModule="@ag-grid-enterprise/date-time-cell-editor",t.AngularModule="@ag-grid-community/angular",t.ReactModule="@ag-grid-community/react",t.VueModule="@ag-grid-community/vue",t.PolymerModule="@ag-grid-community/polymer"}(pt||(pt={}));
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var ft=function(){function t(){}return t.register=function(e,o){void 0===o&&(o=!0),t.modulesMap[e.moduleName]=e,void 0===t.moduleBased?t.moduleBased=o:t.moduleBased!==o&&z((function(){console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/documentation/javascript/packages-modules/ for more information.")}),"ModulePackageCheck")},t.registerModules=function(e,o){void 0===o&&(o=!0),e&&e.forEach((function(e){return t.register(e,o)}))},t.assertRegistered=function(t,e){if(this.isRegistered(t))return!0;var o="AG Grid: unable to use "+e+" as module "+t+" is not present. Please see: https://www.ag-grid.com/documentation/javascript/modules/";return z((function(){console.warn(o)}),e+t),!1},t.isRegistered=function(e){return!!t.modulesMap[e]},t.getRegisteredModules=function(){return l(t.modulesMap)},t.isPackageBased=function(){return!t.moduleBased},t.modulesMap={},t}(),gt=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},yt=function(){function t(t,e,o,n){this.moving=!1,this.menuVisible=!1,this.filterActive=!1,this.eventService=new dt,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=t,this.userProvidedColDef=e,this.colId=o,this.primary=n,this.setState(t)}return t.prototype.setState=function(t){void 0!==t.sort?t.sort!==ht.SORT_ASC&&t.sort!==ht.SORT_DESC||(this.sort=t.sort):t.initialSort!==ht.SORT_ASC&&t.initialSort!==ht.SORT_DESC||(this.sort=t.initialSort);var e=r(t.sortIndex),o=r(t.initialSortIndex);void 0!==e?null!==e&&(this.sortIndex=e):null!==o&&(this.sortIndex=o);var n=s(t.hide),i=s(t.initialHide);this.visible=void 0!==n?!n:!i,void 0!==t.pinned?this.setPinned(t.pinned):this.setPinned(t.initialPinned);var a=r(t.flex),l=r(t.initialFlex);void 0!==a?this.flex=a:void 0!==l&&(this.flex=l)},t.prototype.setColDef=function(t,e){this.colDef=t,this.userProvidedColDef=e},t.prototype.getUserProvidedColDef=function(){return this.userProvidedColDef},t.prototype.setParent=function(t){this.parent=t},t.prototype.getParent=function(){return this.parent},t.prototype.setOriginalParent=function(t){this.originalParent=t},t.prototype.getOriginalParent=function(){return this.originalParent},t.prototype.initialise=function(){var t=this.gridOptionsWrapper.getMinColWidth(),o=this.gridOptionsWrapper.getMaxColWidth();null!=this.colDef.minWidth?this.minWidth=Math.max(this.colDef.minWidth,1):this.minWidth=t,null!=this.colDef.maxWidth?this.maxWidth=this.colDef.maxWidth:this.maxWidth=o,this.resetActualWidth("gridInitializing");var n=this.gridOptionsWrapper.isSuppressFieldDotNotation();this.fieldContainsDots=e(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!n,this.tooltipFieldContainsDots=e(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!n,this.validate()},t.prototype.resetActualWidth=function(t){void 0===t&&(t="api");var e=this.columnUtils.calculateColInitialWidth(this.colDef);this.setActualWidth(e,t,!0)},t.prototype.isEmptyGroup=function(){return!1},t.prototype.isRowGroupDisplayed=function(t){if(o(this.colDef)||o(this.colDef.showRowGroup))return!1;var e=!0===this.colDef.showRowGroup,n=this.colDef.showRowGroup===t;return e||n},t.prototype.getUniqueId=function(){return this.getId()},t.prototype.isPrimary=function(){return this.primary},t.prototype.isFilterAllowed=function(){var t=!!this.colDef.filter||!!this.colDef.filterFramework;return this.primary&&t},t.prototype.isFieldContainsDots=function(){return this.fieldContainsDots},t.prototype.isTooltipFieldContainsDots=function(){return this.tooltipFieldContainsDots},t.prototype.validate=function(){var t=this.colDef;function o(t,e,o){z((function(){o?console.warn(t,o):z((function(){return console.warn(t)}),e)}),e)}if(!ft.isRegistered(pt.RowGroupingModule)){["enableRowGroup","rowGroup","rowGroupIndex","enablePivot","enableValue","pivot","pivotIndex","aggFunc"].forEach((function(n){e(t[n])&&(ft.isPackageBased()?o("AG Grid: "+n+" is only valid in ag-grid-enterprise, your column definition should not have "+n,"ColumnRowGroupingMissing"+n):o("AG Grid: "+n+" is only valid with AG Grid Enterprise Module "+pt.RowGroupingModule+" - your column definition should not have "+n,"ColumnRowGroupingMissing"+n))}))}if(ft.isRegistered(pt.RichSelectModule)||"agRichSelect"!==this.colDef.cellEditor&&"agRichSelectCellEditor"!==this.colDef.cellEditor||(ft.isPackageBased()?o("AG Grid: "+this.colDef.cellEditor+" can only be used with ag-grid-enterprise","ColumnRichSelectMissing"):o("AG Grid: "+this.colDef.cellEditor+" can only be used with AG Grid Enterprise Module "+pt.RichSelectModule,"ColumnRichSelectMissing")),ft.isRegistered(pt.DateTimeCellEditorModule)||"agRichSelect"!==this.colDef.cellEditor&&"agDateTimeCellEditor"!==this.colDef.cellEditor||(ft.isPackageBased()?o("AG Grid: "+this.colDef.cellEditor+" can only be used with ag-grid-enterprise","ColumnDateTimeMissing"):o("AG Grid: "+this.colDef.cellEditor+" can only be used with AG Grid Enterprise Module "+pt.DateTimeCellEditorModule,"ColumnDateTimeMissing")),this.gridOptionsWrapper.isTreeData()){["rowGroup","rowGroupIndex","pivot","pivotIndex"].forEach((function(n){e(t[n])&&o("AG Grid: "+n+" is not possible when doing tree data, your column definition should not have "+n,"TreeDataCannotRowGroup")}))}e(this.colDef.width)&&"number"!=typeof this.colDef.width&&o("AG Grid: colDef.width should be a number, not "+typeof this.colDef.width,"ColumnCheck_asdfawef")},t.prototype.addEventListener=function(t,e){this.eventService.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.eventService.removeEventListener(t,e)},t.prototype.createColumnFunctionCallbackParams=function(t){return{node:t,data:t.data,column:this,colDef:this.colDef,context:this.gridOptionsWrapper.getContext(),api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()}},t.prototype.isSuppressNavigable=function(t){if("boolean"==typeof this.colDef.suppressNavigable)return this.colDef.suppressNavigable;if("function"==typeof this.colDef.suppressNavigable){var e=this.createColumnFunctionCallbackParams(t);return(0,this.colDef.suppressNavigable)(e)}return!1},t.prototype.isCellEditable=function(t){return!(t.group&&!this.gridOptionsWrapper.isEnableGroupEdit())&&this.isColumnFunc(t,this.colDef.editable)},t.prototype.isRowDrag=function(t){return this.isColumnFunc(t,this.colDef.rowDrag)},t.prototype.isDndSource=function(t){return this.isColumnFunc(t,this.colDef.dndSource)},t.prototype.isCellCheckboxSelection=function(t){return this.isColumnFunc(t,this.colDef.checkboxSelection)},t.prototype.isSuppressPaste=function(t){return this.isColumnFunc(t,this.colDef?this.colDef.suppressPaste:null)},t.prototype.isResizable=function(){return!0===this.colDef.resizable},t.prototype.isColumnFunc=function(t,e){return"boolean"==typeof e?e:"function"==typeof e&&e(this.createColumnFunctionCallbackParams(t))},t.prototype.setMoving=function(e,o){void 0===o&&(o="api"),this.moving=e,this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_MOVING_CHANGED,o))},t.prototype.createColumnEvent=function(t,e){return{api:this.gridApi,columnApi:this.columnApi,type:t,column:this,columns:[this],source:e}},t.prototype.isMoving=function(){return this.moving},t.prototype.getSort=function(){return this.sort},t.prototype.setSort=function(e,o){void 0===o&&(o="api"),this.sort!==e&&(this.sort=e,this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_SORT_CHANGED,o)))},t.prototype.setMenuVisible=function(e,o){void 0===o&&(o="api"),this.menuVisible!==e&&(this.menuVisible=e,this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_MENU_VISIBLE_CHANGED,o)))},t.prototype.isMenuVisible=function(){return this.menuVisible},t.prototype.isSortAscending=function(){return this.sort===ht.SORT_ASC},t.prototype.isSortDescending=function(){return this.sort===ht.SORT_DESC},t.prototype.isSortNone=function(){return o(this.sort)},t.prototype.isSorting=function(){return e(this.sort)},t.prototype.getSortIndex=function(){return this.sortIndex},t.prototype.setSortIndex=function(t){this.sortIndex=t},t.prototype.setAggFunc=function(t){this.aggFunc=t},t.prototype.getAggFunc=function(){return this.aggFunc},t.prototype.getLeft=function(){return this.left},t.prototype.getOldLeft=function(){return this.oldLeft},t.prototype.getRight=function(){return this.left+this.actualWidth},t.prototype.setLeft=function(e,o){void 0===o&&(o="api"),this.oldLeft=this.left,this.left!==e&&(this.left=e,this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_LEFT_CHANGED,o)))},t.prototype.isFilterActive=function(){return this.filterActive},t.prototype.setFilterActive=function(e,o,n){void 0===o&&(o="api"),this.filterActive!==e&&(this.filterActive=e,this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_FILTER_ACTIVE_CHANGED,o)));var i=this.createColumnEvent(t.EVENT_FILTER_CHANGED,o);n&&G(i,n),this.eventService.dispatchEvent(i)},t.prototype.setPinned=function(t){!0===t||t===ht.PINNED_LEFT?this.pinned=ht.PINNED_LEFT:t===ht.PINNED_RIGHT?this.pinned=ht.PINNED_RIGHT:this.pinned=null},t.prototype.setFirstRightPinned=function(e,o){void 0===o&&(o="api"),this.firstRightPinned!==e&&(this.firstRightPinned=e,this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_FIRST_RIGHT_PINNED_CHANGED,o)))},t.prototype.setLastLeftPinned=function(e,o){void 0===o&&(o="api"),this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_LAST_LEFT_PINNED_CHANGED,o)))},t.prototype.isFirstRightPinned=function(){return this.firstRightPinned},t.prototype.isLastLeftPinned=function(){return this.lastLeftPinned},t.prototype.isPinned=function(){return this.pinned===ht.PINNED_LEFT||this.pinned===ht.PINNED_RIGHT},t.prototype.isPinnedLeft=function(){return this.pinned===ht.PINNED_LEFT},t.prototype.isPinnedRight=function(){return this.pinned===ht.PINNED_RIGHT},t.prototype.getPinned=function(){return this.pinned},t.prototype.setVisible=function(e,o){void 0===o&&(o="api");var n=!0===e;this.visible!==n&&(this.visible=n,this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_VISIBLE_CHANGED,o)))},t.prototype.isVisible=function(){return this.visible},t.prototype.getColDef=function(){return this.colDef},t.prototype.getColumnGroupShow=function(){return this.colDef.columnGroupShow},t.prototype.getColId=function(){return this.colId},t.prototype.getId=function(){return this.getColId()},t.prototype.getDefinition=function(){return this.colDef},t.prototype.getActualWidth=function(){return this.actualWidth},t.prototype.createBaseColDefParams=function(t){return{node:t,data:t.data,colDef:this.colDef,column:this,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()}},t.prototype.getColSpan=function(t){if(o(this.colDef.colSpan))return 1;var e=this.createBaseColDefParams(t),n=this.colDef.colSpan(e);return Math.max(n,1)},t.prototype.getRowSpan=function(t){if(o(this.colDef.rowSpan))return 1;var e=this.createBaseColDefParams(t),n=this.colDef.rowSpan(e);return Math.max(n,1)},t.prototype.setActualWidth=function(t,e,o){void 0===e&&(e="api"),void 0===o&&(o=!1),null!=this.minWidth&&(t=Math.max(t,this.minWidth)),null!=this.maxWidth&&(t=Math.min(t,this.maxWidth)),this.actualWidth!==t&&(this.actualWidth=t,this.flex&&"flex"!==e&&"gridInitializing"!==e&&(this.flex=null),o||this.fireColumnWidthChangedEvent(e))},t.prototype.fireColumnWidthChangedEvent=function(e){this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_WIDTH_CHANGED,e))},t.prototype.isGreaterThanMax=function(t){return null!=this.maxWidth&&t>this.maxWidth},t.prototype.getMinWidth=function(){return this.minWidth},t.prototype.getMaxWidth=function(){return this.maxWidth},t.prototype.getFlex=function(){return this.flex||0},t.prototype.setFlex=function(t){this.flex!==t&&(this.flex=t)},t.prototype.setMinimum=function(t){void 0===t&&(t="api"),e(this.minWidth)&&this.setActualWidth(this.minWidth,t)},t.prototype.setRowGroupActive=function(e,o){void 0===o&&(o="api"),this.rowGroupActive!==e&&(this.rowGroupActive=e,this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_ROW_GROUP_CHANGED,o)))},t.prototype.isRowGroupActive=function(){return this.rowGroupActive},t.prototype.setPivotActive=function(e,o){void 0===o&&(o="api"),this.pivotActive!==e&&(this.pivotActive=e,this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_PIVOT_CHANGED,o)))},t.prototype.isPivotActive=function(){return this.pivotActive},t.prototype.isAnyFunctionActive=function(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()},t.prototype.isAnyFunctionAllowed=function(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()},t.prototype.setValueActive=function(e,o){void 0===o&&(o="api"),this.aggregationActive!==e&&(this.aggregationActive=e,this.eventService.dispatchEvent(this.createColumnEvent(t.EVENT_VALUE_CHANGED,o)))},t.prototype.isValueActive=function(){return this.aggregationActive},t.prototype.isAllowPivot=function(){return!0===this.colDef.enablePivot},t.prototype.isAllowValue=function(){return!0===this.colDef.enableValue},t.prototype.isAllowRowGroup=function(){return!0===this.colDef.enableRowGroup},t.prototype.getMenuTabs=function(t){var e=this.getColDef().menuTabs;return null==e&&(e=t),e},t.prototype.isLockPosition=function(){return console.warn("AG Grid: since v21, col.isLockPosition() should not be used, please use col.getColDef().lockPosition instead."),!!this.colDef&&!!this.colDef.lockPosition},t.prototype.isLockVisible=function(){return console.warn("AG Grid: since v21, col.isLockVisible() should not be used, please use col.getColDef().lockVisible instead."),!!this.colDef&&!!this.colDef.lockVisible},t.prototype.isLockPinned=function(){return console.warn("AG Grid: since v21, col.isLockPinned() should not be used, please use col.getColDef().lockPinned instead."),!!this.colDef&&!!this.colDef.lockPinned},t.EVENT_MOVING_CHANGED="movingChanged",t.EVENT_LEFT_CHANGED="leftChanged",t.EVENT_WIDTH_CHANGED="widthChanged",t.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",t.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",t.EVENT_VISIBLE_CHANGED="visibleChanged",t.EVENT_FILTER_CHANGED="filterChanged",t.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",t.EVENT_SORT_CHANGED="sortChanged",t.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",t.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",t.EVENT_PIVOT_CHANGED="columnPivotChanged",t.EVENT_VALUE_CHANGED="columnValueChanged",gt([it("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),gt([it("columnUtils")],t.prototype,"columnUtils",void 0),gt([it("columnApi")],t.prototype,"columnApi",void 0),gt([it("gridApi")],t.prototype,"gridApi",void 0),gt([it("context")],t.prototype,"context",void 0),gt([et],t.prototype,"initialise",null),t}(),vt=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},mt=function(){function t(t,e,o,n){this.displayedChildren=[],this.localEventService=new dt,this.groupId=e,this.instanceId=o,this.originalColumnGroup=t,this.pinned=n}return t.createUniqueId=function(t,e){return t+"_"+e},t.prototype.reset=function(){this.parent=null,this.children=null,this.displayedChildren=null},t.prototype.getParent=function(){return this.parent},t.prototype.setParent=function(t){this.parent=t},t.prototype.getUniqueId=function(){return t.createUniqueId(this.groupId,this.instanceId)},t.prototype.isEmptyGroup=function(){return 0===this.displayedChildren.length},t.prototype.isMoving=function(){var t=this.getOriginalColumnGroup().getLeafColumns();return!(!t||0===t.length)&&t.every((function(t){return t.isMoving()}))},t.prototype.checkLeft=function(){if(this.displayedChildren.forEach((function(e){e instanceof t&&e.checkLeft()})),this.displayedChildren.length>0)if(this.gridOptionsWrapper.isEnableRtl()){var e=d(this.displayedChildren).getLeft();this.setLeft(e)}else{var o=this.displayedChildren[0].getLeft();this.setLeft(o)}else this.setLeft(null)},t.prototype.getLeft=function(){return this.left},t.prototype.getOldLeft=function(){return this.oldLeft},t.prototype.setLeft=function(e){this.oldLeft=e,this.left!==e&&(this.left=e,this.localEventService.dispatchEvent(this.createAgEvent(t.EVENT_LEFT_CHANGED)))},t.prototype.getPinned=function(){return this.pinned},t.prototype.createAgEvent=function(t){return{type:t}},t.prototype.addEventListener=function(t,e){this.localEventService.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.localEventService.removeEventListener(t,e)},t.prototype.getGroupId=function(){return this.groupId},t.prototype.getInstanceId=function(){return this.instanceId},t.prototype.isChildInThisGroupDeepSearch=function(e){var o=!1;return this.children.forEach((function(n){e===n&&(o=!0),n instanceof t&&n.isChildInThisGroupDeepSearch(e)&&(o=!0)})),o},t.prototype.getActualWidth=function(){var t=0;return this.displayedChildren&&this.displayedChildren.forEach((function(e){t+=e.getActualWidth()})),t},t.prototype.isResizable=function(){if(!this.displayedChildren)return!1;var t=!1;return this.displayedChildren.forEach((function(e){e.isResizable()&&(t=!0)})),t},t.prototype.getMinWidth=function(){var t=0;return this.displayedChildren.forEach((function(e){t+=e.getMinWidth()||0})),t},t.prototype.addChild=function(t){this.children||(this.children=[]),this.children.push(t)},t.prototype.getDisplayedChildren=function(){return this.displayedChildren},t.prototype.getLeafColumns=function(){var t=[];return this.addLeafColumns(t),t},t.prototype.getDisplayedLeafColumns=function(){var t=[];return this.addDisplayedLeafColumns(t),t},t.prototype.getDefinition=function(){return this.originalColumnGroup.getColGroupDef()},t.prototype.getColGroupDef=function(){return this.originalColumnGroup.getColGroupDef()},t.prototype.isPadding=function(){return this.originalColumnGroup.isPadding()},t.prototype.isExpandable=function(){return this.originalColumnGroup.isExpandable()},t.prototype.isExpanded=function(){return this.originalColumnGroup.isExpanded()},t.prototype.setExpanded=function(t){this.originalColumnGroup.setExpanded(t)},t.prototype.addDisplayedLeafColumns=function(e){this.displayedChildren.forEach((function(o){o instanceof yt?e.push(o):o instanceof t&&o.addDisplayedLeafColumns(e)}))},t.prototype.addLeafColumns=function(e){this.children.forEach((function(o){o instanceof yt?e.push(o):o instanceof t&&o.addLeafColumns(e)}))},t.prototype.getChildren=function(){return this.children},t.prototype.getColumnGroupShow=function(){return this.originalColumnGroup.getColumnGroupShow()},t.prototype.getOriginalColumnGroup=function(){return this.originalColumnGroup},t.prototype.getPaddingLevel=function(){var t=this.getParent();return this.isPadding()&&t&&t.isPadding()?1+t.getPaddingLevel():0},t.prototype.calculateDisplayedColumns=function(){var e=this;this.displayedChildren=[];for(var o=this;null!=o&&o.isPadding();)o=o.getParent();!!o&&o.originalColumnGroup.isExpandable()?(this.children.forEach((function(n){if(!(n instanceof t&&(!n.displayedChildren||!n.displayedChildren.length)))switch(n.getColumnGroupShow()){case t.HEADER_GROUP_SHOW_OPEN:o.originalColumnGroup.isExpanded()&&e.displayedChildren.push(n);break;case t.HEADER_GROUP_SHOW_CLOSED:o.originalColumnGroup.isExpanded()||e.displayedChildren.push(n);break;default:e.displayedChildren.push(n)}})),this.localEventService.dispatchEvent(this.createAgEvent(t.EVENT_DISPLAYED_CHILDREN_CHANGED))):this.displayedChildren=this.children},t.HEADER_GROUP_SHOW_OPEN="open",t.HEADER_GROUP_SHOW_CLOSED="closed",t.EVENT_LEFT_CHANGED="leftChanged",t.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",vt([it("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),t}(),Ct=function(){function t(t,e,o,n){this.localEventService=new dt,this.expandable=!1,this.colGroupDef=t,this.groupId=e,this.expanded=!!t&&!!t.openByDefault,this.padding=o,this.level=n}return t.prototype.setOriginalParent=function(t){this.originalParent=t},t.prototype.getOriginalParent=function(){return this.originalParent},t.prototype.getLevel=function(){return this.level},t.prototype.isVisible=function(){return!!this.children&&this.children.some((function(t){return t.isVisible()}))},t.prototype.isPadding=function(){return this.padding},t.prototype.setExpanded=function(e){this.expanded=void 0!==e&&e;var o={type:t.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(o)},t.prototype.isExpandable=function(){return this.expandable},t.prototype.isExpanded=function(){return this.expanded},t.prototype.getGroupId=function(){return this.groupId},t.prototype.getId=function(){return this.getGroupId()},t.prototype.setChildren=function(t){this.children=t},t.prototype.getChildren=function(){return this.children},t.prototype.getColGroupDef=function(){return this.colGroupDef},t.prototype.getLeafColumns=function(){var t=[];return this.addLeafColumns(t),t},t.prototype.addLeafColumns=function(e){this.children&&this.children.forEach((function(o){o instanceof yt?e.push(o):o instanceof t&&o.addLeafColumns(e)}))},t.prototype.getColumnGroupShow=function(){var t=this.colGroupDef;if(t)return t.columnGroupShow},t.prototype.setupExpandable=function(){var t=this;this.setExpandable(),this.getLeafColumns().forEach((function(e){return e.addEventListener(yt.EVENT_VISIBLE_CHANGED,t.onColumnVisibilityChanged.bind(t))}))},t.prototype.setExpandable=function(){if(!this.isPadding()){for(var e=!1,o=!1,n=!1,i=this.findChildrenRemovingPadding(),r=0,s=i.length;r<s;r++){var a=i[r];if(a.isVisible()){var l=a.getColumnGroupShow();l===mt.HEADER_GROUP_SHOW_OPEN?(e=!0,n=!0):l===mt.HEADER_GROUP_SHOW_CLOSED?(o=!0,n=!0):(e=!0,o=!0)}}var p=e&&o&&n;if(this.expandable!==p){this.expandable=p;var u={type:t.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(u)}}},t.prototype.findChildrenRemovingPadding=function(){var e=[],o=function(n){n.forEach((function(n){n instanceof t&&n.isPadding()?o(n.children):e.push(n)}))};return o(this.children),e},t.prototype.onColumnVisibilityChanged=function(){this.setExpandable()},t.prototype.addEventListener=function(t,e){this.localEventService.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.localEventService.removeEventListener(t,e)},t.EVENT_EXPANDED_CHANGED="expandedChanged",t.EVENT_EXPANDABLE_CHANGED="expandableChanged",t}(),wt={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},Et=["touchstart","touchend","touchmove","touchcancel"],Rt={};
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function Ot(t){t.__ag_Grid_Stop_Propagation=!0}function Pt(t){return!0===t.__ag_Grid_Stop_Propagation}var St,bt=(St={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},function(t){if("boolean"==typeof Rt[t])return Rt[t];var e=document.createElement(St[t]||"div"),o=(t="on"+t)in e;return o||(e.setAttribute(t,"return;"),o="function"==typeof e[t]),Rt[t]=o});function Dt(t,e,o){for(var n=At(e);n;){var i=t.getDomData(n,o);if(i)return i;n=n.parentElement}return null}function At(t){var e=t;return e.target||e.srcElement}function Tt(t,e){return!(!e||!t)&&Ft(e).indexOf(t)>=0}function _t(t){for(var e=[],o=At(t);o;)e.push(o),o=o.parentElement;return e}function Ft(t){var e=t;return e.deepPath?e.deepPath():e.path?e.path:e.composedPath?e.composedPath():e.__agGridEventPath?e.__agGridEventPath:_t(t)}function Nt(t,e,o,n){var i=C(Et,o)?{passive:!0}:void 0;t&&t.addEventListener&&t.addEventListener(e,o,n,i)}var Lt,It=Object.freeze({__proto__:null,stopPropagationForAgGrid:Ot,isStopPropagationForAgGrid:Pt,isEventSupported:bt,getComponentForEvent:Dt,addChangeListener:function(t,e){t.addEventListener("changed",e),t.addEventListener("paste",e),t.addEventListener("input",e),t.addEventListener("keydown",e),t.addEventListener("keyup",e)},getTarget:At,isElementInEventPath:Tt,createEventPath:_t,addAgGridEventPath:function(t){t.__agGridEventPath=Ft(t)},getEventPath:Ft,addSafePassiveEventListener:Nt}),Gt=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Mt=function(){function t(){var t=this;this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.getContext=function(){return t.context},this.isAlive=function(){return!t.destroyed}}return t.prototype.getFrameworkOverrides=function(){return this.frameworkOverrides},t.prototype.destroy=function(){this.destroyFunctions.forEach((function(t){return t()})),this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:t.EVENT_DESTROYED})},t.prototype.addEventListener=function(t,e){this.localEventService||(this.localEventService=new dt),this.localEventService.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.localEventService&&this.localEventService.removeEventListener(t,e)},t.prototype.dispatchEventAsync=function(t){var e=this;window.setTimeout((function(){return e.dispatchEvent(t)}),0)},t.prototype.dispatchEvent=function(t){this.localEventService&&this.localEventService.dispatchEvent(t)},t.prototype.addManagedListener=function(t,e,o){var n=this;if(!this.destroyed){t instanceof HTMLElement?Nt(this.getFrameworkOverrides(),t,e,o):t.addEventListener(e,o);var i=function(){return t.removeEventListener(e,o),n.destroyFunctions=n.destroyFunctions.filter((function(t){return t!==i})),null};return this.destroyFunctions.push(i),i}},t.prototype.addDestroyFunc=function(t){this.isAlive()?this.destroyFunctions.push(t):t()},t.prototype.createManagedBean=function(t,e){var o=this.createBean(t,e);return this.addDestroyFunc(this.destroyBean.bind(this,t,e)),o},t.prototype.createBean=function(t,e,o){return(e||this.getContext()).createBean(t,o)},t.prototype.destroyBean=function(t,e){return(e||this.getContext()).destroyBean(t)},t.prototype.destroyBeans=function(t,e){var o=this;return t&&P(t,(function(t){return o.destroyBean(t,e)})),[]},t.EVENT_DESTROYED="destroyed",Gt([it("frameworkOverrides")],t.prototype,"frameworkOverrides",void 0),Gt([it("context")],t.prototype,"context",void 0),Gt([it("eventService")],t.prototype,"eventService",void 0),Gt([it("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),Gt([ot],t.prototype,"destroy",null),t}(),xt=(Lt=function(t,e){return(Lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}Lt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Vt=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ht=function(t,e){return function(o,n){e(o,n,t)}},Wt=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}xt(e,t),e.prototype.setBeans=function(t){this.logger=t.create("ColumnFactory")},e.prototype.createColumnTree=function(t,e,o){var n=new u,i=this.extractExistingTreeData(o),r=i.existingCols,s=i.existingGroups,a=i.existingColKeys;n.addExistingKeys(a);var l=this.recursivelyCreateColumns(t,0,e,r,n,s),p=this.findMaxDept(l,0);this.logger.log("Number of levels for grouped columns is "+p);var c=this.balanceColumnTree(l,0,p,n);return this.columnUtils.depthFirstOriginalTreeSearch(null,c,(function(t,e){t instanceof Ct&&t.setupExpandable(),t.setOriginalParent(e)})),{columnTree:c,treeDept:p}},e.prototype.extractExistingTreeData=function(t){var e=[],o=[],n=[];return t&&this.columnUtils.depthFirstOriginalTreeSearch(null,t,(function(t){if(t instanceof Ct){var i=t;o.push(i)}else{var r=t;n.push(r.getId()),e.push(r)}})),{existingCols:e,existingGroups:o,existingColKeys:n}},e.prototype.createForAutoGroups=function(t,e){var o=this,n=[];return t.forEach((function(t){var i=o.createAutoGroupTreeItem(e,t);n.push(i)})),n},e.prototype.createAutoGroupTreeItem=function(t,e){for(var o=e,n=this.findDepth(t)-1;n>=0;n--){var i=new Ct(null,"FAKE_PATH_"+e.getId()+"}_"+n,!0,n);this.context.createBean(i),i.setChildren([o]),o.setOriginalParent(i),o=i}return o},e.prototype.findDepth=function(t){for(var e=0,o=t;o&&o[0]&&o[0]instanceof Ct;)e++,o=o[0].getChildren();return e},e.prototype.balanceColumnTree=function(t,e,o,n){for(var i=[],r=0;r<t.length;r++){var s=t[r];if(s instanceof Ct){var a=s,l=this.balanceColumnTree(a.getChildren(),e+1,o,n);a.setChildren(l),i.push(a)}else{for(var p=void 0,u=void 0,c=o-1;c>=e;c--){var d=n.getUniqueKey(null,null),h=this.createMergedColGroupDef(null),f=new Ct(h,d,!0,e);this.context.createBean(f),u&&u.setChildren([f]),u=f,p||(p=u)}if(p&&u){if(i.push(p),t.some((function(t){return t instanceof Ct}))){u.setChildren([s]);continue}u.setChildren(t);break}i.push(s)}}return i},e.prototype.findMaxDept=function(t,e){for(var o=e,n=0;n<t.length;n++){var i=t[n];if(i instanceof Ct){var r=i,s=this.findMaxDept(r.getChildren(),e+1);o<s&&(o=s)}}return o},e.prototype.recursivelyCreateColumns=function(t,e,o,n,i,r){var s=this,a=[];return t?(t.forEach((function(t){var l;l=s.isColumnGroup(t)?s.createColumnGroup(o,t,e,n,i,r):s.createColumn(o,t,n,i),a.push(l)})),a):a},e.prototype.createColumnGroup=function(t,e,o,n,i,r){var s=this.createMergedColGroupDef(e),a=i.getUniqueKey(s.groupId||null,null),l=new Ct(s,a,!1,o);this.context.createBean(l);var p=this.findExistingGroup(e,r);p&&p.isExpanded()&&l.setExpanded(!0);var u=this.recursivelyCreateColumns(s.children,o+1,t,n,i,r);return l.setChildren(u),l},e.prototype.createMergedColGroupDef=function(t){var e={};return M(e,this.gridOptionsWrapper.getDefaultColGroupDef()),M(e,t),this.checkForDeprecatedItems(e),e},e.prototype.createColumn=function(t,e,o,n){var i=this.mergeColDefs(e);this.checkForDeprecatedItems(i);var r=this.findExistingColumn(e,o);if(r)r.setColDef(i,e),this.applyColumnState(r,i);else{var s=n.getUniqueKey(i.colId,i.field);r=new yt(i,e,s,t),this.context.createBean(r)}return r},e.prototype.applyColumnState=function(t,e){var o=r(e.flex);if(void 0!==o&&t.setFlex(o),t.getFlex()<=0){var n=r(e.width);null!=n&&t.setActualWidth(n)}void 0!==e.sort&&(e.sort==ht.SORT_ASC||e.sort==ht.SORT_DESC?t.setSort(e.sort):t.setSort(void 0));var i=r(e.sortIndex);void 0!==i&&t.setSortIndex(i);var a=s(e.hide);void 0!==a&&t.setVisible(!a),void 0!==e.pinned&&t.setPinned(e.pinned)},e.prototype.findExistingColumn=function(t,e){var o=a(e,(function(e){var o=e.getUserProvidedColDef();if(!o)return!1;var n=null!=t.colId,i=null!=t.field;return n?e.getId()===t.colId:i?o.field===t.field:o===t}));return e&&o&&g(e,o),o},e.prototype.findExistingGroup=function(t,e){var o=a(e,(function(e){return!!e.getColGroupDef()&&(!(null==t.groupId)&&e.getId()===t.groupId)}));return o&&g(e,o),o},e.prototype.mergeColDefs=function(t){var e={},o=this.gridOptionsWrapper.getDefaultColDef();G(e,o,!0,!0);var n=t.type;return n||(n=o&&o.type),n&&this.assignColumnTypes(n,e),G(e,t,!0,!0),e},e.prototype.assignColumnTypes=function(t,e){var o=[];if(t instanceof Array){t.some((function(t){return"string"!=typeof t}))?console.warn("ag-grid: if colDef.type is supplied an array it should be of type 'string[]'"):o=t}else{if("string"!=typeof t)return void console.warn("ag-grid: colDef.type should be of type 'string' | 'string[]'");o=t.split(",")}var n=M({},wt);A(this.gridOptionsWrapper.getColumnTypes()||{},(function(t,e){t in n?console.warn("AG Grid: the column type '"+t+"' is a default column type and cannot be overridden."):n[t]=e})),o.forEach((function(t){var o=n[t.trim()];o?G(e,o,!0,!0):console.warn("ag-grid: colDef.type '"+t+"' does not correspond to defined gridOptions.columnTypes")}))},e.prototype.checkForDeprecatedItems=function(t){if(t){var e=t;void 0!==e.group&&console.warn("ag-grid: colDef.group is invalid, please check documentation on how to do grouping as it changed in version 3"),void 0!==e.headerGroup&&console.warn("ag-grid: colDef.headerGroup is invalid, please check documentation on how to do grouping as it changed in version 3"),void 0!==e.headerGroupShow&&console.warn("ag-grid: colDef.headerGroupShow is invalid, should be columnGroupShow, please check documentation on how to do grouping as it changed in version 3"),void 0!==e.suppressRowGroup&&console.warn("ag-grid: colDef.suppressRowGroup is deprecated, please use colDef.type instead"),void 0!==e.suppressAggregation&&console.warn("ag-grid: colDef.suppressAggregation is deprecated, please use colDef.type instead"),(e.suppressRowGroup||e.suppressAggregation)&&console.warn("ag-grid: colDef.suppressAggregation and colDef.suppressRowGroup are deprecated, use allowRowGroup, allowPivot and allowValue instead"),e.displayName&&(console.warn("ag-grid: Found displayName "+e.displayName+", please use headerName instead, displayName is deprecated."),e.headerName=e.displayName)}},e.prototype.isColumnGroup=function(t){return void 0!==t.children},Vt([it("columnUtils")],e.prototype,"columnUtils",void 0),Vt([Ht(0,at("loggerFactory"))],e.prototype,"setBeans",null),e=Vt([nt("columnFactory")],e)}(Mt),function(){function t(){}return t.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",t.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",t.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",t.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",t.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",t.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged",t.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged",t.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged",t.EVENT_COLUMN_MOVED="columnMoved",t.EVENT_COLUMN_VISIBLE="columnVisible",t.EVENT_COLUMN_PINNED="columnPinned",t.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",t.EVENT_COLUMN_RESIZED="columnResized",t.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged",t.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged",t.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed",t.EVENT_ROW_GROUP_OPENED="rowGroupOpened",t.EVENT_ROW_DATA_CHANGED="rowDataChanged",t.EVENT_ROW_DATA_UPDATED="rowDataUpdated",t.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged",t.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged",t.EVENT_CHART_CREATED="chartCreated",t.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged",t.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged",t.EVENT_CHART_DESTROYED="chartDestroyed",t.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged",t.EVENT_MODEL_UPDATED="modelUpdated",t.EVENT_PASTE_START="pasteStart",t.EVENT_PASTE_END="pasteEnd",t.EVENT_FILL_START="fillStart",t.EVENT_FILL_END="fillEnd",t.EVENT_CELL_CLICKED="cellClicked",t.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",t.EVENT_CELL_MOUSE_DOWN="cellMouseDown",t.EVENT_CELL_CONTEXT_MENU="cellContextMenu",t.EVENT_CELL_VALUE_CHANGED="cellValueChanged",t.EVENT_ROW_VALUE_CHANGED="rowValueChanged",t.EVENT_CELL_FOCUSED="cellFocused",t.EVENT_ROW_SELECTED="rowSelected",t.EVENT_SELECTION_CHANGED="selectionChanged",t.EVENT_CELL_KEY_DOWN="cellKeyDown",t.EVENT_CELL_KEY_PRESS="cellKeyPress",t.EVENT_CELL_MOUSE_OVER="cellMouseOver",t.EVENT_CELL_MOUSE_OUT="cellMouseOut",t.EVENT_FILTER_CHANGED="filterChanged",t.EVENT_FILTER_MODIFIED="filterModified",t.EVENT_FILTER_OPENED="filterOpened",t.EVENT_SORT_CHANGED="sortChanged",t.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved",t.EVENT_ROW_CLICKED="rowClicked",t.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked",t.EVENT_GRID_READY="gridReady",t.EVENT_GRID_SIZE_CHANGED="gridSizeChanged",t.EVENT_VIEWPORT_CHANGED="viewportChanged",t.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged",t.EVENT_FIRST_DATA_RENDERED="firstDataRendered",t.EVENT_DRAG_STARTED="dragStarted",t.EVENT_DRAG_STOPPED="dragStopped",t.EVENT_CHECKBOX_CHANGED="checkboxChanged",t.EVENT_ROW_EDITING_STARTED="rowEditingStarted",t.EVENT_ROW_EDITING_STOPPED="rowEditingStopped",t.EVENT_CELL_EDITING_STARTED="cellEditingStarted",t.EVENT_CELL_EDITING_STOPPED="cellEditingStopped",t.EVENT_BODY_SCROLL="bodyScroll",t.EVENT_ANIMATION_QUEUE_EMPTY="animationQueueEmpty",t.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged",t.EVENT_PAGINATION_CHANGED="paginationChanged",t.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged",t.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged",t.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged",t.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged",t.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged",t.EVENT_FLASH_CELLS="flashCells",t.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOffsetChanged",t.EVENT_ROW_DRAG_ENTER="rowDragEnter",t.EVENT_ROW_DRAG_MOVE="rowDragMove",t.EVENT_ROW_DRAG_LEAVE="rowDragLeave",t.EVENT_ROW_DRAG_END="rowDragEnd",t.EVENT_POPUP_TO_FRONT="popupToFront",t.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest",t.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest",t.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest",t.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest",t.EVENT_KEYBOARD_FOCUS="keyboardFocus",t.EVENT_MOUSE_FOCUS="mouseFocus",t.EVENT_STORE_UPDATED="storeUpdated",t}()),kt=function(){function t(){this.existingIds={}}return t.prototype.getInstanceIdForKey=function(t){var e,o=this.existingIds[t];return e="number"!=typeof o?0:o+1,this.existingIds[t]=e,e},t}(),Bt=/[&<>"']/g,jt={"&":"&","<":"<",">":">",'"':""","'":"'"};
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function Ut(t){return null==t?null:t.replace(/([A-Z])/g,(function(t){return"-"+t[0].toLowerCase()}))}function zt(t){return null==t?null:t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}function Kt(t){return null!=t&&t.replace?t.replace(Bt,(function(t){return jt[t]})):t}function Yt(t){if(!t||null==t)return null;return t.replace(/([A-Z])([A-Z])([a-z])|([a-z])([A-Z])/g,"$1$4 $2$3$5").replace("."," ").split(" ").map((function(t){return t.substring(0,1).toUpperCase()+(t.length>1?t.substring(1,t.length):"")})).join(" ")}function qt(t,e){return t===e||null!=t&&t.slice(0,e.length)===e}var Xt=Object.freeze({__proto__:null,utf8_encode:function(t){var e=String.fromCharCode;function o(t,o){return e(t>>o&63|128)}function n(t){if(0==(4294967168&t))return e(t);var n="";return 0==(4294965248&t)?n=e(t>>6&31|192):0==(4294901760&t)?(!function(t){if(t>=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}(t),n=e(t>>12&15|224),n+=o(t,6)):0==(4292870144&t)&&(n=e(t>>18&7|240),n+=o(t,12),n+=o(t,6)),n+=e(63&t|128)}for(var i=function(t){var e=[];if(!t)return[];for(var o,n,i=t.length,r=0;r<i;)(o=t.charCodeAt(r++))>=55296&&o<=56319&&r<i?56320==(64512&(n=t.charCodeAt(r++)))?e.push(((1023&o)<<10)+(1023&n)+65536):(e.push(o),r--):e.push(o);return e}(t),r=i.length,s=-1,a="";++s<r;)a+=n(i[s]);return a},camelCaseToHyphen:Ut,hyphenToCamelCase:zt,capitalise:function(t){return t[0].toUpperCase()+t.substr(1).toLowerCase()},escapeString:Kt,camelCaseToHumanText:Yt,startsWith:qt}),Qt=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),$t=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Zt=function(t,e){return function(o,n){e(o,n,t)}};
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/!function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.primaryHeaderRowCount=0,e.secondaryHeaderRowCount=0,e.secondaryColumnsPresent=!1,e.gridHeaderRowCount=0,e.displayedColumnsLeft=[],e.displayedColumnsRight=[],e.displayedColumnsCenter=[],e.displayedColumns=[],e.displayedColumnsAndGroupsMap={},e.viewportColumns=[],e.viewportColumnsCenter=[],e.rowGroupColumns=[],e.valueColumns=[],e.pivotColumns=[],e.ready=!1,e.autoGroupsNeedBuilding=!1,e.forceRecreateAutoGroups=!1,e.pivotMode=!1,e.bodyWidth=0,e.leftWidth=0,e.rightWidth=0,e.bodyWidthDirty=!0,e.colDefVersion=0,e.flexColsCalculatedAtLestOnce=!1,e}Qt(i,t),i.prototype.init=function(){this.suppressColumnVirtualisation=this.gridOptionsWrapper.isSuppressColumnVirtualisation();var t=this.gridOptionsWrapper.isPivotMode();this.isPivotSettingAllowed(t)&&(this.pivotMode=t),this.usingTreeData=this.gridOptionsWrapper.isTreeData(),this.addManagedListener(this.gridOptionsWrapper,"autoGroupColumnDef",this.onAutoGroupColumnDefChanged.bind(this))},i.prototype.onAutoGroupColumnDefChanged=function(){this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns("gridOptionsChanged")},i.prototype.getColDefVersion=function(){return this.colDefVersion},i.prototype.setColumnDefs=function(t,e){var o=this;void 0===e&&(e="api");var n=!!this.columnDefs;this.colDefVersion++;var i=this.compareColumnStatesAndRaiseEvents(e);this.columnDefs=t,this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;var r=this.primaryColumns,s=this.primaryColumnTree,a=this.columnFactory.createColumnTree(t,!0,s);this.primaryColumnTree=a.columnTree,this.primaryHeaderRowCount=a.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach((function(t){return o.primaryColumnsMap[t.getId()]=t})),this.extractRowGroupColumns(e,r),this.extractPivotColumns(e,r),this.extractValueColumns(e,r),this.ready=!0,this.updateGridColumns(),n&&this.gridColsArePrimary&&this.gridOptionsWrapper.isApplyColumnDefOrder()&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(e),this.checkViewportColumns(),this.dispatchEverythingChanged(e),i(),this.dispatchNewColumnsLoaded()},i.prototype.dispatchNewColumnsLoaded=function(){var t={type:Wt.EVENT_NEW_COLUMNS_LOADED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t)},i.prototype.dispatchEverythingChanged=function(t){void 0===t&&(t="api");var e={type:Wt.EVENT_COLUMN_EVERYTHING_CHANGED,api:this.gridApi,columnApi:this.columnApi,source:t};this.eventService.dispatchEvent(e)},i.prototype.orderGridColumnsLikePrimary=function(){var t=this;this.gridColumns.sort((function(e,o){var n=t.primaryColumns.indexOf(e),i=t.primaryColumns.indexOf(o),r=n>=0,s=i>=0;return r&&s?n-i:r?1:s?-1:t.gridColumns.indexOf(e)-t.gridColumns.indexOf(o)}))},i.prototype.isAutoRowHeightActive=function(){return this.autoRowHeightColumns&&this.autoRowHeightColumns.length>0},i.prototype.getAllAutoRowHeightCols=function(){return this.autoRowHeightColumns},i.prototype.setViewport=function(){this.gridOptionsWrapper.isEnableRtl()?(this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth,this.viewportRight=this.bodyWidth-this.scrollPosition):(this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition)},i.prototype.getDisplayedColumnsStartingAt=function(t){for(var e=t,o=[];null!=e;)o.push(e),e=this.getDisplayedColAfter(e);return o},i.prototype.checkViewportColumns=function(){if(null!=this.displayedColumnsCenter){var t=this.viewportColumns.map((function(t){return t.getId()})).join("#");if(this.extractViewport(),t!==this.viewportColumns.map((function(t){return t.getId()})).join("#")){var e={type:Wt.EVENT_VIRTUAL_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)}}},i.prototype.setViewportPosition=function(t,e){(t!==this.scrollWidth||e!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=t,this.scrollPosition=e,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns())},i.prototype.isPivotMode=function(){return this.pivotMode},i.prototype.isPivotSettingAllowed=function(t){return!t||!this.gridOptionsWrapper.isTreeData()||(console.warn("AG Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'"),!1)},i.prototype.setPivotMode=function(t,e){if(void 0===e&&(e="api"),t!==this.pivotMode&&this.isPivotSettingAllowed(this.pivotMode)){this.pivotMode=t,this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(e);var o={type:Wt.EVENT_COLUMN_PIVOT_MODE_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(o)}},i.prototype.getSecondaryPivotColumn=function(t,e){if(!this.secondaryColumnsPresent||!this.secondaryColumns)return null;var o=this.getPrimaryColumn(e),n=null;return this.secondaryColumns.forEach((function(e){var i=e.getColDef().pivotKeys,r=e.getColDef().pivotValueColumn;h(i,t)&&r===o&&(n=e)})),n},i.prototype.setBeans=function(t){this.logger=t.create("ColumnController")},i.prototype.setFirstRightAndLastLeftPinned=function(t){var e,o;this.gridOptionsWrapper.isEnableRtl()?(e=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,o=this.displayedColumnsRight?d(this.displayedColumnsRight):null):(e=this.displayedColumnsLeft?d(this.displayedColumnsLeft):null,o=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach((function(n){n.setLastLeftPinned(n===e,t),n.setFirstRightPinned(n===o,t)}))},i.prototype.autoSizeColumns=function(t,e,o){var n=this;void 0===o&&(o="api"),this.animationFrameService.flushAllFrames();var i=[],r=-1;for(null==e&&(e=this.gridOptionsWrapper.isSkipHeaderOnAutoSize());0!==r;)r=0,this.actionOnGridColumns(t,(function(t){if(i.indexOf(t)>=0)return!1;var s=n.autoWidthCalculator.getPreferredWidthForColumn(t,e);if(s>0){var a=n.normaliseColumnWidth(t,s);t.setActualWidth(a,o),i.push(t),r++}return!0}),o);this.fireColumnResizedEvent(i,!0,"autosizeColumns")},i.prototype.fireColumnResizedEvent=function(t,e,o,n){if(void 0===n&&(n=null),t&&t.length){var i={type:Wt.EVENT_COLUMN_RESIZED,columns:t,column:1===t.length?t[0]:null,flexColumns:n,finished:e,api:this.gridApi,columnApi:this.columnApi,source:o};this.eventService.dispatchEvent(i)}},i.prototype.autoSizeColumn=function(t,e,o){void 0===o&&(o="api"),t&&this.autoSizeColumns([t],e,o)},i.prototype.autoSizeAllColumns=function(t,e){void 0===e&&(e="api");var o=this.getAllDisplayedColumns();this.autoSizeColumns(o,t,e)},i.prototype.getColumnsFromTree=function(t){var e=[],o=function(t){for(var n=0;n<t.length;n++){var i=t[n];i instanceof yt?e.push(i):i instanceof Ct&&o(i.getChildren())}};return o(t),e},i.prototype.getAllDisplayedTrees=function(){return this.displayedTreeLeft&&this.displayedTreeRight&&this.displayedTreeCentre?this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight):null},i.prototype.getPrimaryColumnTree=function(){return this.primaryColumnTree},i.prototype.getHeaderRowCount=function(){return this.gridHeaderRowCount},i.prototype.getDisplayedTreeLeft=function(){return this.displayedTreeLeft},i.prototype.getDisplayedTreeRight=function(){return this.displayedTreeRight},i.prototype.getDisplayedTreeCentre=function(){return this.displayedTreeCentre},i.prototype.isColumnDisplayed=function(t){return this.getAllDisplayedColumns().indexOf(t)>=0},i.prototype.getAllDisplayedColumns=function(){return this.displayedColumns},i.prototype.getViewportColumns=function(){return this.viewportColumns},i.prototype.getDisplayedLeftColumnsForRow=function(t){return this.colSpanActive?this.getDisplayedColumnsForRow(t,this.displayedColumnsLeft):this.displayedColumnsLeft},i.prototype.getDisplayedRightColumnsForRow=function(t){return this.colSpanActive?this.getDisplayedColumnsForRow(t,this.displayedColumnsRight):this.displayedColumnsRight},i.prototype.getDisplayedColumnsForRow=function(t,e,o,n){for(var i,r=[],s=null,a=function(a){var l,p=e[a],u=e.length-a,c=Math.min(p.getColSpan(t),u),d=[p];if(c>1){for(var h=c-1,f=1;f<=h;f++)d.push(e[a+f]);a+=h}if(o?(l=!1,d.forEach((function(t){o(t)&&(l=!0)}))):l=!0,l){if(0===r.length&&s)!!n&&n(p)&&r.push(s);r.push(p)}s=p,i=a},l=0;l<e.length;l++)a(l),l=i;return r},i.prototype.getViewportCenterColumnsForRow=function(t){var o=this;if(!this.colSpanActive)return this.viewportColumnsCenter;var n=this.suppressColumnVirtualisation?null:this.isColumnInViewport.bind(this);return this.getDisplayedColumnsForRow(t,this.displayedColumnsCenter,n,(function(t){var n=t.getLeft();return e(n)&&n>o.viewportLeft}))},i.prototype.getAriaColumnIndex=function(t){return this.getAllGridColumns().indexOf(t)+1},i.prototype.isColumnInViewport=function(t){var e=t.getLeft()||0,o=e+t.getActualWidth(),n=this.viewportLeft-200,i=this.viewportRight+200;return!(e<n&&o<n)&&!(e>i&&o>i)},i.prototype.getDisplayedColumnsLeftWidth=function(){return this.getWidthOfColsInList(this.displayedColumnsLeft)},i.prototype.getDisplayedColumnsRightWidth=function(){return this.getWidthOfColsInList(this.displayedColumnsRight)},i.prototype.updatePrimaryColumnList=function(t,e,o,i,r,s){var a=this;if(void 0===s&&(s="api"),t&&!n(t)){var l=!1;if(t.forEach((function(t){var n=a.getPrimaryColumn(t);if(n){if(o){if(e.indexOf(n)>=0)return;e.push(n)}else{if(e.indexOf(n)<0)return;g(e,n)}i(n),l=!0}})),l){this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(s);var p={type:r,columns:e,column:1===e.length?e[0]:null,api:this.gridApi,columnApi:this.columnApi,source:s};this.eventService.dispatchEvent(p)}}},i.prototype.setRowGroupColumns=function(t,e){void 0===e&&(e="api"),this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(t,this.rowGroupColumns,Wt.EVENT_COLUMN_ROW_GROUP_CHANGED,this.setRowGroupActive.bind(this),e)},i.prototype.setRowGroupActive=function(t,e,o){t!==e.isRowGroupActive()&&(e.setRowGroupActive(t,o),t||this.gridOptionsWrapper.isSuppressMakeColumnVisibleAfterUnGroup()||e.setVisible(!0,o))},i.prototype.addRowGroupColumn=function(t,e){void 0===e&&(e="api"),t&&this.addRowGroupColumns([t],e)},i.prototype.addRowGroupColumns=function(t,e){void 0===e&&(e="api"),this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(t,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),Wt.EVENT_COLUMN_ROW_GROUP_CHANGED,e)},i.prototype.removeRowGroupColumns=function(t,e){void 0===e&&(e="api"),this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(t,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),Wt.EVENT_COLUMN_ROW_GROUP_CHANGED,e)},i.prototype.removeRowGroupColumn=function(t,e){void 0===e&&(e="api"),t&&this.removeRowGroupColumns([t],e)},i.prototype.addPivotColumns=function(t,e){void 0===e&&(e="api"),this.updatePrimaryColumnList(t,this.pivotColumns,!0,(function(t){return t.setPivotActive(!0,e)}),Wt.EVENT_COLUMN_PIVOT_CHANGED,e)},i.prototype.setPivotColumns=function(t,e){void 0===e&&(e="api"),this.setPrimaryColumnList(t,this.pivotColumns,Wt.EVENT_COLUMN_PIVOT_CHANGED,(function(t,o){o.setPivotActive(t,e)}),e)},i.prototype.addPivotColumn=function(t,e){void 0===e&&(e="api"),this.addPivotColumns([t],e)},i.prototype.removePivotColumns=function(t,e){void 0===e&&(e="api"),this.updatePrimaryColumnList(t,this.pivotColumns,!1,(function(t){return t.setPivotActive(!1,e)}),Wt.EVENT_COLUMN_PIVOT_CHANGED,e)},i.prototype.removePivotColumn=function(t,e){void 0===e&&(e="api"),this.removePivotColumns([t],e)},i.prototype.setPrimaryColumnList=function(t,o,n,i,r){var s=this;o.length=0,e(t)&&t.forEach((function(t){var e=s.getPrimaryColumn(t);e&&o.push(e)})),this.primaryColumns.forEach((function(t){var e=o.indexOf(t)>=0;i(e,t)})),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r);var a={type:n,columns:o,column:1===o.length?o[0]:null,api:this.gridApi,columnApi:this.columnApi,source:r};this.eventService.dispatchEvent(a)},i.prototype.setValueColumns=function(t,e){void 0===e&&(e="api"),this.setPrimaryColumnList(t,this.valueColumns,Wt.EVENT_COLUMN_VALUE_CHANGED,this.setValueActive.bind(this),e)},i.prototype.setValueActive=function(t,e,o){if(t!==e.isValueActive()&&(e.setValueActive(t,o),t&&!e.getAggFunc())){var n=this.aggFuncService.getDefaultAggFunc(e);e.setAggFunc(n)}},i.prototype.addValueColumns=function(t,e){void 0===e&&(e="api"),this.updatePrimaryColumnList(t,this.valueColumns,!0,this.setValueActive.bind(this,!0),Wt.EVENT_COLUMN_VALUE_CHANGED,e)},i.prototype.addValueColumn=function(t,e){void 0===e&&(e="api"),t&&this.addValueColumns([t],e)},i.prototype.removeValueColumn=function(t,e){void 0===e&&(e="api"),this.removeValueColumns([t],e)},i.prototype.removeValueColumns=function(t,e){void 0===e&&(e="api"),this.updatePrimaryColumnList(t,this.valueColumns,!1,this.setValueActive.bind(this,!1),Wt.EVENT_COLUMN_VALUE_CHANGED,e)},i.prototype.normaliseColumnWidth=function(t,o){var n=t.getMinWidth();e(n)&&o<n&&(o=n);var i=t.getMaxWidth();return e(i)&&t.isGreaterThanMax(o)&&(o=i),o},i.prototype.getPrimaryOrGridColumn=function(t){return this.getPrimaryColumn(t)||this.getGridColumn(t)},i.prototype.setColumnWidths=function(t,e,o,n){var i=this;void 0===n&&(n="api");var r=[];t.forEach((function(t){var o=i.getPrimaryOrGridColumn(t.key);if(o&&(r.push({width:t.newWidth,ratios:[1],columns:[o]}),"shift"===i.gridOptionsWrapper.getColResizeDefault()&&(e=!e),e)){var n=i.getDisplayedColAfter(o);if(!n)return;var s=o.getActualWidth()-t.newWidth,a=n.getActualWidth()+s;r.push({width:a,ratios:[1],columns:[n]})}})),0!==r.length&&this.resizeColumnSets(r,o,n)},i.prototype.checkMinAndMaxWidthsForSet=function(t){var o=t.columns,n=t.width,i=0,r=0,s=!0;return o.forEach((function(t){var o=t.getMinWidth();i+=o||0;var n=t.getMaxWidth();e(n)&&n>0?r+=n:s=!1})),n>=i&&(!s||n<=r)},i.prototype.resizeColumnSets=function(t,o,n){if(!t||t.every(this.checkMinAndMaxWidthsForSet.bind(this))){var i=[],r=[];t.forEach((function(t){var o=t.width,s=t.columns,a=t.ratios,l={},p={};s.forEach((function(t){return r.push(t)}));for(var u=!0,c=0,d=function(){if(++c>1e3)return console.error("AG Grid: infinite loop in resizeColumnSets"),"break";u=!1;var t=[],n=0,i=o;s.forEach((function(e,o){if(p[e.getId()])i-=l[e.getId()];else{t.push(e);var r=a[o];n+=r}}));var r=1/n;t.forEach((function(n,s){var c;s===t.length-1?c=i:(c=Math.round(a[s]*o*r),i-=c);var d=n.getMinWidth(),h=n.getMaxWidth();e(d)&&c<d?(c=d,p[n.getId()]=!0,u=!0):e(h)&&h>0&&c>h&&(c=h,p[n.getId()]=!0,u=!0),l[n.getId()]=c}))};u;){if("break"===d())break}s.forEach((function(t){var e=l[t.getId()];t.getActualWidth()!==e&&(t.setActualWidth(e,n),i.push(t))}))}));var s=i.length>0,a=this.refreshFlexedColumns({resizingCols:r,skipSetLeft:!0});s&&(this.setLeftValues(n),this.updateBodyWidths(),this.checkViewportColumns());var l=r.concat(a);(s||o)&&this.fireColumnResizedEvent(l,o,n,a)}else if(o){var p=t&&t.length>0?t[0].columns:null;this.fireColumnResizedEvent(p,o,n)}},i.prototype.setColumnAggFunc=function(t,e,o){if(void 0===o&&(o="api"),t){var n=this.getPrimaryColumn(t);if(n){n.setAggFunc(e);var i={type:Wt.EVENT_COLUMN_VALUE_CHANGED,columns:[n],column:n,api:this.gridApi,columnApi:this.columnApi,source:o};this.eventService.dispatchEvent(i)}}},i.prototype.moveRowGroupColumn=function(t,e,o){void 0===o&&(o="api");var n=this.rowGroupColumns[t];this.rowGroupColumns.splice(t,1),this.rowGroupColumns.splice(e,0,n);var i={type:Wt.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:this.rowGroupColumns,column:1===this.rowGroupColumns.length?this.rowGroupColumns[0]:null,api:this.gridApi,columnApi:this.columnApi,source:o};this.eventService.dispatchEvent(i)},i.prototype.moveColumns=function(t,e,o){if(void 0===o&&(o="api"),this.columnAnimationService.start(),e>this.gridColumns.length-t.length)return console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+e),void console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");var n=this.getGridColumns(t);if(!!this.doesMovePassRules(n,e)){m(this.gridColumns,n,e),this.updateDisplayedColumns(o);var i={type:Wt.EVENT_COLUMN_MOVED,columns:n,column:1===n.length?n[0]:null,toIndex:e,api:this.gridApi,columnApi:this.columnApi,source:o};this.eventService.dispatchEvent(i),this.columnAnimationService.finish()}},i.prototype.doesMovePassRules=function(t,e){var o=this.gridColumns.slice();return m(o,t,e),!!this.doesMovePassMarryChildren(o)&&!!this.doesMovePassLockedPositions(o)},i.prototype.sortColumnsLikeGridColumns=function(t){var e=this;!t||t.length<=1||(t.filter((function(t){return e.gridColumns.indexOf(t)<0})).length>0||t.sort((function(t,o){return e.gridColumns.indexOf(t)-e.gridColumns.indexOf(o)})))},i.prototype.doesMovePassLockedPositions=function(t){var e=!1,o=!0;return t.forEach((function(t){t.getColDef().lockPosition?e&&(o=!1):e=!0})),o},i.prototype.doesMovePassMarryChildren=function(t){var e=!0;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,(function(o){if(o instanceof Ct){var n=o,i=n.getColGroupDef();if(i&&i.marryChildren){var r=[];n.getLeafColumns().forEach((function(e){var o=t.indexOf(e);r.push(o)})),Math.max.apply(Math,r)-Math.min.apply(Math,r)>n.getLeafColumns().length-1&&(e=!1)}}})),e},i.prototype.moveColumn=function(t,e,o){void 0===o&&(o="api"),this.moveColumns([t],e,o)},i.prototype.moveColumnByIndex=function(t,e,o){void 0===o&&(o="api");var n=this.gridColumns[t];this.moveColumn(n,e,o)},i.prototype.getColumnDefs=function(){var t=this,e=this.primaryColumns.slice();return this.gridColsArePrimary?e.sort((function(e,o){return t.gridColumns.indexOf(e)-t.gridColumns.indexOf(o)})):this.lastPrimaryOrder&&e.sort((function(e,o){return t.lastPrimaryOrder.indexOf(e)-t.lastPrimaryOrder.indexOf(o)})),this.columnDefFactory.buildColumnDefs(e,this.rowGroupColumns,this.pivotColumns)},i.prototype.getBodyContainerWidth=function(){return this.bodyWidth},i.prototype.getContainerWidth=function(t){switch(t){case ht.PINNED_LEFT:return this.leftWidth;case ht.PINNED_RIGHT:return this.rightWidth;default:return this.bodyWidth}},i.prototype.updateBodyWidths=function(){var t=this.getWidthOfColsInList(this.displayedColumnsCenter),e=this.getWidthOfColsInList(this.displayedColumnsLeft),o=this.getWidthOfColsInList(this.displayedColumnsRight);if(this.bodyWidthDirty=this.bodyWidth!==t,this.bodyWidth!==t||this.leftWidth!==e||this.rightWidth!==o){this.bodyWidth=t,this.leftWidth=e,this.rightWidth=o;var n={type:Wt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(n)}},i.prototype.getValueColumns=function(){return this.valueColumns?this.valueColumns:[]},i.prototype.getPivotColumns=function(){return this.pivotColumns?this.pivotColumns:[]},i.prototype.isPivotActive=function(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode},i.prototype.getRowGroupColumns=function(){return this.rowGroupColumns?this.rowGroupColumns:[]},i.prototype.getDisplayedCenterColumns=function(){return this.displayedColumnsCenter},i.prototype.getDisplayedLeftColumns=function(){return this.displayedColumnsLeft},i.prototype.getDisplayedRightColumns=function(){return this.displayedColumnsRight},i.prototype.getDisplayedColumns=function(t){switch(t){case ht.PINNED_LEFT:return this.getDisplayedLeftColumns();case ht.PINNED_RIGHT:return this.getDisplayedRightColumns();default:return this.getDisplayedCenterColumns()}},i.prototype.getAllPrimaryColumns=function(){return this.primaryColumns?this.primaryColumns.slice():null},i.prototype.getSecondaryColumns=function(){return this.secondaryColumns?this.secondaryColumns.slice():null},i.prototype.getAllColumnsForQuickFilter=function(){return this.columnsForQuickFilter},i.prototype.getAllGridColumns=function(){return this.gridColumns},i.prototype.isEmpty=function(){return n(this.gridColumns)},i.prototype.isRowGroupEmpty=function(){return n(this.rowGroupColumns)},i.prototype.setColumnVisible=function(t,e,o){void 0===o&&(o="api"),this.setColumnsVisible([t],e,o)},i.prototype.setColumnsVisible=function(t,e,o){var n=this;void 0===e&&(e=!1),void 0===o&&(o="api"),this.columnAnimationService.start(),this.actionOnGridColumns(t,(function(t){return t.isVisible()!==e&&(t.setVisible(e,o),!0)}),o,(function(){return{type:Wt.EVENT_COLUMN_VISIBLE,visible:e,column:null,columns:null,api:n.gridApi,columnApi:n.columnApi,source:o}})),this.columnAnimationService.finish()},i.prototype.setColumnPinned=function(t,e,o){void 0===o&&(o="api"),t&&this.setColumnsPinned([t],e,o)},i.prototype.setColumnsPinned=function(t,e,o){var n,i=this;(void 0===o&&(o="api"),"print"!==this.gridOptionsWrapper.getDomLayout())?(this.columnAnimationService.start(),n=!0===e||e===ht.PINNED_LEFT?ht.PINNED_LEFT:e===ht.PINNED_RIGHT?ht.PINNED_RIGHT:null,this.actionOnGridColumns(t,(function(t){return t.getPinned()!==n&&(t.setPinned(n),!0)}),o,(function(){return{type:Wt.EVENT_COLUMN_PINNED,pinned:n,column:null,columns:null,api:i.gridApi,columnApi:i.columnApi,source:o}})),this.columnAnimationService.finish()):console.warn("Changing the column pinning status is not allowed with domLayout='print'")},i.prototype.actionOnGridColumns=function(t,o,i,r){var s=this;if(!n(t)){var a=[];if(t.forEach((function(t){var e=s.getGridColumn(t);e&&(!1!==o(e)&&a.push(e))})),a.length&&(this.updateDisplayedColumns(i),e(r)&&r)){var l=r();l.columns=a,l.column=1===a.length?a[0]:null,this.eventService.dispatchEvent(l)}}},i.prototype.getDisplayedColBefore=function(t){var e=this.getAllDisplayedColumns(),o=e.indexOf(t);return o>0?e[o-1]:null},i.prototype.getDisplayedColAfter=function(t){var e=this.getAllDisplayedColumns(),o=e.indexOf(t);return o<e.length-1?e[o+1]:null},i.prototype.getDisplayedGroupAfter=function(t){return this.getDisplayedGroupAtDirection(t,"After")},i.prototype.getDisplayedGroupBefore=function(t){return this.getDisplayedGroupAtDirection(t,"Before")},i.prototype.getDisplayedGroupAtDirection=function(t,e){for(var o=t.getOriginalColumnGroup().getLevel()+t.getPaddingLevel(),n=t.getDisplayedLeafColumns(),i="After"===e?d(n):n[0],r="getDisplayedCol"+e;;){var s=this[r](i);if(!s)return null;var a=this.getColumnGroupAtLevel(s,o);if(a!==t)return a}},i.prototype.getColumnGroupAtLevel=function(t,e){for(var o=t.getParent();;){if(o.getOriginalColumnGroup().getLevel()+o.getPaddingLevel()<=e)break;o=o.getParent()}return o},i.prototype.isPinningLeft=function(){return this.displayedColumnsLeft.length>0},i.prototype.isPinningRight=function(){return this.displayedColumnsRight.length>0},i.prototype.getPrimaryAndSecondaryAndAutoColumns=function(){var t=this.primaryColumns?this.primaryColumns.slice(0):[];return this.groupAutoColumns&&e(this.groupAutoColumns)&&this.groupAutoColumns.forEach((function(e){return t.push(e)})),this.secondaryColumnsPresent&&this.secondaryColumns&&this.secondaryColumns.forEach((function(e){return t.push(e)})),t},i.prototype.createStateItemFromColumn=function(t){var e=t.isRowGroupActive()?this.rowGroupColumns.indexOf(t):null,o=t.isPivotActive()?this.pivotColumns.indexOf(t):null,n=t.isValueActive()?t.getAggFunc():null,i=null!=t.getSort()?t.getSort():null,r=null!=t.getSortIndex()?t.getSortIndex():null,s=null!=t.getFlex()&&t.getFlex()>0?t.getFlex():null;return{colId:t.getColId(),width:t.getActualWidth(),hide:!t.isVisible(),pinned:t.getPinned(),sort:i,sortIndex:r,aggFunc:n,rowGroup:t.isRowGroupActive(),rowGroupIndex:e,pivot:t.isPivotActive(),pivotIndex:o,flex:s}},i.prototype.getColumnState=function(){if(o(this.primaryColumns)||!this.isAlive())return[];var t=this.primaryColumns.map(this.createStateItemFromColumn.bind(this)),e=(this.groupAutoColumns?this.groupAutoColumns.map(this.createStateItemFromColumn.bind(this)):[]).concat(t);return this.pivotMode||this.orderColumnStateList(e),e},i.prototype.orderColumnStateList=function(t){var e=new Map(this.gridColumns.map((function(t,e){return[t.getColId(),e]})));t.sort((function(t,o){return(e.has(t.colId)?e.get(t.colId):-1)-(e.has(o.colId)?e.get(o.colId):-1)}))},i.prototype.resetColumnState=function(t){void 0===t&&(t="api");var e=this.getColumnsFromTree(this.primaryColumnTree),n=[],i=1e3,r=1e3,s=[];this.groupAutoColumns&&(s=s.concat(this.groupAutoColumns)),e&&(s=s.concat(e)),s.forEach((function(t){var e=t.getColDef(),s=null!=e.sort?e.sort:null,a=e.sortIndex,l=!!e.hide,p=e.pinned?e.pinned:null,u=e.width,c=null!=e.flex?e.flex:null,d=e.rowGroupIndex,h=e.rowGroup;null!=d||null!=h&&0!=h||(d=null,h=null);var f=e.pivotIndex,g=e.pivot;null!=f||null!=g&&0!=g||(f=null,g=null);var y=null!=e.aggFunc?e.aggFunc:null,v={colId:t.getColId(),sort:s,sortIndex:a,hide:l,pinned:p,width:u,flex:c,rowGroup:h,rowGroupIndex:d,pivot:g,pivotIndex:f,aggFunc:y};o(d)&&h&&(v.rowGroupIndex=i++),o(f)&&g&&(v.pivotIndex=r++),n.push(v)})),this.applyColumnState({state:n,applyOrder:!0},t)},i.prototype.applyColumnState=function(t,e){var o=this;if(void 0===e&&(e="api"),n(this.primaryColumns))return!1;if(t&&t.state&&!t.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;this.columnAnimationService.start();var i=this.compareColumnStatesAndRaiseEvents(e);this.autoGroupsNeedBuilding=!0;var r=this.primaryColumns.slice(),s=!0,a={},l={},p=[],u=this.rowGroupColumns.slice(),c=this.pivotColumns.slice();t.state&&t.state.forEach((function(n){var i=ht.GROUP_AUTO_COLUMN_ID,u=n.colId||"";if(qt(u,i))p.push(n);else{var c=o.getPrimaryColumn(u);c?(o.syncColumnWithStateItem(c,n,t.defaultState,a,l,!1,e),g(r,c)):s=!1}})),r.forEach((function(n){o.syncColumnWithStateItem(n,null,t.defaultState,a,l,!1,e)}));var d=function(t,e,o,n){var i=t[o.getId()],r=t[n.getId()],s=null!=i,a=null!=r;if(s&&a)return i-r;if(s)return-1;if(a)return 1;var l=e.indexOf(o),p=e.indexOf(n),u=l>=0;return u&&p>=0?l-p:u?-1:1};return this.rowGroupColumns.sort(d.bind(this,a,u)),this.pivotColumns.sort(d.bind(this,l,c)),this.updateGridColumns(),p.forEach((function(n){var i=o.getAutoColumn(n.colId);o.syncColumnWithStateItem(i,n,t.defaultState,null,null,!0,e)})),this.applyOrderAfterApplyState(t),this.updateDisplayedColumns(e),this.dispatchEverythingChanged(e),i(),this.columnAnimationService.finish(),s},i.prototype.applyOrderAfterApplyState=function(t){var e=this;if(this.gridColsArePrimary&&t.applyOrder&&t.state){var o=[],n={};t.state.forEach((function(t){if(t.colId&&!n[t.colId]){var i=e.primaryColumnsMap[t.colId];i&&(o.push(i),n[t.colId]=!0)}})),this.gridColumns.forEach((function(t){n[t.getColId()]||o.push(t)})),o=this.putFixedColumnsFirst(o),this.doesMovePassMarryChildren(o)?this.gridColumns=o:console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.")}},i.prototype.compareColumnStatesAndRaiseEvents=function(t){var e=this;if(!!!this.columnDefs)return function(){};var o={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},n=this.getColumnState(),i={};return n.forEach((function(t){i[t.colId]=t})),function(){if(!e.gridOptionsWrapper.isSuppressColumnStateEvents()){var r=function(o,n,i,r){if(!h(n.map(r).sort(),i.map(r).sort())){var s={type:o,columns:i,column:1===i.length?i[0]:null,api:e.gridApi,columnApi:e.columnApi,source:t};e.eventService.dispatchEvent(s)}},s=function(t){var o=[];return e.gridColumns.forEach((function(e){var n=i[e.getColId()];n&&t(n,e)&&o.push(e)})),o},a=function(t){return t.getColId()};r(Wt.EVENT_COLUMN_ROW_GROUP_CHANGED,o.rowGroupColumns,e.rowGroupColumns,a),r(Wt.EVENT_COLUMN_PIVOT_CHANGED,o.pivotColumns,e.pivotColumns,a),r(Wt.EVENT_COLUMN_VALUE_CHANGED,o.valueColumns,e.valueColumns,a);e.fireColumnResizedEvent(s((function(t,e){return t.width!=e.getActualWidth()})),!0,t);e.raiseColumnPinnedEvent(s((function(t,e){return t.pinned!=e.getPinned()})),t);e.raiseColumnVisibleEvent(s((function(t,e){return t.hide==e.isVisible()})),t);s((function(t,e){return t.sort!=e.getSort()||t.sortIndex!=e.getSortIndex()})).length>0&&e.sortController.dispatchSortChangedEvents(),e.raiseColumnMovedEvent(n,t)}}},i.prototype.raiseColumnPinnedEvent=function(t,e){if(t.length){var o={type:Wt.EVENT_COLUMN_PINNED,pinned:null,columns:t,column:null,api:this.gridApi,columnApi:this.columnApi,source:e};this.eventService.dispatchEvent(o)}},i.prototype.raiseColumnVisibleEvent=function(t,e){if(t.length){var o={type:Wt.EVENT_COLUMN_VISIBLE,visible:void 0,columns:t,column:null,api:this.gridApi,columnApi:this.columnApi,source:e};this.eventService.dispatchEvent(o)}},i.prototype.raiseColumnMovedEvent=function(t,e){var o=this,n=this.getColumnState(),i={};n.forEach((function(t){return i[t.colId]=t}));var r={};t.forEach((function(t){i[t.colId]&&(r[t.colId]=!0)}));var s=b(t,(function(t){return r[t.colId]})),a=b(n,(function(t){return r[t.colId]})),l=[];if(a.forEach((function(t,e){var n=s&&s[e];if(n&&n.colId!==t.colId){var i=o.getGridColumn(n.colId);i&&l.push(i)}})),l.length){var p={type:Wt.EVENT_COLUMN_MOVED,columns:l,column:null,api:this.gridApi,columnApi:this.columnApi,source:e};this.eventService.dispatchEvent(p)}},i.prototype.syncColumnWithStateItem=function(t,o,n,i,r,s,a){if(t){var l=function(t,i){var r=o,s=n,a={value1:void 0,value2:void 0},l=!1;return r&&(void 0!==r[t]&&(a.value1=r[t],l=!0),e(i)&&void 0!==r[i]&&(a.value2=r[i],l=!0)),!l&&s&&(void 0!==s[t]&&(a.value1=s[t]),e(i)&&void 0!==s[i]&&(a.value2=s[i])),a},p=l("hide").value1;void 0!==p&&t.setVisible(!p,a);var u=l("pinned").value1;void 0!==u&&t.setPinned(u);var c=this.gridOptionsWrapper.getMinColWidth(),d=l("flex").value1;if(void 0!==d&&t.setFlex(d),t.getFlex()<=0){var h=l("width").value1;null!=h&&c&&h>=c&&t.setActualWidth(h,a)}var f=l("sort").value1;void 0!==f&&(f===ht.SORT_DESC||f===ht.SORT_ASC?t.setSort(f):t.setSort(void 0));var y=l("sortIndex").value1;if(void 0!==y&&t.setSortIndex(y),!s){var v=l("aggFunc").value1;void 0!==v&&("string"==typeof v?(t.setAggFunc(v),t.isValueActive()||(t.setValueActive(!0,a),this.valueColumns.push(t))):(e(v)&&console.warn("AG Grid: stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),t.setAggFunc(null),t.isValueActive()&&(t.setValueActive(!1,a),g(this.valueColumns,t))));var m=l("rowGroup","rowGroupIndex"),C=m.value1,w=m.value2;void 0===C&&void 0===w||("number"==typeof w||C?(t.isRowGroupActive()||(t.setRowGroupActive(!0,a),this.rowGroupColumns.push(t)),i&&"number"==typeof w&&(i[t.getId()]=w)):t.isRowGroupActive()&&(t.setRowGroupActive(!1,a),g(this.rowGroupColumns,t)));var E=l("pivot","pivotIndex"),R=E.value1,O=E.value2;void 0===R&&void 0===O||("number"==typeof O||R?(t.isPivotActive()||(t.setPivotActive(!0,a),this.pivotColumns.push(t)),r&&"number"==typeof O&&(r[t.getId()]=O)):t.isPivotActive()&&(t.setPivotActive(!1,a),g(this.pivotColumns,t)))}}},i.prototype.getGridColumns=function(t){return this.getColumns(t,this.getGridColumn.bind(this))},i.prototype.getColumns=function(t,e){var o=[];return t&&t.forEach((function(t){var n=e(t);n&&o.push(n)})),o},i.prototype.getColumnWithValidation=function(t){if(null==t)return null;var e=this.getGridColumn(t);return e||console.warn("AG Grid: could not find column "+t),e},i.prototype.getPrimaryColumn=function(t){return this.getColumn(t,this.primaryColumns,this.primaryColumnsMap)},i.prototype.getGridColumn=function(t){return this.getColumn(t,this.gridColumns,this.gridColumnsMap)},i.prototype.getColumn=function(t,e,o){if(!t)return null;if("string"==typeof t&&o[t])return o[t];for(var n=0;n<e.length;n++)if(this.columnsMatch(e[n],t))return e[n];return this.getAutoColumn(t)},i.prototype.getAutoColumn=function(t){var n=this;return this.groupAutoColumns&&e(this.groupAutoColumns)&&!o(this.groupAutoColumns)?a(this.groupAutoColumns,(function(e){return n.columnsMatch(e,t)})):null},i.prototype.columnsMatch=function(t,e){var o=t===e,n=t.getColDef()===e,i=t.getColId()==e;return o||n||i},i.prototype.getDisplayNameForColumn=function(t,e,o){if(void 0===o&&(o=!1),!t)return null;var n=this.getHeaderName(t.getColDef(),t,null,null,e);return o?this.wrapHeaderNameWithAggFunc(t,n):n},i.prototype.getDisplayNameForOriginalColumnGroup=function(t,e,o){var n=e?e.getColGroupDef():null;return n?this.getHeaderName(n,null,t,e,o):null},i.prototype.getDisplayNameForColumnGroup=function(t,e){return this.getDisplayNameForOriginalColumnGroup(t,t.getOriginalColumnGroup(),e)},i.prototype.getHeaderName=function(t,e,o,n,i){var r=t.headerValueGetter;if(r){var s={colDef:t,column:e,columnGroup:o,originalColumnGroup:n,location:i,api:this.gridOptionsWrapper.getApi(),context:this.gridOptionsWrapper.getContext()};return"function"==typeof r?r(s):"string"==typeof r?this.expressionService.evaluate(r,s):(console.warn("ag-grid: headerValueGetter must be a function or a string"),"")}return null!=t.headerName?t.headerName:t.field?Yt(t.field):""},i.prototype.wrapHeaderNameWithAggFunc=function(t,o){if(this.gridOptionsWrapper.isSuppressAggFuncInHeader())return o;var n,i=t.getColDef().pivotValueColumn,r=null;if(e(i))r=i?i.getAggFunc():null,n=!0;else{var s=t.isValueActive(),a=this.pivotMode||!this.isRowGroupEmpty();s&&a?(r=t.getAggFunc(),n=!0):n=!1}if(n){var l="string"==typeof r?r:"func";return this.gridOptionsWrapper.getLocaleTextFunc()(l,l)+"("+o+")"}return o},i.prototype.getColumnGroup=function(t,e){if(!t)return null;if(t instanceof mt)return t;var o=this.getAllDisplayedTrees(),n="number"==typeof e,i=null;return this.columnUtils.depthFirstAllColumnTreeSearch(o,(function(o){if(o instanceof mt){var r=o;(n?t===r.getGroupId()&&e===r.getInstanceId():t===r.getGroupId())&&(i=r)}})),i},i.prototype.isReady=function(){return this.ready},i.prototype.extractValueColumns=function(t,e){this.valueColumns=this.extractColumns(e,this.valueColumns,(function(e,o){return e.setValueActive(o,t)}),(function(){}),(function(){}),(function(t){var e=t.aggFunc;return null===e||""===e?null:void 0!==e?!!e:void 0}),(function(t){return null!=t.initialAggFunc&&""!=t.initialAggFunc})),this.valueColumns.forEach((function(t){var e=t.getColDef();null!=e.aggFunc&&""!=e.aggFunc?t.setAggFunc(e.aggFunc):t.getAggFunc()||t.setAggFunc(e.initialAggFunc)}))},i.prototype.extractRowGroupColumns=function(t,e){this.rowGroupColumns=this.extractColumns(e,this.rowGroupColumns,(function(e,o){return e.setRowGroupActive(o,t)}),(function(t){return t.rowGroupIndex}),(function(t){return t.initialRowGroupIndex}),(function(t){return t.rowGroup}),(function(t){return t.initialRowGroup}))},i.prototype.extractColumns=function(t,e,o,n,i,a,l){void 0===t&&(t=[]),void 0===e&&(e=[]);var p=[],u=[];this.primaryColumns.forEach((function(o){var c,d=t.indexOf(o)<0,h=o.getColDef(),f=s(a(h)),g=s(l(h)),y=r(n(h)),v=r(i(h));d?c=void 0!==f||void 0!==y?void 0!==f?f:y>=0:g||v>=0:c=void 0!==f?f:void 0!==y?null!==y&&y>=0:e.indexOf(o)>=0;c&&((d?null!=y||null!=v:null!=y)?p.push(o):u.push(o))}));var c=function(t){var e=n(t.getColDef()),o=i(t.getColDef());return null!=e?e:o};p.sort((function(t,e){var o=c(t),n=c(e);return o===n?0:o<n?-1:1}));var d=[].concat(p);return e.forEach((function(t){u.indexOf(t)>=0&&d.push(t)})),u.forEach((function(t){d.indexOf(t)<0&&d.push(t)})),e.forEach((function(t){d.indexOf(t)<0&&o(t,!1)})),d.forEach((function(t){e.indexOf(t)<0&&o(t,!0)})),d},i.prototype.extractPivotColumns=function(t,e){this.pivotColumns=this.extractColumns(e,this.pivotColumns,(function(e,o){return e.setPivotActive(o,t)}),(function(t){return t.pivotIndex}),(function(t){return t.initialPivotIndex}),(function(t){return t.pivot}),(function(t){return t.initialPivot}))},i.prototype.resetColumnGroupState=function(t){void 0===t&&(t="api");var e=[];this.columnUtils.depthFirstOriginalTreeSearch(null,this.primaryColumnTree,(function(t){if(t instanceof Ct){var o=t.getColGroupDef(),n={groupId:t.getGroupId(),open:o?o.openByDefault:void 0};e.push(n)}})),this.setColumnGroupState(e,t)},i.prototype.getColumnGroupState=function(){var t=[];return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,(function(e){if(e instanceof Ct){var o=e;t.push({groupId:o.getGroupId(),open:o.isExpanded()})}})),t},i.prototype.setColumnGroupState=function(t,e){var o=this;void 0===e&&(e="api"),this.columnAnimationService.start();var n=[];t.forEach((function(t){var e=t.groupId,i=t.open,r=o.getOriginalColumnGroup(e);r&&r.isExpanded()!==i&&(o.logger.log("columnGroupOpened("+r.getGroupId()+","+i+")"),r.setExpanded(i),n.push(r))})),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e),n.forEach((function(t){var e={type:Wt.EVENT_COLUMN_GROUP_OPENED,columnGroup:t,api:o.gridApi,columnApi:o.columnApi};o.eventService.dispatchEvent(e)})),this.columnAnimationService.finish()},i.prototype.setColumnGroupOpened=function(t,e,o){var n;void 0===o&&(o="api"),n=t instanceof Ct?t.getId():t||"",this.setColumnGroupState([{groupId:n,open:e}],o)},i.prototype.getOriginalColumnGroup=function(t){if(t instanceof Ct)return t;"string"!=typeof t&&console.error("AG Grid: group key must be a string");var e=null;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,(function(o){if(o instanceof Ct){var n=o;n.getId()===t&&(e=n)}})),e},i.prototype.calculateColumnsForDisplay=function(){var t=this;return this.pivotMode&&!this.secondaryColumnsPresent?this.gridColumns.filter((function(e){var o=t.groupAutoColumns&&C(t.groupAutoColumns,e),n=t.valueColumns&&C(t.valueColumns,e);return o||n})):this.gridColumns.filter((function(e){return t.groupAutoColumns&&C(t.groupAutoColumns,e)||e.isVisible()}))},i.prototype.checkColSpanActiveInCols=function(t){var o=!1;return t.forEach((function(t){e(t.getColDef().colSpan)&&(o=!0)})),o},i.prototype.calculateColumnsForGroupDisplay=function(){var t=this;this.groupDisplayColumns=[];var o=function(o){var n=o.getColDef();n&&e(n.showRowGroup)&&t.groupDisplayColumns.push(o)};this.gridColumns.forEach(o),this.groupAutoColumns&&this.groupAutoColumns.forEach(o)},i.prototype.getGroupDisplayColumns=function(){return this.groupDisplayColumns},i.prototype.updateDisplayedColumns=function(t){var e=this.calculateColumnsForDisplay();this.buildDisplayedTrees(e),this.calculateColumnsForGroupDisplay(),this.updateGroupsAndDisplayedColumns(t),this.setFirstRightAndLastLeftPinned(t)},i.prototype.isSecondaryColumnsPresent=function(){return this.secondaryColumnsPresent},i.prototype.setSecondaryColumns=function(t,e){void 0===e&&(e="api");var o=t&&t.length>0;if(o||this.secondaryColumnsPresent){if(o){this.processSecondaryColumnDefinitions(t);var n=this.columnFactory.createColumnTree(t,!1);this.secondaryBalancedTree=n.columnTree,this.secondaryHeaderRowCount=n.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsPresent=!0}else this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsPresent=!1;this.updateGridColumns(),this.updateDisplayedColumns(e)}},i.prototype.processSecondaryColumnDefinitions=function(t){var o=this.gridOptionsWrapper.getProcessSecondaryColDefFunc(),n=this.gridOptionsWrapper.getProcessSecondaryColGroupDefFunc();if(o||n){var i=function(t){t.forEach((function(t){if(e(t.children)){var r=t;n&&n(r),i(r.children)}else{o&&o(t)}}))};t&&i(t)}},i.prototype.updateGridColumns=function(){var t=this;this.gridColsArePrimary&&(this.lastPrimaryOrder=this.gridColumns),this.secondaryColumns&&this.secondaryBalancedTree?(this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1):(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,this.orderGridColsLikeLastPrimary()),this.addAutoGroupToGridColumns(),this.autoRowHeightColumns=this.gridColumns.filter((function(t){return t.getColDef().autoHeight})),this.gridColumns=this.putFixedColumnsFirst(this.gridColumns),this.setupQuickFilterColumns(),this.clearDisplayedAndViewportColumns(),this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns),this.gridColumnsMap={},this.gridColumns.forEach((function(e){return t.gridColumnsMap[e.getId()]=e}));var e={type:Wt.EVENT_GRID_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)},i.prototype.orderGridColsLikeLastPrimary=function(){if(!o(this.lastPrimaryOrder)){var t=new Map(this.lastPrimaryOrder.map((function(t,e){return[t,e]}))),e=!0;if(this.gridColumns.forEach((function(o){t.has(o)&&(e=!1)})),!e){var n=new Map(this.gridColumns.map((function(t){return[t,!0]}))),i=this.lastPrimaryOrder.filter((function(t){return n.has(t)})),r=new Map(i.map((function(t){return[t,!0]}))),s=this.gridColumns.filter((function(t){return!r.has(t)})),a=i.slice();s.forEach((function(t){var e=t.getOriginalParent();if(e){for(var o=[];!o.length&&e;){e.getLeafColumns().forEach((function(t){var e=a.indexOf(t)>=0,n=o.indexOf(t)<0;e&&n&&o.push(t)})),e=e.getOriginalParent()}if(o.length){var n=o.map((function(t){return a.indexOf(t)})),i=Math.max.apply(Math,n);v(a,t,i+1)}else a.push(t)}else a.push(t)})),this.gridColumns=a}}},i.prototype.isPrimaryColumnGroupsPresent=function(){return this.primaryHeaderRowCount>1},i.prototype.setupQuickFilterColumns=function(){this.groupAutoColumns?this.columnsForQuickFilter=this.primaryColumns.concat(this.groupAutoColumns):this.columnsForQuickFilter=this.primaryColumns},i.prototype.putFixedColumnsFirst=function(t){var e=t.filter((function(t){return t.getColDef().lockPosition})),o=t.filter((function(t){return!t.getColDef().lockPosition}));return e.concat(o)},i.prototype.addAutoGroupToGridColumns=function(){if(this.createGroupAutoColumnsIfNeeded(),!o(this.groupAutoColumns)){this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;var t=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.gridBalancedTree=t.concat(this.gridBalancedTree)}},i.prototype.clearDisplayedAndViewportColumns=function(){this.displayedTreeLeft=[],this.displayedTreeRight=[],this.displayedTreeCentre=[],this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.viewportColumns=[]},i.prototype.updateGroupsAndDisplayedColumns=function(t){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(t),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();var e={type:Wt.EVENT_DISPLAYED_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)},i.prototype.deriveDisplayedColumns=function(t){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinDisplayedColumns(),this.setLeftValues(t)},i.prototype.joinDisplayedColumns=function(){this.gridOptionsWrapper.isEnableRtl()?this.displayedColumns=this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumns=this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)},i.prototype.setLeftValues=function(t){this.setLeftValuesOfColumns(t),this.setLeftValuesOfGroups()},i.prototype.setLeftValuesOfColumns=function(t){var e=this,o=this.primaryColumns.slice(0),n=this.gridOptionsWrapper.isEnableRtl();[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach((function(i){if(n){var r=e.getWidthOfColsInList(i);i.forEach((function(e){r-=e.getActualWidth(),e.setLeft(r,t)}))}else{var s=0;i.forEach((function(e){e.setLeft(s,t),s+=e.getActualWidth()}))}y(o,i)})),o.forEach((function(e){e.setLeft(null,t)}))},i.prototype.setLeftValuesOfGroups=function(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach((function(t){t.forEach((function(t){t instanceof mt&&t.checkLeft()}))}))},i.prototype.derivedDisplayedColumnsFromDisplayedTree=function(t,e){e.length=0,this.columnUtils.depthFirstDisplayedColumnTreeSearch(t,(function(t){t instanceof yt&&e.push(t)}))},i.prototype.extractViewportColumns=function(){this.suppressColumnVirtualisation?this.viewportColumnsCenter=this.displayedColumnsCenter:this.viewportColumnsCenter=this.filterOutColumnsWithinViewport(),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)},i.prototype.getVirtualHeaderGroupRow=function(t,e){var n;switch(t){case ht.PINNED_LEFT:n=this.viewportRowLeft[e];break;case ht.PINNED_RIGHT:n=this.viewportRowRight[e];break;default:n=this.viewportRowCenter[e]}return o(n)&&(n=[]),n},i.prototype.extractViewportRows=function(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};var t={};this.viewportColumns.forEach((function(e){return t[e.getId()]=!0}));var e=function(o,n,i){for(var r=!1,s=0;s<o.length;s++){var a=o[s],l=!1;if(a instanceof yt)l=!0===t[a.getId()];else{var p=a.getDisplayedChildren();p&&(l=e(p,n,i+1))}l&&(r=!0,n[i]||(n[i]=[]),n[i].push(a))}return r};e(this.displayedTreeLeft,this.viewportRowLeft,0),e(this.displayedTreeRight,this.viewportRowRight,0),e(this.displayedTreeCentre,this.viewportRowCenter,0)},i.prototype.extractViewport=function(){this.extractViewportColumns(),this.extractViewportRows()},i.prototype.filterOutColumnsWithinViewport=function(){return this.displayedColumnsCenter.filter(this.isColumnInViewport.bind(this))},i.prototype.refreshFlexedColumns=function(t){var o=this;void 0===t&&(t={});var n=t.source?t.source:"flex";if(null!=t.viewportWidth&&(this.flexViewportWidth=t.viewportWidth),!this.flexViewportWidth)return[];var i=-1;t.resizingCols&&t.resizingCols.forEach((function(t){var e=o.displayedColumnsCenter.indexOf(t);i<e&&(i=e)}));var r=function(t){var e=o.displayedColumnsCenter.indexOf(t)>i;return t.getFlex()&&e},s=this.displayedColumnsCenter.filter((function(t){return!r(t)})),a=this.displayedColumnsCenter.filter((function(t){return r(t)})),l=[];if(!a.length)return[];var p,u=[];t:for(;;){var c=a.reduce((function(t,e){return t+e.getFlex()}),0);p=this.flexViewportWidth-this.getWidthOfColsInList(s);for(var d=0;d<a.length;d++){var h=a[d],f=p*h.getFlex()/c,y=0,v=h.getMinWidth(),m=h.getMaxWidth();if(e(v)&&f<v?y=v:e(m)&&f>m&&(y=m),y){h.setActualWidth(y,n),g(a,h),l.push(h),s.push(h);continue t}u[d]=Math.round(f)}break}var C=p;return a.forEach((function(t,e){t.setActualWidth(Math.min(u[e],C),n),l.push(t),C-=u[e]})),t.skipSetLeft||this.setLeftValues(n),t.updateBodyWidths&&this.updateBodyWidths(),t.fireResizedEvent&&this.fireColumnResizedEvent(l,!0,n,a),this.flexColsCalculatedAtLestOnce||(this.gridOptionsWrapper.isRowModelDefault()&&this.rowModel.resetRowHeights(),this.flexColsCalculatedAtLestOnce=!0),a},i.prototype.sizeColumnsToFit=function(t,o,n){void 0===o&&(o="sizeColumnsToFit");var i=this.getAllDisplayedColumns();if(!(t<=0)&&i.length){var r=[],s=[];i.forEach((function(t){!0===t.getColDef().suppressSizeToFit?s.push(t):r.push(t)}));var a=r.slice(0),l=!1,p=function(t){g(r,t),s.push(t)};for(r.forEach((function(t){return t.resetActualWidth(o)}));!l;){l=!0;var u=t-this.getWidthOfColsInList(s);if(u<=0)r.forEach((function(t){t.setMinimum(o)}));else for(var c=u/this.getWidthOfColsInList(r),d=u,h=r.length-1;h>=0;h--){var f=r[h],y=f.getMinWidth(),v=f.getMaxWidth(),m=Math.round(f.getActualWidth()*c);e(y)&&m<y?(m=y,p(f),l=!1):e(v)&&f.isGreaterThanMax(m)?(m=v,p(f),l=!1):0===h&&(m=d),f.setActualWidth(m,o,!0),d-=m}}a.forEach((function(t){t.fireColumnWidthChangedEvent(o)})),this.setLeftValues(o),this.updateBodyWidths(),n||this.fireColumnResizedEvent(a,!0,o)}},i.prototype.buildDisplayedTrees=function(t){var e=[],o=[],n=[];t.forEach((function(t){switch(t.getPinned()){case"left":e.push(t);break;case"right":o.push(t);break;default:n.push(t)}}));var i=new kt;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(e,this.gridBalancedTree,i,ht.PINNED_LEFT,this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(o,this.gridBalancedTree,i,ht.PINNED_RIGHT,this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(n,this.gridBalancedTree,i,null,this.displayedTreeCentre),this.updateDisplayedMap()},i.prototype.updateDisplayedMap=function(){var t=this;this.displayedColumnsAndGroupsMap={};var e=function(e){t.displayedColumnsAndGroupsMap[e.getUniqueId()]=e};this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeCentre,e),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeLeft,e),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeRight,e)},i.prototype.isDisplayed=function(t){return this.displayedColumnsAndGroupsMap[t.getUniqueId()]===t},i.prototype.updateOpenClosedVisibilityInColumnGroups=function(){var t=this.getAllDisplayedTrees();this.columnUtils.depthFirstAllColumnTreeSearch(t,(function(t){t instanceof mt&&t.calculateDisplayedColumns()}))},i.prototype.getGroupAutoColumns=function(){return this.groupAutoColumns},i.prototype.createGroupAutoColumnsIfNeeded=function(){if(this.autoGroupsNeedBuilding){this.autoGroupsNeedBuilding=!1;var t=this.gridOptionsWrapper.isGroupUseEntireRow(this.pivotMode),e=this.pivotMode?this.gridOptionsWrapper.isPivotSuppressAutoColumn():this.gridOptionsWrapper.isGroupSuppressAutoColumn();if((this.rowGroupColumns.length>0||this.usingTreeData)&&!e&&!t){var o=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);(!this.autoColsEqual(o,this.groupAutoColumns)||this.forceRecreateAutoGroups)&&(this.groupAutoColumns=o)}else this.groupAutoColumns=null}},i.prototype.autoColsEqual=function(t,e){return h(t,e,(function(t,e){return t.getColId()===e.getColId()}))},i.prototype.getWidthOfColsInList=function(t){return t.reduce((function(t,e){return t+e.getActualWidth()}),0)},i.prototype.getGridBalancedTree=function(){return this.gridBalancedTree},i.prototype.hasFloatingFilters=function(){var t=this.gridOptionsWrapper.getDefaultColDef();return null!=t&&!0===t.floatingFilter||null!=this.columnDefs&&this.columnDefs.some((function(t){return!0===t.floatingFilter}))},i.prototype.getFirstDisplayedColumn=function(){var t=this.gridOptionsWrapper.isEnableRtl(),e=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];t&&e.reverse();for(var o=0;o<e.length;o++){var n=this[e[o]]();if(n.length)return t?d(n):n[0]}return null},$t([it("expressionService")],i.prototype,"expressionService",void 0),$t([it("columnFactory")],i.prototype,"columnFactory",void 0),$t([it("displayedGroupCreator")],i.prototype,"displayedGroupCreator",void 0),$t([it("autoWidthCalculator")],i.prototype,"autoWidthCalculator",void 0),$t([it("columnUtils")],i.prototype,"columnUtils",void 0),$t([it("columnAnimationService")],i.prototype,"columnAnimationService",void 0),$t([it("autoGroupColService")],i.prototype,"autoGroupColService",void 0),$t([rt("aggFuncService")],i.prototype,"aggFuncService",void 0),$t([rt("valueCache")],i.prototype,"valueCache",void 0),$t([rt("animationFrameService")],i.prototype,"animationFrameService",void 0),$t([it("rowModel")],i.prototype,"rowModel",void 0),$t([it("columnApi")],i.prototype,"columnApi",void 0),$t([it("gridApi")],i.prototype,"gridApi",void 0),$t([it("sortController")],i.prototype,"sortController",void 0),$t([it("columnDefFactory")],i.prototype,"columnDefFactory",void 0),$t([et],i.prototype,"init",null),$t([Zt(0,at("loggerFactory"))],i.prototype,"setBeans",null),i=$t([nt("columnController")],i)}(Mt);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function Jt(t,e){for(var o=""+t;o.length<e;)o="0"+o;return o}function te(t,e){for(var o=[],n=t;n<=e;n++)o.push(n);return o}function ee(t){return""!==t&&!isNaN(parseFloat(t))&&isFinite(t)}function oe(){return Number.MAX_SAFE_INTEGER||9007199254740991}function ne(t){return"number"!=typeof t?"":t.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")}var ie=Object.freeze({__proto__:null,padStart:Jt,createArrayOfNumbers:te,isNumeric:ee,getMaxSafeInteger:oe,cleanNumber:function(t){return"string"==typeof t&&(t=parseInt(t,10)),"number"==typeof t?Math.floor(t):null},decToHex:function(t,e){for(var o="",n=0;n<e;n++)o+=String.fromCharCode(255&t),t>>>=8;return o},formatNumberTwoDecimalPlacesAndCommas:function(t){return"number"!=typeof t?"":ne(Math.round(100*t)/100)},formatNumberCommas:ne,sum:function(t){return null==t?null:t.reduce((function(t,e){return t+e}),0)}}),re=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),se=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ae=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}re(e,t),e.prototype.calculateColInitialWidth=function(t){var e,o=this.gridOptionsWrapper,n=null!=t.minWidth?t.minWidth:o.getMinColWidth(),i=null!=t.maxWidth?t.maxWidth:o.getMaxColWidth()||oe(),s=r(t.width),a=r(t.initialWidth);return e=null!=s?s:null!=a?a:o.getColWidth(),Math.max(Math.min(e,i),n)},e.prototype.getOriginalPathForColumn=function(t,e){var o=[],n=!1,i=function(e,r){for(var s=0;s<e.length;s++){if(n)return;var a=e[s];if(a instanceof Ct)i(a.getChildren(),r+1),o[r]=a;else a===t&&(n=!0)}};return i(e,0),n?o:null},e.prototype.depthFirstOriginalTreeSearch=function(t,e,o){var n=this;e&&e.forEach((function(e){e instanceof Ct&&n.depthFirstOriginalTreeSearch(e,e.getChildren(),o),o(e,t)}))},e.prototype.depthFirstAllColumnTreeSearch=function(t,e){var o=this;t&&t.forEach((function(t){t instanceof mt&&o.depthFirstAllColumnTreeSearch(t.getChildren(),e),e(t)}))},e.prototype.depthFirstDisplayedColumnTreeSearch=function(t,e){var o=this;t&&t.forEach((function(t){t instanceof mt&&o.depthFirstDisplayedColumnTreeSearch(t.getDisplayedChildren(),e),e(t)}))},e=se([nt("columnUtils")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),le=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},pe=(function(t){function o(){return null!==t&&t.apply(this,arguments)||this}ae(o,t),o.prototype.createDisplayedGroups=function(t,e,o,n,i){var r,s,a=this,l=[],p=this.mapOldGroupsById(i);return t.forEach((function(t){for(var i=a.getOriginalPathForColumn(e,t),u=[],c=!s,h=0;h<i.length;h++)if(c||i[h]!==s[h]){var f=a.createColumnGroup(i[h],o,p,n);u[h]=f,0==h?l.push(f):u[h-1].addChild(f)}else u[h]=r[h];0===u.length?l.push(t):d(u).addChild(t);r=u,s=i})),this.setupParentsIntoColumns(l,null),l},o.prototype.createColumnGroup=function(t,o,n,i){var r=t.getGroupId(),s=o.getInstanceIdForKey(r),a=n[mt.createUniqueId(r,s)];return a&&a.getOriginalColumnGroup()!==t&&(a=null),e(a)?a.reset():(a=new mt(t,r,s,i),this.context.createBean(a)),a},o.prototype.mapOldGroupsById=function(t){var e={},o=function(t){t.forEach((function(t){if(t instanceof mt){var n=t;e[t.getUniqueId()]=n,o(n.getChildren())}}))};return t&&o(t),e},o.prototype.setupParentsIntoColumns=function(t,e){var o=this;t.forEach((function(t){if(t.setParent(e),t instanceof mt){var n=t;o.setupParentsIntoColumns(n.getChildren(),n)}}))},o.prototype.getOriginalPathForColumn=function(t,e){var o=[],n=!1,i=function(t,r){for(var s=0;s<t.length;s++){if(n)return;var a=t[s];if(a instanceof Ct)i(a.getChildren(),r+1),o[r]=a;else a===e&&(n=!0)}};return i(t,0),n?o:(console.warn("could not get path"),null)},le([it("columnUtils")],o.prototype,"columnUtils",void 0),o=le([nt("displayedGroupCreator")],o)}(Mt),function(){for(var t=0,e=0,o=arguments.length;e<o;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<o;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)n[i]=r[s];return n}),ue=function(){function t(){}return t.STRING_PROPERTIES=["sortingOrder","rowClass","rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","quickFilterText","rowModelType","editType","domLayout","clipboardDeliminator","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","serverSideStoreType"],t.OBJECT_PROPERTIES=["components","frameworkComponents","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultExportParams","columnTypes","rowClassRules","detailGridOptions","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","colResizeDefault","reduxStore","statusBar","sideBar","chartThemeOverrides","customChartThemes"],t.ARRAY_PROPERTIES=["alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes"],t.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","colWidth","headerHeight","groupHeaderHeight","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","minColWidth","maxColWidth","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","scrollbarWidth","batchUpdateWaitMillis","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay"],t.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellSelection","suppressHorizontalScroll","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","angularCompileRows","angularCompileFilters","groupSuppressAutoColumn","groupSelectsChildren","groupIncludeFooter","groupIncludeTotalFooter","groupUseEntireRow","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressParentsInRowNodes","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","rememberGroupStateWhenNewData","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","suppressAggAtRootLevel","suppressFocusAfterRefresh","functionsPassive","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","enableMultiRowDragging","enableGroupEdit","embedFullWidthRows","deprecatedEmbedFullWidthRows","suppressPaginationPanel","floatingFilter","groupHideOpenParents","groupMultiAutoColumn","pagination","stopEditingWhenGridLosesFocus","paginationAutoPageSize","suppressScrollOnNewData","purgeClosedRowNodes","cacheQuickFilter","deltaRowDataMode","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","treeData","masterDetail","suppressMultiRangeSelection","enterMovesDownAfterEdit","enterMovesDown","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressEnterpriseResetOnNewColumns","enableOldSetFilterModel","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","serverSideSortingAlwaysResets","reactNext","suppressSetColumnStateEvents","suppressColumnStateEvents","enableCharts","deltaColumnMode","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","immutableData","immutableColumns","pivotSuppressAutoColumn","suppressExpandablePivotGroups","applyColumnDefOrder","debounceVerticalScrollbar","detailRowAutoHeight","serverSideFilteringAlwaysResets","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction"],t.FUNCTION_PROPERTIES=["localeTextFunc","groupRowInnerRenderer","groupRowInnerRendererFramework","dateComponent","dateComponentFramework","groupRowRenderer","groupRowRendererFramework","isExternalFilterPresent","getRowHeight","doesExternalFilterPass","getRowClass","getRowStyle","getRowClassRules","traverseNode","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","groupRowAggNodes","getRowNodeId","isFullWidthCell","fullWidthCellRenderer","fullWidthCellRendererFramework","processSecondaryColDef","processSecondaryColGroupDef","getBusinessKeyForNode","sendToClipboard","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","getDetailRowData","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","loadingCellRenderer","loadingCellRendererFramework","loadingOverlayComponent","loadingOverlayComponentFramework","noRowsOverlayComponent","noRowsOverlayComponentFramework","detailCellRenderer","detailCellRendererFramework","defaultGroupSortComparator","isRowMaster","isRowSelectable","postSort","processHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","suppressKeyboardEvent","createChartContainer","processChartOptions","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideStoreParams","isServerSideGroupOpenByDefault"],t.ALL_PROPERTIES=pe(t.ARRAY_PROPERTIES,t.OBJECT_PROPERTIES,t.STRING_PROPERTIES,t.NUMBER_PROPERTIES,t.FUNCTION_PROPERTIES,t.BOOLEAN_PROPERTIES),t.FRAMEWORK_PROPERTIES=["__ob__","__v_skip","__metadata__","mappedColumnProperties","hasChildColumns","toColDef","createColDefFromGridColumn"],t}(),ce=function(){for(var t=0,e=0,o=arguments.length;e<o;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<o;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)n[i]=r[s];return n},de=function(){function t(){}return t.getEventCallbacks=function(){return t.EVENT_CALLBACKS||(t.EVENT_CALLBACKS=t.EVENTS.map((function(e){return t.getCallbackForEvent(e)}))),t.EVENT_CALLBACKS},t.copyAttributesToGridOptions=function(e,o,n){"object"!=typeof e&&(e={});var i=e,r=function(t){return void 0!==o[t]};return ce(t.ARRAY_PROPERTIES,t.STRING_PROPERTIES,t.OBJECT_PROPERTIES,t.FUNCTION_PROPERTIES,t.getEventCallbacks()).filter(r).forEach((function(t){return i[t]=o[t]})),t.BOOLEAN_PROPERTIES.filter(r).forEach((function(e){return i[e]=t.toBoolean(o[e])})),t.NUMBER_PROPERTIES.filter(r).forEach((function(e){return i[e]=t.toNumber(o[e])})),e},t.getCallbackForEvent=function(t){return!t||t.length<2?t:"on"+t[0].toUpperCase()+t.substr(1)},t.processOnChange=function(e,o,n,i){if(e){var r=o,s=function(t){return e[t]};ce(t.ARRAY_PROPERTIES,t.OBJECT_PROPERTIES,t.STRING_PROPERTIES,t.getEventCallbacks()).filter(s).forEach((function(t){return r[t]=e[t].currentValue})),t.BOOLEAN_PROPERTIES.filter(s).forEach((function(o){return r[o]=t.toBoolean(e[o].currentValue)})),t.NUMBER_PROPERTIES.filter(s).forEach((function(o){return r[o]=t.toNumber(e[o].currentValue)})),e.enableCellTextSelection&&n.setEnableCellTextSelection(t.toBoolean(e.enableCellTextSelection.currentValue)),e.quickFilterText&&n.setQuickFilter(e.quickFilterText.currentValue),e.rowData&&n.setRowData(e.rowData.currentValue),e.pinnedTopRowData&&n.setPinnedTopRowData(e.pinnedTopRowData.currentValue),e.pinnedBottomRowData&&n.setPinnedBottomRowData(e.pinnedBottomRowData.currentValue),e.autoGroupColumnDef&&n.setAutoGroupColumnDef(e.autoGroupColumnDef.currentValue,"gridOptionsChanged"),e.columnDefs&&n.setColumnDefs(e.columnDefs.currentValue,"gridOptionsChanged"),e.datasource&&n.setDatasource(e.datasource.currentValue),e.headerHeight&&n.setHeaderHeight(t.toNumber(e.headerHeight.currentValue)),e.paginationPageSize&&n.paginationSetPageSize(t.toNumber(e.paginationPageSize.currentValue)),e.pivotMode&&i.setPivotMode(t.toBoolean(e.pivotMode.currentValue)),e.groupRemoveSingleChildren&&n.setGroupRemoveSingleChildren(t.toBoolean(e.groupRemoveSingleChildren.currentValue)),e.suppressRowDrag&&n.setSuppressRowDrag(t.toBoolean(e.suppressRowDrag.currentValue)),e.suppressMoveWhenRowDragging&&n.setSuppressMoveWhenRowDragging(t.toBoolean(e.suppressMoveWhenRowDragging.currentValue)),e.suppressRowClickSelection&&n.setSuppressRowClickSelection(t.toBoolean(e.suppressRowClickSelection.currentValue)),e.suppressClipboardPaste&&n.setSuppressClipboardPaste(t.toBoolean(e.suppressClipboardPaste.currentValue)),e.sideBar&&n.setSideBar(e.sideBar.currentValue);var a={type:Wt.EVENT_COMPONENT_STATE_CHANGED,api:o.api,columnApi:o.columnApi};A(e,(function(t,e){a[t]=e})),n.dispatchEvent(a)}},t.toBoolean=function(t){return"boolean"==typeof t?t:"string"==typeof t&&("TRUE"===t.toUpperCase()||""==t)},t.toNumber=function(t){return"number"==typeof t?t:"string"==typeof t?Number(t):void 0},t.EVENTS=[],t.STRING_PROPERTIES=ue.STRING_PROPERTIES,t.OBJECT_PROPERTIES=ue.OBJECT_PROPERTIES,t.ARRAY_PROPERTIES=ue.ARRAY_PROPERTIES,t.NUMBER_PROPERTIES=ue.NUMBER_PROPERTIES,t.BOOLEAN_PROPERTIES=ue.BOOLEAN_PROPERTIES,t.FUNCTION_PROPERTIES=ue.FUNCTION_PROPERTIES,t.ALL_PROPERTIES=ue.ALL_PROPERTIES,t}();
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/de.EVENTS=l(Wt);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var he=function(){for(var t=0,e=0,o=arguments.length;e<o;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<o;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)n[i]=r[s];return n},fe=function(){function t(){}return t.STRING_PROPERTIES=["headerName","columnGroupShow","headerClass","toolPanelClass","headerValueGetter","pivotKeys","groupId","colId","sort","initialSort","field","type","tooltipComponent","tooltipField","headerTooltip","cellClass","showRowGroup","template","templateUrl","filter","initialAggFunc","aggFunc","cellRenderer","cellEditor","pinned","initialPinned","chartDataType"],t.OBJECT_PROPERTIES=["headerGroupComponent","headerGroupComponentFramework","headerGroupComponentParams","cellStyle","cellRendererParams","cellEditorFramework","cellEditorParams","pinnedRowCellRendererFramework","pinnedRowCellRendererParams","filterFramework","filterParams","pivotValueColumn","headerComponent","headerComponentFramework","headerComponentParams","floatingFilterComponent","floatingFilterComponentParams","floatingFilterComponentFramework","tooltipComponent","tooltipComponentParams","tooltipComponentFramework","refData","columnsMenuParams"],t.ARRAY_PROPERTIES=["children","sortingOrder","allowedAggFuncs","menuTabs","pivotTotalColumnIds","cellClassRules","icons"],t.NUMBER_PROPERTIES=["sortedAt","sortIndex","initialSortIndex","flex","initialFlex","width","initialWidth","minWidth","maxWidth","rowGroupIndex","initialRowGroupIndex","pivotIndex","initialPivotIndex"],t.BOOLEAN_PROPERTIES=["suppressCellFlash","suppressColumnsToolPanel","suppressFiltersToolPanel","openByDefault","marryChildren","hide","initialHide","rowGroup","initialRowGroup","pivot","initialPivot","checkboxSelection","headerCheckboxSelection","headerCheckboxSelectionFilteredOnly","suppressMenu","suppressMovable","lockPosition","lockVisible","lockPinned","unSortIcon","suppressSizeToFit","suppressAutoSize","enableRowGroup","enablePivot","enableValue","editable","suppressPaste","suppressNavigable","enableCellChangeFlash","rowDrag","dndSource","autoHeight","wrapText","sortable","resizable","singleClickEdit","floatingFilter"],t.FUNCTION_PROPERTIES=["dndSourceOnRowDrag","valueGetter","valueSetter","filterValueGetter","keyCreator","cellRenderer","cellRendererFramework","pinnedRowCellRenderer","valueFormatter","pinnedRowValueFormatter","valueParser","comparator","equals","pivotComparator","suppressKeyboardEvent","suppressHeaderKeyboardEvent","colSpan","rowSpan","getQuickFilterText","newValueHandler","onCellValueChanged","onCellClicked","onCellDoubleClicked","onCellContextMenu","rowDragText","tooltipValueGetter","tooltipComponent","tooltipComponentFramework","cellRendererSelector","cellEditorSelector"],t.ALL_PROPERTIES=he(t.ARRAY_PROPERTIES,t.OBJECT_PROPERTIES,t.STRING_PROPERTIES,t.NUMBER_PROPERTIES,t.FUNCTION_PROPERTIES,t.BOOLEAN_PROPERTIES),t.FRAMEWORK_PROPERTIES=["__ob__","__v_skip","__metadata__","mappedColumnProperties","hasChildColumns","toColDef","createColDefFromGridColumn"],t}(),ge=function(){function t(t,e,o,n){void 0===n&&(n=1),this.r=Math.min(1,Math.max(0,t||0)),this.g=Math.min(1,Math.max(0,e||0)),this.b=Math.min(1,Math.max(0,o||0)),this.a=Math.min(1,Math.max(0,n||0))}return t.fromString=function(e){if(e.indexOf("#")>=0)return t.fromHexString(e);var o=t.nameToHex[e];if(o)return t.fromHexString(o);if(e.indexOf("rgb")>=0)return t.fromRgbaString(e);throw new Error("Invalid color string: '"+e+"'")},t.fromHexString=function(e){var o=e.match(t.hexRe);if(o)return new t((n=parseInt(o[1],16))/255,(i=parseInt(o[2],16))/255,(r=parseInt(o[3],16))/255,(s=void 0!==o[4]?parseInt(o[4],16):255)/255);if(o=e.match(t.shortHexRe)){var n=parseInt(o[1],16),i=parseInt(o[2],16),r=parseInt(o[3],16),s=void 0!==o[4]?parseInt(o[4],16):15;return new t((n+=16*n)/255,(i+=16*i)/255,(r+=16*r)/255,(s+=16*s)/255)}throw new Error("Malformed hexadecimal color string: '"+e+"'")},t.fromRgbaString=function(e){var o=e.match(t.rgbRe);if(o)return new t(+o[1]/255,+o[2]/255,+o[3]/255);if(o=e.match(t.rgbaRe))return new t(+o[1]/255,+o[2]/255,+o[3]/255,+o[4]);throw new Error("Malformed rgb/rgba color string: '"+e+"'")},t.fromArray=function(e){if(4===e.length)return new t(e[0],e[1],e[2],e[3]);if(3===e.length)return new t(e[0],e[1],e[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")},t.fromHSB=function(e,o,n,i){void 0===i&&(i=1);var r=t.HSBtoRGB(e,o,n);return new t(r[0],r[1],r[2],i)},t.padHex=function(t){return 1===t.length?"0"+t:t},t.prototype.toHexString=function(){var e="#"+t.padHex(Math.round(255*this.r).toString(16))+t.padHex(Math.round(255*this.g).toString(16))+t.padHex(Math.round(255*this.b).toString(16));return this.a<1&&(e+=t.padHex(Math.round(255*this.a).toString(16))),e},t.prototype.toRgbaString=function(t){void 0===t&&(t=3);var e=[Math.round(255*this.r),Math.round(255*this.g),Math.round(255*this.b)],o=Math.pow(10,t);return 1!==this.a?(e.push(Math.round(this.a*o)/o),"rgba("+e.join(", ")+")"):"rgb("+e.join(", ")+")"},t.prototype.toString=function(){return 1===this.a?this.toHexString():this.toRgbaString()},t.prototype.toHSB=function(){return t.RGBtoHSB(this.r,this.g,this.b)},t.RGBtoHSB=function(t,e,o){var n=Math.min(t,e,o),i=Math.max(t,e,o),r=NaN;if(n!==i){var s=i-n,a=(i-t)/s,l=(i-e)/s,p=(i-o)/s;r=t===i?p-l:e===i?2+a-p:4+l-a,(r/=6)<0&&(r+=1)}return[360*r,0!==i?(i-n)/i:0,i]},t.HSBtoRGB=function(t,e,o){isNaN(t)&&(t=0),t=(t%360+360)%360/360;var n=0,i=0,r=0;if(0===e)n=i=r=o;else{var s=6*(t-Math.floor(t)),a=s-Math.floor(s),l=o*(1-e),p=o*(1-e*a),u=o*(1-e*(1-a));switch(s>>0){case 0:n=o,i=u,r=l;break;case 1:n=p,i=o,r=l;break;case 2:n=l,i=o,r=u;break;case 3:n=l,i=p,r=o;break;case 4:n=u,i=l,r=o;break;case 5:n=o,i=l,r=p}}return[n,i,r]},t.prototype.derive=function(e,o,n,i){var r=t.RGBtoHSB(this.r,this.g,this.b),s=r[2];0==s&&n>1&&(s=.05);var a=((r[0]+e)%360+360)%360,l=Math.max(Math.min(r[1]*o,1),0);s=Math.max(Math.min(s*n,1),0);var p=Math.max(Math.min(this.a*i,1),0),u=t.HSBtoRGB(a,l,s);return u.push(p),t.fromArray(u)},t.prototype.brighter=function(){return this.derive(0,1,1/.7,1)},t.prototype.darker=function(){return this.derive(0,1,.7,1)},t.hexRe=/\s*#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?\s*$/,t.shortHexRe=/\s*#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])?\s*$/,t.rgbRe=/\s*rgb\((\d+),\s*(\d+),\s*(\d+)\)\s*/,t.rgbaRe=/\s*rgba\((\d+),\s*(\d+),\s*(\d+),\s*([.\d]+)\)\s*/,t.nameToHex=Object.freeze({aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"}),t}();var ye,ve,me,Ce,we,Ee,Re=Object.freeze({__proto__:null,stringToArray:
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function(t,e){void 0===e&&(e=",");var o=[],n=function(t){return"\r"===t||"\n"===t},i=!1;if(""===t)return[[""]];for(var r,s,a,l=function(l,p,u){var c=t[u-1],d=t[u],h=t[u+1],f=function(){o[l]||(o[l]=[]),o[l][p]||(o[l][p]="")};if(f(),'"'===d){if(i)return'"'===h?(o[l][p]+='"',u++):i=!1,r=l,s=p,a=u,"continue";if(void 0===c||c===e||n(c))return i=!0,r=l,s=p,a=u,"continue"}if(!i){if(d===e)return p++,f(),r=l,s=p,a=u,"continue";if(n(d))return p=0,l++,f(),"\r"===d&&"\n"===h&&u++,r=l,s=p,a=u,"continue"}o[l][p]+=d,r=l,s=p,a=u},p=0,u=0,c=0;c<t.length;c++)l(p,u,c),p=r,u=s,c=a;return o}});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function Oe(){return void 0===ve&&(ve=/*@cc_on!@*/!!document.documentMode),ve}function Pe(){return void 0===me&&(me=!Oe()&&!!window.StyleMedia),me}function Se(){return void 0===ye&&(ye=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),ye}function be(){if(void 0===Ce){var t=window;Ce=!!t.chrome&&(!!t.chrome.webstore||!!t.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return Ce}function De(){if(void 0===we){var t=window;we=void 0!==t.InstallTrigger}return we}function Ae(){return void 0===Ee&&(Ee=(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!window.MSStream),Ee}function Te(t){if(!t)return null;var e=t.tabIndex,o=t.getAttribute("tabIndex");if(Oe()&&0===e&&null===o){return!0==={a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[t.nodeName.toLowerCase()]?"0":null}return-1!==e||null!==o&&(""!==o||De())?e.toString():null}function _e(){if(!document.body)return-1;var t=1e6,e=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,o=document.createElement("div");for(document.body.appendChild(o);;){var n=2*t;if(o.style.height=n+"px",n>e||o.clientHeight!==n)break;t=n}return document.body.removeChild(o),t}function Fe(){var t=document.body,e=document.createElement("div");e.style.width=e.style.height="100px",e.style.opacity="0",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar",e.style.position="absolute",t.appendChild(e);var o=e.offsetWidth-e.clientWidth;return 0===o&&0===e.clientWidth?null:(e.parentNode&&e.parentNode.removeChild(e),o)}function Ne(){return document.body?document.body.clientWidth:window.innerHeight?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:-1}function Le(){return document.body?document.body.clientHeight:window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:-1}var Ie,Ge=Object.freeze({__proto__:null,isBrowserIE:Oe,isBrowserEdge:Pe,isBrowserSafari:Se,isBrowserChrome:be,isBrowserFirefox:De,isIOSUserAgent:Ae,getTabIndex:Te,getMaxDivHeight:_e,getScrollbarWidth:Fe,hasOverflowScrolling:function(){var t=["webkit","moz","o","ms"],e=document.createElement("div"),o=!1;document.getElementsByTagName("body")[0].appendChild(e),e.setAttribute("style",t.map((function(t){return"-"+t+"-overflow-scrolling: touch"})).concat("overflow-scrolling: touch").join(";"));var n=window.getComputedStyle(e);if("touch"===n.overflowScrolling&&(o=!0),!o)for(var i=0,r=t;i<r.length;i++)if("touch"===n[r[i]+"OverflowScrolling"]){o=!0;break}return e.parentNode&&e.parentNode.removeChild(e),o},getBodyWidth:Ne,getBodyHeight:Le});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function Me(t,e){if(t&&e&&0!==e.length){if(!(e.indexOf(" ")>=0)){if(t.classList)t.classList.add(e);else if(t.className&&t.className.length>0){var o=t.className.split(" ");o.indexOf(e)<0&&(o.push(e),t.setAttribute("class",o.join(" ")))}else t.setAttribute("class",e);return t}e.split(" ").forEach((function(e){return Me(t,e)}))}}function xe(t,e){if(t&&e&&0!==e.length)if(e.indexOf(" ")>=0)e.split(" ").forEach((function(e){return xe(t,e)}));else if(t.classList)t.classList.remove(e);else if(t.className&&t.className.length>0){var o=t.className.split(" ").filter((function(t){return t!==e})).join(" ");t.setAttribute("class",o)}}function Ve(t,e,o){o?Me(t,e):xe(t,e)}function He(t,e){if(t.classList)return t.classList.contains(e);if(t.className){var o=t.className===e,n=t.className.indexOf(" "+e+" ")>=0,i=0===t.className.indexOf(e+" "),r=t.className.lastIndexOf(" "+e)===t.className.length-e.length-1;return o||n||i||r}return!1}function We(t){var e=Element.prototype.matches||Element.prototype.msMatchesSelector,o=e.call(t,ht.INPUT_SELECTOR),n=e.call(t,ht.FOCUSABLE_EXCLUDE),i=eo(t);return o&&!n&&i}function ke(t,e){Ve(t,"ag-hidden",!e)}function Be(t,e){Ve(t,"ag-invisible",!e)}function je(t,e){var o=e?function(t){return t.setAttribute("disabled","")}:function(t){return t.removeAttribute("disabled")};o(t),Oo(t.querySelectorAll("input"),(function(t){return o(t)}))}function Ue(t,e,o){for(var n=0;t;){if(He(t,e))return!0;if(t=t.parentElement,o&&++n>o)break}return!1}function ze(t){var e=window.getComputedStyle(t),o=e.height,n=e.width,i=e.paddingTop,r=e.paddingRight,s=e.paddingBottom,a=e.paddingLeft,l=e.marginTop,p=e.marginRight,u=e.marginBottom,c=e.marginLeft,d=e.boxSizing;return{height:parseFloat(o),width:parseFloat(n),paddingTop:parseFloat(i),paddingRight:parseFloat(r),paddingBottom:parseFloat(s),paddingLeft:parseFloat(a),marginTop:parseFloat(l),marginRight:parseFloat(p),marginBottom:parseFloat(u),marginLeft:parseFloat(c),boxSizing:d}}function Ke(t){var e=ze(t);return"border-box"===e.boxSizing?e.height-e.paddingTop-e.paddingBottom:e.height}function Ye(t){var e=ze(t);return"border-box"===e.boxSizing?e.width-e.paddingLeft-e.paddingRight:e.width}function qe(t){var e=ze(t),o=e.marginBottom+e.marginTop;return Math.ceil(t.offsetHeight+o)}function Xe(t){var e=ze(t),o=e.marginLeft+e.marginRight;return Math.ceil(t.offsetWidth+o)}function Qe(){if("boolean"==typeof Ie)return Ie;var t=document.createElement("div");return t.style.direction="rtl",t.style.width="1px",t.style.height="1px",t.style.position="fixed",t.style.top="0px",t.style.overflow="hidden",t.dir="rtl",t.innerHTML='<div style="width: 2px">\n <span style="display: inline-block; width: 1px"></span>\n <span style="display: inline-block; width: 1px"></span>\n </div>',document.body.appendChild(t),t.scrollLeft=1,Ie=0===Math.floor(t.scrollLeft),document.body.removeChild(t),Ie}function $e(t,e){var o=t.scrollLeft;return e&&(o=Math.abs(o),be()&&!Qe()&&(o=t.scrollWidth-t.clientWidth-o)),o}function Ze(t,e,o){o&&(Qe()?e*=-1:(Se()||be())&&(e=t.scrollWidth-t.clientWidth-e)),t.scrollLeft=e}function Je(t){for(;t&&t.firstChild;)t.removeChild(t.firstChild)}function to(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function eo(t){return null!==t.offsetParent}function oo(t){var e=document.createElement("div");return e.innerHTML=(t||"").trim(),e.firstChild}function no(t,e){t.lastChild?t.insertAdjacentHTML("afterbegin",e):t.innerHTML=e}function io(t){return t&&t.clientHeight?t.clientHeight:0}function ro(t){return t&&t.clientWidth?t.clientWidth:0}function so(t,e,o){o&&o.nextSibling===e||(o?o.nextSibling?t.insertBefore(e,o.nextSibling):t.appendChild(e):t.firstChild&&t.firstChild!==e&&t.insertAdjacentElement("afterbegin",e))}function ao(t,e){for(var o=0;o<e.length;o++){var n=e[o],i=t.children[o];i!==n&&t.insertBefore(n,i)}}function lo(t,e,o){var n;return o?(o.insertAdjacentHTML("afterend",e),n=o.nextSibling):(t.firstChild?t.insertAdjacentHTML("afterbegin",e):t.innerHTML=e,n=t.firstChild),n}function po(t,e){e&&Object.keys(e).forEach((function(o){var n=zt(o);n&&(t.style[n]=e[o])}))}function uo(t){return t.clientWidth<t.scrollWidth}function co(t){return t.clientHeight<t.scrollHeight}function ho(t,e){"flex"===e?(t.style.removeProperty("width"),t.style.removeProperty("minWidth"),t.style.removeProperty("maxWidth"),t.style.flex="1 1 auto"):fo(t,e)}function fo(t,e){e=yo(e),t.style.width=e.toString(),t.style.maxWidth=e.toString(),t.style.minWidth=e.toString()}function go(t,e){e=yo(e),t.style.height=e.toString(),t.style.maxHeight=e.toString(),t.style.minHeight=e.toString()}function yo(t){return"number"==typeof t?t+"px":t}function vo(t){return"function"==typeof Node?t instanceof Node:t&&"object"==typeof t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName}function mo(t){return"function"==typeof HTMLElement?t instanceof HTMLElement:t&&W(t)&&1===t.nodeType&&"string"==typeof t.nodeName}function Co(t){return vo(t)||mo(t)}function wo(t){if(null==t)return[];var e=[];return Oo(t,(function(t){return e.push(t)})),e}function Eo(t,e){if(t)for(var o=0;o<t.length;o++){var n=t[o];e(n.name,n.value)}}function Ro(t,e,o){null==o?t.removeAttribute(e):t.setAttribute(e,o.toString())}function Oo(t,e){if(null!=t)for(var o=0;o<t.length;o++)e(t[o])}var Po=Object.freeze({__proto__:null,addCssClass:Me,removeCssClass:xe,addOrRemoveCssClass:Ve,radioCssClass:function(t,e,o){for(var n=t.parentElement,i=n&&n.firstChild;i;)e&&Ve(i,e,i===t),o&&Ve(i,o,i!==t),i=i.nextSibling},containsClass:He,isFocusableFormField:We,setDisplayed:ke,setVisible:Be,setDisabled:je,isElementChildOfClass:Ue,getElementSize:ze,getInnerHeight:Ke,getInnerWidth:Ye,getAbsoluteHeight:qe,getAbsoluteWidth:Xe,isRtlNegativeScroll:Qe,getScrollLeft:$e,setScrollLeft:Ze,clearElement:Je,removeElement:function(t,e){to(t.querySelector(e))},removeFromParent:to,isVisible:eo,loadTemplate:oo,appendHtml:no,getElementAttribute:function(t,e){return t.attributes&&t.attributes[e]?t.attributes[e].value:null},offsetHeight:io,offsetWidth:ro,ensureDomOrder:so,setDomChildOrder:ao,insertTemplateWithDomOrder:lo,prependDC:function(t,o){e(t.firstChild)?t.insertBefore(o,t.firstChild):t.appendChild(o)},addStylesToElement:po,isHorizontalScrollShowing:uo,isVerticalScrollShowing:co,setElementWidth:ho,setFixedWidth:fo,setElementHeight:function(t,e){"flex"===e?(t.style.removeProperty("height"),t.style.removeProperty("minHeight"),t.style.removeProperty("maxHeight"),t.style.flex="1 1 auto"):go(t,e)},setFixedHeight:go,formatSize:yo,isNode:vo,isElement:mo,isNodeOrElement:Co,copyNodeList:wo,iterateNamedNodeMap:Eo,setCheckboxState:function(t,e){"boolean"==typeof e?(t.checked=e,t.indeterminate=!1):t.indeterminate=!0},addOrRemoveAttribute:Ro,nodeListForEach:Oo});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function So(t){if(!t)return"";var e=[];return A(t,(function(t,o){var n=Ut(t);e.push(n+": "+o+";")})),e.join(" ")}function bo(t,e){t.then((function(t){var o=t.getGui();null!=o&&("object"==typeof o?e.appendChild(o):e.innerHTML=o)}))}var Do=Object.freeze({__proto__:null,getNameOfClass:function(t){var e=t.toString(),o=/function (.{1,})\(/.exec(e);return o&&o.length>1?o[1]:""},findLineByLeastSquares:function(t){var e=t.length,o=0;if(e<=1)return t;for(var n=0;n<t.length;n++){var i=t[n];Math.floor(i)!==i&&(o=Math.max(o,i.toString().split(".")[1].length))}for(var r=0,s=0,a=0,l=0,p=0,u=0;u<e;u++)r+=u,s+=p=t[u],l+=u*u,a+=u*p;var c=(e*a-r*s)/(e*l-r*r),d=s/e-c*r/e,h=[];for(u=0;u<=e;u++)h.push(parseFloat((u*c+d).toFixed(o)));return h},cssStyleObjectToMarkup:So,message:function(t){var e=document.createElement("div"),o=document.querySelector("#__ag__message");if(e.innerHTML=t,!o){o=oo('<div id="__ag__message" style="display: inline-block; position: absolute; top: 0px; left: 0px; color: white; background-color: black; z-index: 20; padding: 2px; border: 1px solid darkred; height: 200px; overflow-y: auto;"></div>'),document.body&&document.body.appendChild(o)}o.insertBefore(e,o.children[0])},bindCellRendererToHtmlElement:bo});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function Ao(t,e,o){t.setAttribute(_o(e),o.toString())}function To(t,e){t.removeAttribute(_o(e))}function _o(t){return"aria-"+t}function Fo(t){return t.isSortAscending()?"ascending":t.isSortDescending()?"descending":"none"}function No(t){return parseInt(t.getAttribute("aria-posinset"),10)}function Lo(t){return t.getAttribute("aria-describedby")||""}function Io(t,e){Ao(t,"label",e)}function Go(t,e){Ao(t,"labelledby",e)}function Mo(t,e){Ao(t,"describedby",e)}function xo(t,e){Ao(t,"disabled",e)}function Vo(t,e){Ao(t,"expanded",e)}function Ho(t){To(t,"expanded")}function Wo(t,e){Ao(t,"setsize",e)}function ko(t,e){Ao(t,"posinset",e)}function Bo(t,e){Ao(t,"multiselectable",e)}function jo(t,e){Ao(t,"rowcount",e)}function Uo(t,e){Ao(t,"rowindex",e)}function zo(t,e){Ao(t,"colcount",e)}function Ko(t,e){Ao(t,"colindex",e)}function Yo(t,e){Ao(t,"colspan",e)}function qo(t,e){Ao(t,"sort",e)}function Xo(t){To(t,"sort")}function Qo(t,e){e?Ao(t,"selected",e):To(t,"selected")}function $o(t,e){Ao(t,"checked",void 0===e?"mixed":e)}var Zo=Object.freeze({__proto__:null,getAriaSortState:Fo,getAriaLevel:function(t){return parseInt(t.getAttribute("aria-level"),10)},getAriaPosInSet:No,getAriaDescribedBy:Lo,setAriaLabel:Io,setAriaLabelledBy:Go,setAriaDescribedBy:Mo,setAriaLevel:function(t,e){Ao(t,"level",e)},setAriaDisabled:xo,setAriaExpanded:Vo,removeAriaExpanded:Ho,setAriaSetSize:Wo,setAriaPosInSet:ko,setAriaMultiSelectable:Bo,setAriaRowCount:jo,setAriaRowIndex:Uo,setAriaColCount:zo,setAriaColIndex:Ko,setAriaColSpan:Yo,setAriaSort:qo,removeAriaSort:Xo,setAriaSelected:Qo,setAriaChecked:$o});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function Jo(t,e,o){if(void 0===e&&(e=!0),void 0===o&&(o="-"),!t)return null;var n=[t.getFullYear(),t.getMonth()+1,t.getDate()].map((function(t){return Jt(t,2)})).join(o);return e&&(n+=" "+[t.getHours(),t.getMinutes(),t.getSeconds()].map((function(t){return Jt(t,2)})).join(":")),n}function tn(t){if(!t)return null;var e=t.split(" "),o=e[0],n=e[1];if(!o)return null;var i=o.split("-").map((function(t){return parseInt(t,10)}));if(3!==i.filter((function(t){return!isNaN(t)})).length)return null;var r=i[0],s=i[1],a=i[2],l=new Date(r,s-1,a);if(l.getFullYear()!==r||l.getMonth()!==s-1||l.getDate()!==a)return null;if(!n||"00:00:00"===n)return l;var p=n.split(":").map((function(t){return parseInt(t,10)})),u=p[0],c=p[1],d=p[2];return u>=0&&u<24&&l.setHours(u),c>=0&&c<60&&l.setMinutes(c),d>=0&&d<60&&l.setSeconds(d),l}var en=Object.freeze({__proto__:null,serialiseDate:Jo,parseDateTimeFromString:tn});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function on(t,e,o){var n={},i=t.filter((function(t){return!e.some((function(e){return e===t}))}));return i.length>0&&i.forEach((function(t){return n[t]=nn(t,o)})),n}function nn(t,e,o,n){var i=n?an:sn,r=e.map((function(e){return{value:e,relevance:i(t.toLowerCase(),e.toLocaleLowerCase())}}));return r.sort((function(t,e){return e.relevance-t.relevance})),o&&(r=r.filter((function(t){return 0!==t.relevance}))),r.map((function(t){return t.value}))}function rn(t){var e,o,n,i=t.toLowerCase(),r=new Array(i.length-1);for(e=o=0,n=r.length;o<=n;e=o+=1)r[e]=i.slice(e,e+2);return r}function sn(t,e){if(0===t.length&&0===e.length)return 0;var o,n,i=rn(t),r=rn(e),s=i.length+r.length,a=0;for(o=0,n=i.length;o<n;o++){var l,p=i[o],u=void 0;for(u=0,l=r.length;u<l;u++){p===r[u]&&a++}}return a>0?2*a/s:0}function an(t,e){for(var o=t.replace(/\s/g,""),n=e.replace(/\s/g,""),i=0,r=0,s=0;s<o.length;s++){var a=n.indexOf(o[s]);-1!==a&&(r=a,i+=100*(n.length-r)/n.length,i*=i)}return i}var ln=Object.freeze({__proto__:null,fuzzyCheckStrings:on,fuzzySuggestions:nn,get_bigrams:rn,string_distances:sn,string_weighted_distances:an}),pn={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none"};
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function un(t,e,o){var n=cn(t,e,o);if(n&&n.className.indexOf("ag-icon")>-1)return n;var i=document.createElement("span");return i.appendChild(n),i}function cn(t,e,o,n){var i=null,r=o&&o.getColDef().icons;if(r&&(i=r[t]),e&&!i){var s=e.getIcons();s&&(i=s[t])}if(!i){var a=document.createElement("span"),l=pn[t];return l||(n?l=t:(console.warn("AG Grid: Did not find icon "+t),l="")),a.setAttribute("class","ag-icon ag-icon-"+l),a.setAttribute("unselectable","on"),a.setAttribute("role","presentation"),a}var p=void 0;if("function"==typeof i)p=i();else{if("string"!=typeof i)throw new Error("icon from grid options needs to be a string or a function");p=i}return"string"==typeof p?oo(p):Co(p)?p:void console.warn("AG Grid: iconRenderer should return back a string or a dom object")}var dn=Object.freeze({__proto__:null,iconNameClassMap:pn,createIcon:un,createIconNoSpan:cn});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function hn(t,e){return(t.which||t.keyCode)===e}function fn(t){if(t.altKey||t.ctrlKey||t.metaKey)return!1;var e=1===t.key.length,o=function(t){return(Pe()||Oe())&&"Del"===t.key&&46===t.charCode}(t);return e||o}function gn(t,e,o,n,i){var r=t.getSuppressKeyboardEventFunc(),s=n?n.getColDef().suppressKeyboardEvent:void 0;if(!r&&!s)return!1;var a={event:e,editing:i,column:n,api:t.getApi(),node:o,data:o.data,colDef:n.getColDef(),context:t.getContext(),columnApi:t.getColumnApi()};if(s&&s(a))return!0;return!!r&&r(a)}function yn(t,o,n,i){var r=i.getDefinition(),s=r&&r.suppressHeaderKeyboardEvent;return!!e(s)&&!!s({api:t.getApi(),columnApi:t.getColumnApi(),context:t.getContext(),colDef:r,column:i,headerRowIndex:n,event:o})}var vn=Object.freeze({__proto__:null,isKeyPressed:hn,isEventFromPrintableCharacter:fn,isUserSuppressingKeyboardEvent:gn,isUserSuppressingHeaderKeyboardEvent:yn});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/var mn=Object.freeze({__proto__:null,keys:function(t){var e=[];return t.forEach((function(t,o){return e.push(o)})),e}});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function Cn(t,e,o){if(0===o)return!1;var n=Math.abs(t.clientX-e.clientX),i=Math.abs(t.clientY-e.clientY);return Math.max(n,i)<=o}var wn=Object.freeze({__proto__:null,normalizeWheel:function(t){var e=0,o=0,n=0,i=0;return"detail"in t&&(o=t.detail),"wheelDelta"in t&&(o=-t.wheelDelta/120),"wheelDeltaY"in t&&(o=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=o,o=0),n=10*e,i=10*o,"deltaY"in t&&(i=t.deltaY),"deltaX"in t&&(n=t.deltaX),(n||i)&&t.deltaMode&&(1==t.deltaMode?(n*=40,i*=40):(n*=800,i*=800)),n&&!e&&(e=n<1?-1:1),i&&!o&&(o=i<1?-1:1),{spinX:e,spinY:o,pixelX:n,pixelY:i}},isLeftClick:function(t){return"buttons"in t?1==t.buttons:1==(t.which||t.button)},areEventsNear:Cn});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/var En=Object.freeze({__proto__:null,sortRowNodesByOrder:function(t,e){if(t){for(var o=function(t,o){var n=e[t.id],i=e[o.id],r=void 0!==n,s=void 0!==i;return r&&s?n-i:!r&&!s?t.__objectId-o.__objectId:r?1:-1},n=!1,i=0;i<t.length-1;i++)if(o(t[i],t[i+1])>0){n=!0;break}n&&t.sort(o)}},traverseNodesWithKey:function(t,e){var o=[];!function t(n){if(!n)return;n.forEach((function(n){if(n.group||n.hasChildren()){o.push(n.key);var i=o.join("|");e(n,i),t(n.childrenAfterGroup),o.pop()}}))}(t)}});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/function Rn(t){var e=new Set;return t.forEach((function(t){return e.add(t)})),e}var On,Pn=Object.freeze({__proto__:null,convertToSet:Rn}),Sn=function(){return(Sn=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},bn=Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn(Sn({},Do),Zo),D),Ge),Re),en),Po),It),J),ln),p),dn),vn),mn),wn),ie),k),En),Pn),Xt),Dn=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=1),this.nextValue=t,this.step=e}return t.prototype.next=function(){var t=this.nextValue;return this.nextValue+=this.step,t},t.prototype.peek=function(){return this.nextValue},t.prototype.skip=function(t){this.nextValue+=t},t}();
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/!function(t){t[t.IN_PROGRESS=0]="IN_PROGRESS",t[t.RESOLVED=1]="RESOLVED"}(On||(On={}));var An,Tn=function(){function t(t){var e=this;this.status=On.IN_PROGRESS,this.resolution=null,this.waiters=[],t((function(t){return e.onDone(t)}),(function(t){return e.onReject(t)}))}return t.all=function(e){return new t((function(t){var o=e.length,n=new Array(o);P(e,(function(e,i){e.then((function(e){n[i]=e,0===--o&&t(n)}))}))}))},t.resolve=function(e){return void 0===e&&(e=null),new t((function(t){return t(e)}))},t.prototype.then=function(e){var o=this;return new t((function(t){o.status===On.RESOLVED?t(e(o.resolution)):o.waiters.push((function(o){return t(e(o))}))}))},t.prototype.resolveNow=function(t,e){return this.status===On.RESOLVED?e(this.resolution):t},t.prototype.onDone=function(t){this.status=On.RESOLVED,this.resolution=t,P(this.waiters,(function(e){return e(t)}))},t.prototype.onReject=function(t){console.warn("TBI")},t}(),_n=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Fn=function(){return(Fn=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},Nn=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/!function(t){t[t.NOTHING=0]="NOTHING",t[t.WAITING_TO_SHOW=1]="WAITING_TO_SHOW",t[t.SHOWING=2]="SHOWING"}(An||(An={}));var Ln=function(t){function o(e){var o=t.call(this)||this;return o.DEFAULT_HIDE_TOOLTIP_TIMEOUT=1e4,o.SHOW_QUICK_TOOLTIP_DIFF=1e3,o.FADE_OUT_TOOLTIP_TIMEOUT=1e3,o.state=An.NOTHING,o.tooltipInstanceCount=0,o.tooltipMouseTrack=!1,o.parentComp=e,o}return _n(o,t),o.prototype.postConstruct=function(){this.tooltipShowDelay=this.gridOptionsWrapper.getTooltipShowDelay()||2e3,this.tooltipMouseTrack=this.gridOptionsWrapper.isTooltipMouseTrack();var t=this.parentComp.getGui();this.addManagedListener(t,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(t,"mouseleave",this.onMouseLeave.bind(this)),this.addManagedListener(t,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(t,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(t,"keydown",this.onKeyDown.bind(this))},o.prototype.destroy=function(){this.setToDoNothing(),t.prototype.destroy.call(this)},o.prototype.onMouseEnter=function(t){if(this.state==An.NOTHING){var e=this.isLastTooltipHiddenRecently()?200:this.tooltipShowDelay;this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),e),this.lastMouseEvent=t,this.state=An.WAITING_TO_SHOW}},o.prototype.onMouseLeave=function(){this.setToDoNothing()},o.prototype.onKeyDown=function(){this.setToDoNothing()},o.prototype.setToDoNothing=function(){this.state===An.SHOWING&&this.hideTooltip(),this.clearTimeouts(),this.state=An.NOTHING},o.prototype.onMouseMove=function(t){this.lastMouseEvent=t,this.tooltipMouseTrack&&this.state===An.SHOWING&&this.tooltipComp&&this.positionTooltipUnderLastMouseEvent()},o.prototype.onMouseDown=function(){this.setToDoNothing()},o.prototype.hideTooltip=function(){this.tooltipComp&&(this.destroyTooltipComp(),o.lastTooltipHideTime=(new Date).getTime()),this.state=An.NOTHING},o.prototype.destroyTooltipComp=function(){var t=this;Me(this.tooltipComp.getGui(),"ag-tooltip-hiding");var e=this.tooltipPopupDestroyFunc,o=this.tooltipComp;window.setTimeout((function(){e(),t.getContext().destroyBean(o)}),this.FADE_OUT_TOOLTIP_TIMEOUT),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0},o.prototype.isLastTooltipHiddenRecently=function(){return(new Date).getTime()-o.lastTooltipHideTime<this.SHOW_QUICK_TOOLTIP_DIFF},o.prototype.showTooltip=function(){var t=Fn({api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()},this.parentComp.getTooltipParams());if(e(t.value)){this.state=An.SHOWING,this.tooltipInstanceCount++;var o=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.newTooltipComponent(t).then(o)}else this.setToDoNothing()},o.prototype.newTooltipComponentCallback=function(t,e){if(this.state!==An.SHOWING||this.tooltipInstanceCount!==t)this.getContext().destroyBean(e);else{var o=e.getGui();this.tooltipComp=e,He(o,"ag-tooltip")||Me(o,"ag-tooltip-custom");var n=this.popupService.addPopup({eChild:o});n&&(this.tooltipPopupDestroyFunc=n.hideFunc),this.positionTooltipUnderLastMouseEvent(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.DEFAULT_HIDE_TOOLTIP_TIMEOUT)}},o.prototype.positionTooltipUnderLastMouseEvent=function(){this.popupService.positionPopupUnderMouseEvent({type:"tooltip",mouseEvent:this.lastMouseEvent,ePopup:this.tooltipComp.getGui(),nudgeY:18})},o.prototype.clearTimeouts=function(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0),this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)},Nn([it("popupService")],o.prototype,"popupService",void 0),Nn([it("userComponentFactory")],o.prototype,"userComponentFactory",void 0),Nn([it("columnApi")],o.prototype,"columnApi",void 0),Nn([it("gridApi")],o.prototype,"gridApi",void 0),Nn([et],o.prototype,"postConstruct",null),o}(Mt),In=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Gn=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Mn=new Dn,xn=function(t){function e(e){var o=t.call(this)||this;return o.annotatedGuiListeners=[],o.displayed=!0,o.visible=!0,o.compId=Mn.next(),o.cssClassStates={},e&&o.setTemplate(e),o}return In(e,t),e.prototype.preConstructOnComponent=function(){this.usingBrowserTooltips=this.gridOptionsWrapper.isEnableBrowserTooltips()},e.prototype.getCompId=function(){return this.compId},e.prototype.getTooltipParams=function(){return{value:this.tooltipText,location:"UNKNOWN"}},e.prototype.setTooltip=function(t){var e=this;this.tooltipText!=t&&(this.tooltipText&&(e.usingBrowserTooltips?e.getGui().removeAttribute("title"):e.tooltipFeature=e.destroyBean(e.tooltipFeature)),this.tooltipText=t,this.tooltipText&&(e.usingBrowserTooltips?e.getGui().setAttribute("title",e.tooltipText):e.tooltipFeature=e.createBean(new Ln(e))))},e.prototype.createChildComponentsFromTags=function(t,e){var o=this;P(wo(t.childNodes),(function(n){if(n instanceof HTMLElement){var i=o.createComponentFromElement(n,(function(t){o.copyAttributesFromNode(n,t.getGui())}),e);if(i){if(i.addItems&&n.children.length){o.createChildComponentsFromTags(n,e);var r=Array.prototype.slice.call(n.children);i.addItems(r)}o.swapComponentForNode(i,t,n)}else n.childNodes&&o.createChildComponentsFromTags(n,e)}}))},e.prototype.createComponentFromElement=function(t,e,o){var n=t.nodeName,i=o?o[t.getAttribute("ref")]:void 0,r=this.agStackComponentsRegistry.getComponentClass(n);if(r){var s=new r(i);return this.createBean(s,null,e),s}return null},e.prototype.copyAttributesFromNode=function(t,e){Eo(t.attributes,(function(t,o){return e.setAttribute(t,o)}))},e.prototype.swapComponentForNode=function(t,e,o){var n=t.getGui();e.replaceChild(n,o),e.insertBefore(document.createComment(o.nodeName),n),this.addDestroyFunc(this.destroyBean.bind(this,t)),this.swapInComponentForQuerySelectors(t,o)},e.prototype.swapInComponentForQuerySelectors=function(t,e){var o=this;this.iterateOverQuerySelectors((function(n){o[n.attributeName]===e&&(o[n.attributeName]=t)}))},e.prototype.iterateOverQuerySelectors=function(t){for(var e=Object.getPrototypeOf(this);null!=e;){var o=e.__agComponentMetaData,n=K(e.constructor);o&&o[n]&&o[n].querySelectors&&P(o[n].querySelectors,(function(e){return t(e)})),e=Object.getPrototypeOf(e)}},e.prototype.setTemplate=function(t,e){var o=oo(t);this.setTemplateFromElement(o,e)},e.prototype.setTemplateFromElement=function(t,e){this.eGui=t,this.eGui.__agComponent=this,this.addAnnotatedGuiEventListeners(),this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),e)},e.prototype.createChildComponentsPreConstruct=function(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())},e.prototype.wireQuerySelectors=function(){var t=this;if(this.eGui){var e=this;this.iterateOverQuerySelectors((function(o){var n=t.eGui.querySelector(o.querySelector);n&&(e[o.attributeName]=n.__agComponent||n)}))}},e.prototype.addAnnotatedGuiEventListeners=function(){var t=this;if(this.removeAnnotatedGuiEventListeners(),this.eGui){var e=this.getAgComponentMetaData("guiListenerMethods");e&&(this.annotatedGuiListeners||(this.annotatedGuiListeners=[]),e.forEach((function(e){var o=t.getRefElement(e.ref);if(o){var n=t[e.methodName].bind(t);o.addEventListener(e.eventName,n),t.annotatedGuiListeners.push({eventName:e.eventName,listener:n,element:o})}})))}},e.prototype.addAnnotatedGridEventListeners=function(){var t=this,e=this.getAgComponentMetaData("gridListenerMethods");e&&e.forEach((function(e){var o=t[e.methodName].bind(t);t.addManagedListener(t.eventService,e.eventName,o)}))},e.prototype.getAgComponentMetaData=function(t){for(var e=[],o=Object.getPrototypeOf(this);null!=o;){var n=o.__agComponentMetaData,i=K(o.constructor);n&&n[i]&&n[i][t]&&(e=e.concat(n[i][t])),o=Object.getPrototypeOf(o)}return e},e.prototype.removeAnnotatedGuiEventListeners=function(){this.annotatedGuiListeners&&(P(this.annotatedGuiListeners,(function(t){t.element.removeEventListener(t.eventName,t.listener)})),this.annotatedGuiListeners=[])},e.prototype.getGui=function(){return this.eGui},e.prototype.getFocusableElement=function(){return this.eGui},e.prototype.setParentComponent=function(t){this.parentComponent=t},e.prototype.getParentComponent=function(){return this.parentComponent},e.prototype.setGui=function(t){this.eGui=t},e.prototype.queryForHtmlElement=function(t){return this.eGui.querySelector(t)},e.prototype.queryForHtmlInputElement=function(t){return this.eGui.querySelector(t)},e.prototype.appendChild=function(t,e){if(e||(e=this.eGui),null!=t)if(Co(t))e.appendChild(t);else{var o=t;e.appendChild(o.getGui()),this.addDestroyFunc(this.destroyBean.bind(this,o))}},e.prototype.isDisplayed=function(){return this.displayed},e.prototype.setVisible=function(t){t!==this.visible&&(this.visible=t,Be(this.eGui,t))},e.prototype.setDisplayed=function(t){if(t!==this.displayed){this.displayed=t,ke(this.eGui,t);var o={type:e.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(o)}},e.prototype.destroy=function(){this.removeAnnotatedGuiEventListeners(),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),t.prototype.destroy.call(this)},e.prototype.addGuiEventListener=function(t,e){var o=this;this.eGui.addEventListener(t,e),this.addDestroyFunc((function(){return o.eGui.removeEventListener(t,e)}))},e.prototype.addCssClass=function(t){!0!==this.cssClassStates[t]&&(Me(this.eGui,t),this.cssClassStates[t]=!0)},e.prototype.removeCssClass=function(t){!1!==this.cssClassStates[t]&&(xe(this.eGui,t),this.cssClassStates[t]=!1)},e.prototype.addOrRemoveCssClass=function(t,e){this.cssClassStates[t]!==e&&(Ve(this.eGui,t,e),this.cssClassStates[t]=e)},e.prototype.getAttribute=function(t){var e=this.eGui;return e?e.getAttribute(t):null},e.prototype.getRefElement=function(t){return this.queryForHtmlElement('[ref="'+t+'"]')},e.EVENT_DISPLAYED_CHANGED="displayedChanged",Gn([it("agStackComponentsRegistry")],e.prototype,"agStackComponentsRegistry",void 0),Gn([tt],e.prototype,"preConstructOnComponent",null),Gn([tt],e.prototype,"createChildComponentsPreConstruct",null),Gn([et],e.prototype,"addAnnotatedGridEventListeners",null),e}(Mt),Vn=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Hn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Vn(e,t),e.prototype.isPopup=function(){return!0},e.prototype.setParentComponent=function(e){Me(e.getGui(),"ag-has-popup"),t.prototype.setParentComponent.call(this,e)},e.prototype.destroy=function(){var e=this.parentComponent;e&&e.isAlive()&&xe(e.getGui(),"ag-has-popup"),t.prototype.destroy.call(this)},e}(xn);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
function Wn(t){return kn.bind(this,"[ref="+t+"]")}function kn(t,e,o,n){null!==t?"number"!=typeof n?function(t,e,o){var n=function(t,e){t.__agComponentMetaData||(t.__agComponentMetaData={});t.__agComponentMetaData[e]||(t.__agComponentMetaData[e]={});return t.__agComponentMetaData[e]}
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/(t,K(t.constructor));n[e]||(n[e]=[]);n[e].push(o)}(e,"querySelectors",{attributeName:o,querySelector:t}):console.error("AG Grid: QuerySelector should be on an attribute"):console.error("AG Grid: QuerySelector selector should not be null")}var Bn,jn=function(){function t(){}return t.BACKSPACE=8,t.TAB=9,t.ENTER=13,t.SHIFT=16,t.ESCAPE=27,t.SPACE=32,t.LEFT=37,t.UP=38,t.RIGHT=39,t.DOWN=40,t.DELETE=46,t.A=65,t.C=67,t.V=86,t.D=68,t.Z=90,t.Y=89,t.F2=113,t.PAGE_UP=33,t.PAGE_DOWN=34,t.PAGE_HOME=36,t.PAGE_END=35,t}(),Un=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),zn=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Kn=function(t){function o(){return t.call(this,o.TEMPLATE)||this}return Un(o,t),o.prototype.init=function(t){this.params=t;var o,n=this.eInput;t.cellStartedEdit?(this.focusAfterAttached=!0,t.keyPress===jn.BACKSPACE||t.keyPress===jn.DELETE?o="":t.charPress?o=t.charPress:(o=this.getStartValue(t),t.keyPress!==jn.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,o=this.getStartValue(t)),e(o)&&n.setValue(o,!0),this.addManagedListener(n.getGui(),"keydown",(function(t){var e=t.keyCode;e!==jn.PAGE_UP&&e!==jn.PAGE_DOWN||t.preventDefault()}))},o.prototype.afterGuiAttached=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),o=this.eInput;if(o.setInputAriaLabel(t("ariaInputEditor","Input Editor")),this.focusAfterAttached){Se()||o.getFocusableElement().focus();var n=o.getInputElement();if(this.highlightAllOnFocus)n.select();else{var i=o.getValue(),r=e(i)&&i.length||0;r&&n.setSelectionRange(r,r)}}},o.prototype.focusIn=function(){var t=this.eInput,e=t.getFocusableElement(),o=t.getInputElement();e.focus(),o.select()},o.prototype.focusOut=function(){var t=this.eInput.getInputElement();Oe()&&t.setSelectionRange(0,0)},o.prototype.getValue=function(){var t=this.eInput;return this.params.parseValue(t.getValue())},o.prototype.getStartValue=function(t){return t.useFormatter||t.column.getColDef().refData?t.formatValue(t.value):t.value},o.prototype.isPopup=function(){return!1},o.TEMPLATE='<div class="ag-cell-edit-wrapper"><ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field></div>',zn([Wn("eInput")],o.prototype,"eInput",void 0),o}(Hn),Yn=function(){function t(t,e,o,n){var i=this;this.alive=!0,this.context=t,e.newDateComponent(o).then((function(e){i.alive?(i.dateComp=e,e&&(n.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached(),i.tempValue&&e.setDate(i.tempValue))):t.destroyBean(e)}))}return t.prototype.destroy=function(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)},t.prototype.getDate=function(){return this.dateComp?this.dateComp.getDate():this.tempValue},t.prototype.setDate=function(t){this.dateComp?this.dateComp.setDate(t):this.tempValue=t},t.prototype.setInputPlaceholder=function(t){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(t)},t.prototype.setInputAriaLabel=function(t){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(t)},t.prototype.afterGuiAttached=function(t){this.dateComp&&"function"==typeof this.dateComp.afterGuiAttached&&this.dateComp.afterGuiAttached(t)},t}(),qn=function(){function t(){this.customFilterOptions={}}return t.prototype.init=function(t,e){this.filterOptions=t.filterOptions||e,this.mapCustomOptions(),this.selectDefaultItem(t)},t.prototype.getFilterOptions=function(){return this.filterOptions},t.prototype.mapCustomOptions=function(){var t=this;this.filterOptions&&this.filterOptions.forEach((function(e){if("string"!=typeof e){R(["displayKey","displayName","test"],(function(t){return!!e[t]||(console.warn("AG Grid: ignoring FilterOptionDef as it doesn't contain a '"+t+"'"),!1)}))&&(t.customFilterOptions[e.displayKey]=e)}}))},t.prototype.selectDefaultItem=function(t){if(t.defaultOption)this.defaultOption=t.defaultOption;else if(this.filterOptions.length>=1){var e=this.filterOptions[0];"string"==typeof e?this.defaultOption=e:e.displayKey?this.defaultOption=e.displayKey:console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")},t.prototype.getDefaultOption=function(){return this.defaultOption},t.prototype.getCustomOption=function(t){return this.customFilterOptions[t]},t}(),Xn={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose One",equals:"Equals",notEqual:"Not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"In range",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equals",greaterThanOrEqual:"Greater than or equals",contains:"Contains",notContains:"Not contains",startsWith:"Starts with",endsWith:"Ends with",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"},Qn=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),$n=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Zn=function(t){function e(e,o){void 0===o&&(o=!1);var n=t.call(this,e)||this;return n.isFocusableContainer=o,n.skipTabGuardFocus=!1,n}return Qn(e,t),e.prototype.postConstruct=function(){var t=this,o=this.getFocusableElement();o&&(Me(o,e.FOCUS_MANAGED_CLASS),this.isFocusableContainer&&(this.topTabGuard=this.createTabGuard("top"),this.bottomTabGuard=this.createTabGuard("bottom"),this.addTabGuards(),this.activateTabGuards(),this.forEachTabGuard((function(e){return t.addManagedListener(e,"focus",t.onFocus.bind(t))}))),this.addKeyDownListeners(o),this.addManagedListener(o,"focusin",this.onFocusIn.bind(this)),this.addManagedListener(o,"focusout",this.onFocusOut.bind(this)))},e.prototype.focusInnerElement=function(t){void 0===t&&(t=!1);var e=this.focusController.findFocusableElements(this.getFocusableElement());this.isFocusableContainer&&this.tabGuardsAreActive()&&(e.splice(0,1),e.splice(e.length-1,1)),e.length&&e[t?e.length-1:0].focus()},e.prototype.onTabKeyDown=function(t){var e=this;if(!t.defaultPrevented){var o=this.tabGuardsAreActive();this.isFocusableContainer&&o&&this.deactivateTabGuards();var n=this.focusController.findNextFocusableElement(this.getFocusableElement(),!1,t.shiftKey);this.isFocusableContainer&&o&&setTimeout((function(){return e.activateTabGuards()}),0),n&&(n.focus(),t.preventDefault())}},e.prototype.onFocusIn=function(t){this.isFocusableContainer&&this.deactivateTabGuards()},e.prototype.onFocusOut=function(t){this.isFocusableContainer&&!this.getFocusableElement().contains(t.relatedTarget)&&this.activateTabGuards()},e.prototype.forceFocusOutOfContainer=function(t){if(void 0===t&&(t=!1),this.isFocusableContainer){this.activateTabGuards(),this.skipTabGuardFocus=!0;var e=t?this.topTabGuard:this.bottomTabGuard;e&&e.focus()}},e.prototype.appendChild=function(e,o){if(this.isFocusableContainer){Co(e)||(e=e.getGui());var n=this.bottomTabGuard;n?n.insertAdjacentElement("beforebegin",e):t.prototype.appendChild.call(this,e,o)}else t.prototype.appendChild.call(this,e,o)},e.prototype.createTabGuard=function(t){var e=document.createElement("div");return e.classList.add("ag-tab-guard"),e.classList.add("ag-tab-guard-"+t),e.setAttribute("role","presentation"),e},e.prototype.addTabGuards=function(){var t=this.getFocusableElement();t.insertAdjacentElement("afterbegin",this.topTabGuard),t.insertAdjacentElement("beforeend",this.bottomTabGuard)},e.prototype.forEachTabGuard=function(t){this.topTabGuard&&t(this.topTabGuard),this.bottomTabGuard&&t(this.bottomTabGuard)},e.prototype.addKeyDownListeners=function(t){var e=this;this.addManagedListener(t,"keydown",(function(t){t.defaultPrevented||Pt(t)||(e.shouldStopEventPropagation(t)?Ot(t):t.keyCode===jn.TAB?e.onTabKeyDown(t):e.handleKeyDown&&e.handleKeyDown(t))}))},e.prototype.shouldStopEventPropagation=function(t){return!1},e.prototype.onFocus=function(t){this.skipTabGuardFocus?this.skipTabGuardFocus=!1:this.focusInnerElement(t.target===this.bottomTabGuard)},e.prototype.activateTabGuards=function(){this.forEachTabGuard((function(t){return t.setAttribute("tabIndex","0")}))},e.prototype.deactivateTabGuards=function(){this.forEachTabGuard((function(t){return t.removeAttribute("tabIndex")}))},e.prototype.tabGuardsAreActive=function(){return!!this.topTabGuard&&this.topTabGuard.hasAttribute("tabIndex")},e.prototype.clearGui=function(){var t=this.tabGuardsAreActive();Je(this.getFocusableElement()),this.isFocusableContainer&&(this.addTabGuards(),t&&this.activateTabGuards())},e.FOCUS_MANAGED_CLASS="ag-focus-managed",$n([it("focusController")],e.prototype,"focusController",void 0),$n([et],e.prototype,"postConstruct",null),e}(xn),Jn=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ti=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ei=function(t){function e(e){var o=t.call(this)||this;return o.filterNameKey=e,o.applyActive=!1,o.hidePopup=null,o.appliedModel=null,o}return Jn(e,t),e.prototype.getFilterTitle=function(){return this.translate(this.filterNameKey)},e.prototype.onFilterChanged=function(){console.warn("AG Grid: you should not call onFilterChanged() directly on the filter, please call\n gridApi.onFilterChanged() instead. onFilterChanged is not part of the exposed filter interface (it was\n a method that existed on an old version of the filters that was not intended for public use."),this.providedFilterParams.filterChangedCallback()},e.prototype.isFilterActive=function(){return!!this.appliedModel},e.prototype.postConstruct=function(){this.resetTemplate(),t.prototype.postConstruct.call(this)},e.prototype.resetTemplate=function(t){var e='\n <div class="ag-filter-wrapper">\n <div class="ag-filter-body-wrapper ag-'+this.getCssIdentifier()+'-body-wrapper">\n '+this.createBodyTemplate()+"\n </div>\n </div>";this.setTemplate(e,t)},e.prototype.init=function(t){var e=this;this.setParams(t),this.resetUiToDefaults(!0).then((function(){e.updateUiVisibility(),e.setupOnBtApplyDebounce()}))},e.prototype.setParams=function(t){if(e.checkForDeprecatedParams(t),this.providedFilterParams=t,"keep"===t.newRowsAction)this.newRowsActionKeep=!0;else if("clear"===t.newRowsAction)this.newRowsActionKeep=!1;else{var o=[ht.ROW_MODEL_TYPE_SERVER_SIDE,ht.ROW_MODEL_TYPE_INFINITE];this.newRowsActionKeep=o.indexOf(this.rowModel.getType())>=0}this.applyActive=e.isUseApplyButton(t),this.createButtonPanel()},e.prototype.createButtonPanel=function(){var t=this,e=this.providedFilterParams.buttons;if(e&&!(e.length<1)){var o=document.createElement("div");Me(o,"ag-filter-apply-panel");Rn(e).forEach((function(e){return function(e){var n,i;switch(e){case"apply":n=t.translate("applyFilter"),i=function(e){return t.onBtApply(!1,!1,e)};break;case"clear":n=t.translate("clearFilter"),i=function(){return t.onBtClear()};break;case"reset":n=t.translate("resetFilter"),i=function(){return t.onBtReset()};break;case"cancel":n=t.translate("cancelFilter"),i=function(e){t.onBtCancel(e)};break;default:return void console.warn("Unknown button type specified")}var r=oo('<button\n type="button"\n ref="'+e+'FilterButton"\n class="ag-standard-button ag-filter-apply-panel-button"\n >'+n+"\n </button>");o.appendChild(r),t.addManagedListener(r,"click",i)}(e)})),this.getGui().appendChild(o)}},e.checkForDeprecatedParams=function(t){var e=t.buttons||[];if(!(e.length>0)){var o=t.applyButton,n=t.resetButton;t.clearButton&&(console.warn("AG Grid: as of AG Grid v23.2, filterParams.clearButton is deprecated. Please use filterParams.buttons instead"),e.push("clear")),n&&(console.warn("AG Grid: as of AG Grid v23.2, filterParams.resetButton is deprecated. Please use filterParams.buttons instead"),e.push("reset")),o&&(console.warn("AG Grid: as of AG Grid v23.2, filterParams.applyButton is deprecated. Please use filterParams.buttons instead"),e.push("apply")),t.apply&&(console.warn("AG Grid: as of AG Grid v21, filterParams.apply is deprecated. Please use filterParams.buttons instead"),e.push("apply")),t.buttons=e}},e.prototype.getDefaultDebounceMs=function(){return 0},e.prototype.setupOnBtApplyDebounce=function(){var t=e.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs());this.onBtApplyDebounce=$(this.onBtApply.bind(this),t)},e.prototype.getModel=function(){return this.appliedModel},e.prototype.setModel=function(t){var e=this;return(t?this.setModelIntoUi(t):this.resetUiToDefaults()).then((function(){e.updateUiVisibility(),e.applyModel()}))},e.prototype.onBtCancel=function(t){var e=this;this.setModelIntoUi(this.getModel()).then((function(){e.onUiChanged(!1,"prevent"),e.providedFilterParams.closeOnApply&&e.close(t)}))},e.prototype.onBtClear=function(){var t=this;this.resetUiToDefaults().then((function(){return t.onUiChanged()}))},e.prototype.onBtReset=function(){this.onBtClear(),this.onBtApply()},e.prototype.applyModel=function(){var t=this.getModelFromUi();if(!this.isModelValid(t))return!1;var e=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(e,t)},e.prototype.isModelValid=function(t){return!0},e.prototype.onBtApply=function(t,e,o){void 0===t&&(t=!1),void 0===e&&(e=!1),this.applyModel()&&this.providedFilterParams.filterChangedCallback({afterFloatingFilter:t,afterDataChange:e}),this.providedFilterParams.closeOnApply&&this.applyActive&&!t&&!e&&this.close(o)},e.prototype.onNewRowsLoaded=function(){var t=this;this.newRowsActionKeep||this.resetUiToDefaults().then((function(){return t.appliedModel=null}))},e.prototype.close=function(t){if(this.hidePopup){var e,o=t,n=o&&o.key;"Enter"!==n&&"Space"!==n||(e={keyboardEvent:o}),this.hidePopup(e),this.hidePopup=null}},e.prototype.isNewRowsActionKeep=function(){return this.newRowsActionKeep},e.prototype.onUiChanged=function(t,e){if(void 0===t&&(t=!1),this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive){var o=this.isModelValid(this.getModelFromUi());je(this.getRefElement("applyFilterButton"),!o)}t&&!e||"immediately"===e?this.onBtApply(t):(this.applyActive||e)&&"debounce"!==e||this.onBtApplyDebounce()},e.prototype.afterGuiAttached=function(t){null!=t&&(this.hidePopup=t.hidePopup)},e.getDebounceMs=function(t,o){return e.isUseApplyButton(t)?(null!=t.debounceMs&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):null!=t.debounceMs?t.debounceMs:o},e.isUseApplyButton=function(t){return e.checkForDeprecatedParams(t),!!t.buttons&&t.buttons.indexOf("apply")>=0},e.prototype.destroy=function(){this.hidePopup=null,t.prototype.destroy.call(this)},e.prototype.translate=function(t){return this.gridOptionsWrapper.getLocaleTextFunc()(t,Xn[t])},ti([it("rowModel")],e.prototype,"rowModel",void 0),ti([et],e.prototype,"postConstruct",null),e}(Zn),oi=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ni=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/!function(t){t[t.One=0]="One",t[t.Two=1]="Two"}(Bn||(Bn={}));var ii,ri=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return oi(e,t),e.prototype.showValueFrom=function(t){return!this.doesFilterHaveHiddenInput(t)&&t!==e.EMPTY},e.prototype.showValueTo=function(t){return t===e.IN_RANGE},e.prototype.onFloatingFilterChanged=function(t,e){this.setTypeFromFloatingFilter(t),this.setValueFromFloatingFilter(e),this.onUiChanged(!0)},e.prototype.setTypeFromFloatingFilter=function(t){this.eType1.setValue(t),this.eType2.setValue(this.optionsFactory.getDefaultOption()),(this.isDefaultOperator("AND")?this.eJoinOperatorAnd:this.eJoinOperatorOr).setValue(!0)},e.prototype.getModelFromUi=function(){return this.isConditionUiComplete(Bn.One)?this.isAllowTwoConditions()&&this.isConditionUiComplete(Bn.Two)?{filterType:this.getFilterType(),operator:this.getJoinOperator(),condition1:this.createCondition(Bn.One),condition2:this.createCondition(Bn.Two)}:this.createCondition(Bn.One):null},e.prototype.getCondition1Type=function(){return this.eType1.getValue()},e.prototype.getCondition2Type=function(){return this.eType2.getValue()},e.prototype.getJoinOperator=function(){return!0===this.eJoinOperatorOr.getValue()?"OR":"AND"},e.prototype.areModelsEqual=function(t,e){if(!t&&!e)return!0;if(!t&&e||t&&!e)return!1;var o,n=!t.operator,i=!e.operator;if(!n&&i||n&&!i)return!1;if(n){var r=t,s=e;o=this.areSimpleModelsEqual(r,s)}else{var a=t,l=e;o=a.operator===l.operator&&this.areSimpleModelsEqual(a.condition1,l.condition1)&&this.areSimpleModelsEqual(a.condition2,l.condition2)}return o},e.prototype.setModelIntoUi=function(t){if(t.operator){var e=t,o="OR"===e.operator;this.eJoinOperatorAnd.setValue(!o),this.eJoinOperatorOr.setValue(o),this.eType1.setValue(e.condition1.type),this.eType2.setValue(e.condition2.type),this.setConditionIntoUi(e.condition1,Bn.One),this.setConditionIntoUi(e.condition2,Bn.Two)}else{var n=t;this.eJoinOperatorAnd.setValue(this.isDefaultOperator("AND")),this.eJoinOperatorOr.setValue(this.isDefaultOperator("OR")),this.eType1.setValue(n.type),this.eType2.setValue(this.optionsFactory.getDefaultOption()),this.setConditionIntoUi(n,Bn.One),this.setConditionIntoUi(null,Bn.Two)}return Tn.resolve()},e.prototype.doesFilterPass=function(t){var e=this,o=this.getModel();if(null==o)return!0;var n=o.operator,i=[];if(n){var r=o;i.push(r.condition1,r.condition2)}else i.push(o);return(n&&"OR"===n?O:R)(i,(function(o){return e.individualConditionPasses(t,o)}))},e.prototype.setParams=function(e){t.prototype.setParams.call(this,e),this.optionsFactory=new qn,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.allowTwoConditions=!e.suppressAndOrCondition,this.alwaysShowBothConditions=!!e.alwaysShowBothConditions,this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.putOptionsIntoDropdown(),this.addChangedListeners()},e.prototype.getDefaultJoinOperator=function(t){return C(["AND","OR"],t)?t:"AND"},e.prototype.putOptionsIntoDropdown=function(){var t=this,e=this.optionsFactory.getFilterOptions();P(e,(function(e){var o,n;if("string"==typeof e)o=e,n=t.translate(o);else{o=e.displayKey;var i=t.optionsFactory.getCustomOption(o);n=i?t.gridOptionsWrapper.getLocaleTextFunc()(i.displayKey,i.displayName):t.translate(o)}var r=function(){return{value:o,text:n}};t.eType1.addOption(r()),t.eType2.addOption(r())}));var o=e.length<=1;this.eType1.setDisabled(o),this.eType2.setDisabled(o)},e.prototype.isAllowTwoConditions=function(){return this.allowTwoConditions},e.prototype.createBodyTemplate=function(){return'\n <ag-select class="ag-filter-select" ref="eOptions1"></ag-select>\n '+this.createValueTemplate(Bn.One)+'\n <div class="ag-filter-condition" ref="eJoinOperatorPanel">\n <ag-radio-button ref="eJoinOperatorAnd" class="ag-filter-condition-operator ag-filter-condition-operator-and"></ag-radio-button>\n <ag-radio-button ref="eJoinOperatorOr" class="ag-filter-condition-operator ag-filter-condition-operator-or"></ag-radio-button>\n </div>\n <ag-select class="ag-filter-select" ref="eOptions2"></ag-select>\n '+this.createValueTemplate(Bn.Two)},e.prototype.getCssIdentifier=function(){return"simple-filter"},e.prototype.updateUiVisibility=function(){var t=this.isCondition2Enabled();this.alwaysShowBothConditions?(this.eJoinOperatorAnd.setDisabled(!t),this.eJoinOperatorOr.setDisabled(!t),this.eType2.setDisabled(!t),je(this.eCondition2Body,!t)):(ke(this.eJoinOperatorPanel,t),ke(this.eType2.getGui(),t),ke(this.eCondition2Body,t))},e.prototype.isCondition2Enabled=function(){return this.allowTwoConditions&&this.isConditionUiComplete(Bn.One)},e.prototype.resetUiToDefaults=function(t){var e=this.gridOptionsWrapper.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator"),o="ag-simple-filter-and-or-"+this.getCompId(),n=this.optionsFactory.getDefaultOption();return this.eType1.setValue(n,t).setAriaLabel(e),this.eType2.setValue(n,t).setAriaLabel(e),this.eJoinOperatorAnd.setValue(this.isDefaultOperator("AND"),t).setName(o).setLabel(this.translate("andCondition")),this.eJoinOperatorOr.setValue(this.isDefaultOperator("OR"),t).setName(o).setLabel(this.translate("orCondition")),Tn.resolve()},e.prototype.isDefaultOperator=function(t){return t===this.defaultJoinOperator},e.prototype.addChangedListeners=function(){var t=this,e=function(){return t.onUiChanged()};this.eType1.onValueChange(e),this.eType2.onValueChange(e),this.eJoinOperatorOr.onValueChange(e),this.eJoinOperatorAnd.onValueChange(e)},e.prototype.doesFilterHaveHiddenInput=function(t){var e=this.optionsFactory.getCustomOption(t);return e&&e.hideFilterInput},e.EMPTY="empty",e.EQUALS="equals",e.NOT_EQUAL="notEqual",e.LESS_THAN="lessThan",e.LESS_THAN_OR_EQUAL="lessThanOrEqual",e.GREATER_THAN="greaterThan",e.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",e.IN_RANGE="inRange",e.CONTAINS="contains",e.NOT_CONTAINS="notContains",e.STARTS_WITH="startsWith",e.ENDS_WITH="endsWith",ni([Wn("eOptions1")],e.prototype,"eType1",void 0),ni([Wn("eOptions2")],e.prototype,"eType2",void 0),ni([Wn("eJoinOperatorPanel")],e.prototype,"eJoinOperatorPanel",void 0),ni([Wn("eJoinOperatorAnd")],e.prototype,"eJoinOperatorAnd",void 0),ni([Wn("eJoinOperatorOr")],e.prototype,"eJoinOperatorOr",void 0),ni([Wn("eCondition1Body")],e.prototype,"eCondition1Body",void 0),ni([Wn("eCondition2Body")],e.prototype,"eCondition2Body",void 0),e}(ei),si=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ai=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return si(e,t),e.prototype.setParams=function(e){t.prototype.setParams.call(this,e),this.scalarFilterParams=e,this.checkDeprecatedParams()},e.prototype.checkDeprecatedParams=function(){this.scalarFilterParams.nullComparator&&(console.warn("AG Grid: Since v21.0, the property filterParams.nullComparator is deprecated. Please use filterParams.includeBlanksInEquals, filterParams.includeBlanksInLessThan and filterParams.includeBlanksInGreaterThan instead."),this.scalarFilterParams.includeBlanksInEquals=this.scalarFilterParams.nullComparator.equals,this.scalarFilterParams.includeBlanksInLessThan=this.scalarFilterParams.nullComparator.lessThan,this.scalarFilterParams.includeBlanksInGreaterThan=this.scalarFilterParams.nullComparator.greaterThan)},e.prototype.individualConditionPasses=function(t,o){var n=this.scalarFilterParams.valueGetter(t.node),i=this.mapRangeFromModel(o),r=i.from,s=i.to,a=o.type,l=this.optionsFactory.getCustomOption(a);if(l&&(null!=r||l.hideFilterInput))return l.test(r,n);if(null==n){switch(a){case e.EQUALS:case e.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case e.GREATER_THAN:case e.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case e.LESS_THAN:case e.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case e.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0}return!1}var p=this.comparator(),u=p(r,n);switch(a){case e.EQUALS:return 0===u;case e.NOT_EQUAL:return 0!==u;case e.GREATER_THAN:return u>0;case e.GREATER_THAN_OR_EQUAL:return u>=0;case e.LESS_THAN:return u<0;case e.LESS_THAN_OR_EQUAL:return u<=0;case e.IN_RANGE:var c=p(s,n);return this.scalarFilterParams.inRangeInclusive?u>=0&&c<=0:u>0&&c<0;default:throw new Error("Unexpected type of filter: "+a)}},e}(ri),li=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),pi=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ui=function(t){function e(){return t.call(this,"dateFilter")||this}return li(e,t),e.prototype.afterGuiAttached=function(e){t.prototype.afterGuiAttached.call(this,e),this.dateCondition1FromComp.afterGuiAttached(e)},e.prototype.mapRangeFromModel=function(t){return{from:tn(t.dateFrom),to:tn(t.dateTo)}},e.prototype.setValueFromFloatingFilter=function(t){this.dateCondition1FromComp.setDate(null==t?null:tn(t)),this.dateCondition1ToComp.setDate(null),this.dateCondition2FromComp.setDate(null),this.dateCondition2ToComp.setDate(null)},e.prototype.setConditionIntoUi=function(t,e){var o=t?[tn(t.dateFrom),tn(t.dateTo)]:[null,null],n=o[0],i=o[1],r=this.getFromToComponents(e),s=r[0],a=r[1];s.setDate(n),a.setDate(i)},e.prototype.resetUiToDefaults=function(e){var o=this;return t.prototype.resetUiToDefaults.call(this,e).then((function(){o.dateCondition1FromComp.setDate(null),o.dateCondition1ToComp.setDate(null),o.dateCondition2FromComp.setDate(null),o.dateCondition2ToComp.setDate(null)}))},e.prototype.comparator=function(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)},e.prototype.defaultComparator=function(t,e){return null==e||e<t?-1:e>t?1:0},e.prototype.setParams=function(e){t.prototype.setParams.call(this,e),this.dateFilterParams=e,this.createDateComponents()},e.prototype.createDateComponents=function(){var t=this,e=function(e){return new Yn(t.getContext(),t.userComponentFactory,{onDateChanged:function(){return t.onUiChanged()},filterParams:t.dateFilterParams},e)};this.dateCondition1FromComp=e(this.eCondition1PanelFrom),this.dateCondition1ToComp=e(this.eCondition1PanelTo),this.dateCondition2FromComp=e(this.eCondition2PanelFrom),this.dateCondition2ToComp=e(this.eCondition2PanelTo),this.addDestroyFunc((function(){t.dateCondition1FromComp.destroy(),t.dateCondition1ToComp.destroy(),t.dateCondition2FromComp.destroy(),t.dateCondition2ToComp.destroy()}))},e.prototype.getDefaultFilterOptions=function(){return e.DEFAULT_FILTER_OPTIONS},e.prototype.createValueTemplate=function(t){var e=t===Bn.One?"1":"2";return'\n <div class="ag-filter-body" ref="eCondition'+e+'Body">\n <div class="ag-filter-from ag-filter-date-from" ref="eCondition'+e+'PanelFrom"></div>\n <div class="ag-filter-to ag-filter-date-to" ref="eCondition'+e+'PanelTo"></div>\n </div>'},e.prototype.isConditionUiComplete=function(t){var e=t===Bn.One?this.getCondition1Type():this.getCondition2Type();if(e===ri.EMPTY)return!1;if(this.doesFilterHaveHiddenInput(e))return!0;var o=this.getFromToComponents(t),n=o[0],i=o[1],r=null==this.dateFilterParams.minValidYear?1e3:this.dateFilterParams.minValidYear,s=function(t){return null!=t&&t.getUTCFullYear()>r};return s(n.getDate())&&(!this.showValueTo(e)||s(i.getDate()))},e.prototype.areSimpleModelsEqual=function(t,e){return t.dateFrom===e.dateFrom&&t.dateTo===e.dateTo&&t.type===e.type},e.prototype.getFilterType=function(){return"date"},e.prototype.createCondition=function(t){var e=t===Bn.One?this.getCondition1Type():this.getCondition2Type(),o=this.getFromToComponents(t),n=o[0],i=o[1];return{dateFrom:Jo(n.getDate()),dateTo:Jo(i.getDate()),type:e,filterType:this.getFilterType()}},e.prototype.resetPlaceholder=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),e=this.translate("dateFormatOoo"),o=t("ariaFilterValue","Filter Value");this.dateCondition1FromComp.setInputPlaceholder(e),this.dateCondition1FromComp.setInputAriaLabel(o),this.dateCondition1ToComp.setInputPlaceholder(e),this.dateCondition1ToComp.setInputAriaLabel(o),this.dateCondition2FromComp.setInputPlaceholder(e),this.dateCondition2FromComp.setInputAriaLabel(o),this.dateCondition2ToComp.setInputPlaceholder(e),this.dateCondition2ToComp.setInputAriaLabel(o)},e.prototype.updateUiVisibility=function(){t.prototype.updateUiVisibility.call(this),this.resetPlaceholder();var e=this.getCondition1Type();ke(this.eCondition1PanelFrom,this.showValueFrom(e)),ke(this.eCondition1PanelTo,this.showValueTo(e));var o=this.getCondition2Type();ke(this.eCondition2PanelFrom,this.showValueFrom(o)),ke(this.eCondition2PanelTo,this.showValueTo(o))},e.prototype.getFromToComponents=function(t){return t===Bn.One?[this.dateCondition1FromComp,this.dateCondition1ToComp]:[this.dateCondition2FromComp,this.dateCondition2ToComp]},e.DEFAULT_FILTER_OPTIONS=[ai.EQUALS,ai.GREATER_THAN,ai.LESS_THAN,ai.NOT_EQUAL,ai.IN_RANGE],pi([Wn("eCondition1PanelFrom")],e.prototype,"eCondition1PanelFrom",void 0),pi([Wn("eCondition1PanelTo")],e.prototype,"eCondition1PanelTo",void 0),pi([Wn("eCondition2PanelFrom")],e.prototype,"eCondition2PanelFrom",void 0),pi([Wn("eCondition2PanelTo")],e.prototype,"eCondition2PanelTo",void 0),pi([it("userComponentFactory")],e.prototype,"userComponentFactory",void 0),e}(ai),ci=function(){function t(t,e){var o=this;void 0===e&&(e=!1),this.destroyFuncs=[],this.touching=!1,this.eventService=new dt,this.eElement=t,this.preventMouseClick=e;var n=this.onTouchStart.bind(this),i=this.onTouchMove.bind(this),r=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",n,{passive:!0}),this.eElement.addEventListener("touchmove",i,{passive:!0}),this.eElement.addEventListener("touchend",r,{passive:!1}),this.destroyFuncs.push((function(){o.eElement.removeEventListener("touchstart",n,{passive:!0}),o.eElement.removeEventListener("touchmove",i,{passive:!0}),o.eElement.removeEventListener("touchend",r,{passive:!1})}))}return t.prototype.getActiveTouch=function(t){for(var e=0;e<t.length;e++){if(t[e].identifier===this.touchStart.identifier)return t[e]}return null},t.prototype.addEventListener=function(t,e){this.eventService.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.eventService.removeEventListener(t,e)},t.prototype.onTouchStart=function(e){var o=this;if(!this.touching){this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;var n=this.touchStart;window.setTimeout((function(){var i=o.touchStart===n;if(o.touching&&i&&!o.moved){o.moved=!0;var r={type:t.EVENT_LONG_TAP,touchStart:o.touchStart,touchEvent:e};o.eventService.dispatchEvent(r)}}),500)}},t.prototype.onTouchMove=function(t){if(this.touching){var e=this.getActiveTouch(t.touches);if(e)!Cn(e,this.touchStart,4)&&(this.moved=!0)}},t.prototype.onTouchEnd=function(e){if(this.touching){if(!this.moved){var o={type:t.EVENT_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(o),this.checkForDoubleTap()}this.preventMouseClick&&e.preventDefault(),this.touching=!1}},t.prototype.checkForDoubleTap=function(){var e=(new Date).getTime();if(this.lastTapTime&&this.lastTapTime>0)if(e-this.lastTapTime>t.DOUBLE_TAP_MILLIS){var o={type:t.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(o),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e},t.prototype.destroy=function(){this.destroyFuncs.forEach((function(t){return t()}))},t.EVENT_TAP="tap",t.EVENT_DOUBLE_TAP="doubleTap",t.EVENT_LONG_TAP="longTap",t.DOUBLE_TAP_MILLIS=500,t}(),di=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),hi=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},fi=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.lastMovingChanged=0,e}return di(o,t),o.prototype.destroy=function(){t.prototype.destroy.call(this)},o.prototype.refresh=function(t){return this.params=t,this.workOutTemplate()==this.currentTemplate&&(this.workOutShowMenu()==this.currentShowMenu&&(this.workOutSort()==this.currentSort&&(this.setDisplayName(t),!0)))},o.prototype.workOutTemplate=function(){var t=c(this.params.template,o.TEMPLATE);return t=t&&t.trim?t.trim():t},o.prototype.init=function(t){this.params=t,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate),this.setupTap(),this.setupIcons(t.column),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setDisplayName(t)},o.prototype.setDisplayName=function(t){if(this.currentDisplayName!=t.displayName){this.currentDisplayName=t.displayName;var e=Kt(this.currentDisplayName);this.eText&&(this.eText.innerHTML=e)}},o.prototype.setupIcons=function(t){this.addInIcon("sortAscending",this.eSortAsc,t),this.addInIcon("sortDescending",this.eSortDesc,t),this.addInIcon("sortUnSort",this.eSortNone,t),this.addInIcon("menu",this.eMenu,t),this.addInIcon("filter",this.eFilter,t)},o.prototype.addInIcon=function(t,e,o){if(null!=e){var n=cn(t,this.gridOptionsWrapper,o);n&&e.appendChild(n)}},o.prototype.setupTap=function(){var t=this,o=this.gridOptionsWrapper;if(!o.isSuppressTouch()){var n=new ci(this.getGui(),!0),i=o.isSuppressMenuHide(),r=i&&e(this.eMenu),s=r?new ci(this.eMenu,!0):n;if(this.params.enableMenu){var a=r?"EVENT_TAP":"EVENT_LONG_TAP";this.addManagedListener(s,ci[a],(function(e){o.getApi().showColumnMenuAfterMouseClick(t.params.column,e.touchStart)}))}if(this.params.enableSorting){this.addManagedListener(n,ci.EVENT_TAP,(function(e){var o=e.touchStart.target;i&&t.eMenu.contains(o)||t.sortController.progressSort(t.params.column,!1,"uiColumnSorted")}))}this.addDestroyFunc((function(){return n.destroy()})),r&&this.addDestroyFunc((function(){return s.destroy()}))}},o.prototype.workOutShowMenu=function(){var t=!this.gridOptionsWrapper.isSuppressMenuHide(),e=Ae()&&t;return this.params.enableMenu&&!e},o.prototype.setMenu=function(){var t=this;if(this.eMenu)if(this.currentShowMenu=this.workOutShowMenu(),this.currentShowMenu){var e=this.gridOptionsWrapper.isSuppressMenuHide();this.addManagedListener(this.eMenu,"click",(function(){return t.showMenu(t.eMenu)})),Ve(this.eMenu,"ag-header-menu-always-show",e)}else to(this.eMenu)},o.prototype.showMenu=function(t){t||(t=this.eMenu),this.menuFactory.showMenuAfterButtonClick(this.params.column,t)},o.prototype.removeSortIcons=function(){to(this.eSortAsc),to(this.eSortDesc),to(this.eSortNone),to(this.eSortOrder)},o.prototype.workOutSort=function(){return this.params.enableSorting},o.prototype.setupSort=function(){var t=this;if(this.currentSort=this.params.enableSorting,this.currentSort){var e=this.gridOptionsWrapper.isMultiSortKeyCtrl();this.addManagedListener(this.params.column,yt.EVENT_MOVING_CHANGED,(function(){t.lastMovingChanged=(new Date).getTime()})),this.eLabel&&this.addManagedListener(this.eLabel,"click",(function(o){var n=t.params.column.isMoving(),i=(new Date).getTime()-t.lastMovingChanged<50;if(!(n||i)){var r=e?o.ctrlKey||o.metaKey:o.shiftKey;t.params.progressSort(r)}})),this.addManagedListener(this.params.column,yt.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.onSortChanged(),this.addManagedListener(this.eventService,Wt.EVENT_SORT_CHANGED,this.setMultiSortOrder.bind(this)),this.setMultiSortOrder()}else this.removeSortIcons()},o.prototype.onSortChanged=function(){if(Ve(this.getGui(),"ag-header-cell-sorted-asc",this.params.column.isSortAscending()),Ve(this.getGui(),"ag-header-cell-sorted-desc",this.params.column.isSortDescending()),Ve(this.getGui(),"ag-header-cell-sorted-none",this.params.column.isSortNone()),this.eSortAsc&&Ve(this.eSortAsc,"ag-hidden",!this.params.column.isSortAscending()),this.eSortDesc&&Ve(this.eSortDesc,"ag-hidden",!this.params.column.isSortDescending()),this.eSortNone){var t=!this.params.column.getColDef().unSortIcon&&!this.gridOptionsWrapper.isUnSortIcon();Ve(this.eSortNone,"ag-hidden",t||!this.params.column.isSortNone())}},o.prototype.setMultiSortOrder=function(){if(this.eSortOrder){var t=this.params.column,e=this.sortController.getColumnsWithSortingOrdered(),o=e.indexOf(t),n=e.length>1,i=t.isSorting()&&n;ke(this.eSortOrder,i),o>=0?this.eSortOrder.innerHTML=(o+1).toString():Je(this.eSortOrder)}},o.prototype.setupFilterIcon=function(){this.eFilter&&(this.addManagedListener(this.params.column,yt.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.onFilterChanged())},o.prototype.onFilterChanged=function(){var t=this.params.column.isFilterActive();Ve(this.eFilter,"ag-hidden",!t)},o.TEMPLATE='<div class="ag-cell-label-container" role="presentation">\n <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>\n <div ref="eLabel" class="ag-header-cell-label" role="presentation" unselectable="on">\n <span ref="eText" class="ag-header-cell-text" unselectable="on"></span>\n <span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>\n <span ref="eSortOrder" class="ag-header-icon ag-header-label-icon ag-sort-order" aria-hidden="true"></span>\n <span ref="eSortAsc" class="ag-header-icon ag-header-label-icon ag-sort-ascending-icon" aria-hidden="true"></span>\n <span ref="eSortDesc" class="ag-header-icon ag-header-label-icon ag-sort-descending-icon" aria-hidden="true"></span>\n <span ref="eSortNone" class="ag-header-icon ag-header-label-icon ag-sort-none-icon" aria-hidden="true"></span>\n </div>\n </div>',hi([it("sortController")],o.prototype,"sortController",void 0),hi([it("menuFactory")],o.prototype,"menuFactory",void 0),hi([Wn("eFilter")],o.prototype,"eFilter",void 0),hi([Wn("eSortAsc")],o.prototype,"eSortAsc",void 0),hi([Wn("eSortDesc")],o.prototype,"eSortDesc",void 0),hi([Wn("eSortNone")],o.prototype,"eSortNone",void 0),hi([Wn("eSortOrder")],o.prototype,"eSortOrder",void 0),hi([Wn("eMenu")],o.prototype,"eMenu",void 0),hi([Wn("eLabel")],o.prototype,"eLabel",void 0),hi([Wn("eText")],o.prototype,"eText",void 0),o}(xn),gi=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),yi=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},vi=function(t){function o(){return t.call(this,o.TEMPLATE)||this}return gi(o,t),o.prototype.destroy=function(){t.prototype.destroy.call(this)},o.prototype.init=function(t){this.params=t,this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()},o.prototype.setupExpandIcons=function(){var t=this;this.addInIcon("columnGroupOpened","agOpened"),this.addInIcon("columnGroupClosed","agClosed");var e=function(e){if(!Pt(e)){var o=!t.params.columnGroup.isExpanded();t.columnController.setColumnGroupOpened(t.params.columnGroup.getOriginalColumnGroup(),o,"uiColumnExpanded")}};this.addTouchAndClickListeners(this.eCloseIcon,e),this.addTouchAndClickListeners(this.eOpenIcon,e);var o=function(t){Ot(t)};this.addManagedListener(this.eCloseIcon,"dblclick",o),this.addManagedListener(this.eOpenIcon,"dblclick",o),this.addManagedListener(this.getGui(),"dblclick",e),this.updateIconVisibility();var n=this.params.columnGroup.getOriginalColumnGroup();this.addManagedListener(n,Ct.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(n,Ct.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))},o.prototype.addTouchAndClickListeners=function(t,e){var o=new ci(t,!0);this.addManagedListener(o,ci.EVENT_TAP,e),this.addDestroyFunc((function(){return o.destroy()})),this.addManagedListener(t,"click",e)},o.prototype.updateIconVisibility=function(){if(this.params.columnGroup.isExpandable()){var t=this.params.columnGroup.isExpanded();ke(this.eOpenIcon,t),ke(this.eCloseIcon,!t)}else ke(this.eOpenIcon,!1),ke(this.eCloseIcon,!1)},o.prototype.addInIcon=function(t,e){var o=cn(t,this.gridOptionsWrapper,null);o&&this.getRefElement(e).appendChild(o)},o.prototype.addGroupExpandIcon=function(){if(!this.params.columnGroup.isExpandable())return ke(this.eOpenIcon,!1),void ke(this.eCloseIcon,!1)},o.prototype.setupLabel=function(){var t=this.params.displayName;if(e(t)){var o=Kt(t);this.getRefElement("agLabel").innerHTML=o}},o.TEMPLATE='<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">\n <span ref="agLabel" class="ag-header-group-text" role="presentation"></span>\n <span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>\n <span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>\n </div>',yi([it("columnController")],o.prototype,"columnController",void 0),yi([Wn("agOpened")],o.prototype,"eOpenIcon",void 0),yi([Wn("agClosed")],o.prototype,"eCloseIcon",void 0),o}(xn),mi=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ci=function(){function t(){this.rowIndex=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=t.OBJECT_ID_SEQUENCE++,this.alreadyRendered=!1,this.highlighted=null,this.selected=!1}return t.prototype.setData=function(t){this.setDataCommon(t,!1)},t.prototype.updateData=function(t){this.setDataCommon(t,!0)},t.prototype.setDataCommon=function(t,e){var o=this.data;this.data=t,this.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable();var n=this.createDataChangedEvent(t,o,e);this.dispatchLocalEvent(n)},t.prototype.updateDataOnDetailNode=function(){this.detailNode&&(this.detailNode.data=this.data)},t.prototype.createDataChangedEvent=function(e,o,n){return{type:t.EVENT_DATA_CHANGED,node:this,oldData:o,newData:e,update:n}},t.prototype.createLocalRowEvent=function(t){return{type:t,node:this}},t.prototype.getRowIndexString=function(){return this.rowPinned===ht.PINNED_TOP?"t-"+this.rowIndex:this.rowPinned===ht.PINNED_BOTTOM?"b-"+this.rowIndex:this.rowIndex.toString()},t.prototype.createDaemonNode=function(){var e=new t;return this.context.createBean(e),e.id=this.id,e.data=this.data,e.daemon=!0,e.selected=this.selected,e.level=this.level,e},t.prototype.setDataAndId=function(t,o){var n=e(this.id)?this.createDaemonNode():null,i=this.data;this.data=t,this.updateDataOnDetailNode(),this.setId(o),this.selectionController.syncInRowNode(this,n),this.checkRowSelectable();var r=this.createDataChangedEvent(t,i,!1);this.dispatchLocalEvent(r)},t.prototype.checkRowSelectable=function(){var t=this.gridOptionsWrapper.getIsRowSelectableFunc(),o=t&&e(this);this.setRowSelectable(!o||t(this))},t.prototype.setRowSelectable=function(e){this.selectable!==e&&(this.selectable=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_SELECTABLE_CHANGED)))},t.prototype.setId=function(e){var o=this.gridOptionsWrapper.getRowNodeIdFunc();o?this.data?(this.id=o(this.data),this.id&&this.id.startsWith&&this.id.startsWith(t.ID_PREFIX_ROW_GROUP)&&console.error("AG Grid: Row ID's cannot start with "+t.ID_PREFIX_ROW_GROUP+", this is a reserved prefix for AG Grid's row grouping feature.")):this.id=void 0:this.id=e},t.prototype.isPixelInRange=function(t){return!(!e(this.rowTop)||!e(this.rowHeight))&&(t>=this.rowTop&&t<this.rowTop+this.rowHeight)},t.prototype.setFirstChild=function(e){this.firstChild!==e&&(this.firstChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_FIRST_CHILD_CHANGED)))},t.prototype.setLastChild=function(e){this.lastChild!==e&&(this.lastChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_LAST_CHILD_CHANGED)))},t.prototype.setChildIndex=function(e){this.childIndex!==e&&(this.childIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_CHILD_INDEX_CHANGED)))},t.prototype.setRowTop=function(e){this.rowTop!==e&&(this.rowTop=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_TOP_CHANGED)),this.setDisplayed(null!==e))},t.prototype.clearRowTopAndRowIndex=function(){this.oldRowTop=this.rowTop,this.setRowTop(null),this.setRowIndex(null)},t.prototype.setDisplayed=function(e){this.displayed!==e&&(this.displayed=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_DISPLAYED_CHANGED)))},t.prototype.setDragging=function(e){this.dragging!==e&&(this.dragging=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_DRAGGING_CHANGED)))},t.prototype.setHighlighted=function(e){e!==this.highlighted&&(this.highlighted=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_HIGHLIGHT_CHANGED)))},t.prototype.setAllChildrenCount=function(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_ALL_CHILDREN_COUNT_CHANGED)))},t.prototype.setMaster=function(e){this.master!==e&&(this.master&&!e&&(this.expanded=!1),this.master=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_MASTER_CHANGED)))},t.prototype.setRowHeight=function(e,o){void 0===o&&(o=!1),this.rowHeight=e,this.rowHeightEstimated=o,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_HEIGHT_CHANGED))},t.prototype.setRowIndex=function(e){this.rowIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_ROW_INDEX_CHANGED))},t.prototype.setUiLevel=function(e){this.uiLevel!==e&&(this.uiLevel=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_UI_LEVEL_CHANGED)))},t.prototype.setExpanded=function(e){if(this.expanded!==e){this.expanded=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_EXPANDED_CHANGED));var o=M({},this.createGlobalRowEvent(Wt.EVENT_ROW_GROUP_OPENED),{expanded:e});this.mainEventService.dispatchEvent(o),this.gridOptionsWrapper.isGroupIncludeFooter()&&this.rowRenderer.refreshCells({rowNodes:[this]})}},t.prototype.createGlobalRowEvent=function(t){return{type:t,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned,context:this.gridOptionsWrapper.getContext(),api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()}},t.prototype.dispatchLocalEvent=function(t){this.eventService&&this.eventService.dispatchEvent(t)},t.prototype.setDataValue=function(t,e){var o=this.columnController.getPrimaryColumn(t),n=this.valueService.getValue(o,this);this.valueService.setValue(this,o,e),this.dispatchCellChangedEvent(o,e,n)},t.prototype.setGroupValue=function(t,e){var n=this.columnController.getGridColumn(t);o(this.groupData)&&(this.groupData={});var i=n.getColId(),r=this.groupData[i];r!==e&&(this.groupData[i]=e,this.dispatchCellChangedEvent(n,e,r))},t.prototype.setAggData=function(t){var e=this,o=I([this.aggData,t]),n=this.aggData;this.aggData=t,this.eventService&&o.forEach((function(t){var o=e.columnController.getGridColumn(t),i=e.aggData?e.aggData[t]:void 0,r=n?n[t]:void 0;e.dispatchCellChangedEvent(o,i,r)}))},t.prototype.updateHasChildren=function(){var e=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;e!==this.__hasChildren&&(this.__hasChildren=!!e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(t.EVENT_HAS_CHILDREN_CHANGED)))},t.prototype.hasChildren=function(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren},t.prototype.isEmptyRowGroupNode=function(){return this.group&&n(this.childrenAfterGroup)},t.prototype.dispatchCellChangedEvent=function(e,o,n){var i={type:t.EVENT_CELL_CHANGED,node:this,column:e,newValue:o,oldValue:n};this.dispatchLocalEvent(i)},t.prototype.resetQuickFilterAggregateText=function(){this.quickFilterAggregateText=null},t.prototype.isExpandable=function(){return!(!this.hasChildren()&&!this.master)},t.prototype.isSelected=function(){return this.footer?this.sibling.isSelected():this.selected},t.prototype.depthFirstSearch=function(t){this.childrenAfterGroup&&this.childrenAfterGroup.forEach((function(e){return e.depthFirstSearch(t)})),t(this)},t.prototype.calculateSelectedFromChildren=function(){var t,e=!1,o=!1,n=!1;if(this.childrenAfterGroup)for(var i=0;i<this.childrenAfterGroup.length;i++){var r=this.childrenAfterGroup[i];if(r.selectable)switch(r.isSelected()){case!0:e=!0;break;case!1:o=!0;break;default:n=!0}}t=n?void 0:!(!e||o)||!(!e&&o)&&void 0,this.selectThisNode(t)},t.prototype.setSelectedInitialValue=function(t){this.selected=t},t.prototype.setSelected=function(t,e,o){void 0===e&&(e=!1),void 0===o&&(o=!1),this.setSelectedParams({newValue:t,clearSelection:e,suppressFinishActions:o,rangeSelect:!1})},t.prototype.isRowPinned=function(){return this.rowPinned===ht.PINNED_TOP||this.rowPinned===ht.PINNED_BOTTOM},t.prototype.setSelectedParams=function(t){var e=this.gridOptionsWrapper.isGroupSelectsChildren(),o=!0===t.newValue,n=!0===t.clearSelection,i=!0===t.suppressFinishActions,r=!0===t.rangeSelect,s=e&&!0===t.groupSelectsFiltered;if(void 0===this.id)return console.warn("AG Grid: cannot select node until id for node is known"),0;if(this.rowPinned)return console.warn("AG Grid: cannot select pinned rows"),0;if(this.footer)return this.sibling.setSelectedParams(t);if(r&&this.selectionController.getLastSelectedNode()){var a=this.selectionController.getLastSelectedNode()!==this,l=this.gridOptionsWrapper.isRowSelectionMulti();if(a&&l){var p=this.doRowRangeSelection(t.newValue);return this.selectionController.setLastSelectedNode(this),p}}var u=0;s&&this.group||this.selectThisNode(o)&&u++;if(e&&this.group&&(u+=this.selectChildNodes(o,s)),!i){if(o&&(n||!this.gridOptionsWrapper.isRowSelectionMulti())&&(u+=this.selectionController.clearOtherNodes(this)),u>0){this.selectionController.updateGroupsFromChildrenSelections();var c={type:Wt.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.mainEventService.dispatchEvent(c)}o&&this.selectionController.setLastSelectedNode(this)}return u},t.prototype.doRowRangeSelection=function(t){var e=this;void 0===t&&(t=!0);var o=this.gridOptionsWrapper.isGroupSelectsChildren(),n=this.selectionController.getLastSelectedNode(),i=this.rowModel.getNodesInRangeForSelection(this,n),r=0;i.forEach((function(n){n.group&&o||!1===t&&e===n||n.selectThisNode(t)&&r++})),this.selectionController.updateGroupsFromChildrenSelections();var s={type:Wt.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};return this.mainEventService.dispatchEvent(s),r},t.prototype.isParentOfNode=function(t){for(var e=this.parent;e;){if(e===t)return!0;e=e.parent}return!1},t.prototype.selectThisNode=function(e){var o=!this.selectable&&e,n=this.selected===e;if(o||n)return!1;this.selected=e,this.eventService&&this.dispatchLocalEvent(this.createLocalRowEvent(t.EVENT_ROW_SELECTED));var i=this.createGlobalRowEvent(Wt.EVENT_ROW_SELECTED);return this.mainEventService.dispatchEvent(i),!0},t.prototype.selectChildNodes=function(t,e){var n=e?this.childrenAfterFilter:this.childrenAfterGroup;if(o(n))return 0;for(var i=0,r=0;r<n.length;r++)i+=n[r].setSelectedParams({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:e});return i},t.prototype.addEventListener=function(t,e){this.eventService||(this.eventService=new dt),this.eventService.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.eventService.removeEventListener(t,e)},t.prototype.onMouseEnter=function(){this.dispatchLocalEvent(this.createLocalRowEvent(t.EVENT_MOUSE_ENTER))},t.prototype.onMouseLeave=function(){this.dispatchLocalEvent(this.createLocalRowEvent(t.EVENT_MOUSE_LEAVE))},t.prototype.getFirstChildOfFirstChild=function(t){for(var o=this,n=!0,i=!1,r=null;n&&!i;){var s=o.parent;e(s)&&o.firstChild?s.rowGroupColumn===t&&(i=!0,r=s):n=!1,o=s}return i?r:null},t.prototype.isFullWidthCell=function(){var t=this.gridOptionsWrapper.getIsFullWidthCellFunc();return!!t&&t(this)},t.prototype.getRoute=function(){if(null!=this.key){for(var t=[],e=this;null!=e.key;)t.push(e.key),e=e.parent;return t.reverse()}},t.ID_PREFIX_ROW_GROUP="row-group-",t.ID_PREFIX_TOP_PINNED="t-",t.ID_PREFIX_BOTTOM_PINNED="b-",t.OBJECT_ID_SEQUENCE=0,t.EVENT_ROW_SELECTED="rowSelected",t.EVENT_DATA_CHANGED="dataChanged",t.EVENT_CELL_CHANGED="cellChanged",t.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged",t.EVENT_MASTER_CHANGED="masterChanged",t.EVENT_MOUSE_ENTER="mouseEnter",t.EVENT_MOUSE_LEAVE="mouseLeave",t.EVENT_HEIGHT_CHANGED="heightChanged",t.EVENT_TOP_CHANGED="topChanged",t.EVENT_DISPLAYED_CHANGED="displayedChanged",t.EVENT_FIRST_CHILD_CHANGED="firstChildChanged",t.EVENT_LAST_CHILD_CHANGED="lastChildChanged",t.EVENT_CHILD_INDEX_CHANGED="childIndexChanged",t.EVENT_ROW_INDEX_CHANGED="rowIndexChanged",t.EVENT_EXPANDED_CHANGED="expandedChanged",t.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged",t.EVENT_SELECTABLE_CHANGED="selectableChanged",t.EVENT_UI_LEVEL_CHANGED="uiLevelChanged",t.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged",t.EVENT_DRAGGING_CHANGED="draggingChanged",mi([it("eventService")],t.prototype,"mainEventService",void 0),mi([it("rowRenderer")],t.prototype,"rowRenderer",void 0),mi([it("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),mi([it("selectionController")],t.prototype,"selectionController",void 0),mi([it("columnController")],t.prototype,"columnController",void 0),mi([it("valueService")],t.prototype,"valueService",void 0),mi([it("rowModel")],t.prototype,"rowModel",void 0),mi([it("context")],t.prototype,"context",void 0),mi([it("valueCache")],t.prototype,"valueCache",void 0),mi([it("columnApi")],t.prototype,"columnApi",void 0),mi([it("gridApi")],t.prototype,"gridApi",void 0),t}(),wi=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Ei=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ri=function(t){function e(){return t.call(this,'\n <div class="ag-selection-checkbox" role="presentation">\n <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n </div>')||this}return wi(e,t),e.prototype.postConstruct=function(){this.eCheckbox.setPassive(!0)},e.prototype.getCheckboxId=function(){return this.eCheckbox.getInputElement().id},e.prototype.onDataChanged=function(){this.onSelectionChanged()},e.prototype.onSelectableChanged=function(){this.showOrHideSelect()},e.prototype.onSelectionChanged=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),e=this.rowNode.isSelected(),o=void 0===e?t("ariaIndeterminate","indeterminate"):!0===e?t("ariaChecked","checked"):t("ariaUnchecked","unchecked"),n=t("ariaRowToggleSelection","Press Space to toggle row selection");this.eCheckbox.setValue(e,!0),this.eCheckbox.setInputAriaLabel(n+" ("+o+")")},e.prototype.onCheckedClicked=function(t){var e=this.gridOptionsWrapper.isGroupSelectsFiltered();return this.rowNode.setSelectedParams({newValue:!1,rangeSelect:t.shiftKey,groupSelectsFiltered:e})},e.prototype.onUncheckedClicked=function(t){var e=this.gridOptionsWrapper.isGroupSelectsFiltered();return this.rowNode.setSelectedParams({newValue:!0,rangeSelect:t.shiftKey,groupSelectsFiltered:e})},e.prototype.init=function(t){var e=this;this.rowNode=t.rowNode,this.column=t.column,this.onSelectionChanged(),this.addGuiEventListener("click",(function(t){return Ot(t)})),this.addGuiEventListener("dblclick",(function(t){return Ot(t)})),this.addManagedListener(this.eCheckbox.getInputElement(),"click",(function(t){var o=e.eCheckbox.getValue();void 0===e.eCheckbox.getPreviousValue()?0===e.onUncheckedClicked(t||{})&&e.onCheckedClicked(t):o?e.onCheckedClicked(t):e.onUncheckedClicked(t||{})})),this.addManagedListener(this.rowNode,Ci.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this)),this.isRowSelectableFunc=this.gridOptionsWrapper.getIsRowSelectableFunc(),(this.isRowSelectableFunc||this.checkboxCallbackExists())&&(this.addManagedListener(this.eventService,Wt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.showOrHideSelect.bind(this)),this.showOrHideSelect()),this.eCheckbox.getInputElement().setAttribute("tabindex","-1")},e.prototype.showOrHideSelect=function(){var t=this.rowNode.selectable;t&&this.checkboxCallbackExists()&&(t=this.column.isCellCheckboxSelection(this.rowNode)),this.setDisplayed(t)},e.prototype.checkboxCallbackExists=function(){var t=this.column?this.column.getColDef():null;return!!t&&"function"==typeof t.checkboxSelection},Ei([Wn("eCheckbox")],e.prototype,"eCheckbox",void 0),Ei([et],e.prototype,"postConstruct",null),e}(xn),Oi={propertyName:"dateComponent",isCellRenderer:function(){return!1}},Pi={propertyName:"headerComponent",isCellRenderer:function(){return!1}},Si={propertyName:"headerGroupComponent",isCellRenderer:function(){return!1}},bi={propertyName:"cellRenderer",isCellRenderer:function(){return!0}},Di={propertyName:"pinnedRowCellRenderer",isCellRenderer:function(){return!0}},Ai={propertyName:"cellEditor",isCellRenderer:function(){return!1}},Ti={propertyName:"innerRenderer",isCellRenderer:function(){return!0}},_i={propertyName:"loadingOverlayComponent",isCellRenderer:function(){return!1}},Fi={propertyName:"noRowsOverlayComponent",isCellRenderer:function(){return!1}},Ni={propertyName:"tooltipComponent",isCellRenderer:function(){return!1}},Li={propertyName:"filter",isCellRenderer:function(){return!1}},Ii={propertyName:"floatingFilterComponent",isCellRenderer:function(){return!1}},Gi={propertyName:"toolPanel",isCellRenderer:function(){return!1}},Mi={propertyName:"statusPanel",isCellRenderer:function(){return!1}},xi=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Vi=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/!function(t){t[t.DEFAULT=0]="DEFAULT",t[t.REGISTERED_BY_NAME=1]="REGISTERED_BY_NAME",t[t.HARDCODED=2]="HARDCODED"}(ii||(ii={}));!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}xi(e,t),e.prototype.newDateComponent=function(t){return this.createAndInitUserComponent(this.gridOptions,t,Oi,"agDateInput")},e.prototype.newHeaderComponent=function(t){return this.createAndInitUserComponent(t.column.getColDef(),t,Pi,"agColumnHeader")},e.prototype.newHeaderGroupComponent=function(t){return this.createAndInitUserComponent(t.columnGroup.getColGroupDef(),t,Si,"agColumnGroupHeader")},e.prototype.newFullWidthGroupRowInnerCellRenderer=function(t){return this.createAndInitUserComponent(this.gridOptions.groupRowRendererParams,t,Ti,null,!0)},e.prototype.newFullWidthCellRenderer=function(t,e,o){return this.createAndInitUserComponent(null,t,{propertyName:e,isCellRenderer:function(){return!0}},o)},e.prototype.newCellRenderer=function(t,e,o){return void 0===o&&(o=!1),this.createAndInitUserComponent(t,e,o?Di:bi,null,!0)},e.prototype.newCellEditor=function(t,e){return this.createAndInitUserComponent(t,e,Ai,"agCellEditor")},e.prototype.newInnerCellRenderer=function(t,e){return this.createAndInitUserComponent(t,e,Ti,null)},e.prototype.newLoadingOverlayComponent=function(t){return this.createAndInitUserComponent(this.gridOptions,t,_i,"agLoadingOverlay")},e.prototype.newNoRowsOverlayComponent=function(t){return this.createAndInitUserComponent(this.gridOptions,t,Fi,"agNoRowsOverlay")},e.prototype.newTooltipComponent=function(t){return this.createAndInitUserComponent(t.colDef,t,Ni,"agTooltipComponent")},e.prototype.newFilterComponent=function(t,e,o){return this.createAndInitUserComponent(t,e,Li,o,!1)},e.prototype.newSetFilterCellRenderer=function(t,e){return this.createAndInitUserComponent(t,e,bi,null,!0)},e.prototype.newFloatingFilterComponent=function(t,e,o){return this.createAndInitUserComponent(t,e,Ii,o,!0)},e.prototype.newToolPanelComponent=function(t,e){return this.createAndInitUserComponent(t,e,Gi)},e.prototype.newStatusPanelComponent=function(t,e){return this.createAndInitUserComponent(t,e,Mi)},e.prototype.createAndInitUserComponent=function(t,e,o,n,i){void 0===i&&(i=!1),t||(t=this.gridOptions);var r=this.createComponentInstance(t,o,e,n,i);if(!r)return null;var s=r.componentInstance,a=this.createFinalParams(t,o.propertyName,e,r.paramsFromSelector);this.addReactHacks(a);var l=this.initComponent(s,a);return null==l?Tn.resolve(s):l.then((function(){return s}))},e.prototype.addReactHacks=function(t){var e=this.context.getBean("agGridReact");e&&(t.agGridReact=T(e));var o=this.context.getBean("frameworkComponentWrapper");o&&(t.frameworkComponentWrapper=o)},e.prototype.createUserComponentFromConcreteClass=function(t,e){var o=new t;return this.initComponent(o,e),o},e.prototype.lookupComponentClassDef=function(t,e,o,n){void 0===o&&(o=null);var i=null,r=null,s=null,a=null,l=null;if(null!=t){var p=t[e];null==p||!0===p||("string"==typeof p?i=p:"boolean"==typeof p||(this.agComponentUtils.doesImplementIComponent(p)?r=p:s=p)),a=t[e+"Framework"],l=t[e+"Selector"]}if(r&&a||i&&a||s&&a)throw Error("ag-grid: you are trying to specify: "+e+" twice as a component.");if(a&&!this.frameworkComponentWrapper)throw Error("ag-grid: you are specifying a framework component but you are not using a framework version of ag-grid for : "+e);if(l&&(i||r||s||a))throw Error("ag-grid: you can't specify both, the selector and the component of ag-grid for : "+e);if(a)return{componentFromFramework:!0,component:a,source:ii.HARDCODED,paramsFromSelector:null};if(r)return{componentFromFramework:!1,component:r,source:ii.HARDCODED,paramsFromSelector:null};if(s)return this.agComponentUtils.adaptFunction(e,s,!1,ii.HARDCODED);var u,c=l?l(o):null;if(!(u=c&&c.component?c.component:i||n))return null;var d=this.lookupFromRegisteredComponents(e,u);return d?{componentFromFramework:d.componentFromFramework,component:d.component,source:d.source,paramsFromSelector:c?c.params:null}:null},e.prototype.lookupFromRegisteredComponents=function(t,e){var o=null!=e?e:t,n=this.userComponentRegistry.retrieve(o);return null==n?null:n.componentFromFramework?{component:n.component,componentFromFramework:!0,source:ii.REGISTERED_BY_NAME,paramsFromSelector:null}:this.agComponentUtils.doesImplementIComponent(n.component)?{component:n.component,componentFromFramework:!1,source:n.source==Hi.REGISTERED?ii.REGISTERED_BY_NAME:ii.DEFAULT,paramsFromSelector:null}:this.agComponentUtils.adaptFunction(t,n.component,n.componentFromFramework,n.source==Hi.REGISTERED?ii.REGISTERED_BY_NAME:ii.DEFAULT)},e.prototype.createFinalParams=function(t,e,o,n){void 0===n&&(n=null);var i={};G(i,o);var r=t?t[e+"Params"]:null;null!=r&&("function"==typeof r?G(i,r(o)):"object"==typeof r&&G(i,r));return G(i,n),i},e.prototype.createComponentInstance=function(t,e,o,n,i){var r,s=e.propertyName,a=this.lookupComponentClassDef(t,s,o,n);if(!a||!a.component){var l=t?t[s]:n,p=l||n;return i||console.error("Could not find component "+p+", did you forget to configure this component?"),null}if(a.componentFromFramework){var u=a.component,c=this.componentMetadataProvider.retrieve(s);r=this.frameworkComponentWrapper.wrap(u,c.mandatoryMethodList,c.optionalMethodList,e,n)}else r=new a.component;return{componentInstance:r,paramsFromSelector:a.paramsFromSelector}},e.prototype.initComponent=function(t,e){if(this.context.createBean(t),null!=t.init)return t.init(e)},Vi([it("gridOptions")],e.prototype,"gridOptions",void 0),Vi([it("agComponentUtils")],e.prototype,"agComponentUtils",void 0),Vi([it("componentMetadataProvider")],e.prototype,"componentMetadataProvider",void 0),Vi([it("userComponentRegistry")],e.prototype,"userComponentRegistry",void 0),Vi([rt("frameworkComponentWrapper")],e.prototype,"frameworkComponentWrapper",void 0),e=Vi([nt("userComponentFactory")],e)}(Mt);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/var Hi,Wi=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ki=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Bi=function(t){function e(){return t.call(this,e.TEMPLATE)||this}return Wi(e,t),e.prototype.init=function(t){this.params=t,this.gridOptionsWrapper.isGroupIncludeTotalFooter()&&this.assignBlankValueToGroupFooterCell(t);var e=this.isEmbeddedRowMismatch(),o=null==t.value,n=!1;if(this.gridOptionsWrapper.isGroupIncludeFooter()&&this.gridOptionsWrapper.isGroupHideOpenParents()){var i=t.node;if(i.footer)n=(t.colDef&&t.colDef.showRowGroup)!==(i.rowGroupColumn&&i.rowGroupColumn.getColId())}this.cellIsBlank=e||o||n,this.cellIsBlank||(this.setupDragOpenParents(),this.addExpandAndContract(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent())},e.prototype.assignBlankValueToGroupFooterCell=function(t){t.value||-1!=t.node.level||(t.value="")},e.prototype.isEmbeddedRowMismatch=function(){if(!this.params.fullWidth||!this.gridOptionsWrapper.isEmbedFullWidthRows())return!1;var t=this.params.pinned===ht.PINNED_LEFT,e=this.params.pinned===ht.PINNED_RIGHT,o=!t&&!e;return this.gridOptionsWrapper.isEnableRtl()?this.columnController.isPinningLeft()?!e:!o:this.columnController.isPinningLeft()?!t:!o},e.prototype.setIndent=function(){if(!this.gridOptionsWrapper.isGroupHideOpenParents()){var t=this.params,e=t.node,o=!!!t.colDef||!0===t.colDef.showRowGroup?e.uiLevel:0;t.padding>=0?this.setPaddingDeprecatedWay(o,t.padding):(this.indentClass&&this.removeCssClass(this.indentClass),this.indentClass="ag-row-group-indent-"+o,this.addCssClass(this.indentClass))}},e.prototype.setPaddingDeprecatedWay=function(t,e){z((function(){return console.warn("AG Grid: since v14.2, configuring padding for groupCellRenderer should be done with Sass variables and themes. Please see the AG Grid documentation page for Themes, in particular the property $row-group-indent-size.")}),"groupCellRenderer->doDeprecatedWay");var o=t*e,n=this.getGui(),i=this.gridOptionsWrapper.isEnableRtl()?"paddingRight":"paddingLeft";n.style[i]=o+"px"},e.prototype.setupIndent=function(){var t=this.params.node;this.params.suppressPadding||(this.addManagedListener(t,Ci.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())},e.prototype.addValueElement=function(){this.displayedGroup.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())},e.prototype.addFooterValue=function(){var t,e=this.params.footerValueGetter;if(e){var o=T(this.params);o.value=this.params.value,"function"==typeof e?t=e(o):"string"==typeof e?t=this.expressionService.evaluate(e,o):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else t="Total "+this.params.value;this.eValue.innerHTML=t},e.prototype.addGroupValue=function(){var t,e=this,o=this.params,n=this.displayedGroup.rowGroupColumn,i=n||o.column,r=this.params.value,s=i?this.valueFormatterService.formatValue(i,o.node,o.scope,r):null;o.valueFormatted=s,(t=o.fullWidth?this.useFullWidth(o):this.useInnerRenderer(this.params.colDef.cellRendererParams,i.getColDef(),o))&&t.then((function(t){e.innerCellRenderer=t}))},e.prototype.useInnerRenderer=function(t,e,o){var n=this,i=null,r=this.userComponentFactory.lookupComponentClassDef(t,"innerRenderer");if(r&&null!=r.component&&r.source!=ii.DEFAULT)i=this.userComponentFactory.newInnerCellRenderer(t,o);else{var s=this.userComponentFactory.lookupComponentClassDef(e,"cellRenderer");i=s&&s.source!=ii.DEFAULT?this.userComponentFactory.newCellRenderer(e,o):s&&s.source==ii.DEFAULT&&x(e,"cellRendererParams.innerRenderer",null)?this.userComponentFactory.newInnerCellRenderer(e.cellRendererParams,o):this.userComponentFactory.newCellRenderer({},o)}return null!=i?i.then((function(t){null!=t?bo(i,n.eValue):n.eValue.innerText=null!=o.valueFormatted?o.valueFormatted:o.value})):this.eValue.innerText=null!=o.valueFormatted?o.valueFormatted:o.value,i},e.prototype.useFullWidth=function(t){var e=this.userComponentFactory.newFullWidthGroupRowInnerCellRenderer(t);return null!=e?bo(e,this.eValue):this.eValue.innerText=null!=t.valueFormatted?t.valueFormatted:t.value,e},e.prototype.addChildCount=function(){this.params.suppressCount||(this.addManagedListener(this.displayedGroup,Ci.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())},e.prototype.updateChildCount=function(){var t=this.displayedGroup.allChildrenCount,e=this.isShowRowGroupForThisRow()&&null!=t&&t>=0?"("+t+")":"";this.eChildCount.innerHTML=e},e.prototype.isUserWantsSelected=function(){var t=this.params.checkbox;return"function"==typeof t?t(this.params):!0===t},e.prototype.addCheckboxIfNeeded=function(){var t=this,e=this.displayedGroup,o=this.isUserWantsSelected()&&!e.footer&&!e.rowPinned&&!e.detail;if(o){var n=new Ri;this.getContext().createBean(n),n.init({rowNode:e,column:this.params.column}),this.eCheckbox.appendChild(n.getGui()),this.addDestroyFunc((function(){return t.getContext().destroyBean(n)}))}Ve(this.eCheckbox,"ag-invisible",!o)},e.prototype.addExpandAndContract=function(){var t=this.params,e=t.eGridCell,o=cn("groupExpanded",this.gridOptionsWrapper,null),n=cn("groupContracted",this.gridOptionsWrapper,null);Vo(e,!!t.node.expanded),o&&this.eExpanded.appendChild(o),n&&this.eContracted.appendChild(n),this.addManagedListener(this.eExpanded,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eContracted,"click",this.onExpandClicked.bind(this)),this.addManagedListener(e,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(t.node,Ci.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();var i=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroup,Ci.EVENT_ALL_CHILDREN_COUNT_CHANGED,i),this.addManagedListener(this.displayedGroup,Ci.EVENT_MASTER_CHANGED,i),this.addManagedListener(this.displayedGroup,Ci.EVENT_HAS_CHILDREN_CHANGED,i),this.gridOptionsWrapper.isEnableGroupEdit()||!this.isExpandable()||t.suppressDoubleClickExpand||this.addManagedListener(e,"dblclick",this.onCellDblClicked.bind(this))},e.prototype.onRowNodeIsExpandableChanged=function(){this.showExpandAndContractIcons(),this.setIndent()},e.prototype.onKeyDown=function(t){hn(t,jn.ENTER)&&!this.params.suppressEnterExpand&&(this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract())},e.prototype.setupDragOpenParents=function(){var t=this.params.column,e=this.params.node;if(this.gridOptionsWrapper.isGroupHideOpenParents())if(e.hasChildren()){var n=e.rowGroupColumn;this.draggedFromHideOpenParents=!!n&&!t.isRowGroupDisplayed(n.getId())}else this.draggedFromHideOpenParents=!0;else this.draggedFromHideOpenParents=!1;if(this.draggedFromHideOpenParents)for(var i=e.parent;!o(i);){if(i.rowGroupColumn&&t.isRowGroupDisplayed(i.rowGroupColumn.getId())){this.displayedGroup=i;break}i=i.parent}o(this.displayedGroup)&&(this.displayedGroup=e)},e.prototype.onExpandClicked=function(t){Pt(t)||(Ot(t),this.onExpandOrContract())},e.prototype.onCellDblClicked=function(t){Pt(t)||(Tt(this.eExpanded,t)||Tt(this.eContracted,t)||this.onExpandOrContract())},e.prototype.onExpandOrContract=function(){var t=this.displayedGroup,e=this.params,o=!t.expanded;t.setExpanded(o),Vo(e.eGridCell,o)},e.prototype.isShowRowGroupForThisRow=function(){if(this.gridOptionsWrapper.isTreeData())return!0;var t=this.displayedGroup.rowGroupColumn;if(!t)return!1;var e=this.params.column;return null==e||e.isRowGroupDisplayed(t.getId())},e.prototype.isExpandable=function(){if(this.draggedFromHideOpenParents)return!0;var t=this.displayedGroup,e=this.columnController.isPivotMode()&&t.leafGroup;if(!(t.isExpandable()&&!t.footer&&!e))return!1;var o=this.params.column;return null==o||"string"!=typeof o.getColDef().showRowGroup||this.isShowRowGroupForThisRow()},e.prototype.showExpandAndContractIcons=function(){var t=this,e=t.eContracted,o=t.eExpanded,n=t.params,i=t.displayedGroup,r=t.columnController,s=n.eGridCell,a=n.node,l=this.isExpandable();if(l){var p=!!this.draggedFromHideOpenParents||a.expanded;ke(e,!p),ke(o,p)}else Ho(s),ke(o,!1),ke(e,!1);var u=r.isPivotMode(),c=u&&i.leafGroup,d=l&&!c,h=a.footer&&-1===a.level;this.addOrRemoveCssClass("ag-cell-expandable",d),this.addOrRemoveCssClass("ag-row-group",d),u?this.addOrRemoveCssClass("ag-pivot-leaf-group",c):h||this.addOrRemoveCssClass("ag-row-group-leaf-indent",!d)},e.prototype.destroy=function(){this.getContext().destroyBean(this.innerCellRenderer),t.prototype.destroy.call(this)},e.prototype.refresh=function(){return!1},e.TEMPLATE='<span class="ag-cell-wrapper">\n <span class="ag-group-expanded" ref="eExpanded"></span>\n <span class="ag-group-contracted" ref="eContracted"></span>\n <span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>\n <span class="ag-group-value" ref="eValue"></span>\n <span class="ag-group-child-count" ref="eChildCount"></span>\n </span>',ki([it("expressionService")],e.prototype,"expressionService",void 0),ki([it("valueFormatterService")],e.prototype,"valueFormatterService",void 0),ki([it("columnController")],e.prototype,"columnController",void 0),ki([it("userComponentFactory")],e.prototype,"userComponentFactory",void 0),ki([Wn("eExpanded")],e.prototype,"eExpanded",void 0),ki([Wn("eContracted")],e.prototype,"eContracted",void 0),ki([Wn("eCheckbox")],e.prototype,"eCheckbox",void 0),ki([Wn("eValue")],e.prototype,"eValue",void 0),ki([Wn("eChildCount")],e.prototype,"eChildCount",void 0),e}(xn),ji=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Ui=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},zi=function(t){function o(){var e=t.call(this,o.TEMPLATE)||this;return e.refreshCount=0,e}return ji(o,t),o.prototype.init=function(t){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(t)},o.prototype.showDelta=function(t,o){var n=Math.abs(o),i=t.formatValue(n),r=e(i)?i:n,s=o>=0;this.eDelta.innerHTML=s?"\u2191"+r:"\u2193"+r,Ve(this.eDelta,"ag-value-change-delta-up",s),Ve(this.eDelta,"ag-value-change-delta-down",!s)},o.prototype.setTimerToRemoveDelta=function(){var t=this;this.refreshCount++;var e=this.refreshCount;window.setTimeout((function(){e===t.refreshCount&&t.hideDeltaValue()}),2e3)},o.prototype.hideDeltaValue=function(){xe(this.eValue,"ag-value-change-value-highlight"),Je(this.eDelta)},o.prototype.refresh=function(t){var o=t.value;if(o===this.lastValue)return!1;if(e(t.valueFormatted)?this.eValue.innerHTML=t.valueFormatted:e(t.value)?this.eValue.innerHTML=o:Je(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering())return!1;if("number"==typeof o&&"number"==typeof this.lastValue){var n=o-this.lastValue;this.showDelta(t,n)}return this.lastValue&&Me(this.eValue,"ag-value-change-value-highlight"),this.setTimerToRemoveDelta(),this.lastValue=o,!0},o.TEMPLATE='<span><span class="ag-value-change-delta"></span><span class="ag-value-change-value"></span></span>',Ui([it("filterManager")],o.prototype,"filterManager",void 0),o}(xn),Ki=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Yi=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},qi=function(t){function n(){var e=t.call(this,n.TEMPLATE)||this;return e.refreshCount=0,e.eCurrent=e.queryForHtmlElement(".ag-value-slide-current"),e}return Ki(n,t),n.prototype.init=function(t){this.params=t,this.refresh(t)},n.prototype.addSlideAnimation=function(){var t=this;this.refreshCount++;var e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious),this.ePrevious=oo('<span class="ag-value-slide-previous ag-value-slide-out"></span>'),this.ePrevious.innerHTML=this.eCurrent.innerHTML,this.getGui().insertBefore(this.ePrevious,this.eCurrent),window.setTimeout((function(){e===t.refreshCount&&Me(t.ePrevious,"ag-value-slide-out-end")}),50),window.setTimeout((function(){e===t.refreshCount&&(t.getGui().removeChild(t.ePrevious),t.ePrevious=null)}),3e3)},n.prototype.refresh=function(t){var n=t.value;return o(n)&&(n=""),n!==this.lastValue&&(!this.filterManager.isSuppressFlashingCellsBecauseFiltering()&&(this.addSlideAnimation(),this.lastValue=n,e(t.valueFormatted)?this.eCurrent.innerHTML=t.valueFormatted:e(t.value)?this.eCurrent.innerHTML=n:Je(this.eCurrent),!0))},n.TEMPLATE='<span><span class="ag-value-slide-current"></span></span>',Yi([it("filterManager")],n.prototype,"filterManager",void 0),n}(xn),Xi=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Qi=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},$i=function(t){function e(){return t.call(this,e.TEMPLATE)||this}return Xi(e,t),e.prototype.init=function(t){t.node.failedLoad?this.setupFailed():this.setupLoading()},e.prototype.setupFailed=function(){this.eLoadingText.innerText="ERR"},e.prototype.setupLoading=function(){var t=cn("groupLoading",this.gridOptionsWrapper,null);t&&this.eLoadingIcon.appendChild(t);var e=this.gridOptionsWrapper.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingOoo","Loading")},e.prototype.refresh=function(t){return!1},e.TEMPLATE='<div class="ag-loading">\n <span class="ag-loading-icon" ref="eLoadingIcon"></span>\n <span class="ag-loading-text" ref="eLoadingText"></span>\n </div>',Qi([Wn("eLoadingIcon")],e.prototype,"eLoadingIcon",void 0),Qi([Wn("eLoadingText")],e.prototype,"eLoadingText",void 0),e}(xn),Zi=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Ji=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},tr=function(t){function e(){var e=t.call(this,'<div class="ag-cell-edit-wrapper"><ag-select class="ag-cell-editor" ref="eSelect"></ag-select></div>')||this;return e.startedByEnter=!1,e}return Zi(e,t),e.prototype.init=function(t){var e=this;if(this.focusAfterAttached=t.cellStartedEdit,o(t.values))console.warn("AG Grid: no values found for select cellEditor");else{this.startedByEnter=t.keyPress===jn.ENTER;var n=!1;t.values.forEach((function(o){var i={value:o},r=e.valueFormatterService.formatValue(t.column,null,null,o),s=null!=r;i.text=s?r:o,e.eSelect.addOption(i),n=n||t.value===o})),n?this.eSelect.setValue(t.value,!0):t.values.length&&this.eSelect.setValue(t.values[0],!0),this.gridOptionsWrapper.isFullRowEdit()||this.eSelect.onValueChange((function(){return t.stopEditing()}))}},e.prototype.afterGuiAttached=function(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&this.eSelect.showPicker()},e.prototype.focusIn=function(){this.eSelect.getFocusableElement().focus()},e.prototype.getValue=function(){return this.eSelect.getValue()},e.prototype.isPopup=function(){return!1},Ji([it("valueFormatterService")],e.prototype,"valueFormatterService",void 0),Ji([Wn("eSelect")],e.prototype,"eSelect",void 0),e}(Hn),er=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),or=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return er(e,t),e.prototype.isPopup=function(){return!0},e}(Kn),nr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ir=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nr(e,t),e.prototype.isPopup=function(){return!0},e}(tr),rr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),sr=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ar=function(t){function o(){return t.call(this,o.TEMPLATE)||this}return rr(o,t),o.prototype.init=function(t){this.params=t,this.focusAfterAttached=t.cellStartedEdit,this.eTextArea.setMaxLength(t.maxLength||200).setCols(t.cols||60).setRows(t.rows||10),e(t.value)&&this.eTextArea.setValue(t.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this))},o.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;(e===jn.LEFT||e===jn.UP||e===jn.RIGHT||e===jn.DOWN||t.shiftKey&&e===jn.ENTER)&&t.stopPropagation()},o.prototype.afterGuiAttached=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(t("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()},o.prototype.getValue=function(){return this.params.parseValue(this.eTextArea.getValue())},o.TEMPLATE='<div class="ag-large-text" tabindex="0">\n <ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>\n </div>',sr([Wn("eTextArea")],o.prototype,"eTextArea",void 0),o}(Hn),lr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),pr=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ur=function(e){function o(){return e.call(this,"numberFilter")||this}return lr(o,e),o.prototype.mapRangeFromModel=function(t){return{from:t.filter,to:t.filterTo}},o.prototype.getDefaultDebounceMs=function(){return 500},o.prototype.resetUiToDefaults=function(t){var o=this;return e.prototype.resetUiToDefaults.call(this,t).then((function(){[o.eValueFrom1,o.eValueFrom2,o.eValueTo1,o.eValueTo2].forEach((function(e){return e.setValue(null,t)})),o.resetPlaceholder()}))},o.prototype.setConditionIntoUi=function(t,e){var o=e===Bn.One,n=o?this.eValueFrom1:this.eValueFrom2,i=o?this.eValueTo1:this.eValueTo2;n.setValue(t?""+t.filter:null),i.setValue(t?""+t.filterTo:null)},o.prototype.setValueFromFloatingFilter=function(t){this.eValueFrom1.setValue(t),this.eValueTo1.setValue(null),this.eValueFrom2.setValue(null),this.eValueTo2.setValue(null)},o.prototype.comparator=function(){return function(t,e){return t===e?0:t<e?1:-1}},o.prototype.setParams=function(t){this.numberFilterParams=t;var o=this.getAllowedCharPattern();if(o){var n={allowedCharPattern:o};this.resetTemplate({eValueFrom1:n,eValueTo1:n,eValueFrom2:n,eValueTo2:n})}e.prototype.setParams.call(this,t),this.addValueChangedListeners()},o.prototype.addValueChangedListeners=function(){var t=this,e=function(){return t.onUiChanged()};this.eValueFrom1.onValueChange(e),this.eValueTo1.onValueChange(e),this.eValueFrom2.onValueChange(e),this.eValueTo2.onValueChange(e)},o.prototype.resetPlaceholder=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),e=this.showValueTo(this.getCondition1Type()),o=this.showValueTo(this.getCondition2Type());this.eValueFrom1.setInputPlaceholder(this.translate(e?"inRangeStart":"filterOoo")),this.eValueFrom1.setInputAriaLabel(e?t("ariaFilterFromValue","Filter from value"):t("ariaFilterValue","Filter Value")),this.eValueTo1.setInputPlaceholder(this.translate("inRangeEnd")),this.eValueTo1.setInputAriaLabel(t("ariaFilterToValue","Filter to Value")),this.eValueFrom2.setInputPlaceholder(this.translate(o?"inRangeStart":"filterOoo")),this.eValueFrom2.setInputAriaLabel(o?t("ariaFilterFromValue","Filter from value"):t("ariaFilterValue","Filter Value")),this.eValueTo2.setInputPlaceholder(this.translate("inRangeEnd")),this.eValueTo2.setInputAriaLabel(t("ariaFilterToValue","Filter to Value"))},o.prototype.afterGuiAttached=function(t){e.prototype.afterGuiAttached.call(this,t),this.resetPlaceholder(),t&&t.suppressFocus||this.eValueFrom1.getInputElement().focus()},o.prototype.getDefaultFilterOptions=function(){return o.DEFAULT_FILTER_OPTIONS},o.prototype.createValueTemplate=function(t){var e=t===Bn.One?"1":"2",o=this.getAllowedCharPattern()?"ag-input-text-field":"ag-input-number-field";return'\n <div class="ag-filter-body" ref="eCondition'+e+'Body" role="presentation">\n <'+o+' class="ag-filter-from ag-filter-filter" ref="eValueFrom'+e+'"></'+o+">\n <"+o+' class="ag-filter-to ag-filter-filter" ref="eValueTo'+e+'"></'+o+">\n </div>"},o.prototype.isConditionUiComplete=function(t){var e=t===Bn.One,o=e?this.getCondition1Type():this.getCondition2Type();if(o===ri.EMPTY)return!1;if(this.doesFilterHaveHiddenInput(o))return!0;var n=e?this.eValueFrom1:this.eValueFrom2,i=e?this.eValueTo1:this.eValueTo2;return null!=this.stringToFloat(n.getValue())&&(!this.showValueTo(o)||null!=this.stringToFloat(i.getValue()))},o.prototype.areSimpleModelsEqual=function(t,e){return t.filter===e.filter&&t.filterTo===e.filterTo&&t.type===e.type},o.prototype.getFilterType=function(){return"number"},o.prototype.stringToFloat=function(e){if("number"==typeof e)return e;var o=t(e);return null!=o&&""===o.trim()&&(o=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(o):null==o||"-"===o.trim()?null:parseFloat(o)},o.prototype.createCondition=function(t){var e=t===Bn.One,o=e?this.getCondition1Type():this.getCondition2Type(),n=e?this.eValueFrom1:this.eValueFrom2,i=this.stringToFloat(n.getValue()),r={filterType:this.getFilterType(),type:o};if(!this.doesFilterHaveHiddenInput(o)&&(r.filter=i,this.showValueTo(o))){var s=e?this.eValueTo1:this.eValueTo2,a=this.stringToFloat(s.getValue());r.filterTo=a}return r},o.prototype.updateUiVisibility=function(){e.prototype.updateUiVisibility.call(this),this.resetPlaceholder();var t=this.getCondition1Type(),o=this.getCondition2Type();ke(this.eValueFrom1.getGui(),this.showValueFrom(t)),ke(this.eValueTo1.getGui(),this.showValueTo(t)),ke(this.eValueFrom2.getGui(),this.showValueFrom(o)),ke(this.eValueTo2.getGui(),this.showValueTo(o))},o.prototype.getAllowedCharPattern=function(){var t=(this.numberFilterParams||{}).allowedCharPattern;return t||(be()||Pe()?null:"\\d\\-\\.")},o.DEFAULT_FILTER_OPTIONS=[ai.EQUALS,ai.NOT_EQUAL,ai.LESS_THAN,ai.LESS_THAN_OR_EQUAL,ai.GREATER_THAN,ai.GREATER_THAN_OR_EQUAL,ai.IN_RANGE],pr([Wn("eValueFrom1")],o.prototype,"eValueFrom1",void 0),pr([Wn("eValueTo1")],o.prototype,"eValueTo1",void 0),pr([Wn("eValueFrom2")],o.prototype,"eValueFrom2",void 0),pr([Wn("eValueTo2")],o.prototype,"eValueTo2",void 0),o}(ai),cr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),dr=function(t){function e(){return t.call(this)||this}return cr(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this)},e.prototype.init=function(t){var o=this.gridOptionsWrapper.getOverlayLoadingTemplate()?this.gridOptionsWrapper.getOverlayLoadingTemplate():e.DEFAULT_LOADING_OVERLAY_TEMPLATE,n=this.gridOptionsWrapper.getLocaleTextFunc(),i=o.replace("[LOADING...]",n("loadingOoo","Loading..."));this.setTemplate(i)},e.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span class="ag-overlay-loading-center">[LOADING...]</span>',e}(xn),hr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),fr=function(t){function e(){return t.call(this)||this}return hr(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this)},e.prototype.init=function(t){var o=this.gridOptionsWrapper.getOverlayNoRowsTemplate()?this.gridOptionsWrapper.getOverlayNoRowsTemplate():e.DEFAULT_NO_ROWS_TEMPLATE,n=this.gridOptionsWrapper.getLocaleTextFunc(),i=o.replace("[NO_ROWS_TO_SHOW]",n("noRowsToShow","No Rows To Show"));this.setTemplate(i)},e.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center">[NO_ROWS_TO_SHOW]</span>',e}(xn),gr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),yr=function(t){function e(){return t.call(this,'<div class="ag-tooltip"></div>')||this}return gr(e,t),e.prototype.init=function(t){var e=t.value;this.getGui().innerHTML=e},e}(Hn),vr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),mr=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Cr=function(t){function e(){return t.call(this,'\n <div class="ag-filter-filter">\n <ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>\n </div>')||this}return vr(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this)},e.prototype.init=function(t){var e=this.eDateInput.getInputElement();this.shouldUseBrowserDatePicker(t)&&(Oe()?console.warn("ag-grid: browserDatePicker is specified to true, but it is not supported in IE 11; reverting to text date picker"):e.type="date"),this.addManagedListener(e,"mousedown",(function(){return e.focus()})),this.addManagedListener(this.eDateInput.getInputElement(),"input",(function(e){e.target===document.activeElement&&t.onDateChanged()}))},e.prototype.getDate=function(){return tn(this.eDateInput.getValue())},e.prototype.setDate=function(t){this.eDateInput.setValue(Jo(t,!1))},e.prototype.setInputPlaceholder=function(t){this.eDateInput.setInputPlaceholder(t)},e.prototype.afterGuiAttached=function(t){t&&t.suppressFocus||this.eDateInput.getInputElement().focus()},e.prototype.shouldUseBrowserDatePicker=function(t){return t.filterParams&&null!=t.filterParams.browserDatePicker?t.filterParams.browserDatePicker:be()||De()},mr([Wn("eDateInput")],e.prototype,"eDateInput",void 0),e}(xn),wr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Er=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wr(e,t),e.prototype.getDefaultDebounceMs=function(){return 0},e.prototype.destroy=function(){t.prototype.destroy.call(this)},e.prototype.getTextFromModel=function(t){if(!t)return null;if(t.operator){var e=t,o=this.conditionToString(e.condition1),n=this.conditionToString(e.condition2);return o+" "+e.operator+" "+n}var i=t,r=this.optionsFactory.getCustomOption(i.type);return r?(this.gridOptionsWrapper.getLocaleTextFunc()(r.displayKey,r.displayName),r.displayName):this.conditionToString(i)},e.prototype.isEventFromFloatingFilter=function(t){return t&&t.afterFloatingFilter},e.prototype.getLastType=function(){return this.lastType},e.prototype.setLastTypeFromModel=function(t){if(t){var e;if(t.operator)e=t.condition1;else e=t;this.lastType=e.type}else this.lastType=this.optionsFactory.getDefaultOption()},e.prototype.canWeEditAfterModelFromParentFilter=function(t){if(!t)return this.isTypeEditable(this.lastType);if(t.operator)return!1;var e=t;return this.isTypeEditable(e.type)},e.prototype.init=function(t){this.optionsFactory=new qn,this.optionsFactory.init(t.filterParams,this.getDefaultFilterOptions()),this.lastType=this.optionsFactory.getDefaultOption();var e=this.isTypeEditable(this.lastType);this.setEditable(e)},e.prototype.doesFilterHaveHiddenInput=function(t){var e=this.optionsFactory.getCustomOption(t);return e&&e.hideFilterInput},e.prototype.isTypeEditable=function(t){return!!t&&!this.doesFilterHaveHiddenInput(t)&&t!==ri.IN_RANGE&&t!==ri.EMPTY},e}(xn),Rr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Or=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Pr=function(t){function e(){return t.call(this,'\n <div class="ag-floating-filter-input" role="presentation">\n <ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>\n <div ref="eDateWrapper" style="display: flex;"></div>\n </div>')||this}return Rr(e,t),e.prototype.getDefaultFilterOptions=function(){return ui.DEFAULT_FILTER_OPTIONS},e.prototype.conditionToString=function(t){var e=t.type,o=tn(t.dateFrom);if(e===ri.IN_RANGE){var n=tn(t.dateTo);return Jo(o,!1)+"-"+Jo(n,!1)}return null==o?""+e:""+Jo(o,!1)},e.prototype.init=function(e){t.prototype.init.call(this,e),this.params=e,this.createDateComponent();var o=this.gridOptionsWrapper.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(o("ariaDateFilterInput","Date Filter Input"))},e.prototype.setEditable=function(t){ke(this.eDateWrapper,t),ke(this.eReadOnlyText.getGui(),!t)},e.prototype.onParentModelChanged=function(e,o){if(!this.isEventFromFloatingFilter(o)){t.prototype.setLastTypeFromModel.call(this,e);var n=this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(n),n){if(e){var i=e;this.dateComp.setDate(tn(i.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.getTextFromModel(e)),this.dateComp.setDate(null)}},e.prototype.onDateChanged=function(){var t=this,e=Jo(this.dateComp.getDate());this.params.parentFilterInstance((function(o){o&&o.onFloatingFilterChanged(t.getLastType(),e)}))},e.prototype.createDateComponent=function(){var t=this,e=ei.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),o={onDateChanged:$(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams};this.dateComp=new Yn(this.getContext(),this.userComponentFactory,o,this.eDateWrapper),this.addDestroyFunc((function(){return t.dateComp.destroy()}))},Or([it("userComponentFactory")],e.prototype,"userComponentFactory",void 0),Or([Wn("eReadOnlyText")],e.prototype,"eReadOnlyText",void 0),Or([Wn("eDateWrapper")],e.prototype,"eDateWrapper",void 0),e}(Er),Sr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),br=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Dr=function(e){function o(){return e.call(this,"textFilter")||this}return Sr(o,e),o.trimInput=function(t){var e=t&&t.trim();return""===e?t:e},o.prototype.getDefaultDebounceMs=function(){return 500},o.prototype.getCleanValue=function(e){var n=t(e.getValue());return this.textFilterParams.trimInput?o.trimInput(n):n},o.prototype.addValueChangedListeners=function(){var t=this,e=function(){return t.onUiChanged()};this.eValue1.onValueChange(e),this.eValue2.onValueChange(e)},o.prototype.setParams=function(t){e.prototype.setParams.call(this,t),this.textFilterParams=t,this.comparator=this.textFilterParams.textCustomComparator||o.DEFAULT_COMPARATOR,this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?o.DEFAULT_FORMATTER:o.DEFAULT_LOWERCASE_FORMATTER),this.addValueChangedListeners()},o.prototype.setConditionIntoUi=function(t,e){(e===Bn.One?this.eValue1:this.eValue2).setValue(t?t.filter:null)},o.prototype.createCondition=function(t){var e=t===Bn.One,o=e?this.getCondition1Type():this.getCondition2Type(),n=e?this.eValue1:this.eValue2,i=this.getCleanValue(n);n.setValue(i,!0);var r={filterType:this.getFilterType(),type:o};return this.doesFilterHaveHiddenInput(o)||(r.filter=i),r},o.prototype.getFilterType=function(){return"text"},o.prototype.areSimpleModelsEqual=function(t,e){return t.filter===e.filter&&t.type===e.type},o.prototype.resetUiToDefaults=function(t){var o=this;return e.prototype.resetUiToDefaults.call(this,t).then((function(){o.forEachInput((function(e){return e.setValue(null,t)})),o.resetPlaceholder()}))},o.prototype.resetPlaceholder=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),e=this.translate("filterOoo");this.forEachInput((function(o){o.setInputPlaceholder(e),o.setInputAriaLabel(t("ariaFilterValue","Filter Value"))}))},o.prototype.forEachInput=function(t){P([this.eValue1,this.eValue2],t)},o.prototype.setValueFromFloatingFilter=function(t){this.eValue1.setValue(t),this.eValue2.setValue(null)},o.prototype.getDefaultFilterOptions=function(){return o.DEFAULT_FILTER_OPTIONS},o.prototype.createValueTemplate=function(t){var e=t===Bn.One?"1":"2";return'\n <div class="ag-filter-body" ref="eCondition'+e+'Body" role="presentation">\n <ag-input-text-field class="ag-filter-filter" ref="eValue'+e+'"></ag-input-text-field>\n </div>'},o.prototype.updateUiVisibility=function(){e.prototype.updateUiVisibility.call(this),ke(this.eCondition1Body,this.showValueFrom(this.getCondition1Type())),ke(this.eCondition2Body,this.isCondition2Enabled()&&this.showValueFrom(this.getCondition2Type()))},o.prototype.afterGuiAttached=function(t){e.prototype.afterGuiAttached.call(this,t),this.resetPlaceholder(),t&&t.suppressFocus||this.eValue1.getInputElement().focus()},o.prototype.isConditionUiComplete=function(t){var e=t===Bn.One,o=e?this.getCondition1Type():this.getCondition2Type();return o!==ri.EMPTY&&(!!this.doesFilterHaveHiddenInput(o)||null!=this.getCleanValue(e?this.eValue1:this.eValue2))},o.prototype.individualConditionPasses=function(t,e){var o=e.filter,n=e.type,i=this.textFilterParams.valueGetter(t.node),r=this.formatter(i),s=this.optionsFactory.getCustomOption(n);if(s&&(null!=o||s.hideFilterInput))return s.test(o,r);if(null==i)return n===ri.NOT_EQUAL||n===ri.NOT_CONTAINS;var a=this.formatter(o);return this.comparator(n,r,a)},o.DEFAULT_FILTER_OPTIONS=[ri.CONTAINS,ri.NOT_CONTAINS,ri.EQUALS,ri.NOT_EQUAL,ri.STARTS_WITH,ri.ENDS_WITH],o.DEFAULT_FORMATTER=function(t){return t},o.DEFAULT_LOWERCASE_FORMATTER=function(t){return null==t?null:t.toString().toLowerCase()},o.DEFAULT_COMPARATOR=function(t,e,n){switch(t){case o.CONTAINS:return e.indexOf(n)>=0;case o.NOT_CONTAINS:return e.indexOf(n)<0;case o.EQUALS:return e===n;case o.NOT_EQUAL:return e!=n;case o.STARTS_WITH:return 0===e.indexOf(n);case o.ENDS_WITH:var i=e.lastIndexOf(n);return i>=0&&i===e.length-n.length;default:return console.warn("invalid filter type "+t),!1}},br([Wn("eValue1")],o.prototype,"eValue1",void 0),br([Wn("eValue2")],o.prototype,"eValue2",void 0),o}(ri),Ar=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Tr=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},_r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ar(e,t),e.prototype.postConstruct=function(){this.setTemplate('\n <div class="ag-floating-filter-input" role="presentation">\n <ag-input-text-field ref="eFloatingFilterInput"></ag-input-text-field>\n </div>')},e.prototype.getDefaultDebounceMs=function(){return 500},e.prototype.onParentModelChanged=function(t,e){this.isEventFromFloatingFilter(e)||(this.setLastTypeFromModel(t),this.eFloatingFilterInput.setValue(this.getTextFromModel(t)),this.setEditable(this.canWeEditAfterModelFromParentFilter(t)))},e.prototype.init=function(e){t.prototype.init.call(this,e),this.params=e,this.applyActive=ei.isUseApplyButton(this.params.filterParams);var o=ei.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),n=$(this.syncUpWithParentFilter.bind(this),o),i=this.eFloatingFilterInput.getGui();this.addManagedListener(i,"input",n),this.addManagedListener(i,"keypress",n),this.addManagedListener(i,"keydown",n);var r=e.column.getDefinition();r.filterParams&&r.filterParams.filterOptions&&1===r.filterParams.filterOptions.length&&"inRange"===r.filterParams.filterOptions[0]&&this.eFloatingFilterInput.setDisabled(!0);var s=this.columnController.getDisplayNameForColumn(e.column,"header",!0),a=this.gridOptionsWrapper.getLocaleTextFunc();this.eFloatingFilterInput.setInputAriaLabel(s+" "+a("ariaFilterInput","Filter Input"))},e.prototype.syncUpWithParentFilter=function(t){var e=this,o=hn(t,jn.ENTER);if(!this.applyActive||o){var n=this.eFloatingFilterInput.getValue();this.params.filterParams.trimInput&&(n=Dr.trimInput(n),this.eFloatingFilterInput.setValue(n,!0)),this.params.parentFilterInstance((function(t){t&&t.onFloatingFilterChanged(e.getLastType(),n)}))}},e.prototype.setEditable=function(t){this.eFloatingFilterInput.setDisabled(!t)},Tr([it("columnController")],e.prototype,"columnController",void 0),Tr([Wn("eFloatingFilterInput")],e.prototype,"eFloatingFilterInput",void 0),Tr([et],e.prototype,"postConstruct",null),e}(Er),Fr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Nr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fr(e,t),e.prototype.getDefaultFilterOptions=function(){return ur.DEFAULT_FILTER_OPTIONS},e.prototype.conditionToString=function(t){return t.type==ri.IN_RANGE?t.filter+"-"+t.filterTo:null!=t.filter?""+t.filter:""+t.type},e}(_r),Lr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Ir=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Lr(e,t),e.prototype.conditionToString=function(t){return null!=t.filter?""+t.filter:""+t.type},e.prototype.getDefaultFilterOptions=function(){return Dr.DEFAULT_FILTER_OPTIONS},e}(_r),Gr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Mr=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};!function(t){t[t.DEFAULT=0]="DEFAULT",t[t.REGISTERED=1]="REGISTERED"}(Hi||(Hi={}));!function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.agGridDefaults={agDateInput:Cr,agColumnHeader:fi,agColumnGroupHeader:vi,agTextColumnFloatingFilter:Ir,agNumberColumnFloatingFilter:Nr,agDateColumnFloatingFilter:Pr,agAnimateShowChangeCellRenderer:zi,agAnimateSlideCellRenderer:qi,agGroupCellRenderer:Bi,agGroupRowRenderer:Bi,agLoadingCellRenderer:$i,agCellEditor:Kn,agTextCellEditor:Kn,agSelectCellEditor:tr,agPopupTextCellEditor:or,agPopupSelectCellEditor:ir,agLargeTextCellEditor:ar,agTextColumnFilter:Dr,agNumberColumnFilter:ur,agDateColumnFilter:ui,agLoadingOverlay:dr,agNoRowsOverlay:fr,agTooltipComponent:yr},e.agDeprecatedNames={set:{newComponentName:"agSetColumnFilter",propertyHolder:"filter"},text:{newComponentName:"agTextColumnFilter",propertyHolder:"filter"},number:{newComponentName:"agNumberColumnFilter",propertyHolder:"filter"},date:{newComponentName:"agDateColumnFilter",propertyHolder:"filter"},group:{newComponentName:"agGroupCellRenderer",propertyHolder:"cellRenderer"},animateShowChange:{newComponentName:"agAnimateShowChangeCellRenderer",propertyHolder:"cellRenderer"},animateSlide:{newComponentName:"agAnimateSlideCellRenderer",propertyHolder:"cellRenderer"},select:{newComponentName:"agSelectCellEditor",propertyHolder:"cellEditor"},largeText:{newComponentName:"agLargeTextCellEditor",propertyHolder:"cellEditor"},popupSelect:{newComponentName:"agPopupSelectCellEditor",propertyHolder:"cellEditor"},popupText:{newComponentName:"agPopupTextCellEditor",propertyHolder:"cellEditor"},richSelect:{newComponentName:"agRichSelectCellEditor",propertyHolder:"cellEditor"},headerComponent:{newComponentName:"agColumnHeader",propertyHolder:"headerComponent"}},e.jsComponents={},e.frameworkComponents={},e}Gr(e,t),e.prototype.init=function(){var t=this;null!=this.gridOptions.components&&A(this.gridOptions.components,(function(e,o){return t.registerComponent(e,o)})),null!=this.gridOptions.frameworkComponents&&A(this.gridOptions.frameworkComponents,(function(e,o){return t.registerFwComponent(e,o)}))},e.prototype.registerDefaultComponent=function(t,e){var o=this.translateIfDeprecated(t);this.agGridDefaults[o]?console.error("Trying to overwrite a default component. You should call registerComponent"):this.agGridDefaults[o]=e},e.prototype.registerComponent=function(t,e){var o=this.translateIfDeprecated(t);this.frameworkComponents[o]?console.error("Trying to register a component that you have already registered for frameworks: "+o):this.jsComponents[o]=e},e.prototype.registerFwComponent=function(t,e){var o=this.translateIfDeprecated(t);this.jsComponents[o]?console.error("Trying to register a component that you have already registered for plain javascript: "+o):this.frameworkComponents[o]=e},e.prototype.retrieve=function(t){var e=this.translateIfDeprecated(t),o=this.frameworkComponents[e];if(o)return{componentFromFramework:!0,component:o,source:Hi.REGISTERED};var n=this.jsComponents[e];if(n)return{componentFromFramework:!1,component:n,source:Hi.REGISTERED};var i=this.agGridDefaults[e];return i?{componentFromFramework:!1,component:i,source:Hi.DEFAULT}:(Object.keys(this.agGridDefaults).indexOf(e)<0&&console.warn("AG Grid: Looking for component ["+e+"] but it wasn't found."),null)},e.prototype.translateIfDeprecated=function(t){var e=this.agDeprecatedNames[t];return null!=e?(z((function(){console.warn("ag-grid. Since v15.0 component names have been renamed to be namespaced. You should rename "+e.propertyHolder+":"+t+" to "+e.propertyHolder+":"+e.newComponentName)}),"DEPRECATE_COMPONENT_"+t),e.newComponentName):t},Mr([it("gridOptions")],e.prototype,"gridOptions",void 0),Mr([et],e.prototype,"init",null),e=Mr([nt("userComponentRegistry")],e)}(Mt);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/var xr=function(){function t(){}return t.parse=function(e){if(!e)return null;if(!0===e)return{toolPanels:[t.DEFAULT_COLUMN_COMP,t.DEFAULT_FILTER_COMP],defaultToolPanel:"columns"};if("string"==typeof e)return t.parse([e]);if(Array.isArray(e)){var o=[];return e.forEach((function(e){var n=t.DEFAULT_BY_KEY[e];n?o.push(n):console.warn("ag-grid: the key "+e+" is not a valid key for specifying a tool panel, valid keys are: "+Object.keys(t.DEFAULT_BY_KEY).join(","))})),0===o.length?null:{toolPanels:o,defaultToolPanel:o[0].id}}return{toolPanels:t.parseComponents(e.toolPanels),defaultToolPanel:e.defaultToolPanel,hiddenByDefault:e.hiddenByDefault,position:e.position}},t.parseComponents=function(e){var o=[];return e?(e.forEach((function(e){var n=null;if("string"==typeof e){var i=t.DEFAULT_BY_KEY[e];if(!i)return void console.warn("ag-grid: the key "+e+" is not a valid key for specifying a tool panel, valid keys are: "+Object.keys(t.DEFAULT_BY_KEY).join(","));n=i}else n=e;o.push(n)})),o):o},t.DEFAULT_COLUMN_COMP={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},t.DEFAULT_FILTER_COMP={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},t.DEFAULT_BY_KEY={columns:t.DEFAULT_COLUMN_COMP,filters:t.DEFAULT_FILTER_COMP},t}(),Vr=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Hr=function(t,e){return function(o,n){e(o,n,t)}},Wr=function(){for(var t=0,e=0,o=arguments.length;e<o;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<o;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)n[i]=r[s];return n};function kr(t){return!0===t||"true"===t}function Br(t,e){var o=parseInt(t,10);return ee(o)&&o>0?o:e}var jr,Ur,zr=function(){function t(){this.propertyEventService=new dt,this.domDataKey="__AG_"+Math.random().toString(),this.layoutElements=[],this.destroyed=!1}var n;return n=t,t.prototype.agWire=function(t,e){this.gridOptions.api=t,this.gridOptions.columnApi=e,this.checkForDeprecated(),this.checkForViolations()},t.prototype.destroy=function(){this.gridOptions.api=null,this.gridOptions.columnApi=null,this.removeEventListener(n.PROP_DOM_LAYOUT,this.updateLayoutClassesListener),this.destroyed=!0},t.prototype.init=function(){var t=this;!0!==this.gridOptions.suppressPropertyNamesCheck&&(this.checkGridOptionsProperties(),this.checkColumnDefProperties()),null!=this.gridOptions.sideBar&&(this.gridOptions.sideBar=xr.parse(this.gridOptions.sideBar));var o=this.useAsyncEvents();if(this.eventService.addGlobalListener(this.globalEventHandler.bind(this),o),this.isGroupSelectsChildren()&&this.isSuppressParentsInRowNodes()&&console.warn("AG Grid: 'groupSelectsChildren' does not work with 'suppressParentsInRowNodes', this selection method needs the part in rowNode to work"),this.isGroupSelectsChildren()&&(this.isRowSelectionMulti()||console.warn("AG Grid: rowSelection must be 'multiple' for groupSelectsChildren to make sense"),this.isRowModelServerSide()&&console.warn("AG Grid: group selects children is NOT support for Server Side Row Model. This is because the rows are lazy loaded, so selecting a group is not possible asthe grid has no way of knowing what the children are.")),this.isGroupRemoveSingleChildren()&&this.isGroupHideOpenParents()&&console.warn("AG Grid: groupRemoveSingleChildren and groupHideOpenParents do not work with each other, you need to pick one. And don't ask us how to us these together on our support forum either you will get the same answer!"),this.isRowModelServerSide()){var i=function(t){return"AG Grid: '"+t+"' is not supported on the Server-Side Row Model"};e(this.gridOptions.groupDefaultExpanded)&&console.warn(i("groupDefaultExpanded")),e(this.gridOptions.groupDefaultExpanded)&&console.warn(i("groupIncludeFooter")),e(this.gridOptions.groupDefaultExpanded)&&console.warn(i("groupIncludeTotalFooter"))}this.isEnableRangeSelection()&&ft.assertRegistered(pt.RangeSelectionModule,"enableRangeSelection"),this.isEnableRangeSelection()||!this.isEnableRangeHandle()&&!this.isEnableFillHandle()||console.warn("AG Grid: 'enableRangeHandle' and 'enableFillHandle' will not work unless 'enableRangeSelection' is set to true");var r=function(e){t.gridOptions.icons&&t.gridOptions.icons[e]&&console.warn("gridOptions.icons."+e+" is no longer supported. For information on how to style checkboxes and radio buttons, see https://www.ag-grid.com/javascript-grid-icons/")};r("radioButtonOff"),r("radioButtonOn"),r("checkboxChecked"),r("checkboxUnchecked"),r("checkboxIndeterminate"),this.updateLayoutClassesListener=this.updateLayoutClasses.bind(this),this.addEventListener(n.PROP_DOM_LAYOUT,this.updateLayoutClassesListener),this.getScrollbarWidth()},t.prototype.checkColumnDefProperties=function(){var t=this;null!=this.gridOptions.columnDefs&&this.gridOptions.columnDefs.forEach((function(e){var o=Object.getOwnPropertyNames(e),n=Wr(fe.ALL_PROPERTIES,fe.FRAMEWORK_PROPERTIES);t.checkProperties(o,n,n,"colDef","https://www.ag-grid.com/javascript-grid-column-properties/")}))},t.prototype.checkGridOptionsProperties=function(){var t=Object.getOwnPropertyNames(this.gridOptions),e=Wr(ue.ALL_PROPERTIES,ue.FRAMEWORK_PROPERTIES,l(Wt).map((function(t){return de.getCallbackForEvent(t)}))),o=Wr(e,["api","columnApi"]);this.checkProperties(t,o,e,"gridOptions","https://www.ag-grid.com/javascript-grid-properties/")},t.prototype.checkProperties=function(t,e,o,n,i){var r=on(t,e,o);A(r,(function(t,e){console.warn("ag-grid: invalid "+n+" property '"+t+"' did you mean any of these: "+e.slice(0,8).join(", "))})),Object.keys(r).length>0&&console.warn("ag-grid: to see all the valid "+n+" properties please check: "+i)},t.prototype.getDomDataKey=function(){return this.domDataKey},t.prototype.getDomData=function(t,e){var o=t[this.getDomDataKey()];return o?o[e]:void 0},t.prototype.setDomData=function(t,e,n){var i=this.getDomDataKey(),r=t[i];o(r)&&(r={},t[i]=r),r[e]=n},t.prototype.isRowSelection=function(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection},t.prototype.isSuppressRowDeselection=function(){return kr(this.gridOptions.suppressRowDeselection)},t.prototype.isRowSelectionMulti=function(){return"multiple"===this.gridOptions.rowSelection},t.prototype.isRowMultiSelectWithClick=function(){return kr(this.gridOptions.rowMultiSelectWithClick)},t.prototype.getContext=function(){return this.gridOptions.context},t.prototype.isPivotMode=function(){return kr(this.gridOptions.pivotMode)},t.prototype.isSuppressExpandablePivotGroups=function(){return kr(this.gridOptions.suppressExpandablePivotGroups)},t.prototype.getPivotColumnGroupTotals=function(){return this.gridOptions.pivotColumnGroupTotals},t.prototype.getPivotRowTotals=function(){return this.gridOptions.pivotRowTotals},t.prototype.isRowModelInfinite=function(){return this.gridOptions.rowModelType===ht.ROW_MODEL_TYPE_INFINITE},t.prototype.isRowModelViewport=function(){return this.gridOptions.rowModelType===ht.ROW_MODEL_TYPE_VIEWPORT},t.prototype.isRowModelServerSide=function(){return this.gridOptions.rowModelType===ht.ROW_MODEL_TYPE_SERVER_SIDE},t.prototype.isRowModelDefault=function(){return o(this.gridOptions.rowModelType)||this.gridOptions.rowModelType===ht.ROW_MODEL_TYPE_CLIENT_SIDE},t.prototype.isFullRowEdit=function(){return"fullRow"===this.gridOptions.editType},t.prototype.isSuppressFocusAfterRefresh=function(){return kr(this.gridOptions.suppressFocusAfterRefresh)},t.prototype.isSuppressBrowserResizeObserver=function(){return kr(this.gridOptions.suppressBrowserResizeObserver)},t.prototype.isSuppressMaintainUnsortedOrder=function(){return kr(this.gridOptions.suppressMaintainUnsortedOrder)},t.prototype.isSuppressClearOnFillReduction=function(){return kr(this.gridOptions.suppressClearOnFillReduction)},t.prototype.isShowToolPanel=function(){return kr(this.gridOptions.sideBar&&Array.isArray(this.getSideBar().toolPanels))},t.prototype.getSideBar=function(){return this.gridOptions.sideBar},t.prototype.isSuppressTouch=function(){return kr(this.gridOptions.suppressTouch)},t.prototype.isApplyColumnDefOrder=function(){return kr(this.gridOptions.applyColumnDefOrder)},t.prototype.isSuppressRowTransform=function(){return kr(this.gridOptions.suppressRowTransform)},t.prototype.isSuppressColumnStateEvents=function(){return kr(this.gridOptions.suppressColumnStateEvents)},t.prototype.isAllowDragFromColumnsToolPanel=function(){return kr(this.gridOptions.allowDragFromColumnsToolPanel)},t.prototype.useAsyncEvents=function(){return!kr(this.gridOptions.suppressAsyncEvents)},t.prototype.isEnableCellChangeFlash=function(){return kr(this.gridOptions.enableCellChangeFlash)},t.prototype.getCellFlashDelay=function(){return this.gridOptions.cellFlashDelay||500},t.prototype.getCellFadeDelay=function(){return this.gridOptions.cellFadeDelay||1e3},t.prototype.isGroupSelectsChildren=function(){var t=kr(this.gridOptions.groupSelectsChildren);return t&&this.isTreeData()?(console.warn("AG Grid: groupSelectsChildren does not work with tree data"),!1):t},t.prototype.isSuppressRowHoverHighlight=function(){return kr(this.gridOptions.suppressRowHoverHighlight)},t.prototype.isGroupSelectsFiltered=function(){return kr(this.gridOptions.groupSelectsFiltered)},t.prototype.isGroupHideOpenParents=function(){return kr(this.gridOptions.groupHideOpenParents)},t.prototype.isGroupMultiAutoColumn=function(){return kr(this.gridOptions.groupMultiAutoColumn)||kr(this.gridOptions.groupHideOpenParents)},t.prototype.isGroupRemoveSingleChildren=function(){return kr(this.gridOptions.groupRemoveSingleChildren)},t.prototype.isGroupRemoveLowestSingleChildren=function(){return kr(this.gridOptions.groupRemoveLowestSingleChildren)},t.prototype.isGroupIncludeFooter=function(){return kr(this.gridOptions.groupIncludeFooter)},t.prototype.isGroupIncludeTotalFooter=function(){return kr(this.gridOptions.groupIncludeTotalFooter)},t.prototype.isGroupSuppressBlankHeader=function(){return kr(this.gridOptions.groupSuppressBlankHeader)},t.prototype.isSuppressRowClickSelection=function(){return kr(this.gridOptions.suppressRowClickSelection)},t.prototype.isSuppressCellSelection=function(){return kr(this.gridOptions.suppressCellSelection)},t.prototype.isSuppressMultiSort=function(){return kr(this.gridOptions.suppressMultiSort)},t.prototype.isMultiSortKeyCtrl=function(){return"ctrl"===this.gridOptions.multiSortKey},t.prototype.isGroupSuppressAutoColumn=function(){return kr(this.gridOptions.groupSuppressAutoColumn)},t.prototype.isPivotSuppressAutoColumn=function(){return kr(this.gridOptions.pivotSuppressAutoColumn)},t.prototype.isSuppressDragLeaveHidesColumns=function(){return kr(this.gridOptions.suppressDragLeaveHidesColumns)},t.prototype.isSuppressScrollOnNewData=function(){return kr(this.gridOptions.suppressScrollOnNewData)},t.prototype.isRowDragManaged=function(){return kr(this.gridOptions.rowDragManaged)},t.prototype.isSuppressRowDrag=function(){return kr(this.gridOptions.suppressRowDrag)},t.prototype.isSuppressMoveWhenRowDragging=function(){return kr(this.gridOptions.suppressMoveWhenRowDragging)},t.prototype.isEnableMultiRowDragging=function(){return kr(this.gridOptions.enableMultiRowDragging)},t.prototype.getDomLayout=function(){var t=this.gridOptions.domLayout||ht.DOM_LAYOUT_NORMAL;return-1===[ht.DOM_LAYOUT_PRINT,ht.DOM_LAYOUT_AUTO_HEIGHT,ht.DOM_LAYOUT_NORMAL].indexOf(t)?(z((function(){return console.warn("AG Grid: "+t+" is not valid for DOM Layout, valid values are "+ht.DOM_LAYOUT_NORMAL+", "+ht.DOM_LAYOUT_AUTO_HEIGHT+" and "+ht.DOM_LAYOUT_PRINT)}),"warn about dom layout values"),ht.DOM_LAYOUT_NORMAL):t},t.prototype.isSuppressHorizontalScroll=function(){return kr(this.gridOptions.suppressHorizontalScroll)},t.prototype.isSuppressMaxRenderedRowRestriction=function(){return kr(this.gridOptions.suppressMaxRenderedRowRestriction)},t.prototype.isExcludeChildrenWhenTreeDataFiltering=function(){return kr(this.gridOptions.excludeChildrenWhenTreeDataFiltering)},t.prototype.isAlwaysShowHorizontalScroll=function(){return kr(this.gridOptions.alwaysShowHorizontalScroll)},t.prototype.isAlwaysShowVerticalScroll=function(){return kr(this.gridOptions.alwaysShowVerticalScroll)},t.prototype.isDebounceVerticalScrollbar=function(){return kr(this.gridOptions.debounceVerticalScrollbar)},t.prototype.isSuppressLoadingOverlay=function(){return kr(this.gridOptions.suppressLoadingOverlay)},t.prototype.isSuppressNoRowsOverlay=function(){return kr(this.gridOptions.suppressNoRowsOverlay)},t.prototype.isSuppressFieldDotNotation=function(){return kr(this.gridOptions.suppressFieldDotNotation)},t.prototype.getPinnedTopRowData=function(){return this.gridOptions.pinnedTopRowData},t.prototype.getPinnedBottomRowData=function(){return this.gridOptions.pinnedBottomRowData},t.prototype.isFunctionsPassive=function(){return kr(this.gridOptions.functionsPassive)},t.prototype.isSuppressChangeDetection=function(){return kr(this.gridOptions.suppressChangeDetection)},t.prototype.isSuppressAnimationFrame=function(){return kr(this.gridOptions.suppressAnimationFrame)},t.prototype.getQuickFilterText=function(){return this.gridOptions.quickFilterText},t.prototype.isCacheQuickFilter=function(){return kr(this.gridOptions.cacheQuickFilter)},t.prototype.isUnSortIcon=function(){return kr(this.gridOptions.unSortIcon)},t.prototype.isSuppressMenuHide=function(){return kr(this.gridOptions.suppressMenuHide)},t.prototype.isEnterMovesDownAfterEdit=function(){return kr(this.gridOptions.enterMovesDownAfterEdit)},t.prototype.isEnterMovesDown=function(){return kr(this.gridOptions.enterMovesDown)},t.prototype.isUndoRedoCellEditing=function(){return kr(this.gridOptions.undoRedoCellEditing)},t.prototype.getUndoRedoCellEditingLimit=function(){return this.gridOptions.undoRedoCellEditingLimit},t.prototype.getRowStyle=function(){return this.gridOptions.rowStyle},t.prototype.getRowClass=function(){return this.gridOptions.rowClass},t.prototype.getRowStyleFunc=function(){return this.gridOptions.getRowStyle},t.prototype.getRowClassFunc=function(){return this.gridOptions.getRowClass},t.prototype.rowClassRules=function(){return this.gridOptions.rowClassRules},t.prototype.getServerSideStoreType=function(){return this.gridOptions.serverSideStoreType},t.prototype.getServerSideStoreParamsFunc=function(){return this.gridOptions.getServerSideStoreParams},t.prototype.getCreateChartContainerFunc=function(){return this.gridOptions.createChartContainer},t.prototype.getPopupParent=function(){return this.gridOptions.popupParent},t.prototype.getBlockLoadDebounceMillis=function(){return this.gridOptions.blockLoadDebounceMillis},t.prototype.getPostProcessPopupFunc=function(){return this.gridOptions.postProcessPopup},t.prototype.getPaginationNumberFormatterFunc=function(){return this.gridOptions.paginationNumberFormatter},t.prototype.getChildCountFunc=function(){return this.gridOptions.getChildCount},t.prototype.getIsApplyServerSideTransactionFunc=function(){return this.gridOptions.isApplyServerSideTransaction},t.prototype.getDefaultGroupSortComparator=function(){return this.gridOptions.defaultGroupSortComparator},t.prototype.getIsFullWidthCellFunc=function(){return this.gridOptions.isFullWidthCell},t.prototype.getFullWidthCellRendererParams=function(){return this.gridOptions.fullWidthCellRendererParams},t.prototype.isEmbedFullWidthRows=function(){return kr(this.gridOptions.embedFullWidthRows)||kr(this.gridOptions.deprecatedEmbedFullWidthRows)},t.prototype.isDetailRowAutoHeight=function(){return kr(this.gridOptions.detailRowAutoHeight)},t.prototype.getSuppressKeyboardEventFunc=function(){return this.gridOptions.suppressKeyboardEvent},t.prototype.getBusinessKeyForNodeFunc=function(){return this.gridOptions.getBusinessKeyForNode},t.prototype.getApi=function(){return this.gridOptions.api},t.prototype.getColumnApi=function(){return this.gridOptions.columnApi},t.prototype.isImmutableData=function(){return kr(this.gridOptions.immutableData)},t.prototype.isEnsureDomOrder=function(){return kr(this.gridOptions.ensureDomOrder)},t.prototype.isEnableCharts=function(){return!!kr(this.gridOptions.enableCharts)&&ft.assertRegistered(pt.GridChartsModule,"enableCharts")},t.prototype.getColResizeDefault=function(){return this.gridOptions.colResizeDefault},t.prototype.isSingleClickEdit=function(){return kr(this.gridOptions.singleClickEdit)},t.prototype.isSuppressClickEdit=function(){return kr(this.gridOptions.suppressClickEdit)},t.prototype.isStopEditingWhenGridLosesFocus=function(){return kr(this.gridOptions.stopEditingWhenGridLosesFocus)},t.prototype.getGroupDefaultExpanded=function(){return this.gridOptions.groupDefaultExpanded},t.prototype.getMaxConcurrentDatasourceRequests=function(){return this.gridOptions.maxConcurrentDatasourceRequests},t.prototype.getMaxBlocksInCache=function(){return this.gridOptions.maxBlocksInCache},t.prototype.getCacheOverflowSize=function(){return this.gridOptions.cacheOverflowSize},t.prototype.getPaginationPageSize=function(){return"number"==typeof(t=this.gridOptions.paginationPageSize)?t:"string"==typeof t?parseInt(t,10):void 0;var t},t.prototype.isPaginateChildRows=function(){return!(!this.isGroupRemoveSingleChildren()&&!this.isGroupRemoveLowestSingleChildren())||kr(this.gridOptions.paginateChildRows)},t.prototype.getCacheBlockSize=function(){return Br(this.gridOptions.cacheBlockSize)},t.prototype.getInfiniteInitialRowCount=function(){return this.gridOptions.infiniteInitialRowCount},t.prototype.isPurgeClosedRowNodes=function(){return kr(this.gridOptions.purgeClosedRowNodes)},t.prototype.isSuppressPaginationPanel=function(){return kr(this.gridOptions.suppressPaginationPanel)},t.prototype.getRowData=function(){return this.gridOptions.rowData},t.prototype.isGroupUseEntireRow=function(t){return!t&&kr(this.gridOptions.groupUseEntireRow)},t.prototype.isEnableRtl=function(){return kr(this.gridOptions.enableRtl)},t.prototype.getAutoGroupColumnDef=function(){return this.gridOptions.autoGroupColumnDef},t.prototype.getRowGroupPanelShow=function(){return this.gridOptions.rowGroupPanelShow},t.prototype.getPivotPanelShow=function(){return this.gridOptions.pivotPanelShow},t.prototype.isAngularCompileRows=function(){return kr(this.gridOptions.angularCompileRows)},t.prototype.isAngularCompileFilters=function(){return kr(this.gridOptions.angularCompileFilters)},t.prototype.isDebug=function(){return kr(this.gridOptions.debug)},t.prototype.getColumnDefs=function(){return this.gridOptions.columnDefs},t.prototype.getColumnTypes=function(){return this.gridOptions.columnTypes},t.prototype.getDatasource=function(){return this.gridOptions.datasource},t.prototype.getViewportDatasource=function(){return this.gridOptions.viewportDatasource},t.prototype.getServerSideDatasource=function(){return this.gridOptions.serverSideDatasource},t.prototype.isAccentedSort=function(){return kr(this.gridOptions.accentedSort)},t.prototype.isEnableBrowserTooltips=function(){return kr(this.gridOptions.enableBrowserTooltips)},t.prototype.isEnableCellExpressions=function(){return kr(this.gridOptions.enableCellExpressions)},t.prototype.isEnableGroupEdit=function(){return kr(this.gridOptions.enableGroupEdit)},t.prototype.isSuppressMiddleClickScrolls=function(){return kr(this.gridOptions.suppressMiddleClickScrolls)},t.prototype.isPreventDefaultOnContextMenu=function(){return kr(this.gridOptions.preventDefaultOnContextMenu)},t.prototype.isSuppressPreventDefaultOnMouseWheel=function(){return kr(this.gridOptions.suppressPreventDefaultOnMouseWheel)},t.prototype.isSuppressColumnVirtualisation=function(){return kr(this.gridOptions.suppressColumnVirtualisation)},t.prototype.isSuppressContextMenu=function(){return kr(this.gridOptions.suppressContextMenu)},t.prototype.isAllowContextMenuWithControlKey=function(){return kr(this.gridOptions.allowContextMenuWithControlKey)},t.prototype.isSuppressCopyRowsToClipboard=function(){return kr(this.gridOptions.suppressCopyRowsToClipboard)},t.prototype.isCopyHeadersToClipboard=function(){return kr(this.gridOptions.copyHeadersToClipboard)},t.prototype.isSuppressClipboardPaste=function(){return kr(this.gridOptions.suppressClipboardPaste)},t.prototype.isSuppressLastEmptyLineOnPaste=function(){return kr(this.gridOptions.suppressLastEmptyLineOnPaste)},t.prototype.isPagination=function(){return kr(this.gridOptions.pagination)},t.prototype.isSuppressEnterpriseResetOnNewColumns=function(){return kr(this.gridOptions.suppressEnterpriseResetOnNewColumns)},t.prototype.getProcessDataFromClipboardFunc=function(){return this.gridOptions.processDataFromClipboard},t.prototype.getAsyncTransactionWaitMillis=function(){return e(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:ht.BATCH_WAIT_MILLIS},t.prototype.isSuppressMovableColumns=function(){return kr(this.gridOptions.suppressMovableColumns)},t.prototype.isAnimateRows=function(){return!this.isEnsureDomOrder()&&kr(this.gridOptions.animateRows)},t.prototype.isSuppressColumnMoveAnimation=function(){return kr(this.gridOptions.suppressColumnMoveAnimation)},t.prototype.isSuppressAggFuncInHeader=function(){return kr(this.gridOptions.suppressAggFuncInHeader)},t.prototype.isSuppressAggAtRootLevel=function(){return kr(this.gridOptions.suppressAggAtRootLevel)},t.prototype.isSuppressAggFilteredOnly=function(){return kr(this.gridOptions.suppressAggFilteredOnly)},t.prototype.isShowOpenedGroup=function(){return kr(this.gridOptions.showOpenedGroup)},t.prototype.isEnableRangeSelection=function(){return ft.isRegistered(pt.RangeSelectionModule)&&kr(this.gridOptions.enableRangeSelection)},t.prototype.isEnableRangeHandle=function(){return kr(this.gridOptions.enableRangeHandle)},t.prototype.isEnableFillHandle=function(){return kr(this.gridOptions.enableFillHandle)},t.prototype.getFillHandleDirection=function(){var t=this.gridOptions.fillHandleDirection;return t?"x"!==t&&"y"!==t&&"xy"!==t?(z((function(){return console.warn("AG Grid: valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'.")}),"warn invalid fill direction"),"xy"):t:"xy"},t.prototype.getFillOperation=function(){return this.gridOptions.fillOperation},t.prototype.isSuppressMultiRangeSelection=function(){return kr(this.gridOptions.suppressMultiRangeSelection)},t.prototype.isPaginationAutoPageSize=function(){return kr(this.gridOptions.paginationAutoPageSize)},t.prototype.isRememberGroupStateWhenNewData=function(){return kr(this.gridOptions.rememberGroupStateWhenNewData)},t.prototype.getIcons=function(){return this.gridOptions.icons},t.prototype.getAggFuncs=function(){return this.gridOptions.aggFuncs},t.prototype.getSortingOrder=function(){return this.gridOptions.sortingOrder},t.prototype.getAlignedGrids=function(){return this.gridOptions.alignedGrids},t.prototype.isMasterDetail=function(){return!!kr(this.gridOptions.masterDetail)&&ft.assertRegistered(pt.MasterDetailModule,"masterDetail")},t.prototype.isKeepDetailRows=function(){return kr(this.gridOptions.keepDetailRows)},t.prototype.getKeepDetailRowsCount=function(){var t=this.gridOptions.keepDetailRowsCount;return e(t)&&t>0?this.gridOptions.keepDetailRowsCount:10},t.prototype.getIsRowMasterFunc=function(){return this.gridOptions.isRowMaster},t.prototype.getIsRowSelectableFunc=function(){return this.gridOptions.isRowSelectable},t.prototype.getGroupRowRendererParams=function(){return this.gridOptions.groupRowRendererParams},t.prototype.getOverlayLoadingTemplate=function(){return this.gridOptions.overlayLoadingTemplate},t.prototype.getOverlayNoRowsTemplate=function(){return this.gridOptions.overlayNoRowsTemplate},t.prototype.isSuppressAutoSize=function(){return kr(this.gridOptions.suppressAutoSize)},t.prototype.isEnableCellTextSelection=function(){return kr(this.gridOptions.enableCellTextSelection)},t.prototype.isSuppressParentsInRowNodes=function(){return kr(this.gridOptions.suppressParentsInRowNodes)},t.prototype.isSuppressClipboardApi=function(){return kr(this.gridOptions.suppressClipboardApi)},t.prototype.isFunctionsReadOnly=function(){return kr(this.gridOptions.functionsReadOnly)},t.prototype.isFloatingFilter=function(){return this.gridOptions.floatingFilter},t.prototype.isEnableCellTextSelect=function(){return kr(this.gridOptions.enableCellTextSelection)},t.prototype.isEnableOldSetFilterModel=function(){return kr(this.gridOptions.enableOldSetFilterModel)},t.prototype.getDefaultColDef=function(){return this.gridOptions.defaultColDef},t.prototype.getDefaultColGroupDef=function(){return this.gridOptions.defaultColGroupDef},t.prototype.getDefaultExportParams=function(){return this.gridOptions.defaultExportParams},t.prototype.isSuppressCsvExport=function(){return kr(this.gridOptions.suppressCsvExport)},t.prototype.isAllowShowChangeAfterFilter=function(){return kr(this.gridOptions.allowShowChangeAfterFilter)},t.prototype.isSuppressExcelExport=function(){return kr(this.gridOptions.suppressExcelExport)},t.prototype.isSuppressMakeColumnVisibleAfterUnGroup=function(){return kr(this.gridOptions.suppressMakeColumnVisibleAfterUnGroup)},t.prototype.getDataPathFunc=function(){return this.gridOptions.getDataPath},t.prototype.getIsServerSideGroupFunc=function(){return this.gridOptions.isServerSideGroup},t.prototype.getIsServerSideGroupOpenByDefaultFunc=function(){return this.gridOptions.isServerSideGroupOpenByDefault},t.prototype.getServerSideGroupKeyFunc=function(){return this.gridOptions.getServerSideGroupKey},t.prototype.getGroupRowAggNodesFunc=function(){return this.gridOptions.groupRowAggNodes},t.prototype.getContextMenuItemsFunc=function(){return this.gridOptions.getContextMenuItems},t.prototype.getMainMenuItemsFunc=function(){return this.gridOptions.getMainMenuItems},t.prototype.getRowNodeIdFunc=function(){return this.gridOptions.getRowNodeId},t.prototype.getNavigateToNextHeaderFunc=function(){return this.gridOptions.navigateToNextHeader},t.prototype.getTabToNextHeaderFunc=function(){return this.gridOptions.tabToNextHeader},t.prototype.getNavigateToNextCellFunc=function(){return this.gridOptions.navigateToNextCell},t.prototype.getTabToNextCellFunc=function(){return this.gridOptions.tabToNextCell},t.prototype.isTreeData=function(){return!!kr(this.gridOptions.treeData)&&ft.assertRegistered(pt.RowGroupingModule,"Tree Data")},t.prototype.isValueCache=function(){return kr(this.gridOptions.valueCache)},t.prototype.isValueCacheNeverExpires=function(){return kr(this.gridOptions.valueCacheNeverExpires)},t.prototype.isDeltaSort=function(){return kr(this.gridOptions.deltaSort)},t.prototype.isAggregateOnlyChangedColumns=function(){return kr(this.gridOptions.aggregateOnlyChangedColumns)},t.prototype.getProcessSecondaryColDefFunc=function(){return this.gridOptions.processSecondaryColDef},t.prototype.getProcessSecondaryColGroupDefFunc=function(){return this.gridOptions.processSecondaryColGroupDef},t.prototype.getSendToClipboardFunc=function(){return this.gridOptions.sendToClipboard},t.prototype.getProcessRowPostCreateFunc=function(){return this.gridOptions.processRowPostCreate},t.prototype.getProcessCellForClipboardFunc=function(){return this.gridOptions.processCellForClipboard},t.prototype.getProcessHeaderForClipboardFunc=function(){return this.gridOptions.processHeaderForClipboard},t.prototype.getProcessCellFromClipboardFunc=function(){return this.gridOptions.processCellFromClipboard},t.prototype.getViewportRowModelPageSize=function(){return Br(this.gridOptions.viewportRowModelPageSize,5)},t.prototype.getViewportRowModelBufferSize=function(){return t=this.gridOptions.viewportRowModelBufferSize,e=5,t>=0?t:e;var t,e},t.prototype.isServerSideSortingAlwaysResets=function(){return kr(this.gridOptions.serverSideSortingAlwaysResets)},t.prototype.isServerSideFilteringAlwaysResets=function(){return kr(this.gridOptions.serverSideFilteringAlwaysResets)},t.prototype.getPostSortFunc=function(){return this.gridOptions.postSort},t.prototype.getChartToolbarItemsFunc=function(){return this.gridOptions.getChartToolbarItems},t.prototype.getChartThemeOverrides=function(){return this.gridOptions.chartThemeOverrides},t.prototype.getCustomChartThemes=function(){return this.gridOptions.customChartThemes},t.prototype.getChartThemes=function(){return this.gridOptions.chartThemes||["ag-default","ag-material","ag-pastel","ag-vivid","ag-solar"]},t.prototype.getProcessChartOptionsFunc=function(){return this.gridOptions.processChartOptions},t.prototype.getClipboardDeliminator=function(){return e(this.gridOptions.clipboardDeliminator)?this.gridOptions.clipboardDeliminator:"\t"},t.prototype.setProperty=function(t,e,o){void 0===o&&(o=!1);var n=this.gridOptions,i=n[t];if(o||i!==e){n[t]=e;var r={type:t,currentValue:e,previousValue:i};this.propertyEventService.dispatchEvent(r)}},t.prototype.addLayoutElement=function(t){this.layoutElements.push(t),this.updateLayoutClasses()},t.prototype.updateLayoutClasses=function(){var t=this.getDomLayout(),e=t===ht.DOM_LAYOUT_AUTO_HEIGHT,o=t===ht.DOM_LAYOUT_PRINT,n=t===ht.DOM_LAYOUT_NORMAL;this.layoutElements.forEach((function(t){Ve(t,"ag-layout-auto-height",e),Ve(t,"ag-layout-normal",n),Ve(t,"ag-layout-print",o)}))},t.prototype.addEventListener=function(t,e){this.propertyEventService.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.propertyEventService.removeEventListener(t,e)},t.prototype.isSkipHeaderOnAutoSize=function(){return!!this.gridOptions.skipHeaderOnAutoSize},t.prototype.getAutoSizePadding=function(){var t=this.gridOptions.autoSizePadding;return null!=t&&t>=0?t:20},t.prototype.getHeaderHeight=function(){return"number"==typeof this.gridOptions.headerHeight?this.gridOptions.headerHeight:this.getFromTheme(25,"headerHeight")},t.prototype.getFloatingFiltersHeight=function(){return"number"==typeof this.gridOptions.floatingFiltersHeight?this.gridOptions.floatingFiltersHeight:this.getFromTheme(25,"headerHeight")},t.prototype.getGroupHeaderHeight=function(){return"number"==typeof this.gridOptions.groupHeaderHeight?this.gridOptions.groupHeaderHeight:this.getHeaderHeight()},t.prototype.getPivotHeaderHeight=function(){return"number"==typeof this.gridOptions.pivotHeaderHeight?this.gridOptions.pivotHeaderHeight:this.getHeaderHeight()},t.prototype.getPivotGroupHeaderHeight=function(){return"number"==typeof this.gridOptions.pivotGroupHeaderHeight?this.gridOptions.pivotGroupHeaderHeight:this.getGroupHeaderHeight()},t.prototype.isExternalFilterPresent=function(){return"function"==typeof this.gridOptions.isExternalFilterPresent&&this.gridOptions.isExternalFilterPresent()},t.prototype.doesExternalFilterPass=function(t){return"function"==typeof this.gridOptions.doesExternalFilterPass&&this.gridOptions.doesExternalFilterPass(t)},t.prototype.getTooltipShowDelay=function(){var t=this.gridOptions.tooltipShowDelay;return e(t)?(t<0&&console.warn("ag-grid: tooltipShowDelay should not be lower than 0"),Math.max(200,t)):null},t.prototype.isTooltipMouseTrack=function(){return kr(this.gridOptions.tooltipMouseTrack)},t.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(){return kr(this.gridOptions.suppressModelUpdateAfterUpdateTransaction)},t.prototype.getDocument=function(){var t=null;return this.gridOptions.getDocument&&e(this.gridOptions.getDocument)&&(t=this.gridOptions.getDocument()),t&&e(t)?t:document},t.prototype.getMinColWidth=function(){var t=this.gridOptions.minColWidth;if(e(t)&&t>n.MIN_COL_WIDTH)return this.gridOptions.minColWidth;var o=this.getFromTheme(null,"headerCellMinWidth");return e(o)?Math.max(o,n.MIN_COL_WIDTH):n.MIN_COL_WIDTH},t.prototype.getMaxColWidth=function(){return this.gridOptions.maxColWidth&&this.gridOptions.maxColWidth>n.MIN_COL_WIDTH?this.gridOptions.maxColWidth:null},t.prototype.getColWidth=function(){return"number"!=typeof this.gridOptions.colWidth||this.gridOptions.colWidth<n.MIN_COL_WIDTH?200:this.gridOptions.colWidth},t.prototype.getRowBuffer=function(){var t=this.gridOptions.rowBuffer;return"number"==typeof t?t<0&&(z((function(){return console.warn("AG Grid: rowBuffer should not be negative")}),"warn rowBuffer negative"),this.gridOptions.rowBuffer=t=0):t=ht.ROW_BUFFER_SIZE,t},t.prototype.getRowBufferInPixels=function(){return this.getRowBuffer()*this.getRowHeightAsNumber()},t.prototype.getScrollbarWidth=function(){if(null==this.scrollbarWidth){var t="number"==typeof this.gridOptions.scrollbarWidth&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:Fe();null!=t&&(this.scrollbarWidth=t,this.eventService.dispatchEvent({type:Wt.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth},t.prototype.checkForDeprecated=function(){var t=this.gridOptions;t.deprecatedEmbedFullWidthRows&&console.warn("AG Grid: since v21.2, deprecatedEmbedFullWidthRows has been replaced with embedFullWidthRows."),t.enableOldSetFilterModel&&console.warn("AG Grid: since v22.x, enableOldSetFilterModel is deprecated. Please move to the new Set Filter Model as the old one may not be supported in v23 onwards."),t.floatingFilter&&(console.warn("AG Grid: since v23.1, floatingFilter on the gridOptions is deprecated. Please use floatingFilter on the colDef instead."),t.defaultColDef||(t.defaultColDef={}),null==t.defaultColDef.floatingFilter&&(t.defaultColDef.floatingFilter=!0)),t.rowDeselection&&console.warn("AG Grid: since v24.x, rowDeselection is deprecated and the behaviour is true by default. Please use `suppressRowDeselection` to prevent rows from being deselected.");var e=function(e,o,n){null!=t[e]&&(console.warn("ag-grid: since version "+n+", '"+e+"' is deprecated / renamed, please use the new property name '"+o+"' instead."),null==t[o]&&(t[o]=t[e]))};if(e("batchUpdateWaitMillis","asyncTransactionWaitMillis","23.1.x"),e("deltaRowDataMode","immutableData","23.1.x"),(t.immutableColumns||t.deltaColumnMode)&&console.warn("AG Grid: since v24.0, immutableColumns and deltaColumnMode properties are gone. The grid now works like this as default. To keep column order maintained, set grid property applyColumnDefOrder=true"),e("suppressSetColumnStateEvents","suppressColumnStateEvents","24.0.x"),t.groupRowInnerRenderer||t.groupRowInnerRendererParams||t.groupRowInnerRendererFramework){console.warn("AG Grid: since v24.0, grid properties groupRowInnerRenderer, groupRowInnerRendererFramework and groupRowInnerRendererParams are no longer used."),console.warn(" Instead use the grid properties groupRowRendererParams.innerRenderer, groupRowRendererParams.innerRendererFramework and groupRowRendererParams.innerRendererParams."),console.warn(" For example instead of this:"),console.warn(' groupRowInnerRenderer: "myRenderer"'),console.warn(" groupRowInnerRendererParams: {x: a}"),console.warn(" Replace with this:"),console.warn(" groupRowRendererParams: {"),console.warn(' innerRenderer: "myRenderer",'),console.warn(" innerRendererParams: {x: a}"),console.warn(" }"),console.warn(" We have copied the properties over for you. However to stop this error message, please change your application code."),t.groupRowRendererParams||(t.groupRowRendererParams={});var o=t.groupRowRendererParams;t.groupRowInnerRenderer&&(o.innerRenderer=t.groupRowInnerRenderer),t.groupRowInnerRendererParams&&(o.innerRendererParams=t.groupRowInnerRendererParams),t.groupRowInnerRendererFramework&&(o.innerRendererFramework=t.groupRowInnerRendererFramework)}t.rememberGroupStateWhenNewData&&console.warn("AG Grid: since v24.0, grid property rememberGroupStateWhenNewData is deprecated. This feature was provided before Transaction Updates worked (which keep group state). Now that transaction updates are possible and they keep group state, this feature is no longer needed."),t.detailCellRendererParams&&t.detailCellRendererParams.autoHeight&&(console.warn("AG Grid: since v24.1, grid property detailCellRendererParams.autoHeight is replaced with grid property detailRowAutoHeight. This allows this feature to work when you provide a custom DetailCellRenderer"),t.detailRowAutoHeight=!0),t.suppressKeyboardEvent&&console.warn("AG Grid: since v24.1 suppressKeyboardEvent in the gridOptions has been deprecated and will be removed in\n future versions of AG Grid. If you need this to be set for every column use the defaultColDef property."),t.suppressEnterpriseResetOnNewColumns&&(console.warn("AG Grid: since v25, grid property suppressEnterpriseResetOnNewColumns is deprecated. This was a temporary property to allow changing columns in Server Side Row Model without triggering a reload. Now that it is possible to dynamically change columns in the grid, this is no longer needed."),t.detailRowAutoHeight=!0)},t.prototype.checkForViolations=function(){this.isTreeData()&&this.treeDataViolations()},t.prototype.treeDataViolations=function(){this.isRowModelDefault()&&o(this.getDataPathFunc())&&console.warn("AG Grid: property usingTreeData=true with rowModel=clientSide, but you did not provide getDataPath function, please provide getDataPath function if using tree data."),this.isRowModelServerSide()&&(o(this.getIsServerSideGroupFunc())&&console.warn("AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not provide isServerSideGroup function, please provide isServerSideGroup function if using tree data."),o(this.getServerSideGroupKeyFunc())&&console.warn("AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not provide getServerSideGroupKey function, please provide getServerSideGroupKey function if using tree data."))},t.prototype.getLocaleTextFunc=function(){if(this.gridOptions.localeTextFunc)return this.gridOptions.localeTextFunc;var t=this.gridOptions.localeText;return function(e,o){return t&&t[e]?t[e]:o}},t.prototype.globalEventHandler=function(t,e){if(!this.destroyed){var o=de.getCallbackForEvent(t);"function"==typeof this.gridOptions[o]&&this.gridOptions[o](e)}},t.prototype.getRowHeightAsNumber=function(){return!this.gridOptions.rowHeight||o(this.gridOptions.rowHeight)?this.getDefaultRowHeight():this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:(console.warn("AG Grid row height must be a number if not using standard row model"),this.getDefaultRowHeight())},t.prototype.getRowHeightForNode=function(t,o){if(void 0===o&&(o=!1),"function"==typeof this.gridOptions.getRowHeight){if(o)return{height:this.getDefaultRowHeight(),estimated:!0};var n={node:t,data:t.data,api:this.gridOptions.api,context:this.gridOptions.context},i=this.gridOptions.getRowHeight(n);if(this.isNumeric(i))return 0===i&&z((function(){return console.warn("AG Grid: The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.")}),"invalidRowHeight"),{height:Math.max(1,i),estimated:!1}}if(t.detail&&this.isMasterDetail())return this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1};var r=this.getDefaultRowHeight(),s=this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:r,a=e(s)?Math.min(r,s):r;if(this.columnController.isAutoRowHeightActive()){if(o)return{height:s,estimated:!0};var l=this.autoHeightCalculator.getPreferredHeightForRow(t);return{height:Math.max(l,a),estimated:!1}}return{height:s,estimated:!1}},t.prototype.isDynamicRowHeight=function(){return"function"==typeof this.gridOptions.getRowHeight},t.prototype.getListItemHeight=function(){return this.getFromTheme(20,"listItemHeight")},t.prototype.chartMenuPanelWidth=function(){return this.environment.chartMenuPanelWidth()},t.prototype.isNumeric=function(t){return!isNaN(t)&&"number"==typeof t&&isFinite(t)},t.prototype.getFromTheme=function(t,e){var o=this.environment.getTheme().theme;return o&&0===o.indexOf("ag-theme")?this.environment.getSassVariable(o,e):t},t.prototype.getDefaultRowHeight=function(){return this.getFromTheme(25,"rowHeight")},t.MIN_COL_WIDTH=10,t.PROP_HEADER_HEIGHT="headerHeight",t.PROP_GROUP_REMOVE_SINGLE_CHILDREN="groupRemoveSingleChildren",t.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN="groupRemoveLowestSingleChildren",t.PROP_PIVOT_HEADER_HEIGHT="pivotHeaderHeight",t.PROP_SUPPRESS_CLIPBOARD_PASTE="suppressClipboardPaste",t.PROP_GROUP_HEADER_HEIGHT="groupHeaderHeight",t.PROP_PIVOT_GROUP_HEADER_HEIGHT="pivotGroupHeaderHeight",t.PROP_FLOATING_FILTERS_HEIGHT="floatingFiltersHeight",t.PROP_SUPPRESS_ROW_CLICK_SELECTION="suppressRowClickSelection",t.PROP_SUPPRESS_ROW_DRAG="suppressRowDrag",t.PROP_SUPPRESS_MOVE_WHEN_ROW_DRAG="suppressMoveWhenRowDragging",t.PROP_POPUP_PARENT="popupParent",t.PROP_DOM_LAYOUT="domLayout",t.PROP_FILL_HANDLE_DIRECTION="fillHandleDirection",Vr([it("gridOptions")],t.prototype,"gridOptions",void 0),Vr([it("columnController")],t.prototype,"columnController",void 0),Vr([it("eventService")],t.prototype,"eventService",void 0),Vr([it("environment")],t.prototype,"environment",void 0),Vr([it("autoHeightCalculator")],t.prototype,"autoHeightCalculator",void 0),Vr([Hr(0,at("gridApi")),Hr(1,at("columnApi"))],t.prototype,"agWire",null),Vr([ot],t.prototype,"destroy",null),Vr([et],t.prototype,"init",null),t=n=Vr([nt("gridOptionsWrapper")],t)}(),Kr=function(){function t(t,e){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=t,this.pathRoot={rowNode:e,children:null},this.mapToItems[e.id]=this.pathRoot}return t.prototype.setInactive=function(){this.active=!1},t.prototype.isActive=function(){return this.active},t.prototype.depthFirstSearchChangedPath=function(t,e){if(t.children)for(var o=0;o<t.children.length;o++)this.depthFirstSearchChangedPath(t.children[o],e);e(t.rowNode)},t.prototype.depthFirstSearchEverything=function(t,e,o){if(t.childrenAfterGroup)for(var n=0;n<t.childrenAfterGroup.length;n++){var i=t.childrenAfterGroup[n];i.childrenAfterGroup?this.depthFirstSearchEverything(t.childrenAfterGroup[n],e,o):o&&e(i)}e(t)},t.prototype.forEachChangedNodeDepthFirst=function(t,e){void 0===e&&(e=!1),this.active?this.depthFirstSearchChangedPath(this.pathRoot,t):this.depthFirstSearchEverything(this.pathRoot.rowNode,t,e)},t.prototype.executeFromRootNode=function(t){t(this.pathRoot.rowNode)},t.prototype.createPathItems=function(t){for(var e=t,o=0;!this.mapToItems[e.id];){var n={rowNode:e,children:null};this.mapToItems[e.id]=n,o++,e=e.parent}return o},t.prototype.populateColumnsMap=function(t,e){var o=this;if(this.keepingColumns&&e)for(var n=t;n;)this.nodeIdsToColumns[n.id]||(this.nodeIdsToColumns[n.id]={}),e.forEach((function(t){return o.nodeIdsToColumns[n.id][t.getId()]=!0})),n=n.parent},t.prototype.linkPathItems=function(t,e){for(var o=t,n=0;n<e;n++){var i=this.mapToItems[o.id],r=this.mapToItems[o.parent.id];r.children||(r.children=[]),r.children.push(i),o=o.parent}},t.prototype.addParentNode=function(t,e){if(t&&!t.isRowPinned()){var o=this.createPathItems(t);this.linkPathItems(t,o),this.populateColumnsMap(t,e)}},t.prototype.canSkip=function(t){return this.active&&!this.mapToItems[t.id]},t.prototype.getValueColumnsForNode=function(t,e){if(!this.keepingColumns)return e;var o=this.nodeIdsToColumns[t.id];return e.filter((function(t){return o[t.getId()]}))},t.prototype.getNotValueColumnsForNode=function(t,e){if(!this.keepingColumns)return null;var o=this.nodeIdsToColumns[t.id];return e.filter((function(t){return!o[t.getId()]}))},t}(),Yr=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),qr=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Xr=function(t,e){return function(o,n){e(o,n,t)}},Qr=(function(t){function o(){return null!==t&&t.apply(this,arguments)||this}Yr(o,t),o.prototype.setBeans=function(t){this.logger=t.create("SelectionController"),this.reset(),this.gridOptionsWrapper.isRowModelDefault()&&this.addManagedListener(this.eventService,Wt.EVENT_ROW_DATA_CHANGED,this.reset.bind(this))},o.prototype.init=function(){this.groupSelectsChildren=this.gridOptionsWrapper.isGroupSelectsChildren(),this.addManagedListener(this.eventService,Wt.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))},o.prototype.setLastSelectedNode=function(t){this.lastSelectedNode=t},o.prototype.getLastSelectedNode=function(){return this.lastSelectedNode},o.prototype.getSelectedNodes=function(){var t=[];return A(this.selectedNodes,(function(e,o){o&&t.push(o)})),t},o.prototype.getSelectedRows=function(){var t=[];return A(this.selectedNodes,(function(e,o){o&&o.data&&t.push(o.data)})),t},o.prototype.removeGroupsFromSelection=function(){var t=this;A(this.selectedNodes,(function(e,o){o&&o.group&&(t.selectedNodes[o.id]=void 0)}))},o.prototype.updateGroupsFromChildrenSelections=function(t){if(this.gridOptionsWrapper.isGroupSelectsChildren()&&this.rowModel.getType()===ht.ROW_MODEL_TYPE_CLIENT_SIDE){var e=this.rowModel.getRootNode();t||(t=new Kr(!0,e)).setInactive(),t.forEachChangedNodeDepthFirst((function(t){t!==e&&t.calculateSelectedFromChildren()}))}},o.prototype.getNodeForIdIfSelected=function(t){return this.selectedNodes[t]},o.prototype.clearOtherNodes=function(t){var e=this,o={},n=0;return A(this.selectedNodes,(function(i,r){if(r&&r.id!==t.id){var s=e.selectedNodes[r.id];n+=s.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0}),e.groupSelectsChildren&&r.parent&&(o[r.parent.id]=r.parent)}})),A(o,(function(t,e){e.calculateSelectedFromChildren()})),n},o.prototype.onRowSelected=function(t){var e=t.node;this.groupSelectsChildren&&e.group||(e.isSelected()?this.selectedNodes[e.id]=e:this.selectedNodes[e.id]=void 0)},o.prototype.syncInRowNode=function(t,e){this.syncInOldRowNode(t,e),this.syncInNewRowNode(t)},o.prototype.syncInOldRowNode=function(t,o){e(o)&&t.id!==o.id&&o&&(e(this.selectedNodes[o.id])&&(this.selectedNodes[o.id]=o))},o.prototype.syncInNewRowNode=function(t){e(this.selectedNodes[t.id])?(t.setSelectedInitialValue(!0),this.selectedNodes[t.id]=t):t.setSelectedInitialValue(!1)},o.prototype.reset=function(){this.logger.log("reset"),this.selectedNodes={},this.lastSelectedNode=null},o.prototype.getBestCostNodeSelection=function(){if(this.rowModel.getType()===ht.ROW_MODEL_TYPE_CLIENT_SIDE){var t=this.rowModel.getTopLevelNodes();if(null!==t){var e=[];return function t(o){for(var n=0,i=o.length;n<i;n++){var r=o[n];r.isSelected()?e.push(r):r.group&&r.children&&t(r.children)}}(t),e}console.warn("selectAll not available doing rowModel=virtual")}else console.warn("getBestCostNodeSelection is only available when using normal row model")},o.prototype.setRowModel=function(t){this.rowModel=t},o.prototype.isEmpty=function(){var t=0;return A(this.selectedNodes,(function(e,o){o&&t++})),0===t},o.prototype.deselectAllRowNodes=function(t){void 0===t&&(t=!1);var e=function(t){return t.selectThisNode(!1)},o=this.rowModel.getType()===ht.ROW_MODEL_TYPE_CLIENT_SIDE;if(t){if(!o)return void console.error("AG Grid: selecting just filtered only works with In Memory Row Model");this.rowModel.forEachNodeAfterFilter(e)}else A(this.selectedNodes,(function(t,o){o&&e(o)})),this.reset();o&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections();var n={type:Wt.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(n)},o.prototype.selectAllRowNodes=function(t){if(void 0===t&&(t=!1),this.rowModel.getType()!==ht.ROW_MODEL_TYPE_CLIENT_SIDE)throw new Error("selectAll only available with normal row model, ie not "+this.rowModel.getType());var e=this.rowModel,o=function(t){return t.selectThisNode(!0)};t?e.forEachNodeAfterFilter(o):e.forEachNode(o),this.rowModel.getType()===ht.ROW_MODEL_TYPE_CLIENT_SIDE&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections();var n={type:Wt.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(n)},o.prototype.selectNode=function(t,e){t&&t.setSelectedParams({newValue:!0,clearSelection:!e})},o.prototype.deselectIndex=function(t){var e=this.rowModel.getRow(t);this.deselectNode(e)},o.prototype.deselectNode=function(t){t&&t.setSelectedParams({newValue:!1,clearSelection:!1})},o.prototype.selectIndex=function(t,e){var o=this.rowModel.getRow(t);this.selectNode(o,e)},qr([it("rowModel")],o.prototype,"rowModel",void 0),qr([it("columnApi")],o.prototype,"columnApi",void 0),qr([it("gridApi")],o.prototype,"gridApi",void 0),qr([Xr(0,at("loggerFactory"))],o.prototype,"setBeans",null),qr([et],o.prototype,"init",null),o=qr([nt("selectionController")],o)}(Mt),function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s});
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/!function(){function t(){}t.prototype.sizeColumnsToFit=function(t){void 0===t&&console.error("AG Grid: missing parameter to columnApi.sizeColumnsToFit(gridWidth)"),this.columnController.sizeColumnsToFit(t,"api")},t.prototype.setColumnGroupOpened=function(t,e){this.columnController.setColumnGroupOpened(t,e,"api")},t.prototype.getColumnGroup=function(t,e){return this.columnController.getColumnGroup(t,e)},t.prototype.getOriginalColumnGroup=function(t){return this.columnController.getOriginalColumnGroup(t)},t.prototype.getDisplayNameForColumn=function(t,e){return this.columnController.getDisplayNameForColumn(t,e)||""},t.prototype.getDisplayNameForColumnGroup=function(t,e){return this.columnController.getDisplayNameForColumnGroup(t,e)||""},t.prototype.getColumn=function(t){return this.columnController.getPrimaryColumn(t)},t.prototype.applyColumnState=function(t){return this.columnController.applyColumnState(t,"api")},t.prototype.getColumnState=function(){return this.columnController.getColumnState()},t.prototype.resetColumnState=function(){this.columnController.resetColumnState("api")},t.prototype.getColumnGroupState=function(){return this.columnController.getColumnGroupState()},t.prototype.setColumnGroupState=function(t){this.columnController.setColumnGroupState(t,"api")},t.prototype.resetColumnGroupState=function(){this.columnController.resetColumnGroupState("api")},t.prototype.isPinning=function(){return this.columnController.isPinningLeft()||this.columnController.isPinningRight()},t.prototype.isPinningLeft=function(){return this.columnController.isPinningLeft()},t.prototype.isPinningRight=function(){return this.columnController.isPinningRight()},t.prototype.getDisplayedColAfter=function(t){return this.columnController.getDisplayedColAfter(t)},t.prototype.getDisplayedColBefore=function(t){return this.columnController.getDisplayedColBefore(t)},t.prototype.setColumnVisible=function(t,e){this.columnController.setColumnVisible(t,e,"api")},t.prototype.setColumnsVisible=function(t,e){this.columnController.setColumnsVisible(t,e,"api")},t.prototype.setColumnPinned=function(t,e){this.columnController.setColumnPinned(t,e,"api")},t.prototype.setColumnsPinned=function(t,e){this.columnController.setColumnsPinned(t,e,"api")},t.prototype.getAllColumns=function(){return this.columnController.getAllPrimaryColumns()},t.prototype.getAllGridColumns=function(){return this.columnController.getAllGridColumns()},t.prototype.getDisplayedLeftColumns=function(){return this.columnController.getDisplayedLeftColumns()},t.prototype.getDisplayedCenterColumns=function(){return this.columnController.getDisplayedCenterColumns()},t.prototype.getDisplayedRightColumns=function(){return this.columnController.getDisplayedRightColumns()},t.prototype.getAllDisplayedColumns=function(){return this.columnController.getAllDisplayedColumns()},t.prototype.getAllDisplayedVirtualColumns=function(){return this.columnController.getViewportColumns()},t.prototype.moveColumn=function(t,e){"number"==typeof t?(console.warn("AG Grid: you are using moveColumn(fromIndex, toIndex) - moveColumn takes a column key and a destination index, not two indexes, to move with indexes use moveColumnByIndex(from,to) instead"),this.columnController.moveColumnByIndex(t,e,"api")):this.columnController.moveColumn(t,e,"api")},t.prototype.moveColumnByIndex=function(t,e){this.columnController.moveColumnByIndex(t,e,"api")},t.prototype.moveColumns=function(t,e){this.columnController.moveColumns(t,e,"api")},t.prototype.moveRowGroupColumn=function(t,e){this.columnController.moveRowGroupColumn(t,e)},t.prototype.setColumnAggFunc=function(t,e){this.columnController.setColumnAggFunc(t,e)},t.prototype.setColumnWidth=function(t,e,o){void 0===o&&(o=!0),this.columnController.setColumnWidths([{key:t,newWidth:e}],!1,o)},t.prototype.setColumnWidths=function(t,e){void 0===e&&(e=!0),this.columnController.setColumnWidths(t,!1,e)},t.prototype.setPivotMode=function(t){this.columnController.setPivotMode(t)},t.prototype.isPivotMode=function(){return this.columnController.isPivotMode()},t.prototype.getSecondaryPivotColumn=function(t,e){return this.columnController.getSecondaryPivotColumn(t,e)},t.prototype.setValueColumns=function(t){this.columnController.setValueColumns(t,"api")},t.prototype.getValueColumns=function(){return this.columnController.getValueColumns()},t.prototype.removeValueColumn=function(t){this.columnController.removeValueColumn(t,"api")},t.prototype.removeValueColumns=function(t){this.columnController.removeValueColumns(t,"api")},t.prototype.addValueColumn=function(t){this.columnController.addValueColumn(t,"api")},t.prototype.addValueColumns=function(t){this.columnController.addValueColumns(t,"api")},t.prototype.setRowGroupColumns=function(t){this.columnController.setRowGroupColumns(t,"api")},t.prototype.removeRowGroupColumn=function(t){this.columnController.removeRowGroupColumn(t,"api")},t.prototype.removeRowGroupColumns=function(t){this.columnController.removeRowGroupColumns(t,"api")},t.prototype.addRowGroupColumn=function(t){this.columnController.addRowGroupColumn(t,"api")},t.prototype.addRowGroupColumns=function(t){this.columnController.addRowGroupColumns(t,"api")},t.prototype.getRowGroupColumns=function(){return this.columnController.getRowGroupColumns()},t.prototype.setPivotColumns=function(t){this.columnController.setPivotColumns(t,"api")},t.prototype.removePivotColumn=function(t){this.columnController.removePivotColumn(t,"api")},t.prototype.removePivotColumns=function(t){this.columnController.removePivotColumns(t,"api")},t.prototype.addPivotColumn=function(t){this.columnController.addPivotColumn(t,"api")},t.prototype.addPivotColumns=function(t){this.columnController.addPivotColumns(t,"api")},t.prototype.getPivotColumns=function(){return this.columnController.getPivotColumns()},t.prototype.getLeftDisplayedColumnGroups=function(){return this.columnController.getDisplayedTreeLeft()},t.prototype.getCenterDisplayedColumnGroups=function(){return this.columnController.getDisplayedTreeCentre()},t.prototype.getRightDisplayedColumnGroups=function(){return this.columnController.getDisplayedTreeRight()},t.prototype.getAllDisplayedColumnGroups=function(){return this.columnController.getAllDisplayedTrees()},t.prototype.autoSizeColumn=function(t,e){return this.columnController.autoSizeColumn(t,e,"api")},t.prototype.autoSizeColumns=function(t,e){return this.columnController.autoSizeColumns(t,e,"api")},t.prototype.autoSizeAllColumns=function(t){this.columnController.autoSizeAllColumns(t,"api")},t.prototype.setSecondaryColumns=function(t){this.columnController.setSecondaryColumns(t,"api")},t.prototype.getSecondaryColumns=function(){return this.columnController.getSecondaryColumns()},t.prototype.getPrimaryColumns=function(){return this.columnController.getAllPrimaryColumns()},t.prototype.cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid=function(){setTimeout(bn.removeAllReferences.bind(window,this,"Column API"),100)},t.prototype.columnGroupOpened=function(t,e){console.error("AG Grid: columnGroupOpened no longer exists, use setColumnGroupOpened"),this.setColumnGroupOpened(t,e)},t.prototype.hideColumns=function(t,e){console.error("AG Grid: hideColumns is deprecated, use setColumnsVisible"),this.columnController.setColumnsVisible(t,!e,"api")},t.prototype.hideColumn=function(t,e){console.error("AG Grid: hideColumn is deprecated, use setColumnVisible"),this.columnController.setColumnVisible(t,!e,"api")},t.prototype.setState=function(t){return console.error("AG Grid: setState is deprecated, use setColumnState"),this.setColumnState(t)},t.prototype.getState=function(){return console.error("AG Grid: getState is deprecated, use getColumnState"),this.getColumnState()},t.prototype.resetState=function(){console.error("AG Grid: resetState is deprecated, use resetColumnState"),this.resetColumnState()},t.prototype.getAggregationColumns=function(){return console.error("AG Grid: getAggregationColumns is deprecated, use getValueColumns"),this.columnController.getValueColumns()},t.prototype.removeAggregationColumn=function(t){console.error("AG Grid: removeAggregationColumn is deprecated, use removeValueColumn"),this.columnController.removeValueColumn(t,"api")},t.prototype.removeAggregationColumns=function(t){console.error("AG Grid: removeAggregationColumns is deprecated, use removeValueColumns"),this.columnController.removeValueColumns(t,"api")},t.prototype.addAggregationColumn=function(t){console.error("AG Grid: addAggregationColumn is deprecated, use addValueColumn"),this.columnController.addValueColumn(t,"api")},t.prototype.addAggregationColumns=function(t){console.error("AG Grid: addAggregationColumns is deprecated, use addValueColumns"),this.columnController.addValueColumns(t,"api")},t.prototype.setColumnAggFunction=function(t,e){console.error("AG Grid: setColumnAggFunction is deprecated, use setColumnAggFunc"),this.columnController.setColumnAggFunc(t,e,"api")},t.prototype.getDisplayNameForCol=function(t){return console.error("AG Grid: getDisplayNameForCol is deprecated, use getDisplayNameForColumn"),this.getDisplayNameForColumn(t,null)},t.prototype.setColumnState=function(t){return this.columnController.applyColumnState({state:t,applyOrder:!0},"api")},Qr([it("columnController")],t.prototype,"columnController",void 0),Qr([ot],t.prototype,"cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid",null),t=Qr([nt("columnApi")],t)}();!function(t){t[t.FILL=0]="FILL",t[t.RANGE=1]="RANGE"}(jr||(jr={})),function(t){t[t.VALUE=0]="VALUE",t[t.DIMENSION=1]="DIMENSION"}(Ur||(Ur={}));
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var $r,Zr,Jr,ts=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),es=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};!function(t){t[t.ToolPanel=0]="ToolPanel",t[t.HeaderCell=1]="HeaderCell",t[t.RowDrag=2]="RowDrag",t[t.ChartPanel=3]="ChartPanel"}($r||($r={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down"}(Zr||(Zr={})),function(t){t[t.Left=0]="Left",t[t.Right=1]="Right"}(Jr||(Jr={}));var os,ns=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dragSourceAndParamsList=[],e.dropTargets=[],e}var o;return ts(e,t),o=e,e.prototype.init=function(){this.ePinnedIcon=un("columnMovePin",this.gridOptionsWrapper,null),this.eHideIcon=un("columnMoveHide",this.gridOptionsWrapper,null),this.eMoveIcon=un("columnMoveMove",this.gridOptionsWrapper,null),this.eLeftIcon=un("columnMoveLeft",this.gridOptionsWrapper,null),this.eRightIcon=un("columnMoveRight",this.gridOptionsWrapper,null),this.eGroupIcon=un("columnMoveGroup",this.gridOptionsWrapper,null),this.eAggregateIcon=un("columnMoveValue",this.gridOptionsWrapper,null),this.ePivotIcon=un("columnMovePivot",this.gridOptionsWrapper,null),this.eDropNotAllowedIcon=un("dropNotAllowed",this.gridOptionsWrapper,null)},e.prototype.addDragSource=function(t,e){void 0===e&&(e=!1);var o={eElement:t.eElement,dragStartPixels:t.dragStartPixels,onDragStart:this.onDragStart.bind(this,t),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this)};this.dragSourceAndParamsList.push({params:o,dragSource:t}),this.dragService.addDragSource(o,e)},e.prototype.removeDragSource=function(t){var e=a(this.dragSourceAndParamsList,(function(e){return e.dragSource===t}));e&&(this.dragService.removeDragSource(e.params),g(this.dragSourceAndParamsList,e))},e.prototype.clearDragSourceParamsList=function(){var t=this;this.dragSourceAndParamsList.forEach((function(e){return t.dragService.removeDragSource(e.params)})),this.dragSourceAndParamsList.length=0},e.prototype.nudge=function(){this.dragging&&this.onDragging(this.eventLastTime,!0)},e.prototype.onDragStart=function(t,e){this.dragging=!0,this.dragSource=t,this.eventLastTime=e,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=this.dragSource.dragSourceDropTarget,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()},e.prototype.onDragStop=function(t){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){var e=this.createDropTargetEvent(this.lastDropTarget,t,null,null,!1);this.lastDropTarget.onDragStop(e)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()},e.prototype.onDragging=function(t,e){var o=this,n=this.getHorizontalDirection(t),i=this.getVerticalDirection(t);this.eventLastTime=t,this.positionGhost(t);var r=this.dropTargets.filter((function(e){return o.isMouseOnDropTarget(t,e)})),s=r.length,a=null;if(s>0&&(a=1===s?r[0]:r.reduce((function(t,e){if(!t)return e;var o=t.getContainer(),n=e.getContainer();return o.contains(n)?e:t}))),a!==this.lastDropTarget)this.leaveLastTargetIfExists(t,n,i,e),this.enterDragTargetIfExists(a,t,n,i,e),this.lastDropTarget=a;else if(a&&a.onDragging){var l=this.createDropTargetEvent(a,t,n,i,e);a.onDragging(l)}},e.prototype.enterDragTargetIfExists=function(t,e,o,n,i){if(t){if(t.onDragEnter){var r=this.createDropTargetEvent(t,e,o,n,i);t.onDragEnter(r)}this.setGhostIcon(t.getIconName?t.getIconName():null)}},e.prototype.leaveLastTargetIfExists=function(t,e,o,n){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){var i=this.createDropTargetEvent(this.lastDropTarget,t,e,o,n);this.lastDropTarget.onDragLeave(i)}this.setGhostIcon(null)}},e.prototype.getAllContainersFromDropTarget=function(t){var e=[t.getContainer()],o=t.getSecondaryContainers?t.getSecondaryContainers():null;return o&&(e=e.concat(o)),e},e.prototype.isMouseOnDropTarget=function(t,e){var o=!1;return this.getAllContainersFromDropTarget(e).filter((function(t){return t})).forEach((function(e){var n=e.getBoundingClientRect();if(0!==n.width&&0!==n.height){var i=t.clientX>=n.left&&t.clientX<n.right,r=t.clientY>=n.top&&t.clientY<n.bottom;i&&r&&(o=!0)}})),o&&e.isInterestedIn(this.dragSource.type)},e.prototype.addDropTarget=function(t){this.dropTargets.push(t)},e.prototype.removeDropTarget=function(t){this.dropTargets=this.dropTargets.filter((function(e){return e.getContainer()!==t.getContainer()}))},e.prototype.hasExternalDropZones=function(){return this.dropTargets.some((function(t){return t.external}))},e.prototype.findExternalZone=function(t){return a(this.dropTargets.filter((function(t){return t.external})),(function(e){return e.getContainer()===t.getContainer()}))},e.prototype.getHorizontalDirection=function(t){var e=this.eventLastTime&&this.eventLastTime.clientX,o=t.clientX;return e===o?null:e>o?Jr.Left:Jr.Right},e.prototype.getVerticalDirection=function(t){var e=this.eventLastTime&&this.eventLastTime.clientY,o=t.clientY;return e===o?null:e>o?Zr.Up:Zr.Down},e.prototype.createDropTargetEvent=function(t,e,o,n,i){var r=t.getContainer(),s=r.getBoundingClientRect(),a=this.gridApi,l=this.columnApi,p=this.dragItem,u=this.dragSource;return{event:e,x:e.clientX-s.left,y:e.clientY-s.top,vDirection:n,hDirection:o,dragSource:u,fromNudge:i,dragItem:p,api:a,columnApi:l,dropZoneTarget:r}},e.prototype.positionGhost=function(t){var e=this.eGhost;if(e){var o=e.getBoundingClientRect().height,n=Ne()-2,i=Le()-2,r=t.pageY-o/2,s=t.pageX-10,a=this.gridOptionsWrapper.getDocument(),l=window.pageYOffset||a.documentElement.scrollTop,p=window.pageXOffset||a.documentElement.scrollLeft;n>0&&s+e.clientWidth>n+p&&(s=n+p-e.clientWidth),s<0&&(s=0),i>0&&r+e.clientHeight>i+l&&(r=i+l-e.clientHeight),r<0&&(r=0),e.style.left=s+"px",e.style.top=r+"px"}},e.prototype.removeGhost=function(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null},e.prototype.createGhost=function(){this.eGhost=oo(o.GHOST_TEMPLATE);var t=this.environment.getTheme().theme;t&&Me(this.eGhost,t),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);var e=this.eGhost.querySelector(".ag-dnd-ghost-label"),n=this.dragSource.dragItemName;Y(n)&&(n=n()),e.innerHTML=Kt(n)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";var i=this.gridOptionsWrapper.getDocument(),r=i.fullscreenElement||i.querySelector("body");this.eGhostParent=r,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")},e.prototype.setGhostIcon=function(t,e){void 0===e&&(e=!1),Je(this.eGhostIcon);var n=null;switch(t||(t=this.dragSource.defaultIconName||o.ICON_NOT_ALLOWED),t){case o.ICON_PINNED:n=this.ePinnedIcon;break;case o.ICON_MOVE:n=this.eMoveIcon;break;case o.ICON_LEFT:n=this.eLeftIcon;break;case o.ICON_RIGHT:n=this.eRightIcon;break;case o.ICON_GROUP:n=this.eGroupIcon;break;case o.ICON_AGGREGATE:n=this.eAggregateIcon;break;case o.ICON_PIVOT:n=this.ePivotIcon;break;case o.ICON_NOT_ALLOWED:n=this.eDropNotAllowedIcon;break;case o.ICON_HIDE:n=this.eHideIcon}Ve(this.eGhostIcon,"ag-shake-left-to-right",e),n===this.eHideIcon&&this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns()||n&&this.eGhostIcon.appendChild(n)},e.ICON_PINNED="pinned",e.ICON_MOVE="move",e.ICON_LEFT="left",e.ICON_RIGHT="right",e.ICON_GROUP="group",e.ICON_AGGREGATE="aggregate",e.ICON_PIVOT="pivot",e.ICON_NOT_ALLOWED="notAllowed",e.ICON_HIDE="hide",e.GHOST_TEMPLATE='<div class="ag-dnd-ghost ag-unselectable">\n <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>\n <div class="ag-dnd-ghost-label"></div>\n </div>',es([it("dragService")],e.prototype,"dragService",void 0),es([it("environment")],e.prototype,"environment",void 0),es([it("columnApi")],e.prototype,"columnApi",void 0),es([it("gridApi")],e.prototype,"gridApi",void 0),es([et],e.prototype,"init",null),es([ot],e.prototype,"clearDragSourceParamsList",null),e=o=es([nt("dragAndDropService")],e)}(Mt),is=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),rs=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ss=function(t){function e(e,o,n,i,r){var s=t.call(this)||this;return s.rowNode=e,s.column=o,s.cellValueFn=n,s.beans=i,s.customGui=r,s.isCustomGui=!1,s.dragSource=null,s}return is(e,t),e.prototype.postConstruct=function(){this.customGui?(this.isCustomGui=!0,this.setDragElement(this.customGui)):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(cn("rowDrag",this.beans.gridOptionsWrapper,null)),this.addDragSource());this.checkCompatibility();var t=this.beans.gridOptionsWrapper.isRowDragManaged()?new ps(this,this.beans,this.rowNode,this.column):new ls(this,this.beans,this.rowNode,this.column);this.createManagedBean(t,this.beans.context)},e.prototype.setDragElement=function(t){this.setTemplateFromElement(t),this.addDragSource()},e.prototype.getSelectedCount=function(){if(!this.beans.gridOptionsWrapper.isEnableMultiRowDragging())return 1;var t=this.beans.selectionController.getSelectedNodes();return-1!==t.indexOf(this.rowNode)?t.length:1},e.prototype.checkCompatibility=function(){var t=this.beans.gridOptionsWrapper.isRowDragManaged();this.beans.gridOptionsWrapper.isTreeData()&&t&&z((function(){return console.warn("AG Grid: If using row drag with tree data, you cannot have rowDragManaged=true")}),"RowDragComp.managedAndTreeData")},e.prototype.addDragSource=function(){var t=this;this.dragSource&&this.removeDragSource();var e={rowNode:this.rowNode,columns:[this.column],defaultTextValue:this.cellValueFn()},o=this.column.getColDef().rowDragText;this.dragSource={type:$r.RowDrag,eElement:this.getGui(),dragItemName:function(){var n=t.getSelectedCount();return o?o(e,n):1===n?t.cellValueFn():n+" rows"},getDragItem:function(){return e},dragStartPixels:0,dragSourceDomDataKey:this.beans.gridOptionsWrapper.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)},e.prototype.removeDragSource=function(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null},rs([et],e.prototype,"postConstruct",null),rs([ot],e.prototype,"removeDragSource",null),e}(xn),as=function(t){function e(e,o,n){var i=t.call(this)||this;return i.parent=e,i.column=n,i.rowNode=o,i}return is(e,t),e.prototype.setDisplayedOrVisible=function(t){if(t)this.parent.setDisplayed(!1);else{var e=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui;Y(this.column.getColDef().rowDrag)?(this.parent.setDisplayed(!0),this.parent.setVisible(e)):this.parent.setDisplayed(e)}},e}(Mt),ls=function(t){function e(e,o,n,i){var r=t.call(this,e,n,i)||this;return r.beans=o,r}return is(e,t),e.prototype.postConstruct=function(){this.addManagedListener(this.beans.gridOptionsWrapper,"suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.workOutVisibility()},e.prototype.onSuppressRowDrag=function(){this.workOutVisibility()},e.prototype.workOutVisibility=function(){var t=this.beans.gridOptionsWrapper.isSuppressRowDrag();this.setDisplayedOrVisible(t)},rs([et],e.prototype,"postConstruct",null),e}(as),ps=function(t){function e(e,o,n,i){var r=t.call(this,e,n,i)||this;return r.beans=o,r}return is(e,t),e.prototype.postConstruct=function(){this.addManagedListener(this.beans.eventService,Wt.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,Wt.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,Wt.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.gridOptionsWrapper,"suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()},e.prototype.onSuppressRowDrag=function(){this.workOutVisibility()},e.prototype.workOutVisibility=function(){var t=this.beans.gridPanel.getRowDragFeature(),e=t&&t.shouldPreventRowMove(),o=this.beans.gridOptionsWrapper.isSuppressRowDrag(),n=this.beans.dragAndDropService.hasExternalDropZones(),i=e&&!n||o;this.setDisplayedOrVisible(i)},rs([et],e.prototype,"postConstruct",null),e}(as),us=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),cs=function(t){function e(e){var o=t.call(this,'<div class="ag-popup-editor" tabindex="-1"/>')||this;return o.getGuiCalledOnChild=!1,o.cellEditor=e,o}return us(e,t),e.prototype.onKeyDown=function(t){gn(this.gridOptionsWrapper,t,this.params.node,this.params.column,!0)||this.params.onKeyDown(t)},e.prototype.getGui=function(){return this.getGuiCalledOnChild||(this.appendChild(this.cellEditor.getGui()),this.getGuiCalledOnChild=!0),t.prototype.getGui.call(this)},e.prototype.init=function(o){var n=this;this.params=o,this.gridOptionsWrapper.setDomData(this.getGui(),e.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addDestroyFunc((function(){return n.destroyBean(n.cellEditor)})),this.addManagedListener(t.prototype.getGui.call(this),"keydown",this.onKeyDown.bind(this))},e.prototype.afterGuiAttached=function(){this.cellEditor.afterGuiAttached&&this.cellEditor.afterGuiAttached()},e.prototype.getValue=function(){return this.cellEditor.getValue()},e.prototype.isCancelBeforeStart=function(){return!!this.cellEditor.isCancelBeforeStart&&this.cellEditor.isCancelBeforeStart()},e.prototype.isCancelAfterEnd=function(){return!!this.cellEditor.isCancelAfterEnd&&this.cellEditor.isCancelAfterEnd()},e.prototype.getPopupPosition=function(){if(this.cellEditor.getPopupPosition)return this.cellEditor.getPopupPosition()},e.prototype.focusIn=function(){this.cellEditor.focusIn&&this.cellEditor.focusIn()},e.prototype.focusOut=function(){this.cellEditor.focusOut&&this.cellEditor.focusOut()},e.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",e}(Hn),ds=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),hs=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},fs=function(t){function e(e,o,n,i,r){var s=t.call(this,'<div class="ag-drag-handle ag-row-drag" draggable="true"></div>')||this;return s.rowNode=e,s.column=o,s.cellValue=n,s.beans=i,s.eCell=r,s}return ds(e,t),e.prototype.postConstruct=function(){this.getGui().appendChild(cn("rowDrag",this.beans.gridOptionsWrapper,null)),this.addGuiEventListener("mousedown",(function(t){t.stopPropagation()})),this.addDragSource(),this.checkVisibility()},e.prototype.addDragSource=function(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))},e.prototype.onDragStart=function(t){var e=this,o=this.column.getColDef().dndSourceOnRowDrag,n=Oe();n||t.dataTransfer.setDragImage(this.eCell,0,0);o?o({rowNode:this.rowNode,dragEvent:t}):function(){try{var o=JSON.stringify(e.rowNode.data);n?t.dataTransfer.setData("text",o):(t.dataTransfer.setData("application/json",o),t.dataTransfer.setData("text/plain",o))}catch(t){}}()},e.prototype.checkVisibility=function(){var t=this.column.isDndSource(this.rowNode);this.setDisplayed(t)},hs([et],e.prototype,"postConstruct",null),e}(xn),gs=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ys=function(){return(ys=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},vs=function(t){function n(e,o,n,i,r,s,a){var l=t.call(this)||this;if(l.hasChartRange=!1,l.editingCell=!1,l.suppressRefreshCell=!1,l.tooltipFeatureEnabled=!1,l.scope=null,l.cellEditorVersion=0,l.cellRendererVersion=0,l.scope=e,l.beans=o,l.column=n,l.rowNode=i,l.rowComp=r,l.autoHeightCell=s,l.printLayout=a,l.createGridCellVo(),l.rangeSelectionEnabled=l.beans.rangeController&&o.gridOptionsWrapper.isEnableRangeSelection(),l.cellFocused=l.beans.focusController.isCellFocused(l.cellPosition),l.firstRightPinned=l.column.isFirstRightPinned(),l.lastLeftPinned=l.column.isLastLeftPinned(),l.rangeSelectionEnabled&&l.beans.rangeController){var p=l.beans.rangeController;l.rangeCount=p.getCellRangeCount(l.cellPosition),l.hasChartRange=l.getHasChartRange()}return l.getValueAndFormat(),l.setUsingWrapper(),l.chooseCellRenderer(),l.setupColSpan(),l.rowSpan=l.column.getRowSpan(l.rowNode),l}return gs(n,t),n.prototype.getCreateTemplate=function(){var t=this.beans.gridOptionsWrapper.isEnableCellTextSelection()?"":' unselectable="on"',o=[],n=this.column,i=this.getCellWidth(),r=this.modifyLeftForPrintLayout(this.getCellLeft()),s=this.getInitialValueToRender(),a=x(this.column,"colDef.template",null)?s:Kt(s);this.tooltip=this.getToolTip();var l=Kt(this.tooltip),p=Kt(n.getId()),u=this.preProcessStylesFromColDef(),c=this.getInitialCssClasses(),d=this.getStylesForRowSpanning(),h=Kt(this.beans.columnController.getAriaColumnIndex(this.column).toString());return o.push("<div"),o.push(' tabindex="-1"'),o.push(""+t),o.push(' role="gridcell"'),o.push(' aria-colindex="'+h+'"'),o.push(' comp-id="'+this.getCompId()+'" '),o.push(' col-id="'+p+'"'),o.push(' class="'+Kt(c.join(" "))+'"'),this.beans.gridOptionsWrapper.isEnableBrowserTooltips()&&e(l)&&o.push(' title="'+l+'"'),this.rangeSelectionEnabled&&o.push(' aria-selected="'+(this.rangeCount?"true":"false")+'"'),o.push(' style="width: '+Number(i)+"px; left: "+Number(r)+"px; "+Kt(u)+" "+Kt(d)+'">'),this.usingWrapper?o.push(this.getCellWrapperString(a)):null!=a&&o.push(a),o.push("</div>"),o.join("")},n.prototype.getCellWrapperString=function(t){return void 0===t&&(t=""),'<div ref="eCellWrapper" class="ag-cell-wrapper" role="presentation">\n <span ref="eCellValue" role="presentation" class="ag-cell-value"'+(this.beans.gridOptionsWrapper.isEnableCellTextSelection()?"":' unselectable="on"')+">\n "+(null!=t?t:"")+"\n </span>\n </div>"},n.prototype.getStylesForRowSpanning=function(){return 1===this.rowSpan?"":"height: "+this.beans.gridOptionsWrapper.getRowHeightAsNumber()*this.rowSpan+"px; z-index: 1;"},n.prototype.afterAttached=function(){var t='[comp-id="'+this.getCompId()+'"]',o=this.eParentRow.querySelector(t);this.setGui(o),this.addDomData(),this.populateTemplate(),this.createCellRendererInstance(!0),this.angular1Compile(),this.refreshHandle(),e(this.tooltip)&&this.createTooltipFeatureIfNeeded()},n.prototype.createTooltipFeatureIfNeeded=function(){this.beans.gridOptionsWrapper.isEnableBrowserTooltips()||this.tooltipFeatureEnabled||(this.createManagedBean(new Ln(this),this.beans.context),this.tooltipFeatureEnabled=!0)},n.prototype.onColumnHover=function(){var t=this.beans.columnHoverService.isHovered(this.column);this.addOrRemoveCssClass("ag-column-hover",t)},n.prototype.onCellChanged=function(t){t.column===this.column&&this.refreshCell({})},n.prototype.getCellLeft=function(){return(this.beans.gridOptionsWrapper.isEnableRtl()&&this.colsSpanning?d(this.colsSpanning):this.column).getLeft()},n.prototype.getCellWidth=function(){return this.colsSpanning?this.colsSpanning.reduce((function(t,e){return t+e.getActualWidth()}),0):this.column.getActualWidth()},n.prototype.onFlashCells=function(t){var e=this.beans.cellPositionUtils.createId(this.cellPosition);t.cells[e]&&this.animateCell("highlight")},n.prototype.setupColSpan=function(){o(this.getComponentHolder().colSpan)||(this.addManagedListener(this.beans.eventService,Wt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,Wt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)),this.colsSpanning=this.getColSpanningList())},n.prototype.getColSpanningList=function(){var t=this.column.getColSpan(this.rowNode),e=[];if(1===t)e.push(this.column);else for(var n=this.column,i=this.column.getPinned(),r=0;n&&r<t&&(e.push(n),(n=this.beans.columnController.getDisplayedColAfter(n))&&!o(n))&&i===n.getPinned();r++);return e},n.prototype.onDisplayColumnsChanged=function(){var t=this.getColSpanningList();h(this.colsSpanning,t)||(this.colsSpanning=t,this.onWidthChanged(),this.onLeftChanged())},n.prototype.refreshAriaIndex=function(){var t=this.beans.columnController.getAriaColumnIndex(this.column);Ko(this.getGui(),t)},n.prototype.getInitialCssClasses=function(){var t=["ag-cell","ag-cell-not-inline-editing"];return this.autoHeightCell||t.push("ag-cell-auto-height"),!this.beans.gridOptionsWrapper.isSuppressCellSelection()&&this.cellFocused&&t.push("ag-cell-focus"),this.firstRightPinned&&t.push("ag-cell-first-right-pinned"),this.lastLeftPinned&&t.push("ag-cell-last-left-pinned"),this.beans.columnHoverService.isHovered(this.column)&&t.push("ag-column-hover"),w(t,this.preProcessClassesFromColDef()),w(t,this.preProcessCellClassRules()),w(t,this.getInitialRangeClasses()),this.usingWrapper||t.push("ag-cell-value"),this.wrapText=1==this.column.getColDef().wrapText,this.wrapText&&t.push("ag-cell-wrap-text"),t},n.prototype.getInitialValueToRender=function(){if(this.usingCellRenderer)return"string"==typeof this.cellRendererGui?this.cellRendererGui:"";var t=this.getComponentHolder();return t.template?t.template:t.templateUrl?this.beans.templateService.getTemplate(t.templateUrl,this.refreshCell.bind(this,!0))||"":this.getValueToUse()},n.prototype.getRenderedRow=function(){return this.rowComp},n.prototype.isSuppressNavigable=function(){return this.column.isSuppressNavigable(this.rowNode)},n.prototype.getCellRenderer=function(){return this.cellRenderer},n.prototype.getCellEditor=function(){return this.cellEditor},n.prototype.onNewColumnsLoaded=function(){this.postProcessWrapText(),this.postProcessCellClassRules()},n.prototype.postProcessWrapText=function(){var t=1==this.column.getColDef().wrapText;t!==this.wrapText&&(this.wrapText=t,this.addOrRemoveCssClass("ag-cell-wrap-text",this.wrapText))},n.prototype.refreshCell=function(t){if(!this.suppressRefreshCell&&!this.editingCell){var e=this.getComponentHolder(),o=t&&t.newData,n=t&&t.suppressFlash||e.suppressCellFlash,i=t&&t.forceRefresh,r=this.value;this.value=this.getValue();var s=!this.valuesAreEqual(r,this.value);if(i||s){this.valueFormatted=this.beans.valueFormatterService.formatValue(this.column,this.rowNode,this.scope,this.value),!o&&this.attemptCellRendererRefresh()||this.replaceContentsAfterRefresh();var a=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!n&&!a&&(this.beans.gridOptionsWrapper.isEnableCellChangeFlash()||e.enableCellChangeFlash)&&this.flashCell(),this.postProcessStylesFromColDef(),this.postProcessClassesFromColDef()}this.updateAngular1ScopeAndCompile(),this.refreshToolTip(),this.postProcessCellClassRules()}},n.prototype.flashCell=function(t){var e=t&&t.flashDelay,o=t&&t.fadeDelay;this.animateCell("data-changed",e,o)},n.prototype.animateCell=function(t,o,n){var i=this,r="ag-cell-"+t,s="ag-cell-"+t+"-animation",a=this.getGui(),l=this.beans.gridOptionsWrapper;o||(o=l.getCellFlashDelay()),e(n)||(n=l.getCellFadeDelay()),this.addCssClass(r),this.removeCssClass(s),window.setTimeout((function(){i.removeCssClass(r),i.addCssClass(s),a.style.transition="background-color "+n+"ms",window.setTimeout((function(){i.removeCssClass(s),a.style.removeProperty("transition")}),n)}),o)},n.prototype.replaceContentsAfterRefresh=function(){this.setUsingWrapper(),Je(this.eCellValue),this.cellRenderer=this.beans.context.destroyBean(this.cellRenderer),this.cellRendererGui=null,this.putDataIntoCellAfterRefresh(),this.updateAngular1ScopeAndCompile()},n.prototype.updateAngular1ScopeAndCompile=function(){this.beans.gridOptionsWrapper.isAngularCompileRows()&&this.scope&&(this.scope.data=ys({},this.rowNode.data),this.angular1Compile())},n.prototype.angular1Compile=function(){if(this.beans.gridOptionsWrapper.isAngularCompileRows()){var t=this.getGui();if(!t.classList.contains("ng-scope")||0===t.childElementCount){var e=this.beans.$compile(t)(this.scope);this.addDestroyFunc((function(){return e.remove()}))}}},n.prototype.postProcessStylesFromColDef=function(){var t=this.processStylesFromColDef();t&&po(this.getGui(),t)},n.prototype.preProcessStylesFromColDef=function(){return So(this.processStylesFromColDef())},n.prototype.processStylesFromColDef=function(){var t=this.getComponentHolder();if(t.cellStyle){var e=void 0;if("function"==typeof t.cellStyle){var o={column:this.column,value:this.value,colDef:t,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex,$scope:this.scope,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext()};e=(0,t.cellStyle)(o)}else e=t.cellStyle;return e}},n.prototype.postProcessClassesFromColDef=function(){var t=this;this.processClassesFromColDef((function(e){return t.addCssClass(e)}))},n.prototype.preProcessClassesFromColDef=function(){var t=[];return this.processClassesFromColDef((function(e){return t.push(e)})),t},n.prototype.processClassesFromColDef=function(t){var e=this.getComponentHolder(),o={value:this.value,data:this.rowNode.data,node:this.rowNode,colDef:e,rowIndex:this.rowNode.rowIndex,$scope:this.scope,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext()};this.beans.stylingService.processStaticCellClasses(e,o,t)},n.prototype.putDataIntoCellAfterRefresh=function(){var t=this.getComponentHolder();if(t.template)this.eCellValue.innerHTML=t.template;else if(t.templateUrl){var e=this.beans.templateService.getTemplate(t.templateUrl,this.refreshCell.bind(this,!0));e&&(this.eCellValue.innerHTML=e)}else if(this.chooseCellRenderer(),this.usingCellRenderer)this.createCellRendererInstance();else{var o=this.getValueToUse();null!=o&&(this.eCellValue.innerHTML=Kt(o)||"")}},n.prototype.attemptCellRendererRefresh=function(){if(o(this.cellRenderer)||!this.cellRenderer||o(this.cellRenderer.refresh))return!1;var t=this.createCellRendererParams(),e=this.beans.userComponentFactory.createFinalParams(this.getComponentHolder(),this.cellRendererType,t),n=this.cellRenderer.refresh(e);return!0===n||void 0===n},n.prototype.refreshToolTip=function(){var t=this.getToolTip();if(this.tooltip!==t){this.createTooltipFeatureIfNeeded();var o=e(t);o&&this.tooltip===t.toString()||(this.tooltip=t,this.beans.gridOptionsWrapper.isEnableBrowserTooltips()&&(o?this.eCellValue.setAttribute("title",this.tooltip):this.eCellValue.removeAttribute("title")))}},n.prototype.valuesAreEqual=function(t,e){var o=this.getComponentHolder(),n=o?o.equals:null;return n?n(t,e):t===e},n.prototype.getToolTip=function(){var t=this.getComponentHolder(),o=this.rowNode.data;if(t.tooltipField&&e(o))return V(o,t.tooltipField,this.column.isTooltipFieldContainsDots());var n=t.tooltipValueGetter;return n?n(ys(ys({api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext()},this.getTooltipParams()),{value:this.value})):null},n.prototype.getTooltipParams=function(){return{location:"cell",colDef:this.getComponentHolder(),column:this.getColumn(),rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.getTooltipText(),valueFormatted:this.valueFormatted}},n.prototype.getTooltipText=function(t){return void 0===t&&(t=!0),t?Kt(this.tooltip):this.tooltip},n.prototype.processCellClassRules=function(t,e){var o=this.getComponentHolder(),n={value:this.value,data:this.rowNode.data,node:this.rowNode,colDef:o,rowIndex:this.cellPosition.rowIndex,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),$scope:this.scope,context:this.beans.gridOptionsWrapper.getContext()};this.beans.stylingService.processClassRules(o.cellClassRules,n,t,e)},n.prototype.postProcessCellClassRules=function(){var t=this;this.processCellClassRules((function(e){return t.addCssClass(e)}),(function(e){return t.removeCssClass(e)}))},n.prototype.preProcessCellClassRules=function(){var t=[];return this.processCellClassRules((function(e){return t.push(e)}),(function(t){})),t},n.prototype.setUsingWrapper=function(){var t=this.getComponentHolder();if(this.rowNode.rowPinned)return this.usingWrapper=!1,this.includeSelectionComponent=!1,this.includeRowDraggingComponent=!1,void(this.includeDndSourceComponent=!1);var e="function"==typeof t.checkboxSelection,o="function"==typeof t.rowDrag,n="function"==typeof t.dndSource;this.includeSelectionComponent=e||!0===t.checkboxSelection,this.includeRowDraggingComponent=o||!0===t.rowDrag,this.includeDndSourceComponent=n||!0===t.dndSource;var i=this.beans.gridOptionsWrapper.isEnableCellTextSelection();this.usingWrapper=i||this.includeRowDraggingComponent||this.includeSelectionComponent||this.includeDndSourceComponent},n.prototype.chooseCellRenderer=function(){var t=this.getComponentHolder();if(t.template||t.templateUrl)this.usingCellRenderer=!1;else{var e=this.createCellRendererParams();this.rowNode.rowPinned&&this.beans.userComponentFactory.lookupComponentClassDef(t,"pinnedRowCellRenderer",e)?(this.cellRendererType=n.CELL_RENDERER_TYPE_PINNED,this.usingCellRenderer=!0):this.beans.userComponentFactory.lookupComponentClassDef(t,"cellRenderer",e)?(this.cellRendererType=n.CELL_RENDERER_TYPE_NORMAL,this.usingCellRenderer=!0):this.usingCellRenderer=!1}},n.prototype.createCellRendererInstance=function(t){var e=this;if(void 0===t&&(t=!1),this.usingCellRenderer){var o=this.beans.gridOptionsWrapper.isAngularCompileRows(),i=this.beans.gridOptionsWrapper.isSuppressAnimationFrame();(o||i||this.autoHeightCell)&&(t=!1);var r=this.createCellRendererParams();this.cellRendererVersion++;var s=this.afterCellRendererCreated.bind(this,this.cellRendererVersion),a=this.cellRendererType===n.CELL_RENDERER_TYPE_NORMAL;this.createCellRendererFunc=function(){e.createCellRendererFunc=null;var t=e.beans.userComponentFactory.newCellRenderer(e.getComponentHolder(),r,!a);t&&t.then(s)},t?this.beans.taskQueue.createTask(this.createCellRendererFunc,this.rowNode.rowIndex,"createTasksP2"):this.createCellRendererFunc()}},n.prototype.afterCellRendererCreated=function(t,e){this.isAlive()&&t===this.cellRendererVersion?(this.cellRenderer=e,this.cellRendererGui=this.cellRenderer.getGui(),o(this.cellRendererGui)||this.editingCell||this.eCellValue.appendChild(this.cellRendererGui)):this.beans.context.destroyBean(e)},n.prototype.createCellRendererParams=function(){var t=this;return{value:this.value,valueFormatted:this.valueFormatted,getValue:this.getValue.bind(this),setValue:function(e){return t.beans.valueService.setValue(t.rowNode,t.column,e)},formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,colDef:this.getComponentHolder(),column:this.column,$scope:this.scope,rowIndex:this.cellPosition.rowIndex,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext(),refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.eCellValue,registerRowDragger:function(e){return t.addRowDragging(e)},addRowCompListener:this.rowComp?this.rowComp.addEventListener.bind(this.rowComp):null,addRenderedRowListener:function(e,o){console.warn("AG Grid: since AG Grid .v11, params.addRenderedRowListener() is now params.addRowCompListener()"),t.rowComp&&t.rowComp.addEventListener(e,o)}}},n.prototype.formatValue=function(t){var e=this.beans.valueFormatterService.formatValue(this.column,this.rowNode,this.scope,t);return null!=e?e:t},n.prototype.getValueToUse=function(){return null!=this.valueFormatted?this.valueFormatted:this.value},n.prototype.getValueAndFormat=function(){this.value=this.getValue(),this.valueFormatted=this.beans.valueFormatterService.formatValue(this.column,this.rowNode,this.scope,this.value)},n.prototype.getValue=function(){var t=this.rowNode.leafGroup&&this.beans.columnController.isPivotMode(),e=this.rowNode.group&&this.rowNode.expanded&&!this.rowNode.footer&&!t,o=this.beans.gridOptionsWrapper.isGroupIncludeFooter(),n=this.beans.gridOptionsWrapper.isGroupSuppressBlankHeader(),i=e&&o&&!n;return this.beans.valueService.getValue(this.column,this.rowNode,!1,i)},n.prototype.onMouseEvent=function(t,e){if(!Pt(e))switch(t){case"click":this.onCellClicked(e);break;case"mousedown":this.onMouseDown(e);break;case"dblclick":this.onCellDoubleClicked(e);break;case"mouseout":this.onMouseOut(e);break;case"mouseover":this.onMouseOver(e)}},n.prototype.dispatchCellContextMenuEvent=function(t){var e=this.getComponentHolder(),o=this.createEvent(t,Wt.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(o),e.onCellContextMenu&&window.setTimeout((function(){return e.onCellContextMenu(o)}),0)},n.prototype.createEvent=function(t,e){var o={node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.getComponentHolder(),context:this.beans.gridOptionsWrapper.getContext(),api:this.beans.gridApi,columnApi:this.beans.columnApi,rowPinned:this.rowNode.rowPinned,event:t,type:e,rowIndex:this.rowNode.rowIndex};return this.scope&&(o.$scope=this.scope),o},n.prototype.onMouseOut=function(t){var e=this.createEvent(t,Wt.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(e),this.beans.columnHoverService.clearMouseOver()},n.prototype.onMouseOver=function(t){var e=this.createEvent(t,Wt.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(e),this.beans.columnHoverService.setMouseOver([this.column])},n.prototype.onCellDoubleClicked=function(t){var e=this.getComponentHolder(),o=this.createEvent(t,Wt.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(o),"function"==typeof e.onCellDoubleClicked&&window.setTimeout((function(){return e.onCellDoubleClicked(o)}),0),!this.beans.gridOptionsWrapper.isSingleClickEdit()&&!this.beans.gridOptionsWrapper.isSuppressClickEdit()&&this.startRowOrCellEdit()},n.prototype.startRowOrCellEdit=function(t,e){this.beans.gridOptionsWrapper.isFullRowEdit()?this.rowComp.startRowEditing(t,e,this):this.startEditingIfEnabled(t,e,!0)},n.prototype.isCellEditable=function(){return this.column.isCellEditable(this.rowNode)},n.prototype.startEditingIfEnabled=function(t,e,n){if(void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=!1),this.isCellEditable()&&!this.editingCell){this.editingCell=!0,this.cellEditorVersion++;var i=this.afterCellEditorCreated.bind(this,this.cellEditorVersion),r=this.createCellEditorParams(t,e,n);this.createCellEditor(r).then(i),o(this.cellEditor)&&n&&this.focusCell(!0)}},n.prototype.createCellEditor=function(t){var e=this;return this.beans.userComponentFactory.newCellEditor(this.column.getColDef(),t).then((function(o){var n=o;if(!(n.isPopup&&n.isPopup()))return n;e.beans.gridOptionsWrapper.isFullRowEdit()&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");var i=new cs(n);return e.beans.context.createBean(i),i.init(t),i}))},n.prototype.afterCellEditorCreated=function(t,e){if(t!==this.cellEditorVersion||!this.editingCell)this.beans.context.destroyBean(e);else{if(e.isCancelBeforeStart&&e.isCancelBeforeStart())return this.beans.context.destroyBean(e),void(this.editingCell=!1);if(!e.getGui)return console.warn("AG Grid: cellEditor for column "+this.column.getId()+" is missing getGui() method"),e.render&&console.warn("AG Grid: we found 'render' on the component, are you trying to set a React renderer but added it as colDef.cellEditor instead of colDef.cellEditorFmk?"),this.beans.context.destroyBean(e),void(this.editingCell=!1);this.cellEditor=e,this.cellEditorInPopup=void 0!==e.isPopup&&e.isPopup(),this.setInlineEditingClass(),this.cellEditorInPopup?this.addPopupCellEditor():this.addInCellEditor(),e.afterGuiAttached&&e.afterGuiAttached();var o=this.createEvent(null,Wt.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(o)}},n.prototype.addInCellEditor=function(){var t=this.getGui();t.contains(document.activeElement)&&t.focus(),this.clearCellElement(),this.cellEditor&&t.appendChild(this.cellEditor.getGui()),this.angular1Compile()},n.prototype.addPopupCellEditor=function(){var t=this,e=this.cellEditor&&this.cellEditor.getGui();if(e){var o=this.beans.popupService,n=this.beans.gridOptionsWrapper.isStopEditingWhenGridLosesFocus(),i=this.cellEditor&&this.cellEditor.getPopupPosition?this.cellEditor.getPopupPosition():"over",r={column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),ePopup:e,keepWithinBounds:!0},s="under"===i?o.positionPopupUnderComponent.bind(o,r):o.positionPopupOverComponent.bind(o,r),a=o.addPopup({modal:n,eChild:e,closeOnEsc:!0,closedCallback:function(){t.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:s});a&&(this.hideEditorPopup=a.hideFunc),this.angular1Compile()}},n.prototype.onPopupEditorClosed=function(){this.editingCell&&this.stopRowOrCellEdit()},n.prototype.setInlineEditingClass=function(){if(this.isAlive()){var t=this.editingCell&&!this.cellEditorInPopup,e=this.editingCell&&this.cellEditorInPopup;this.addOrRemoveCssClass("ag-cell-inline-editing",t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e),Ve(this.getGui().parentNode,"ag-row-inline-editing",t),Ve(this.getGui().parentNode,"ag-row-not-inline-editing",!t)}},n.prototype.createCellEditorParams=function(t,e,o){return{value:this.getValue(),keyPress:t,charPress:e,column:this.column,colDef:this.column.getColDef(),rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,api:this.beans.gridOptionsWrapper.getApi(),cellStartedEdit:o,columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext(),$scope:this.scope,onKeyDown:this.onKeyDown.bind(this),stopEditing:this.stopEditingAndFocus.bind(this),eGridCell:this.getGui(),parseValue:this.parseValue.bind(this),formatValue:this.formatValue.bind(this)}},n.prototype.stopEditingAndFocus=function(t){void 0===t&&(t=!1),this.stopRowOrCellEdit(),this.focusCell(!0),t||this.navigateAfterEdit()},n.prototype.parseValue=function(t){var o=this.getComponentHolder(),n={node:this.rowNode,data:this.rowNode.data,oldValue:this.value,newValue:t,colDef:o,column:this.column,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext()},i=o.valueParser;return e(i)?this.beans.expressionService.evaluate(i,n):t},n.prototype.focusCell=function(t){void 0===t&&(t=!1),this.beans.focusController.setFocusedCell(this.cellPosition.rowIndex,this.column,this.rowNode.rowPinned,t)},n.prototype.setFocusInOnEditor=function(){this.editingCell&&(this.cellEditor&&this.cellEditor.focusIn?this.cellEditor.focusIn():this.focusCell(!0))},n.prototype.isEditing=function(){return this.editingCell},n.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;switch(e){case jn.ENTER:this.onEnterKeyDown(t);break;case jn.F2:this.onF2KeyDown();break;case jn.ESCAPE:this.onEscapeKeyDown();break;case jn.TAB:this.onTabKeyDown(t);break;case jn.BACKSPACE:case jn.DELETE:this.onBackspaceOrDeleteKeyPressed(e);break;case jn.DOWN:case jn.UP:case jn.RIGHT:case jn.LEFT:this.onNavigationKeyPressed(t,e)}},n.prototype.setFocusOutOnEditor=function(){this.editingCell&&this.cellEditor&&this.cellEditor.focusOut&&this.cellEditor.focusOut()},n.prototype.onNavigationKeyPressed=function(t,e){this.editingCell||(t.shiftKey&&this.rangeSelectionEnabled?this.onShiftRangeSelect(e):this.beans.rowRenderer.navigateToNextCell(t,e,this.cellPosition,!0),t.preventDefault())},n.prototype.onShiftRangeSelect=function(t){if(this.beans.rangeController){var e=this.beans.rangeController.extendLatestRangeInDirection(t);e&&this.beans.rowRenderer.ensureCellVisible(e)}},n.prototype.onTabKeyDown=function(t){this.beans.rowRenderer.onTabKeyDown(this,t)},n.prototype.onBackspaceOrDeleteKeyPressed=function(t){this.editingCell||this.startRowOrCellEdit(t)},n.prototype.onEnterKeyDown=function(t){this.editingCell||this.rowComp.isEditing()?this.stopEditingAndFocus():this.beans.gridOptionsWrapper.isEnterMovesDown()?this.beans.rowRenderer.navigateToNextCell(null,jn.DOWN,this.cellPosition,!1):(this.startRowOrCellEdit(jn.ENTER),this.editingCell&&t.preventDefault())},n.prototype.navigateAfterEdit=function(){this.beans.gridOptionsWrapper.isFullRowEdit()||this.beans.gridOptionsWrapper.isEnterMovesDownAfterEdit()&&this.beans.rowRenderer.navigateToNextCell(null,jn.DOWN,this.cellPosition,!1)},n.prototype.onF2KeyDown=function(){this.editingCell||this.startRowOrCellEdit(jn.F2)},n.prototype.onEscapeKeyDown=function(){this.editingCell&&(this.stopRowOrCellEdit(!0),this.focusCell(!0))},n.prototype.onKeyPress=function(t){if(!(At(t)!==this.getGui())&&!this.editingCell){var e=String.fromCharCode(t.charCode);" "===e?this.onSpaceKeyPressed(t):fn(t)&&(this.startRowOrCellEdit(null,e),t.preventDefault())}},n.prototype.onSpaceKeyPressed=function(t){var e=this.beans.gridOptionsWrapper;if(!this.editingCell&&e.isRowSelection()){var o=this.rowNode.isSelected(),n=!o;if(n||!e.isSuppressRowDeselection()){var i=this.beans.gridOptionsWrapper.isGroupSelectsFiltered(),r=this.rowNode.setSelectedParams({newValue:n,rangeSelect:t.shiftKey,groupSelectsFiltered:i});void 0===o&&0===r&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:t.shiftKey,groupSelectsFiltered:i})}}t.preventDefault()},n.prototype.onMouseDown=function(t){var e=t.ctrlKey,o=t.metaKey,n=t.shiftKey,i=t.target,r=this.beans,s=r.eventService,a=r.rangeController;if(!this.isRightClickInExistingRange(t)){if(!n||a&&!a.getCellRanges().length){var l=(Oe()||Pe())&&!this.editingCell&&!We(i);this.focusCell(l)}else a&&t.preventDefault();if(!this.containsWidget(i)){if(a){var p=this.cellPosition;if(n)a.extendLatestRangeToCell(p);else{var u=e||o;a.setRangeToCell(p,u)}}s.dispatchEvent(this.createEvent(t,Wt.EVENT_CELL_MOUSE_DOWN))}}},n.prototype.isRightClickInExistingRange=function(t){var e=this.beans.rangeController;if(e&&(e.isCellInAnyRange(this.getCellPosition())&&2===t.button))return!0;return!1},n.prototype.containsWidget=function(t){return Ue(t,"ag-selection-checkbox",3)},n.prototype.isDoubleClickOnIPad=function(){if(!Ae()||bt("dblclick"))return!1;var t=(new Date).getTime(),e=t-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=t,e},n.prototype.onCellClicked=function(t){if(this.isDoubleClickOnIPad())return this.onCellDoubleClicked(t),void t.preventDefault();var e=this.beans,o=e.eventService,n=e.gridOptionsWrapper,i=this.createEvent(t,Wt.EVENT_CELL_CLICKED);o.dispatchEvent(i);var r=this.getComponentHolder();r.onCellClicked&&window.setTimeout((function(){return r.onCellClicked(i)}),0),(n.isSingleClickEdit()||r.singleClickEdit)&&!n.isSuppressClickEdit()&&this.startRowOrCellEdit()},n.prototype.createGridCellVo=function(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,column:this.column}},n.prototype.getRowPosition=function(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}},n.prototype.getCellPosition=function(){return this.cellPosition},n.prototype.getParentRow=function(){return this.eParentRow},n.prototype.setParentRow=function(t){this.eParentRow=t},n.prototype.getColumn=function(){return this.column},n.prototype.getComponentHolder=function(){return this.column.getColDef()},n.prototype.detach=function(){this.eParentRow.removeChild(this.getGui())},n.prototype.destroy=function(){this.createCellRendererFunc&&this.beans.taskQueue.cancelTask(this.createCellRendererFunc),this.stopEditing(),this.cellRenderer=this.beans.context.destroyBean(this.cellRenderer),this.beans.context.destroyBean(this.selectionHandle),t.prototype.destroy.call(this)},n.prototype.onLeftChanged=function(){var t=this.modifyLeftForPrintLayout(this.getCellLeft());this.getGui().style.left=t+"px",this.refreshAriaIndex()},n.prototype.modifyLeftForPrintLayout=function(t){if(!this.printLayout||this.column.getPinned()===ht.PINNED_LEFT)return t;var e=this.beans.columnController.getDisplayedColumnsLeftWidth();return this.column.getPinned()===ht.PINNED_RIGHT?e+this.beans.columnController.getBodyContainerWidth()+(t||0):e+(t||0)},n.prototype.onWidthChanged=function(){var t=this.getCellWidth();this.getGui().style.width=t+"px"},n.prototype.getRangeBorders=function(){var t,e,o=this,n=this.beans.gridOptionsWrapper.isEnableRtl(),i=!1,r=!1,s=!1,a=!1,l=this.cellPosition.column,p=this.beans,u=p.rangeController,c=p.columnController;n?(t=c.getDisplayedColAfter(l),e=c.getDisplayedColBefore(l)):(t=c.getDisplayedColBefore(l),e=c.getDisplayedColAfter(l));var d=u.getCellRanges().filter((function(t){return u.isCellInSpecificRange(o.cellPosition,t)}));t||(a=!0),e||(r=!0);for(var h=0;h<d.length&&!(i&&r&&s&&a);h++){var f=d[h],g=u.getRangeStartRow(f),y=u.getRangeEndRow(f);!i&&this.beans.rowPositionUtils.sameRow(g,this.cellPosition)&&(i=!0),!s&&this.beans.rowPositionUtils.sameRow(y,this.cellPosition)&&(s=!0),!a&&t&&f.columns.indexOf(t)<0&&(a=!0),!r&&e&&f.columns.indexOf(e)<0&&(r=!0)}return{top:i,right:r,bottom:s,left:a}},n.prototype.getInitialRangeClasses=function(){var t=[];if(!this.rangeSelectionEnabled||!this.rangeCount)return t;t.push("ag-cell-range-selected"),this.hasChartRange&&t.push("ag-cell-range-chart");var e=Math.min(this.rangeCount,4);if(t.push("ag-cell-range-selected-"+e),this.isSingleCell()&&t.push("ag-cell-range-single-cell"),this.rangeCount>0){var o=this.getRangeBorders();o.top&&t.push("ag-cell-range-top"),o.right&&t.push("ag-cell-range-right"),o.bottom&&t.push("ag-cell-range-bottom"),o.left&&t.push("ag-cell-range-left")}return this.selectionHandle&&t.push("ag-cell-range-handle"),t},n.prototype.onRowIndexChanged=function(){this.createGridCellVo(),this.onCellFocused(),this.onRangeSelectionChanged()},n.prototype.onRangeSelectionChanged=function(){var t=this.beans.rangeController;if(t){var e=this.cellPosition,o=this.rangeCount,n=t.getCellRangeCount(e),i=this.getGui();o!==n&&(this.addOrRemoveCssClass("ag-cell-range-selected",0!==n),this.addOrRemoveCssClass("ag-cell-range-selected-1",1===n),this.addOrRemoveCssClass("ag-cell-range-selected-2",2===n),this.addOrRemoveCssClass("ag-cell-range-selected-3",3===n),this.addOrRemoveCssClass("ag-cell-range-selected-4",n>=4),this.rangeCount=n),Qo(i,this.rangeCount>0);var r=this.getHasChartRange();r!==this.hasChartRange&&(this.hasChartRange=r,this.addOrRemoveCssClass("ag-cell-range-chart",this.hasChartRange)),this.updateRangeBorders(),this.addOrRemoveCssClass("ag-cell-range-single-cell",this.isSingleCell()),this.refreshHandle()}},n.prototype.getHasChartRange=function(){var t=this.beans.rangeController;if(!this.rangeCount||!t)return!1;var e=t.getCellRanges();return e.length>0&&e.every((function(t){return C([Ur.DIMENSION,Ur.VALUE],t.type)}))},n.prototype.shouldHaveSelectionHandle=function(){var t=this.beans,e=t.gridOptionsWrapper,o=t.rangeController,n=o.getCellRanges(),i=n.length;if(this.rangeCount<1||i<1)return!1;var r=d(n),s=this.getCellPosition(),a=1===i&&(e.isEnableFillHandle()||e.isEnableRangeHandle())&&!this.editingCell;if(this.hasChartRange){var l=n[0].type===Ur.DIMENSION&&o.isCellInSpecificRange(s,n[0]);this.addOrRemoveCssClass("ag-cell-range-chart-category",l),a=r.type===Ur.VALUE}return a&&null!=r.endRow&&o.isContiguousRange(r)&&o.isBottomRightCell(r,s)},n.prototype.addSelectionHandle=function(){var t=this.beans,e=t.gridOptionsWrapper,n=d(t.rangeController.getCellRanges()).type,i=e.isEnableFillHandle()&&o(n)?jr.FILL:jr.RANGE;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.beans.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this)},n.prototype.updateRangeBordersIfRangeCount=function(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())},n.prototype.refreshHandle=function(){if(this.beans.rangeController){var t=this.shouldHaveSelectionHandle();this.selectionHandle&&!t&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),t&&this.addSelectionHandle(),this.addOrRemoveCssClass("ag-cell-range-handle",!!this.selectionHandle)}},n.prototype.updateRangeBorders=function(){var t=this.getRangeBorders(),e=this.isSingleCell(),o=!e&&t.top,n=!e&&t.right,i=!e&&t.bottom,r=!e&&t.left;this.addOrRemoveCssClass("ag-cell-range-top",o),this.addOrRemoveCssClass("ag-cell-range-right",n),this.addOrRemoveCssClass("ag-cell-range-bottom",i),this.addOrRemoveCssClass("ag-cell-range-left",r)},n.prototype.onFirstRightPinnedChanged=function(){var t=this.column.isFirstRightPinned();this.firstRightPinned!==t&&(this.firstRightPinned=t,this.addOrRemoveCssClass("ag-cell-first-right-pinned",t))},n.prototype.onLastLeftPinnedChanged=function(){var t=this.column.isLastLeftPinned();this.lastLeftPinned!==t&&(this.lastLeftPinned=t,this.addOrRemoveCssClass("ag-cell-last-left-pinned",t))},n.prototype.refreshShouldDestroy=function(){var t=this.usingWrapper,e=this.includeRowDraggingComponent,o=this.includeDndSourceComponent,n=this.includeSelectionComponent;return this.setUsingWrapper(),t!==this.usingWrapper||e!==this.includeRowDraggingComponent||o!==this.includeDndSourceComponent||n!==this.includeSelectionComponent},n.prototype.populateTemplate=function(){if(this.usingWrapper){this.eCellValue=this.getRefElement("eCellValue"),this.eCellWrapper=this.getRefElement("eCellWrapper"),this.eCellValue.id="cell-"+this.getCompId();var t="";this.includeRowDraggingComponent&&this.addRowDragging(),this.includeDndSourceComponent&&this.addDndSource(),this.includeSelectionComponent&&(t+=this.addSelectionCheckbox().getCheckboxId()),Mo(this.getGui(),t+" "+this.eCellValue.id)}else this.eCellValue=this.getGui(),this.eCellWrapper=this.eCellValue},n.prototype.getFrameworkOverrides=function(){return this.beans.frameworkOverrides},n.prototype.addRowDragging=function(t){var e=this,o=this.beans.gridOptionsWrapper.isPagination(),n=this.beans.gridOptionsWrapper.isRowDragManaged(),i=this.beans.gridOptionsWrapper.isRowModelDefault();if(n){if(!i)return void z((function(){return console.warn("AG Grid: managed row dragging is only allowed in the Client Side Row Model")}),"CellComp.addRowDragging");if(o)return void z((function(){return console.warn("AG Grid: managed row dragging is not possible when doing pagination")}),"CellComp.addRowDragging")}this.rowDraggingComp?t&&this.rowDraggingComp.setDragElement(t):(this.rowDraggingComp=new ss(this.rowNode,this.column,(function(){return e.value}),this.beans,t),this.createManagedBean(this.rowDraggingComp,this.beans.context)),t||this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)},n.prototype.addDndSource=function(){var t=new fs(this.rowNode,this.column,this.getValueToUse(),this.beans,this.getGui());this.createManagedBean(t,this.beans.context),this.eCellWrapper.insertBefore(t.getGui(),this.eCellValue)},n.prototype.addSelectionCheckbox=function(){var t=this,e=new Ri;this.beans.context.createBean(e);var o=this.getComponentHolder().checkboxSelection;return"function"!=typeof o&&(o=void 0),e.init({rowNode:this.rowNode,column:this.column,visibleFunc:o}),this.addDestroyFunc((function(){return t.beans.context.destroyBean(e)})),this.eCellWrapper.insertBefore(e.getGui(),this.eCellValue),e},n.prototype.addDomData=function(){var t=this,e=this.getGui();this.beans.gridOptionsWrapper.setDomData(e,n.DOM_DATA_KEY_CELL_COMP,this),this.addDestroyFunc((function(){return t.beans.gridOptionsWrapper.setDomData(e,n.DOM_DATA_KEY_CELL_COMP,null)}))},n.prototype.isSingleCell=function(){var t=this.beans.rangeController;return 1===this.rangeCount&&t&&!t.isMoreThanOneCell()},n.prototype.onCellFocused=function(t){var e=this.beans.focusController.isCellFocused(this.cellPosition);e!==this.cellFocused&&(!this.beans.gridOptionsWrapper.isSuppressCellSelection()&&this.addOrRemoveCssClass("ag-cell-focus",e),this.cellFocused=e);if(e&&t&&t.forceBrowserFocus){var o=this.getFocusableElement();o.focus(),document.activeElement&&document.activeElement!==document.body||o.focus()}var n=this.beans.gridOptionsWrapper.isFullRowEdit();e||n||!this.editingCell||this.stopRowOrCellEdit()},n.prototype.stopRowOrCellEdit=function(t){void 0===t&&(t=!1),this.beans.gridOptionsWrapper.isFullRowEdit()?this.rowComp.stopRowEditing(t):this.stopEditing(t)},n.prototype.stopEditing=function(t){if(void 0===t&&(t=!1),this.editingCell)if(this.cellEditor){var e,o=this.getValue(),n=!1;if(!t)this.cellEditor.isCancelAfterEnd&&this.cellEditor.isCancelAfterEnd()||(e=this.cellEditor.getValue(),n=!0);if(this.editingCell=!1,this.beans.context.destroyBean(this.cellEditor),this.cellEditor=null,this.cellEditorInPopup&&this.hideEditorPopup)this.hideEditorPopup(),this.hideEditorPopup=null;else{this.clearCellElement();var i=this.getGui();if(this.usingWrapper)i.appendChild(this.eCellWrapper);else if(this.cellRenderer){var r=this.cellRendererGui;r&&i.appendChild(r)}}this.setInlineEditingClass(),this.refreshHandle(),n&&e!==o&&(this.suppressRefreshCell=!0,this.rowNode.setDataValue(this.column,e),this.suppressRefreshCell=!1),this.refreshCell({forceRefresh:!0,suppressFlash:!0});var s=ys(ys({},this.createEvent(null,Wt.EVENT_CELL_EDITING_STOPPED)),{oldValue:o,newValue:e});this.beans.eventService.dispatchEvent(s)}else this.editingCell=!1},n.prototype.clearCellElement=function(){var t=this.getGui();t.contains(document.activeElement)&&!Oe()&&t.focus({preventScroll:!0}),Je(t)},n.DOM_DATA_KEY_CELL_COMP="cellComp",n.CELL_RENDERER_TYPE_NORMAL="cellRenderer",n.CELL_RENDERER_TYPE_PINNED="pinnedRowCellRenderer",n}(xn),ms=function(){return(ms=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},Cs=function(){function t(){}return t.createChildScopeOrNull=function(t,e,o){if(!o.isAngularCompileRows())return null;var n=e.$new();n.data=ms({},t.data),n.rowNode=t,n.context=o.getContext();return{scope:n,scopeDestroyFunc:function(){n.$destroy(),n.data=null,n.rowNode=null,n.context=null}}},t}(),ws=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Es=function(t){function n(e,o,n,i,r,s,a,l,p,u,c){var d=t.call(this)||this;return d.eAllRowContainers=[],d.fullWidthRowDestroyFuncs=[],d.active=!0,d.rowContainerReadyCount=0,d.refreshNeeded=!1,d.columnRefreshPending=!1,d.cellComps={},d.createSecondPassFuncs=[],d.removeFirstPassFuncs=[],d.removeSecondPassFuncs=[],d.initialised=!1,d.elementOrderChanged=!1,d.lastMouseDownOnDragger=!1,d.parentScope=e,d.beans=a,d.bodyContainerComp=o,d.pinnedLeftContainerComp=n,d.pinnedRightContainerComp=i,d.fullWidthContainerComp=r,d.rowNode=s,d.rowIsEven=d.rowNode.rowIndex%2==0,d.paginationPage=d.beans.paginationProxy.getCurrentPage(),d.useAnimationFrameForCreate=p,d.printLayout=u,d.embedFullWidth=c,d.setAnimateFlags(l),d}return ws(n,t),n.prototype.init=function(){var t=this;this.rowFocused=this.beans.focusController.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.setupAngular1Scope(),this.rowLevel=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setupRowContainers(),this.addListeners(),this.slideRowIn&&this.createSecondPassFuncs.push((function(){t.onTopChanged()})),this.fadeRowIn&&this.createSecondPassFuncs.push((function(){t.eAllRowContainers.forEach((function(t){return xe(t,"ag-opacity-zero")}))}))},n.prototype.setupAngular1Scope=function(){var t=Cs.createChildScopeOrNull(this.rowNode,this.parentScope,this.beans.gridOptionsWrapper);t&&(this.scope=t.scope,this.addDestroyFunc(t.scopeDestroyFunc))},n.prototype.createTemplate=function(t,e){void 0===e&&(e=null);var o=[],n=this.rowNode.rowHeight,i=this.getInitialRowClasses(e).join(" "),r=Kt(this.rowNode.id),s=this.preProcessStylesFromGridOptions(),a=this.getRowBusinessKey(),l=Kt(a),p=this.getInitialRowTopStyle(),u=this.rowNode.getRowIndexString(),c=this.beans.headerNavigationService.getHeaderRowCount();return o.push("<div"),o.push(' role="row"'),o.push(' row-index="'+u+'" aria-rowindex="'+(c+this.rowNode.rowIndex+1)+'"'),o.push(r?' row-id="'+r+'"':""),o.push(a?' row-business-key="'+l+'"':""),o.push(' comp-id="'+this.getCompId()+'"'),o.push(' class="'+i+'"'),this.fullWidthRow&&o.push(' tabindex="-1"'),this.beans.gridOptionsWrapper.isRowSelection()&&o.push(' aria-selected="'+(this.rowNode.isSelected()?"true":"false")+'"'),this.rowNode.group&&o.push(" aria-expanded="+(this.rowNode.expanded?"true":"false")),o.push(' style="height: '+n+"px; "+p+" "+s+'">'),o.push(t),o.push("</div>"),o.join("")},n.prototype.getCellForCol=function(t){var e=this.cellComps[t.getColId()];return e?e.getGui():null},n.prototype.afterFlush=function(){this.initialised||(this.initialised=!0,this.executeProcessRowPostCreateFunc())},n.prototype.executeProcessRowPostCreateFunc=function(){var t=this.beans.gridOptionsWrapper.getProcessRowPostCreateFunc();t&&t({eRow:this.eBodyRow,ePinnedLeftRow:this.ePinnedLeftRow,ePinnedRightRow:this.ePinnedRightRow,node:this.rowNode,api:this.beans.gridOptionsWrapper.getApi(),rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext()})},n.prototype.getInitialRowTopStyle=function(){if(this.printLayout)return"";var t=this.slideRowIn?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,e=this.applyPaginationOffset(t),o=this.rowNode.isRowPinned()?e:this.beans.maxDivHeightScaler.getRealPixelPosition(e);return this.beans.gridOptionsWrapper.isSuppressRowTransform()?"top: "+o+"px; ":"transform: translateY("+o+"px);"},n.prototype.getRowBusinessKey=function(){var t=this.beans.gridOptionsWrapper.getBusinessKeyForNodeFunc();if("function"==typeof t)return t(this.rowNode)},n.prototype.areAllContainersReady=function(){return 3===this.rowContainerReadyCount},n.prototype.lazyCreateCells=function(t,e){if(this.active){var o=this.createCells(t);e.innerHTML=o.template,this.callAfterRowAttachedOnCells(o.cellComps,e),this.rowContainerReadyCount++,this.areAllContainersReady()&&this.refreshNeeded&&this.refreshCells()}},n.prototype.createRowContainer=function(t,e,o){var n=this,i=this.useAnimationFrameForCreate,r=i?{cellComps:[],template:""}:this.createCells(e),s=this.createTemplate(r.template);t.appendRowTemplate(s,(function(){var s=t.getRowElement(n.getCompId());n.refreshAriaLabel(s,!!n.rowNode.isSelected()),n.afterRowAttached(t,s),o(s),i?n.beans.taskQueue.createTask(n.lazyCreateCells.bind(n,e,s),n.rowNode.rowIndex,"createTasksP1"):(n.callAfterRowAttachedOnCells(r.cellComps,s),n.rowContainerReadyCount=3)}))},n.prototype.setupRowContainers=function(){var t=this.rowNode.isFullWidthCell(),e=this.beans.doingMasterDetail&&this.rowNode.detail,o=this.beans.columnController.isPivotMode(),i=this.rowNode.group&&!this.rowNode.footer&&this.beans.gridOptionsWrapper.isGroupUseEntireRow(o);this.rowNode.stub?this.createFullWidthRows(n.LOADING_CELL_RENDERER,n.LOADING_CELL_RENDERER_COMP_NAME,!1):e?this.createFullWidthRows(n.DETAIL_CELL_RENDERER,n.DETAIL_CELL_RENDERER_COMP_NAME,!0):t?this.createFullWidthRows(n.FULL_WIDTH_CELL_RENDERER,null,!1):i?this.createFullWidthRows(n.GROUP_ROW_RENDERER,n.GROUP_ROW_RENDERER_COMP_NAME,!1):this.setupNormalRowContainers()},n.prototype.setupNormalRowContainers=function(){var t,e=this,o=[],n=[];this.printLayout?t=this.beans.columnController.getAllDisplayedColumns():(t=this.beans.columnController.getViewportCenterColumnsForRow(this.rowNode),o=this.beans.columnController.getDisplayedLeftColumnsForRow(this.rowNode),n=this.beans.columnController.getDisplayedRightColumnsForRow(this.rowNode)),this.createRowContainer(this.bodyContainerComp,t,(function(t){return e.eBodyRow=t})),this.createRowContainer(this.pinnedRightContainerComp,n,(function(t){return e.ePinnedRightRow=t})),this.createRowContainer(this.pinnedLeftContainerComp,o,(function(t){return e.ePinnedLeftRow=t}))},n.prototype.createFullWidthRows=function(t,e,o){var n=this;if(this.fullWidthRow=!0,this.embedFullWidth){if(this.createFullWidthRowContainer(this.bodyContainerComp,null,null,t,e,(function(t){n.eFullWidthRowBody=t}),(function(t){n.fullWidthRowComponentBody=t}),o),this.printLayout)return;this.createFullWidthRowContainer(this.pinnedLeftContainerComp,ht.PINNED_LEFT,"ag-cell-last-left-pinned",t,e,(function(t){n.eFullWidthRowLeft=t}),(function(t){n.fullWidthRowComponentLeft=t}),o),this.createFullWidthRowContainer(this.pinnedRightContainerComp,ht.PINNED_RIGHT,"ag-cell-first-right-pinned",t,e,(function(t){n.eFullWidthRowRight=t}),(function(t){n.fullWidthRowComponentRight=t}),o)}else this.createFullWidthRowContainer(this.fullWidthContainerComp,null,null,t,e,(function(t){n.eFullWidthRow=t}),(function(t){n.fullWidthRowComponent=t}),o)},n.prototype.setAnimateFlags=function(t){if(t){var o=e(this.rowNode.oldRowTop);this.slideRowIn=o,this.fadeRowIn=!o}else this.slideRowIn=!1,this.fadeRowIn=!1},n.prototype.isEditing=function(){return this.editingRow},n.prototype.stopRowEditing=function(t){this.stopEditing(t)},n.prototype.isFullWidth=function(){return this.fullWidthRow},n.prototype.refreshFullWidth=function(){var t=this,e=function(e,o,n){if(!e||!o)return!0;if(!o.refresh)return!1;var i=t.createFullWidthParams(e,n);return o.refresh(i)},o=e(this.eFullWidthRow,this.fullWidthRowComponent,null),n=e(this.eFullWidthRowBody,this.fullWidthRowComponentBody,null),i=e(this.eFullWidthRowLeft,this.fullWidthRowComponentLeft,ht.PINNED_LEFT),r=e(this.eFullWidthRowRight,this.fullWidthRowComponentRight,ht.PINNED_RIGHT);return o&&n&&i&&r},n.prototype.addListeners=function(){this.addManagedListener(this.rowNode,Ci.EVENT_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_ROW_SELECTED,this.onRowSelected.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_CELL_CHANGED,this.onRowNodeCellChanged.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_DRAGGING_CHANGED,this.onRowNodeDraggingChanged.bind(this)),this.addManagedListener(this.rowNode,Ci.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));var t=this.beans.eventService;this.addManagedListener(t,Wt.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(t,Wt.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(t,Wt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(t,Wt.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(t,Wt.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(t,Wt.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(t,Wt.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(t,Wt.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedListener(t,Wt.EVENT_COLUMN_MOVED,this.onColumnMoved.bind(this)),this.addListenersForCellComps()},n.prototype.addListenersForCellComps=function(){var t=this;this.addManagedListener(this.rowNode,Ci.EVENT_ROW_INDEX_CHANGED,(function(){t.forEachCellComp((function(t){return t.onRowIndexChanged()}))})),this.addManagedListener(this.rowNode,Ci.EVENT_CELL_CHANGED,(function(e){t.forEachCellComp((function(t){return t.onCellChanged(e)}))}))},n.prototype.onRowNodeDataChanged=function(t){this.forEachCellComp((function(e){return e.refreshCell({suppressFlash:!t.update,newData:!t.update})})),this.onRowSelected(),this.postProcessCss()},n.prototype.onRowNodeCellChanged=function(){this.postProcessCss()},n.prototype.postProcessCss=function(){this.postProcessStylesFromGridOptions(),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()},n.prototype.onRowNodeHighlightChanged=function(){var t=this.rowNode.highlighted;this.eAllRowContainers.forEach((function(e){xe(e,"ag-row-highlight-above"),xe(e,"ag-row-highlight-below"),t&&Me(e,"ag-row-highlight-"+t)}))},n.prototype.onRowNodeDraggingChanged=function(){this.postProcessRowDragging()},n.prototype.postProcessRowDragging=function(){var t=this.rowNode.dragging;this.eAllRowContainers.forEach((function(e){return Ve(e,"ag-row-dragging",t)}))},n.prototype.updateExpandedCss=function(){var t=this.rowNode.isExpandable(),e=1==this.rowNode.expanded;this.eAllRowContainers.forEach((function(o){Ve(o,"ag-row-group",t),Ve(o,"ag-row-group-expanded",t&&e),Ve(o,"ag-row-group-contracted",t&&!e),Vo(o,t&&e)}))},n.prototype.onDisplayedColumnsChanged=function(){this.fullWidthRow||this.refreshCells()},n.prototype.destroyFullWidthComponents=function(){this.fullWidthRowDestroyFuncs.forEach((function(t){return t()})),this.fullWidthRowDestroyFuncs=[],this.fullWidthRowComponent&&(this.beans.detailRowCompCache.addOrDestroy(this.rowNode,null,this.fullWidthRowComponent),this.fullWidthRowComponent=null),this.fullWidthRowComponentBody&&(this.beans.detailRowCompCache.addOrDestroy(this.rowNode,null,this.fullWidthRowComponentBody),this.fullWidthRowComponentBody=null),this.fullWidthRowComponentLeft&&(this.beans.detailRowCompCache.addOrDestroy(this.rowNode,ht.PINNED_LEFT,this.fullWidthRowComponentLeft),this.fullWidthRowComponentLeft=null),this.fullWidthRowComponentRight&&(this.beans.detailRowCompCache.addOrDestroy(this.rowNode,ht.PINNED_RIGHT,this.fullWidthRowComponentRight),this.fullWidthRowComponentRight=null)},n.prototype.getContainerForCell=function(t){switch(t){case ht.PINNED_LEFT:return this.ePinnedLeftRow;case ht.PINNED_RIGHT:return this.ePinnedRightRow;default:return this.eBodyRow}},n.prototype.onVirtualColumnsChanged=function(){this.fullWidthRow||this.refreshCells()},n.prototype.onColumnResized=function(){this.fullWidthRow||this.refreshCells()},n.prototype.getRowPosition=function(){return{rowPinned:this.rowNode.rowPinned,rowIndex:this.rowNode.rowIndex}},n.prototype.onKeyboardNavigate=function(t){var e=this.rowNode,o=this.beans.focusController.getFocusedCell(),n={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:o&&o.column};this.beans.rowRenderer.navigateToNextCell(t,t.keyCode,n,!0),t.preventDefault()},n.prototype.onTabKeyDown=function(t){this.isFullWidth()&&this.beans.rowRenderer.onTabKeyDown(this,t)},n.prototype.onFullWidthRowFocused=function(t){var e=this.rowNode,o=this.fullWidthRow&&t.rowIndex===e.rowIndex&&t.rowPinned==e.rowPinned;(Ve(this.eFullWidthRow,"ag-full-width-focus",o),o)&&(this.embedFullWidth?this.eFullWidthRowBody:this.eFullWidthRow).focus()},n.prototype.refreshCell=function(t){this.areAllContainersReady()&&(this.destroyCells([t.getColumn().getId()]),this.refreshCells())},n.prototype.refreshCells=function(){if(this.areAllContainersReady())if(this.beans.gridOptionsWrapper.isSuppressAnimationFrame()||this.printLayout)this.refreshCellsInAnimationFrame();else{if(this.columnRefreshPending)return;this.beans.taskQueue.createTask(this.refreshCellsInAnimationFrame.bind(this),this.rowNode.rowIndex,"createTasksP1")}else this.refreshNeeded=!0},n.prototype.refreshCellsInAnimationFrame=function(){if(this.active){var t,e,o;this.columnRefreshPending=!1,this.printLayout?(t=this.beans.columnController.getAllDisplayedColumns(),e=[],o=[]):(t=this.beans.columnController.getViewportCenterColumnsForRow(this.rowNode),e=this.beans.columnController.getDisplayedLeftColumnsForRow(this.rowNode),o=this.beans.columnController.getDisplayedRightColumnsForRow(this.rowNode)),this.insertCellsIntoContainer(this.eBodyRow,t),this.insertCellsIntoContainer(this.ePinnedLeftRow,e),this.insertCellsIntoContainer(this.ePinnedRightRow,o),this.elementOrderChanged=!1;var n=Object.keys(this.cellComps);t.forEach((function(t){return g(n,t.getId())})),e.forEach((function(t){return g(n,t.getId())})),o.forEach((function(t){return g(n,t.getId())}));var i=n.filter(this.isCellEligibleToBeRemoved.bind(this));this.destroyCells(i)}},n.prototype.onColumnMoved=function(){this.elementOrderChanged=!0},n.prototype.destroyCells=function(t){var e=this;t.forEach((function(t){var n=e.cellComps[t];o(n)||(n.detach(),n.destroy(),e.cellComps[t]=null)}))},n.prototype.isCellEligibleToBeRemoved=function(t){var e=this.beans.columnController.getAllDisplayedColumns(),o=this.cellComps[t];if(!o||this.isCellInWrongRow(o))return!0;var n=o.isEditing(),i=this.beans.focusController.isCellFocused(o.getCellPosition());if(n||i){var r=o.getColumn();return!(e.indexOf(r)>=0)}return!0},n.prototype.ensureCellInCorrectContainer=function(t){if(!this.printLayout){var e=t.getGui(),o=t.getColumn().getPinned(),n=this.getContainerForCell(o),i=t.getParentRow();i!==n&&(i&&i.removeChild(e),n.appendChild(e),t.setParentRow(n),this.elementOrderChanged=!0)}},n.prototype.isCellInWrongRow=function(t){var e=t.getColumn(),o=this.getContainerForCell(e.getPinned());return t.getParentRow()!==o},n.prototype.insertCellsIntoContainer=function(t,e){var o=this;if(t){var n=[],i=[];if(e.forEach((function(e){var r=e.getId(),s=o.cellComps[r];s&&s.getColumn()==e?o.ensureCellInCorrectContainer(s):(s&&o.destroyCells([r]),o.createNewCell(e,t,n,i))})),n.length>0&&(no(t,n.join("")),this.callAfterRowAttachedOnCells(i,t)),this.elementOrderChanged&&this.beans.gridOptionsWrapper.isEnsureDomOrder()){var r=e.map((function(t){return o.getCellForCol(t)}));ao(t,r)}}},n.prototype.addDomData=function(t){var e=this.beans.gridOptionsWrapper;e.setDomData(t,n.DOM_DATA_KEY_RENDERED_ROW,this),this.addDestroyFunc((function(){e.setDomData(t,n.DOM_DATA_KEY_RENDERED_ROW,null)}))},n.prototype.createNewCell=function(t,e,o,n){var i=new vs(this.scope,this.beans,t,this.rowNode,this,!1,this.printLayout),r=i.getCreateTemplate();o.push(r),n.push(i),this.cellComps[t.getId()]=i,i.setParentRow(e),this.elementOrderChanged=!0},n.prototype.onMouseEvent=function(t,e){switch(t){case"dblclick":this.onRowDblClick(e);break;case"click":this.onRowClick(e);break;case"mousedown":this.onRowMouseDown(e)}},n.prototype.createRowEvent=function(t,e){return{type:t,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,context:this.beans.gridOptionsWrapper.getContext(),api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),event:e}},n.prototype.createRowEventWithSource=function(t,e){var o=this.createRowEvent(t,e);return o.source=this,o},n.prototype.onRowDblClick=function(t){if(!Pt(t)){var e=this.createRowEventWithSource(Wt.EVENT_ROW_DOUBLE_CLICKED,t);this.beans.eventService.dispatchEvent(e)}},n.prototype.onRowMouseDown=function(t){if(this.lastMouseDownOnDragger=Ue(t.target,"ag-row-drag",3),this.isFullWidth()){var e=this.rowNode,o=this.beans.columnController;this.beans.focusController.setFocusedCell(e.rowIndex,o.getAllDisplayedColumns()[0],e.rowPinned,!0)}},n.prototype.onRowClick=function(t){if(!(Pt(t)||this.lastMouseDownOnDragger)){var e=this.createRowEventWithSource(Wt.EVENT_ROW_CLICKED,t);this.beans.eventService.dispatchEvent(e);var o=t.ctrlKey||t.metaKey,n=t.shiftKey;if(!(this.beans.gridOptionsWrapper.isGroupSelectsChildren()&&this.rowNode.group||!this.rowNode.selectable||this.rowNode.rowPinned||!this.beans.gridOptionsWrapper.isRowSelection()||this.beans.gridOptionsWrapper.isSuppressRowClickSelection())){var i=this.beans.gridOptionsWrapper.isRowMultiSelectWithClick(),r=!this.beans.gridOptionsWrapper.isSuppressRowDeselection();if(this.rowNode.isSelected())i?this.rowNode.setSelectedParams({newValue:!1}):o?r&&this.rowNode.setSelectedParams({newValue:!1}):this.rowNode.setSelectedParams({newValue:!n,clearSelection:!n,rangeSelect:n});else{var s=!i&&!o;this.rowNode.setSelectedParams({newValue:!0,clearSelection:s,rangeSelect:n})}}}},n.prototype.createFullWidthRowContainer=function(t,e,o,n,i,r,s,a){var l=this,p=this.createTemplate("",o);t.appendRowTemplate(p,(function(){var o=t.getRowElement(l.getCompId()),p=l.createFullWidthParams(o,e),u=function(t){if(l.isAlive()){var e=t.getGui();o.appendChild(e),a&&l.setupDetailRowAutoHeight(e),s(t)}else l.beans.context.destroyBean(t)},c=l.beans.detailRowCompCache.get(l.rowNode,e);if(c)u(c);else{var d=l.beans.userComponentFactory.newFullWidthCellRenderer(p,n,i);if(!d){var h=ft.isRegistered(pt.MasterDetailModule);return void("agDetailCellRenderer"!==i||h?console.error("AG Grid: fullWidthCellRenderer "+i+" not found"):console.warn("AG Grid: cell renderer agDetailCellRenderer (for master detail) not found. Did you forget to include the master detail module?"))}d.then(u)}l.afterRowAttached(t,o),r(o),l.angular1Compile(o)}))},n.prototype.setupDetailRowAutoHeight=function(t){var e=this;if(this.beans.gridOptionsWrapper.isDetailRowAutoHeight()){var o=function(){var o=t.clientHeight;if(null!=o&&o>0){e.beans.frameworkOverrides.setTimeout((function(){e.rowNode.setRowHeight(o),e.beans.clientSideRowModel?e.beans.clientSideRowModel.onRowHeightChanged():e.beans.serverSideRowModel&&e.beans.serverSideRowModel.onRowHeightChanged()}),0)}},n=this.beans.resizeObserverService.observeResize(t,o);this.fullWidthRowDestroyFuncs.push(n),o()}},n.prototype.angular1Compile=function(t){this.scope&&this.beans.$compile(t)(this.scope)},n.prototype.createFullWidthParams=function(t,e){return{fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,$scope:this.scope?this.scope:this.parentScope,$compile:this.beans.$compile,rowIndex:this.rowNode.rowIndex,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext(),eGridCell:t,eParentOfValue:t,pinned:e,addRenderedRowListener:this.addEventListener.bind(this)}},n.prototype.getInitialRowClasses=function(t){var e={rowNode:this.rowNode,extraCssClass:t,rowFocused:this.rowFocused,fadeRowIn:this.fadeRowIn,rowIsEven:this.rowIsEven,rowLevel:this.rowLevel,fullWidthRow:this.fullWidthRow,firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),scope:this.scope};return this.beans.rowCssClassCalculator.getInitialRowClasses(e)},n.prototype.onUiLevelChanged=function(){var t=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=t){var e="ag-row-level-"+t,o="ag-row-level-"+this.rowLevel;this.eAllRowContainers.forEach((function(t){Me(t,e),xe(t,o)}))}this.rowLevel=t},n.prototype.isFirstRowOnPage=function(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()},n.prototype.isLastRowOnPage=function(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()},n.prototype.onModelUpdated=function(){var t=this.isFirstRowOnPage(),e=this.isLastRowOnPage();this.firstRowOnPage!==t&&(this.firstRowOnPage=t,this.eAllRowContainers.forEach((function(e){return Ve(e,"ag-row-first",t)}))),this.lastRowOnPage!==e&&(this.lastRowOnPage=e,this.eAllRowContainers.forEach((function(t){return Ve(t,"ag-row-last",e)})))},n.prototype.stopEditing=function(t){if(void 0===t&&(t=!1),this.forEachCellComp((function(e){e.stopEditing(t)})),this.editingRow){if(!t){var e=this.createRowEvent(Wt.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(e)}this.setEditingRow(!1)}},n.prototype.setEditingRow=function(t){this.editingRow=t,this.eAllRowContainers.forEach((function(e){return Ve(e,"ag-row-editing",t)}));var e=t?this.createRowEvent(Wt.EVENT_ROW_EDITING_STARTED):this.createRowEvent(Wt.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(e)},n.prototype.startRowEditing=function(t,e,o){void 0===t&&(t=null),void 0===e&&(e=null),void 0===o&&(o=null),this.editingRow||(this.forEachCellComp((function(n){var i=n===o;i?n.startEditingIfEnabled(t,e,i):n.startEditingIfEnabled(null,null,i)})),this.setEditingRow(!0))},n.prototype.forEachCellComp=function(t){A(this.cellComps,(function(e,o){o&&t(o)}))},n.prototype.postProcessClassesFromGridOptions=function(){var t=this,e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode,this.scope);e&&e.length&&e.forEach((function(e){t.eAllRowContainers.forEach((function(t){return Me(t,e)}))}))},n.prototype.postProcessRowClassRules=function(){var t=this;this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,this.scope,(function(e){t.eAllRowContainers.forEach((function(t){return Me(t,e)}))}),(function(e){t.eAllRowContainers.forEach((function(t){return xe(t,e)}))}))},n.prototype.preProcessStylesFromGridOptions=function(){return So(this.processStylesFromGridOptions())},n.prototype.postProcessStylesFromGridOptions=function(){var t=this.processStylesFromGridOptions();this.eAllRowContainers.forEach((function(e){return po(e,t)}))},n.prototype.processStylesFromGridOptions=function(){var t=this.beans.gridOptionsWrapper.getRowStyle();if(!t||"function"!=typeof t){var e,o=this.beans.gridOptionsWrapper.getRowStyleFunc();if(o)e=o({data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex,$scope:this.scope,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext()});return M({},t,e)}console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead")},n.prototype.createCells=function(t){var e=this,o=[],n=[];return t.forEach((function(t){var i=new vs(e.scope,e.beans,t,e.rowNode,e,!1,e.printLayout),r=i.getCreateTemplate();o.push(r),n.push(i),e.cellComps[t.getId()]=i})),{template:o.join(""),cellComps:n}},n.prototype.onRowSelected=function(){var t=this,e=this.rowNode.isSelected();this.eAllRowContainers.forEach((function(o){Qo(o,e),Ve(o,"ag-row-selected",e),t.refreshAriaLabel(o,e)}))},n.prototype.refreshAriaLabel=function(t,e){e&&this.beans.gridOptionsWrapper.isSuppressRowDeselection()?t.removeAttribute("aria-label"):Io(t,this.beans.gridOptionsWrapper.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect","Press SPACE to "+(e?"deselect":"select")+" this row."))},n.prototype.callAfterRowAttachedOnCells=function(t,e){var o=this;t.forEach((function(t){t.setParentRow(e),t.afterAttached(),o.editingRow&&t.startEditingIfEnabled()}))},n.prototype.afterRowAttached=function(t,o){var n=this;this.addDomData(o),this.removeSecondPassFuncs.push((function(){t.removeRowElement(o)})),this.removeFirstPassFuncs.push((function(){if(e(n.rowNode.rowTop)){var t=n.roundRowTopToBounds(n.rowNode.rowTop);n.setRowTop(t)}else Me(o,"ag-opacity-zero")})),this.eAllRowContainers.push(o),this.useAnimationFrameForCreate?this.beans.taskQueue.createTask(this.addHoverFunctionality.bind(this,o),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(o)},n.prototype.addHoverFunctionality=function(t){var e=this;this.active&&(this.addManagedListener(t,"mouseenter",(function(){return e.rowNode.onMouseEnter()})),this.addManagedListener(t,"mouseleave",(function(){return e.rowNode.onMouseLeave()})),this.addManagedListener(this.rowNode,Ci.EVENT_MOUSE_ENTER,(function(){e.beans.gridOptionsWrapper.isSuppressRowHoverHighlight()||Me(t,"ag-row-hover")})),this.addManagedListener(this.rowNode,Ci.EVENT_MOUSE_LEAVE,(function(){xe(t,"ag-row-hover")})))},n.prototype.roundRowTopToBounds=function(t){var e=this.beans.gridPanel.getVScrollPosition(),o=this.applyPaginationOffset(e.top,!0)-100,n=this.applyPaginationOffset(e.bottom,!0)+100;return Math.min(Math.max(o,t),n)},n.prototype.getFrameworkOverrides=function(){return this.beans.frameworkOverrides},n.prototype.onRowHeightChanged=function(){if(e(this.rowNode.rowHeight)){var t=this.rowNode.rowHeight+"px";this.eAllRowContainers.forEach((function(e){return e.style.height=t}))}},n.prototype.addEventListener=function(e,o){"renderedRowRemoved"!==e&&"rowRemoved"!==e||(e=Wt.EVENT_VIRTUAL_ROW_REMOVED,console.warn("AG Grid: Since version 11, event renderedRowRemoved is now called "+Wt.EVENT_VIRTUAL_ROW_REMOVED)),t.prototype.addEventListener.call(this,e,o)},n.prototype.removeEventListener=function(e,o){"renderedRowRemoved"!==e&&"rowRemoved"!==e||(e=Wt.EVENT_VIRTUAL_ROW_REMOVED,console.warn("AG Grid: Since version 11, event renderedRowRemoved and rowRemoved is now called "+Wt.EVENT_VIRTUAL_ROW_REMOVED)),t.prototype.removeEventListener.call(this,e,o)},n.prototype.destroy=function(e){(void 0===e&&(e=!1),this.active=!1,this.destroyFullWidthComponents(),e)?(this.removeFirstPassFuncs.forEach((function(t){return t()})),this.removeSecondPassFuncs.push(this.destroyContainingCells.bind(this))):(this.destroyContainingCells(),this.getAndClearDelayedDestroyFunctions().forEach((function(t){return t()})));var o=this.createRowEvent(Wt.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(o),this.beans.eventService.dispatchEvent(o),t.prototype.destroy.call(this)},n.prototype.destroyContainingCells=function(){var t=Object.keys(this.cellComps);this.destroyCells(t)},n.prototype.getAndClearDelayedDestroyFunctions=function(){var t=this.removeSecondPassFuncs;return this.removeSecondPassFuncs=[],t},n.prototype.onCellFocusChanged=function(){var t=this.beans.focusController.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);t!==this.rowFocused&&(this.eAllRowContainers.forEach((function(e){return Ve(e,"ag-row-focus",t)})),this.eAllRowContainers.forEach((function(e){return Ve(e,"ag-row-no-focus",!t)})),this.rowFocused=t),!t&&this.editingRow&&this.stopEditing(!1)},n.prototype.onPaginationChanged=function(){var t=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==t&&(this.paginationPage=t,this.onTopChanged())},n.prototype.onTopChanged=function(){this.setRowTop(this.rowNode.rowTop)},n.prototype.onPaginationPixelOffsetChanged=function(){this.onTopChanged()},n.prototype.applyPaginationOffset=function(t,e){return void 0===e&&(e=!1),this.rowNode.isRowPinned()?t:t+this.beans.paginationProxy.getPixelOffset()*(e?1:-1)},n.prototype.setRowTop=function(t){if(!this.printLayout&&e(t)){var o=this.applyPaginationOffset(t),n=(this.rowNode.isRowPinned()?o:this.beans.maxDivHeightScaler.getRealPixelPosition(o))+"px";this.beans.gridOptionsWrapper.isSuppressRowTransform()?this.eAllRowContainers.forEach((function(t){return t.style.top=n})):this.eAllRowContainers.forEach((function(t){return t.style.transform="translateY("+n+")"}))}},n.prototype.getAndClearNextVMTurnFunctions=function(){var t=this.createSecondPassFuncs;return this.createSecondPassFuncs=[],t},n.prototype.getRowNode=function(){return this.rowNode},n.prototype.getRenderedCellForColumn=function(t){var e=this,o=this.cellComps[t.getColId()];if(o)return o;var n=Object.keys(this.cellComps).map((function(t){return e.cellComps[t]})).filter((function(e){return e&&-1!==e.getColSpanningList().indexOf(t)}));return n.length?n[0]:null},n.prototype.onRowIndexChanged=function(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes())},n.prototype.updateRowIndexes=function(){var t=this,e=this.rowNode.getRowIndexString(),o=this.rowNode.rowIndex%2==0,n=this.rowIsEven!==o,i=this.beans.headerNavigationService.getHeaderRowCount();n&&(this.rowIsEven=o),this.eAllRowContainers.forEach((function(r){r.setAttribute("row-index",e),Uo(r,i+t.rowNode.rowIndex+1),n&&(Ve(r,"ag-row-even",o),Ve(r,"ag-row-odd",!o))}))},n.prototype.ensureDomOrder=function(){[{el:this.getBodyRowElement(),ct:this.bodyContainerComp},{el:this.getPinnedLeftRowElement(),ct:this.pinnedLeftContainerComp},{el:this.getPinnedRightRowElement(),ct:this.pinnedRightContainerComp},{el:this.getFullWidthRowElement(),ct:this.fullWidthContainerComp}].forEach((function(t){t.el&&t.ct.ensureDomOrder(t.el)}))},n.prototype.getPinnedLeftRowElement=function(){return this.ePinnedLeftRow?this.ePinnedLeftRow:this.eFullWidthRowLeft},n.prototype.getPinnedRightRowElement=function(){return this.ePinnedRightRow?this.ePinnedRightRow:this.eFullWidthRowRight},n.prototype.getBodyRowElement=function(){return this.eBodyRow?this.eBodyRow:this.eFullWidthRowBody},n.prototype.getFullWidthRowElement=function(){return this.eFullWidthRow},n.DOM_DATA_KEY_RENDERED_ROW="renderedRow",n.FULL_WIDTH_CELL_RENDERER="fullWidthCellRenderer",n.GROUP_ROW_RENDERER="groupRowRenderer",n.GROUP_ROW_RENDERER_COMP_NAME="agGroupRowRenderer",n.LOADING_CELL_RENDERER="loadingCellRenderer",n.LOADING_CELL_RENDERER_COMP_NAME="agLoadingCellRenderer",n.DETAIL_CELL_RENDERER="detailCellRenderer",n.DETAIL_CELL_RENDERER_COMP_NAME="agDetailCellRenderer",n}(xn),Rs=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Os=function(){return(Os=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},Ps=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ss=function(t,e){return function(o,n){e(o,n,t)}},bs=(function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.destroyFuncsForColumnListeners=[],e.rowCompsByIndex={},e.floatingTopRowComps=[],e.floatingBottomRowComps=[],e.refreshInProgress=!1,e}Rs(n,t),n.prototype.registerGridCore=function(t){this.gridCore=t},n.prototype.getGridCore=function(){return this.gridCore},n.prototype.agWire=function(t){this.logger=t.create("RowRenderer")},n.prototype.registerGridComp=function(t){this.gridPanel=t,this.rowContainers=this.gridPanel.getRowContainers(),this.addManagedListener(this.eventService,Wt.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_BODY_SCROLL,this.redrawAfterScroll.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_BODY_HEIGHT_CHANGED,this.redrawAfterScroll.bind(this)),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_DOM_LAYOUT,this.onDomLayoutChanged.bind(this)),this.registerCellEventListeners(),this.printLayout=this.gridOptionsWrapper.getDomLayout()===ht.DOM_LAYOUT_PRINT,this.embedFullWidthRows=this.printLayout||this.gridOptionsWrapper.isEmbedFullWidthRows(),this.redrawAfterModelUpdate()},n.prototype.registerCellEventListeners=function(){var t=this;this.addManagedListener(this.eventService,Wt.EVENT_CELL_FOCUSED,(function(e){t.forEachCellComp((function(t){return t.onCellFocused(e)})),t.forEachRowComp((function(t,o){o.isFullWidth()&&o.onFullWidthRowFocused(e)}))})),this.addManagedListener(this.eventService,Wt.EVENT_FLASH_CELLS,(function(e){t.forEachCellComp((function(t){return t.onFlashCells(e)}))})),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_HOVER_CHANGED,(function(){t.forEachCellComp((function(t){return t.onColumnHover()}))})),this.addManagedListener(this.eventService,Wt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,(function(){t.printLayout&&t.forEachCellComp((function(t){return t.onLeftChanged()}))})),this.gridOptionsWrapper.isEnableRangeSelection()&&(this.addManagedListener(this.eventService,Wt.EVENT_RANGE_SELECTION_CHANGED,(function(){t.forEachCellComp((function(t){return t.onRangeSelectionChanged()}))})),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_MOVED,(function(){t.forEachCellComp((function(t){return t.updateRangeBordersIfRangeCount()}))})),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_PINNED,(function(){t.forEachCellComp((function(t){return t.updateRangeBordersIfRangeCount()}))})),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_VISIBLE,(function(){t.forEachCellComp((function(t){return t.updateRangeBordersIfRangeCount()}))}))),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,Wt.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))},n.prototype.removeGridColumnListeners=function(){this.destroyFuncsForColumnListeners.forEach((function(t){return t()})),this.destroyFuncsForColumnListeners.length=0},n.prototype.refreshListenersToColumnsForCellComps=function(){var t=this;this.removeGridColumnListeners();var e=this.columnController.getAllGridColumns();e&&e.forEach((function(e){var o=function(o){t.forEachCellComp((function(t){t.getColumn()===e&&o(t)}))},n=function(){o((function(t){return t.onLeftChanged()}))},i=function(){o((function(t){return t.onWidthChanged()}))},r=function(){o((function(t){return t.onFirstRightPinnedChanged()}))},s=function(){o((function(t){return t.onLastLeftPinnedChanged()}))};e.addEventListener(yt.EVENT_LEFT_CHANGED,n),e.addEventListener(yt.EVENT_WIDTH_CHANGED,i),e.addEventListener(yt.EVENT_FIRST_RIGHT_PINNED_CHANGED,r),e.addEventListener(yt.EVENT_LAST_LEFT_PINNED_CHANGED,s),t.destroyFuncsForColumnListeners.push((function(){e.removeEventListener(yt.EVENT_LEFT_CHANGED,n),e.removeEventListener(yt.EVENT_WIDTH_CHANGED,i),e.removeEventListener(yt.EVENT_FIRST_RIGHT_PINNED_CHANGED,r),e.removeEventListener(yt.EVENT_LAST_LEFT_PINNED_CHANGED,s)}))}))},n.prototype.onDomLayoutChanged=function(){var t=this.gridOptionsWrapper.getDomLayout()===ht.DOM_LAYOUT_PRINT,e=t||this.gridOptionsWrapper.isEmbedFullWidthRows(),o=e!==this.embedFullWidthRows||this.printLayout!==t;this.printLayout=t,this.embedFullWidthRows=e,o&&this.redrawAfterModelUpdate()},n.prototype.datasourceChanged=function(){this.firstRenderedRow=0,this.lastRenderedRow=-1;var t=Object.keys(this.rowCompsByIndex);this.removeRowComps(t)},n.prototype.onPageLoaded=function(t){o(t)&&(t={type:Wt.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:!1,keepRenderedRows:!1,newData:!1,newPage:!1}),this.onModelUpdated(t)},n.prototype.getAllCellsForColumn=function(t){var e=[];function o(o,n){var i=n.getCellForCol(t);i&&e.push(i)}return A(this.rowCompsByIndex,o),A(this.floatingBottomRowComps,o),A(this.floatingTopRowComps,o),e},n.prototype.refreshFloatingRowComps=function(){this.refreshFloatingRows(this.floatingTopRowComps,this.pinnedRowModel.getPinnedTopRowData(),this.rowContainers.floatingTopPinnedLeft,this.rowContainers.floatingTopPinnedRight,this.rowContainers.floatingTop,this.rowContainers.floatingTopFullWidth),this.refreshFloatingRows(this.floatingBottomRowComps,this.pinnedRowModel.getPinnedBottomRowData(),this.rowContainers.floatingBottomPinnedLeft,this.rowContainers.floatingBottomPinnedRight,this.rowContainers.floatingBottom,this.rowContainers.floatingBottomFullWidth)},n.prototype.refreshFloatingRows=function(t,e,o,n,i,r){var s=this;t.forEach((function(t){t.destroy()})),t.length=0,e&&e.forEach((function(e){var a=new Es(s.$scope,i,o,n,r,e,s.beans,!1,!1,s.printLayout,s.embedFullWidthRows);a.init(),t.push(a)})),this.flushContainers(t)},n.prototype.onPinnedRowDataChanged=function(){this.redrawAfterModelUpdate({recycleRows:!0})},n.prototype.onModelUpdated=function(t){var e={recycleRows:t.keepRenderedRows,animate:t.animate,newData:t.newData,newPage:t.newPage,onlyBody:!0};this.redrawAfterModelUpdate(e)},n.prototype.getRenderedIndexesForRowNodes=function(t){var e=[];return o(t)||A(this.rowCompsByIndex,(function(o,n){var i=n.getRowNode();t.indexOf(i)>=0&&e.push(o)})),e},n.prototype.redrawRows=function(t){if(t&&0!=t.length){var e=this.getRenderedIndexesForRowNodes(t);this.removeRowComps(e),this.redrawAfterModelUpdate({recycleRows:!0})}},n.prototype.getCellToRestoreFocusToAfterRefresh=function(t){var e=t.suppressKeepFocus?null:this.focusController.getFocusCellToUseAfterRefresh();if(o(e))return null;var n=document.activeElement;return o(this.gridOptionsWrapper.getDomData(n,vs.DOM_DATA_KEY_CELL_COMP))?null:e},n.prototype.redrawAfterModelUpdate=function(t){void 0===t&&(t={}),this.getLockOnRefresh();var e=this.getCellToRestoreFocusToAfterRefresh(t);this.sizeContainerToPageHeight(),this.scrollToTopIfNewData(t);var o=!this.printLayout&&!!t.recycleRows,n=t.animate&&this.gridOptionsWrapper.isAnimateRows(),i=this.binRowComps(o),r=function(){if(null==e||null==i)return!1;var t=!1;return A(i,(function(o,n){var i=n.getRowNode(),r=i.rowIndex==e.rowIndex,s=i.rowPinned==e.rowPinned;r&&s&&(t=!0)})),t}();this.redraw(i,n),t.onlyBody||this.refreshFloatingRowComps(),r||this.restoreFocusedCell(e),this.releaseLockOnRefresh()},n.prototype.scrollToTopIfNewData=function(t){var e=t.newData||t.newPage,o=this.gridOptionsWrapper.isSuppressScrollOnNewData();e&&!o&&this.gridPanel.scrollToTop()},n.prototype.sizeContainerToPageHeight=function(){var t=[this.rowContainers.body,this.rowContainers.fullWidth,this.rowContainers.pinnedLeft,this.rowContainers.pinnedRight];if(this.printLayout)t.forEach((function(t){return t.setHeight(null)}));else{var e=this.paginationProxy.getCurrentPageHeight();0===e&&(e=1),this.maxDivHeightScaler.setModelHeight(e);var o=this.maxDivHeightScaler.getUiContainerHeight();t.forEach((function(t){return t.setHeight(o)}))}},n.prototype.getLockOnRefresh=function(){if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.refreshView(), call setTimeout(function() { api.refreshView(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0},n.prototype.releaseLockOnRefresh=function(){this.refreshInProgress=!1},n.prototype.restoreFocusedCell=function(t){t&&this.focusController.setFocusedCell(t.rowIndex,t.column,t.rowPinned,!0)},n.prototype.stopEditing=function(t){void 0===t&&(t=!1),this.forEachRowComp((function(e,o){o.stopEditing(t)}))},n.prototype.forEachCellComp=function(t){this.forEachRowComp((function(e,o){return o.forEachCellComp(t)}))},n.prototype.forEachRowComp=function(t){A(this.rowCompsByIndex,t),A(this.floatingTopRowComps,t),A(this.floatingBottomRowComps,t)},n.prototype.addRenderedRowListener=function(t,e,o){var n=this.rowCompsByIndex[e];n&&n.addEventListener(t,o)},n.prototype.flashCells=function(t){void 0===t&&(t={});var e=t.flashDelay,o=t.fadeDelay;this.forEachCellCompFiltered(t.rowNodes,t.columns,(function(t){return t.flashCell({flashDelay:e,fadeDelay:o})}))},n.prototype.refreshCells=function(t){void 0===t&&(t={});var e={forceRefresh:t.force,newData:!1,suppressFlash:t.suppressFlash};this.forEachCellCompFiltered(t.rowNodes,t.columns,(function(t){if(t.refreshShouldDestroy()){var o=t.getRenderedRow();o&&o.refreshCell(t)}else t.refreshCell(e)}))},n.prototype.getCellRendererInstances=function(t){var e=[];return this.forEachCellCompFiltered(t.rowNodes,t.columns,(function(t){var o=t.getCellRenderer();o&&e.push(o)})),e},n.prototype.getCellEditorInstances=function(t){var e=[];return this.forEachCellCompFiltered(t.rowNodes,t.columns,(function(t){var o=t.getCellEditor();o&&e.push(o)})),e},n.prototype.getEditingCells=function(){var t=[];return this.forEachCellComp((function(e){if(e.isEditing()){var o=e.getCellPosition();t.push(o)}})),t},n.prototype.forEachCellCompFiltered=function(t,o,n){var i,r,s=this;e(t)&&(i={top:{},bottom:{},normal:{}},t.forEach((function(t){var e=t.id;t.rowPinned===ht.PINNED_TOP?i.top[e]=!0:t.rowPinned===ht.PINNED_BOTTOM?i.bottom[e]=!0:i.normal[e]=!0}))),e(o)&&(r={},o.forEach((function(t){var o=s.columnController.getGridColumn(t);e(o)&&(r[o.getId()]=!0)})));var a=function(t){var o=t.getRowNode(),s=o.id,a=o.rowPinned;if(e(i))if(a===ht.PINNED_BOTTOM){if(!i.bottom[s])return}else if(a===ht.PINNED_TOP){if(!i.top[s])return}else if(!i.normal[s])return;t.forEachCellComp((function(t){var e=t.getColumn().getId();r&&!r[e]||n&&n(t)}))};A(this.rowCompsByIndex,(function(t,e){a(e)})),this.floatingTopRowComps&&this.floatingTopRowComps.forEach(a),this.floatingBottomRowComps&&this.floatingBottomRowComps.forEach(a)},n.prototype.destroy=function(){var e=Object.keys(this.rowCompsByIndex);this.removeRowComps(e),t.prototype.destroy.call(this)},n.prototype.binRowComps=function(t){var o,n=this,i={};return t?(o=[],A(this.rowCompsByIndex,(function(t,r){var s=r.getRowNode();e(s.id)?(i[s.id]=r,delete n.rowCompsByIndex[t]):o.push(t)}))):o=Object.keys(this.rowCompsByIndex),this.removeRowComps(o),i},n.prototype.removeRowComps=function(t){var e=this;t.forEach((function(t){var o=e.rowCompsByIndex[t];o&&o.destroy(),delete e.rowCompsByIndex[t]}))},n.prototype.redrawAfterScroll=function(){this.getLockOnRefresh(),this.redraw(null,!1,!0),this.releaseLockOnRefresh()},n.prototype.removeRowCompsNotToDraw=function(t){var e={};t.forEach((function(t){return e[t]=!0}));var o=Object.keys(this.rowCompsByIndex).filter((function(t){return!e[t]}));this.removeRowComps(o)},n.prototype.calculateIndexesToDraw=function(t){var e=this,o=te(this.firstRenderedRow,this.lastRenderedRow),n=function(t,n){var i=n.getRowNode().rowIndex;null!=i&&(i<e.firstRenderedRow||i>e.lastRenderedRow)&&e.doNotUnVirtualiseRow(n)&&o.push(i)};return A(this.rowCompsByIndex,n),A(t,n),o.sort((function(t,e){return t-e})),o},n.prototype.redraw=function(t,o,n){var i=this;void 0===o&&(o=!1),void 0===n&&(n=!1),this.maxDivHeightScaler.updateOffset(),this.workOutFirstAndLastRowsToRender();var r=this.calculateIndexesToDraw(t);this.removeRowCompsNotToDraw(r),this.printLayout&&(o=!1);var s=[],a=[];r.forEach((function(r){var l=i.createOrUpdateRowComp(r,t,o,n);e(l)&&(a.push(l),w(s,l.getAndClearNextVMTurnFunctions()))})),this.flushContainers(a),X(s),n&&!this.gridOptionsWrapper.isSuppressAnimationFrame()&&!this.printLayout?this.beans.taskQueue.addDestroyTask(this.destroyRowComps.bind(this,t,o)):this.destroyRowComps(t,o),this.checkAngularCompile(),this.gridPanel.updateRowCount()},n.prototype.flushContainers=function(t){A(this.rowContainers,(function(t,e){e&&e.flushRowTemplates()})),t.forEach((function(t){return t.afterFlush()}))},n.prototype.onDisplayedColumnsChanged=function(){var t=this.columnController.isPinningLeft(),e=this.columnController.isPinningRight();(this.pinningLeft!==t||e!==this.pinningRight)&&(this.pinningLeft=t,this.pinningRight=e,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())},n.prototype.redrawFullWidthEmbeddedRows=function(){var t=[];A(this.rowCompsByIndex,(function(e,o){if(o.isFullWidth()){var n=o.getRowNode().rowIndex;t.push(n.toString())}})),this.refreshFloatingRowComps(),this.removeRowComps(t),this.redrawAfterScroll()},n.prototype.refreshFullWidthRows=function(t){var e=[],o=!!t,n=o?{}:void 0;o&&n&&t.forEach((function(t){return n[t.id]=!0})),A(this.rowCompsByIndex,(function(t,i){if(i.isFullWidth()){var r=i.getRowNode();if(o&&n){var s=r.level>0&&r.parent?r.parent.id:void 0;if(!n[r.id]&&!n[s])return}if(!i.refreshFullWidth()){var a=i.getRowNode().rowIndex;e.push(a.toString())}}})),this.removeRowComps(e),this.redrawAfterScroll()},n.prototype.createOrUpdateRowComp=function(t,o,n,i){var r=null,s=this.rowCompsByIndex[t];if(s||e(r=this.paginationProxy.getRow(t))&&e(o)&&o[r.id]&&r.alreadyRendered&&(s=o[r.id],o[r.id]=null),!s){if(r||(r=this.paginationProxy.getRow(t)),!e(r))return;s=this.createRowComp(r,n,i)}else s&&s.ensureDomOrder();return r&&(r.alreadyRendered=!0),this.rowCompsByIndex[t]=s,s},n.prototype.destroyRowComps=function(t,e){var o=[];A(t,(function(t,n){n&&(n.destroy(e),w(o,n.getAndClearDelayedDestroyFunctions()))})),q(o)},n.prototype.checkAngularCompile=function(){var t=this;this.gridOptionsWrapper.isAngularCompileRows()&&window.setTimeout((function(){t.$scope.$apply()}),0)},n.prototype.workOutFirstAndLastRowsToRender=function(){var t,e,o=this;if(this.paginationProxy.isRowsToRender())if(this.printLayout)t=this.paginationProxy.getPageFirstRow(),e=this.paginationProxy.getPageLastRow();else{var n=this.paginationProxy.getPixelOffset(),i=this.paginationProxy.getCurrentPagePixelRange(),r=i.pageFirstPixel,s=i.pageLastPixel,a=this.maxDivHeightScaler.getOffset(),l=this.gridPanel.getVScrollPosition(),p=l.top,u=l.bottom,c=this.gridOptionsWrapper.getRowBufferInPixels(),d=Math.max(p+n-c,r)+a,h=Math.min(u+n+c,s)+a;this.ensureAllRowsInRangeHaveHeightsCalculated(d,h);var f=this.paginationProxy.getRowIndexAtPixel(d),g=this.paginationProxy.getRowIndexAtPixel(h),y=this.paginationProxy.getPageFirstRow(),v=this.paginationProxy.getPageLastRow();f<y&&(f=y),g>v&&(g=v),t=f,e=g}else t=0,e=-1;var m=this.gridOptionsWrapper.getDomLayout()===ht.DOM_LAYOUT_NORMAL,C=this.gridOptionsWrapper.isSuppressMaxRenderedRowRestriction(),w=Math.max(this.gridOptionsWrapper.getRowBuffer(),500);m&&!C&&e-t>w&&(e=t+w);var E=t!==this.firstRenderedRow,R=e!==this.lastRenderedRow;if(E||R){this.firstRenderedRow=t,this.lastRenderedRow=e;var O={type:Wt.EVENT_VIEWPORT_CHANGED,firstRow:t,lastRow:e,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(O)}if(this.paginationProxy.isRowsToRender()){var P={type:Wt.EVENT_FIRST_DATA_RENDERED,firstRow:t,lastRow:e,api:this.gridApi,columnApi:this.columnApi};window.setTimeout((function(){return o.eventService.dispatchEventOnce(P)}),50)}},n.prototype.ensureAllRowsInRangeHaveHeightsCalculated=function(t,e){this.paginationProxy.ensureRowHeightsValid(t,e,-1,-1)&&(this.sizeContainerToPageHeight(),this.maxDivHeightScaler.updateOffset())},n.prototype.getFirstVirtualRenderedRow=function(){return this.firstRenderedRow},n.prototype.getLastVirtualRenderedRow=function(){return this.lastRenderedRow},n.prototype.doNotUnVirtualiseRow=function(t){var e=t.getRowNode(),o=this.focusController.isRowNodeFocused(e),n=t.isEditing(),i=e.detail;return!!(o||n||i)&&!!this.paginationProxy.isRowPresent(e)},n.prototype.createRowComp=function(t,e,o){var n=this.gridOptionsWrapper.isSuppressAnimationFrame(),i=o&&!n&&!this.printLayout,r=new Es(this.$scope,this.rowContainers.body,this.rowContainers.pinnedLeft,this.rowContainers.pinnedRight,this.rowContainers.fullWidth,t,this.beans,e,i,this.printLayout,this.embedFullWidthRows);return r.init(),r},n.prototype.getRenderedNodes=function(){var t=this.rowCompsByIndex;return Object.keys(t).map((function(e){return t[e].getRowNode()}))},n.prototype.navigateToNextCell=function(t,n,i,r){for(var s=i,a=!1;s&&(s===i||!this.isValidNavigateCell(s));)this.gridOptionsWrapper.isEnableRtl()?n===jn.LEFT&&(s=this.getLastCellOfColSpan(s)):n===jn.RIGHT&&(s=this.getLastCellOfColSpan(s)),a=o(s=this.cellNavigationService.getNextCellToFocus(n,s));if(a&&t&&t.keyCode===jn.UP&&(s={rowIndex:-1,rowPinned:null,column:i.column}),r){var l=this.gridOptionsWrapper.getNavigateToNextCellFunc();if(e(l)){var p=l({key:n,previousCellPosition:i,nextCellPosition:s||null,event:t});e(p)?(p.floating&&(z((function(){console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?")}),"no floating in userCell"),p.rowPinned=p.floating),s={rowPinned:p.rowPinned,rowIndex:p.rowIndex,column:p.column}):s=null}}if(s)if(s.rowIndex<0){var u=this.beans.headerNavigationService.getHeaderRowCount();this.focusController.focusHeaderPosition({headerRowIndex:u+s.rowIndex,column:i.column})}else{var c=this.getNormalisedPosition(s);c?this.focusPosition(c):this.tryToFocusFullWidthRow(s)}},n.prototype.getNormalisedPosition=function(t){this.ensureCellVisible(t);var e=this.getComponentForCell(t);return e?(t=e.getCellPosition(),this.ensureCellVisible(t),t):null},n.prototype.tryToFocusFullWidthRow=function(t,e){void 0===e&&(e=!1);var o=this.columnController.getAllDisplayedColumns(),n=this.getRowCompByPosition(t);if(!n||!n.isFullWidth())return!1;var i={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column||(e?d(o):o[0])};return this.focusPosition(i),!0},n.prototype.focusPosition=function(t){this.focusController.setFocusedCell(t.rowIndex,t.column,t.rowPinned,!0),this.rangeController&&this.rangeController.setRangeToCell(t)},n.prototype.isValidNavigateCell=function(t){return!!this.rowPositionUtils.getRowNode(t)},n.prototype.getLastCellOfColSpan=function(t){var e=this.getComponentForCell(t);if(!e)return t;var o=e.getColSpanningList();return 1===o.length?t:{rowIndex:t.rowIndex,column:d(o),rowPinned:t.rowPinned}},n.prototype.ensureCellVisible=function(t){o(t.rowPinned)&&this.gridPanel.ensureIndexVisible(t.rowIndex),t.column.isPinned()||this.gridPanel.ensureColumnVisible(t.column),this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter(),this.animationFrameService.flushAllFrames()},n.prototype.startEditingCell=function(t,e,o){var n=this.getComponentForCell(t);n&&n.startRowOrCellEdit(e,o)},n.prototype.getRowCompByPosition=function(t){var e;switch(t.rowPinned){case ht.PINNED_TOP:e=this.floatingTopRowComps[t.rowIndex];break;case ht.PINNED_BOTTOM:e=this.floatingBottomRowComps[t.rowIndex];break;default:e=this.rowCompsByIndex[t.rowIndex]}return e},n.prototype.getComponentForCell=function(t){var e=this.getRowCompByPosition(t);return e?e.getRenderedCellForColumn(t.column):null},n.prototype.getRowNode=function(t){switch(t.rowPinned){case ht.PINNED_TOP:return this.pinnedRowModel.getPinnedTopRowData()[t.rowIndex];case ht.PINNED_BOTTOM:return this.pinnedRowModel.getPinnedBottomRowData()[t.rowIndex];default:return this.rowModel.getRow(t.rowIndex)}},n.prototype.onTabKeyDown=function(t,e){var o=e.shiftKey;if(this.moveToCellAfter(t,o))e.preventDefault();else if(o){var n=t.getRowPosition(),i=n.rowIndex;if(n.rowPinned?0===i:i===this.paginationProxy.getPageFirstRow()){e.preventDefault();var r=this.beans.headerNavigationService.getHeaderRowCount()-1,s=d(this.columnController.getAllDisplayedColumns());this.focusController.focusHeaderPosition({headerRowIndex:r,column:s})}}else t instanceof vs&&t.focusCell(!0),this.focusController.focusNextGridCoreContainer(!1)&&e.preventDefault()},n.prototype.tabToNextCell=function(t){var e=this.focusController.getFocusedCell();if(o(e))return!1;var n=this.getComponentForCell(e);return!!(!o(n)||(n=this.getRowCompByPosition(e))&&n.isFullWidth())&&this.moveToCellAfter(n,t)},n.prototype.moveToCellAfter=function(t,e){return(t.isEditing()?this.gridOptionsWrapper.isFullRowEdit()?this.moveToNextEditingRow(t,e):this.moveToNextEditingCell(t,e):this.moveToNextCellNotEditing(t,e))||!!this.focusController.getFocusedHeader()},n.prototype.moveToNextEditingCell=function(t,o){var n=t.getCellPosition();t.stopEditing();var i=this.findNextCellToFocusOn(n,o,!0),r=e(i);return r&&i&&(i.startEditingIfEnabled(null,null,!0),i.focusCell(!1)),r},n.prototype.moveToNextEditingRow=function(t,o){var n=t.getCellPosition(),i=this.findNextCellToFocusOn(n,o,!0),r=e(i);return r&&i&&this.moveEditToNextCellOrRow(t,i),r},n.prototype.moveToNextCellNotEditing=function(t,o){var n,i=this.columnController.getAllDisplayedColumns();n=t instanceof Es?Os(Os({},t.getRowPosition()),{column:o?i[0]:d(i)}):t.getCellPosition();var r=this.findNextCellToFocusOn(n,o,!1);if(r instanceof vs)r.focusCell(!0);else if(r)return this.tryToFocusFullWidthRow(r.getRowPosition(),o);return e(r)},n.prototype.moveEditToNextCellOrRow=function(t,e){var o=t.getCellPosition(),n=e.getCellPosition();if(n&&o.rowIndex===n.rowIndex&&o.rowPinned===n.rowPinned)t.setFocusOutOnEditor(),e.setFocusInOnEditor();else{var i=t.getRenderedRow(),r=e.getRenderedRow();t.setFocusOutOnEditor(),i.stopEditing(),r.startRowEditing(),e.setFocusInOnEditor()}e.focusCell()},n.prototype.findNextCellToFocusOn=function(t,o,n){for(var i=t;;){o||(i=this.getLastCellOfColSpan(i)),i=this.cellNavigationService.getNextTabbedCell(i,o);var r=this.gridOptionsWrapper.getTabToNextCellFunc();if(e(r)){var s=r({backwards:o,editing:n,previousCellPosition:t,nextCellPosition:i||null});e(s)?(s.floating&&(z((function(){console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?")}),"no floating in userCell"),s.rowPinned=s.floating),i={rowIndex:s.rowIndex,column:s.column,rowPinned:s.rowPinned}):i=null}if(!i)return null;if(i.rowIndex<0){var a=this.beans.headerNavigationService.getHeaderRowCount();return this.focusController.focusHeaderPosition({headerRowIndex:a+i.rowIndex,column:i.column}),null}if(n){var l=this.lookupRowNodeForCell(i);if(!(l&&i.column.isCellEditable(l)))continue}this.ensureCellVisible(i);var p=this.getComponentForCell(i);if(p){if(!p.isSuppressNavigable())return this.rangeController&&this.rangeController.setRangeToCell(i),p}else{var u=this.getRowCompByPosition(i);if(u&&u.isFullWidth())return u}}},n.prototype.lookupRowNodeForCell=function(t){return t.rowPinned===ht.PINNED_TOP?this.pinnedRowModel.getPinnedTopRow(t.rowIndex):t.rowPinned===ht.PINNED_BOTTOM?this.pinnedRowModel.getPinnedBottomRow(t.rowIndex):this.paginationProxy.getRow(t.rowIndex)},n.prototype.isRangeInRenderedViewport=function(t,e){if(null==t||null==e)return!1;var o=t>this.lastRenderedRow;return!(e<this.firstRenderedRow)&&!o},Ps([it("paginationProxy")],n.prototype,"paginationProxy",void 0),Ps([it("columnController")],n.prototype,"columnController",void 0),Ps([it("$scope")],n.prototype,"$scope",void 0),Ps([it("pinnedRowModel")],n.prototype,"pinnedRowModel",void 0),Ps([it("rowModel")],n.prototype,"rowModel",void 0),Ps([it("focusController")],n.prototype,"focusController",void 0),Ps([it("cellNavigationService")],n.prototype,"cellNavigationService",void 0),Ps([it("columnApi")],n.prototype,"columnApi",void 0),Ps([it("gridApi")],n.prototype,"gridApi",void 0),Ps([it("beans")],n.prototype,"beans",void 0),Ps([it("maxDivHeightScaler")],n.prototype,"maxDivHeightScaler",void 0),Ps([it("animationFrameService")],n.prototype,"animationFrameService",void 0),Ps([it("rowPositionUtils")],n.prototype,"rowPositionUtils",void 0),Ps([rt("rangeController")],n.prototype,"rangeController",void 0),Ps([Ss(0,at("loggerFactory"))],n.prototype,"agWire",null),n=Ps([nt("rowRenderer")],n)}(Mt),function(){function t(){}return t.addHeaderClassesFromColDef=function(t,e,n,i,r){o(t)||this.addColumnClassesFromCollDef(t.headerClass,t,e,n,i,r)},t.addToolPanelClassesFromColDef=function(t,e,n,i,r){o(t)||this.addColumnClassesFromCollDef(t.toolPanelClass,t,e,n,i,r)},t.addColumnClassesFromCollDef=function(t,e,n,i,r,s){if(!o(t)){var a;if("function"==typeof t)a=t({colDef:e,column:r,columnGroup:s,context:i.getContext(),api:i.getApi()});else a=t;"string"==typeof a?Me(n,a):Array.isArray(a)&&a.forEach((function(t){Me(n,t)}))}},t}()),Ds=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),As=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ts=function(t){function e(e,o){var n=t.call(this)||this;return n.columns=e,n.element=o,n}return Ds(e,t),e.prototype.postConstruct=function(){this.addMouseHoverListeners()},e.prototype.addMouseHoverListeners=function(){this.addManagedListener(this.element,"mouseout",this.onMouseOut.bind(this)),this.addManagedListener(this.element,"mouseover",this.onMouseOver.bind(this))},e.prototype.onMouseOut=function(){this.columnHoverService.clearMouseOver()},e.prototype.onMouseOver=function(){this.columnHoverService.setMouseOver(this.columns)},As([it("columnHoverService")],e.prototype,"columnHoverService",void 0),As([et],e.prototype,"postConstruct",null),e}(Mt),_s=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Fs=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ns=function(t){function o(e,o,n,i){var r=t.call(this)||this;return r.columnOrGroup=e,r.eCell=o,r.ariaEl=r.eCell.querySelector("[role=columnheader]")||r.eCell,r.colsSpanning=i,r.beans=n,r.printLayout=n.gridOptionsWrapper.getDomLayout()===ht.DOM_LAYOUT_PRINT,r}return _s(o,t),o.prototype.setColsSpanning=function(t){this.colsSpanning=t,this.onLeftChanged()},o.prototype.getColumnOrGroup=function(){return this.beans.gridOptionsWrapper.isEnableRtl()&&this.colsSpanning?d(this.colsSpanning):this.columnOrGroup},o.prototype.postConstruct=function(){this.addManagedListener(this.columnOrGroup,yt.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.printLayout&&this.addManagedListener(this.eventService,Wt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this))},o.prototype.setLeftFirstTime=function(){var t=this.beans.gridOptionsWrapper.isSuppressColumnMoveAnimation(),o=e(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&o&&!t?this.animateInLeft():this.onLeftChanged()},o.prototype.animateInLeft=function(){var t=this,e=this.getColumnOrGroup().getLeft(),o=this.getColumnOrGroup().getOldLeft();this.setLeft(o),this.actualLeft=e,this.beans.columnAnimationService.executeNextVMTurn((function(){t.actualLeft===e&&t.setLeft(e)}))},o.prototype.onLeftChanged=function(){var t=this.getColumnOrGroup(),e=t.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(t,e),this.setLeft(this.actualLeft)},o.prototype.modifyLeftForPrintLayout=function(t,e){if(!this.printLayout)return e;if(t.getPinned()===ht.PINNED_LEFT)return e;var o=this.beans.columnController.getDisplayedColumnsLeftWidth();return t.getPinned()===ht.PINNED_RIGHT?o+this.beans.columnController.getBodyContainerWidth()+e:o+e},o.prototype.setLeft=function(t){var o;if(e(t)&&(this.eCell.style.left=t+"px"),this.columnOrGroup instanceof yt)o=this.columnOrGroup;else{var n=this.columnOrGroup.getLeafColumns();if(!n.length)return;n.length>1&&Yo(this.ariaEl,n.length),o=n[0]}var i=this.beans.columnController.getAriaColumnIndex(o);Ko(this.ariaEl,i)},Fs([et],o.prototype,"postConstruct",null),o}(Mt),Ls=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Is=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Gs=function(t){function e(e,o){var n=t.call(this,o)||this;return n.labelSeparator="",n.labelAlignment="left",n.label="",n.config=e||{},n}return Ls(e,t),e.prototype.postConstruct=function(){Me(this.getGui(),"ag-labeled"),Me(this.eLabel,"ag-label");var t=this.config,e=t.labelSeparator,o=t.label,n=t.labelWidth,i=t.labelAlignment;null!=e&&this.setLabelSeparator(e),null!=o&&this.setLabel(o),null!=n&&this.setLabelWidth(n),this.setLabelAlignment(i||this.labelAlignment),this.refreshLabel()},e.prototype.refreshLabel=function(){Je(this.eLabel),"string"==typeof this.label?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),""===this.label?(Me(this.eLabel,"ag-hidden"),this.eLabel.setAttribute("role","presentation")):(xe(this.eLabel,"ag-hidden"),this.eLabel.removeAttribute("role"))},e.prototype.setLabelSeparator=function(t){return this.labelSeparator===t||(this.labelSeparator=t,null!=this.label&&this.refreshLabel()),this},e.prototype.getLabelId=function(){return this.eLabel.id=this.eLabel.id||"ag-"+this.getCompId()+"-label",this.eLabel.id},e.prototype.getLabel=function(){return this.label},e.prototype.setLabel=function(t){return this.label===t||(this.label=t,this.refreshLabel()),this},e.prototype.setLabelAlignment=function(t){var e=this.getGui();return Ve(e,"ag-label-align-left","left"===t),Ve(e,"ag-label-align-right","right"===t),Ve(e,"ag-label-align-top","top"===t),this},e.prototype.setLabelWidth=function(t){return null==this.label||ho(this.eLabel,t),this},Is([et],e.prototype,"postConstruct",null),e}(xn),Ms=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),xs=function(t){function e(e,o,n){var i=t.call(this,e,o)||this;return i.className=n,i.disabled=!1,i}return Ms(e,t),e.prototype.postConstruct=function(){t.prototype.postConstruct.call(this),this.className&&Me(this.getGui(),this.className)},e.prototype.onValueChange=function(t){var o=this;return this.addManagedListener(this,e.EVENT_CHANGED,(function(){return t(o.getValue())})),this},e.prototype.getWidth=function(){return this.getGui().clientWidth},e.prototype.setWidth=function(t){return fo(this.getGui(),t),this},e.prototype.getPreviousValue=function(){return this.previousValue},e.prototype.getValue=function(){return this.value},e.prototype.setValue=function(t,o){return this.value===t||(this.previousValue=this.value,this.value=t,o||this.dispatchEvent({type:e.EVENT_CHANGED})),this},e.prototype.setDisabled=function(t){t=!!t;var e=this.getGui();return je(e,t),Ve(e,"ag-disabled",t),this.disabled=t,this},e.prototype.isDisabled=function(){return!!this.disabled},e.EVENT_CHANGED="valueChange",e}(Gs),Vs=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Hs=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ws=function(t){function o(e,o,n,i){void 0===n&&(n="text"),void 0===i&&(i="input");var r=t.call(this,e,'\n <div role="presentation">\n <div ref="eLabel" class="ag-input-field-label"></div>\n <div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">\n <'+i+' ref="eInput" class="ag-input-field-input"></'+i+">\n </div>\n </div>",o)||this;return r.inputType=n,r.displayFieldTag=i,r}return Vs(o,t),o.prototype.postConstruct=function(){t.prototype.postConstruct.call(this),this.setInputType(),Me(this.eLabel,this.className+"-label"),Me(this.eWrapper,this.className+"-input-wrapper"),Me(this.eInput,this.className+"-input"),Me(this.getGui(),"ag-input-field"),this.eInput.id=this.eInput.id||"ag-"+this.getCompId()+"-input";var e=this.config,o=e.width,n=e.value;null!=o&&this.setWidth(o),null!=n&&this.setValue(n),this.addInputListeners()},o.prototype.refreshLabel=function(){e(this.getLabel())?Go(this.eInput,this.getLabelId()):this.eInput.removeAttribute("aria-labelledby"),t.prototype.refreshLabel.call(this)},o.prototype.addInputListeners=function(){var t=this;this.addManagedListener(this.eInput,"input",(function(e){return t.setValue(e.target.value)}))},o.prototype.setInputType=function(){"input"===this.displayFieldTag&&this.eInput.setAttribute("type",this.inputType)},o.prototype.getInputElement=function(){return this.eInput},o.prototype.setInputWidth=function(t){return ho(this.eWrapper,t),this},o.prototype.setInputName=function(t){return this.getInputElement().setAttribute("name",t),this},o.prototype.getFocusableElement=function(){return this.eInput},o.prototype.setMaxLength=function(t){return this.eInput.maxLength=t,this},o.prototype.setInputPlaceholder=function(t){return Ro(this.eInput,"placeholder",t),this},o.prototype.setInputAriaLabel=function(t){return Io(this.eInput,t),this},o.prototype.setDisabled=function(e){return je(this.eInput,e),t.prototype.setDisabled.call(this,e)},Hs([Wn("eLabel")],o.prototype,"eLabel",void 0),Hs([Wn("eWrapper")],o.prototype,"eWrapper",void 0),Hs([Wn("eInput")],o.prototype,"eInput",void 0),o}(xs),ks=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Bs=function(t){function e(e,o,n){void 0===o&&(o="ag-checkbox"),void 0===n&&(n="checkbox");var i=t.call(this,e,o,n)||this;return i.labelAlignment="right",i.selected=!1,i.readOnly=!1,i.passive=!1,i}return ks(e,t),e.prototype.addInputListeners=function(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))},e.prototype.getNextValue=function(){return void 0===this.selected||!this.selected},e.prototype.setPassive=function(t){this.passive=t},e.prototype.isReadOnly=function(){return this.readOnly},e.prototype.setReadOnly=function(t){Ve(this.eWrapper,"ag-disabled",t),this.eInput.disabled=t,this.readOnly=t},e.prototype.setDisabled=function(e){return Ve(this.eWrapper,"ag-disabled",e),t.prototype.setDisabled.call(this,e)},e.prototype.toggle=function(){var t=this.isSelected(),e=this.getNextValue();this.passive?this.dispatchChange(e,t):this.setValue(e)},e.prototype.getValue=function(){return this.isSelected()},e.prototype.setValue=function(t,e){return this.refreshSelectedClass(t),this.setSelected(t,e),this},e.prototype.setName=function(t){return this.getInputElement().name=t,this},e.prototype.isSelected=function(){return this.selected},e.prototype.setSelected=function(t,e){this.isSelected()!==t&&(this.previousValue=this.isSelected(),t=this.selected="boolean"==typeof t?t:void 0,this.eInput.checked=t,this.eInput.indeterminate=void 0===t,e||this.dispatchChange(this.selected,this.previousValue))},e.prototype.dispatchChange=function(t,o,n){this.dispatchEvent({type:e.EVENT_CHANGED,selected:t,previousValue:o,event:n});var i=this.getInputElement(),r={type:Wt.EVENT_CHECKBOX_CHANGED,id:i.id,name:i.name,selected:t,previousValue:o};this.eventService.dispatchEvent(r)},e.prototype.onCheckboxClick=function(t){if(!this.passive){var e=this.isSelected(),o=this.selected=t.target.checked;this.refreshSelectedClass(o),this.dispatchChange(o,e,t)}},e.prototype.refreshSelectedClass=function(t){Ve(this.eWrapper,"ag-checked",!0===t),Ve(this.eWrapper,"ag-indeterminate",null==t)},e}(Ws),js=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Us=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},zs=function(t){function e(e,o){var n=t.call(this)||this;n.cbSelectAllVisible=!1,n.processingEventFromCheckbox=!1,n.cbSelectAll=e,n.column=o;var i=o.getColDef();return n.filteredOnly=!!i&&!!i.headerCheckboxSelectionFilteredOnly,n}return js(e,t),e.prototype.postConstruct=function(){this.showOrHideSelectAll(),this.addManagedListener(this.eventService,Wt.EVENT_NEW_COLUMNS_LOADED,this.showOrHideSelectAll.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.showOrHideSelectAll.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,Bs.EVENT_CHANGED,this.onCbSelectAll.bind(this)),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()},e.prototype.showOrHideSelectAll=function(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible),this.cbSelectAllVisible&&(this.checkRightRowModelType(),this.updateStateOfCheckbox()),this.refreshHeaderAriaDescribedBy(this.cbSelectAllVisible)},e.prototype.refreshHeaderAriaDescribedBy=function(t){var e=this.cbSelectAll.getParentComponent(),o=e&&e.getGui();if(o&&eo(o)){var n="";o&&(n=Lo(o));var i=this.cbSelectAll.getInputElement().id,r=-1!==n.indexOf(i);t?r||Mo(o,i+" "+n.trim()):r&&Mo(o,n.trim().split(" ").filter((function(t){return t===i})).join(" "))}},e.prototype.onModelChanged=function(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()},e.prototype.onSelectionChanged=function(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()},e.prototype.getNextCheckboxState=function(t){return(0!==t.selected||0!==t.notSelected)&&(t.selected>0&&t.notSelected>0?null:t.selected>0)},e.prototype.updateStateOfCheckbox=function(){if(!this.processingEventFromCheckbox){this.processingEventFromCheckbox=!0;var t=this.getSelectionCount(),e=this.getNextCheckboxState(t);this.cbSelectAll.setValue(e),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}},e.prototype.refreshSelectAllLabel=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),e=this.cbSelectAll.getValue()?t("ariaChecked","checked"):t("ariaUnchecked","unchecked"),o=t("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAll.setInputAriaLabel(o+" ("+e+")")},e.prototype.getSelectionCount=function(){var t=this,e=0,o=0,n=function(n){t.gridOptionsWrapper.isGroupSelectsChildren()&&n.group||(n.isSelected()?e++:n.selectable&&o++)};return this.filteredOnly?this.gridApi.forEachNodeAfterFilter(n):this.gridApi.forEachNode(n),{notSelected:o,selected:e}},e.prototype.checkRightRowModelType=function(){var t=this.rowModel.getType();t===ht.ROW_MODEL_TYPE_CLIENT_SIDE||console.warn("AG Grid: selectAllCheckbox is only available if using normal row model, you are using "+t)},e.prototype.onCbSelectAll=function(){this.processingEventFromCheckbox||this.cbSelectAllVisible&&(this.cbSelectAll.getValue()?this.selectionController.selectAllRowNodes(this.filteredOnly):this.selectionController.deselectAllRowNodes(this.filteredOnly))},e.prototype.isCheckboxSelection=function(){var t=this.column.getColDef().headerCheckboxSelection;"function"==typeof t&&(t=t({column:this.column,colDef:this.column.getColDef(),columnApi:this.columnApi,api:this.gridApi}));return!!t&&(this.gridOptionsWrapper.isRowModelServerSide()?(console.warn("headerCheckboxSelection is not supported for Server Side Row Model"),!1):this.gridOptionsWrapper.isRowModelInfinite()?(console.warn("headerCheckboxSelection is not supported for Infinite Row Model"),!1):!this.gridOptionsWrapper.isRowModelViewport()||(console.warn("headerCheckboxSelection is not supported for Viewport Row Model"),!1))},Us([it("gridApi")],e.prototype,"gridApi",void 0),Us([it("columnApi")],e.prototype,"columnApi",void 0),Us([it("rowModel")],e.prototype,"rowModel",void 0),Us([it("selectionController")],e.prototype,"selectionController",void 0),Us([et],e.prototype,"postConstruct",null),e}(Mt),Ks=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Ys=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ks(e,t),e.prototype.shouldStopEventPropagation=function(t){var e=this.focusController.getFocusedHeader(),o=e.headerRowIndex,n=e.column;return yn(this.gridOptionsWrapper,t,o,n)},e.prototype.getColumn=function(){return this.column},e.prototype.getPinned=function(){return this.pinned},e}(Zn),qs=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Xs=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Qs=function(t){function e(o,n){var i=t.call(this,e.TEMPLATE)||this;return i.headerCompVersion=0,i.refreshFunctions=[],i.column=o,i.pinned=n,i}return qs(e,t),e.prototype.postConstruct=function(){t.prototype.postConstruct.call(this),this.colDefVersion=this.columnController.getColDefVersion(),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupTooltip(),this.setupResize(),this.setupMenuClass(),this.setupSortableClass(),this.addColumnHoverListener(),this.addActiveHeaderMouseListeners(),this.createManagedBean(new Ts([this.column],this.getGui())),this.addManagedListener(this.column,yt.EVENT_FILTER_ACTIVE_CHANGED,this.onFilterChanged.bind(this)),this.onFilterChanged(),this.createManagedBean(new zs(this.cbSelectAll,this.column)),this.cbSelectAll.setParentComponent(this),this.createManagedBean(new Ns(this.column,this.getGui(),this.beans)),this.addAttributes(),bs.addHeaderClassesFromColDef(this.column.getColDef(),this.getGui(),this.gridOptionsWrapper,this.column,null),this.addManagedListener(this.eventService,Wt.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.appendHeaderComp()},e.prototype.onColumnRowGroupChanged=function(){this.checkDisplayName()},e.prototype.onColumnPivotChanged=function(){this.checkDisplayName()},e.prototype.onColumnValueChanged=function(){this.checkDisplayName()},e.prototype.checkDisplayName=function(){this.displayName!==this.calculateDisplayName()&&this.refresh()},e.prototype.updateState=function(){var t=this.column.getColDef();this.sortable=t.sortable,this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()},e.prototype.calculateDisplayName=function(){return this.columnController.getDisplayNameForColumn(this.column,"header",!0)},e.prototype.onNewColumnsLoaded=function(){var t=this.columnController.getColDefVersion();t!=this.colDefVersion&&(this.colDefVersion=t,this.refresh())},e.prototype.refresh=function(){this.updateState();var t=this.column.getColDef();if(!(this.colDefHeaderComponent!=t.headerComponent||this.colDefHeaderComponentFramework!=t.headerComponentFramework)&&this.attemptHeaderCompRefresh()){var e=this.draggable&&!this.moveDragSource,o=!this.draggable&&this.moveDragSource;(e||o)&&this.attachDraggingToHeaderComp()}else this.appendHeaderComp();this.refreshFunctions.forEach((function(t){return t()}))},e.prototype.destroyHeaderComp=function(){this.headerComp&&(this.getGui().removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0),this.removeMoveDragSource()},e.prototype.removeMoveDragSource=function(){this.moveDragSource&&(this.dragAndDropService.removeDragSource(this.moveDragSource),this.moveDragSource=void 0)},e.prototype.attemptHeaderCompRefresh=function(){if(!this.headerComp)return!0;if(!this.headerComp.refresh)return!1;var t=this.createParams(),e=this.userComponentFactory.createFinalParams(this.getComponentHolder(),"headerComponent",t);return this.headerComp.refresh(e)},e.prototype.addActiveHeaderMouseListeners=function(){var t=this,e=function(e){return t.setActiveHeader("mouseenter"===e.type)};this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e)},e.prototype.setActiveHeader=function(t){Ve(this.getGui(),"ag-header-active",t)},e.prototype.onFocusIn=function(t){if(!this.getGui().contains(t.relatedTarget)){var e=this.getParentComponent();this.focusController.setFocusedHeader(e.getRowIndex(),this.getColumn())}this.setActiveHeader(!0)},e.prototype.onFocusOut=function(t){this.getGui().contains(t.relatedTarget)||this.setActiveHeader(!1)},e.prototype.handleKeyDown=function(t){var e=this.headerComp;if(e){if(t.keyCode===jn.SPACE){var o=this.cbSelectAll;o.isDisplayed()&&!o.getGui().contains(document.activeElement)&&(t.preventDefault(),o.setValue(!o.getValue()))}if(t.keyCode===jn.ENTER)if(t.ctrlKey||t.metaKey)this.menuEnabled&&e.showMenu&&(t.preventDefault(),e.showMenu());else if(this.sortable){var n=t.shiftKey;this.sortController.progressSort(this.column,n,"uiColumnSorted")}}},e.prototype.onTabKeyDown=function(){},e.prototype.getComponentHolder=function(){return this.column.getColDef()},e.prototype.addColumnHoverListener=function(){this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_HOVER_CHANGED,this.onColumnHover.bind(this)),this.onColumnHover()},e.prototype.onColumnHover=function(){var t=this.columnHoverService.isHovered(this.column);Ve(this.getGui(),"ag-column-hover",t)},e.prototype.setupSortableClass=function(){var t=this,e=this.getGui(),o=function(){Ve(e,"ag-header-cell-sortable",!!t.sortable)},n=function(){t.sortable?qo(e,Fo(t.column)):Xo(e)};o(),n(),this.refreshFunctions.push(o),this.refreshFunctions.push(n),this.addManagedListener(this.column,yt.EVENT_SORT_CHANGED,n.bind(this))},e.prototype.onFilterChanged=function(){var t=this.column.isFilterActive();Ve(this.getGui(),"ag-header-cell-filtered",t)},e.prototype.appendHeaderComp=function(){this.headerCompVersion++;var t=this.column.getColDef();this.colDefHeaderComponent=t.headerComponent,this.colDefHeaderComponentFramework=t.headerComponentFramework;var e=this.createParams(),o=this.afterHeaderCompCreated.bind(this,this.headerCompVersion);this.userComponentFactory.newHeaderComponent(e).then(o)},e.prototype.createParams=function(){var t=this,e=this.column.getColDef();return this.menuEnabled=this.menuFactory.isMenuEnabled(this.column)&&!e.suppressMenu,{column:this.column,displayName:this.displayName,enableSorting:e.sortable,enableMenu:this.menuEnabled,showColumnMenu:function(e){t.gridApi.showColumnMenuAfterButtonClick(t.column,e)},progressSort:function(e){t.sortController.progressSort(t.column,!!e,"uiColumnSorted")},setSort:function(e,o){t.sortController.setSortForColumn(t.column,e,!!o,"uiColumnSorted")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext(),eGridHeader:this.getGui()}},e.prototype.afterHeaderCompCreated=function(t,e){t==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=e,this.headerCompGui=e.getGui(),this.getGui().appendChild(this.headerCompGui),this.attachDraggingToHeaderComp()):this.destroyBean(e)},e.prototype.onColumnMovingChanged=function(){this.column.isMoving()?Me(this.getGui(),"ag-header-cell-moving"):xe(this.getGui(),"ag-header-cell-moving")},e.prototype.workOutDraggable=function(){var t=this.column.getColDef();return!!(!this.gridOptionsWrapper.isSuppressMovableColumns()&&!t.suppressMovable&&!t.lockPosition)||!!t.enableRowGroup||!!t.enablePivot},e.prototype.attachDraggingToHeaderComp=function(){var t=this;this.removeMoveDragSource(),this.draggable&&(this.moveDragSource={type:$r.HeaderCell,eElement:this.headerCompGui,defaultIconName:ns.ICON_HIDE,getDragItem:function(){return t.createDragItem()},dragItemName:this.displayName,onDragStarted:function(){return t.column.setMoving(!0,"uiColumnMoved")},onDragStopped:function(){return t.column.setMoving(!1,"uiColumnMoved")}},this.dragAndDropService.addDragSource(this.moveDragSource,!0))},e.prototype.createDragItem=function(){var t={};return t[this.column.getId()]=this.column.isVisible(),{columns:[this.column],visibleState:t}},e.prototype.setupResize=function(){var t,e,o=this,n=this.getComponentHolder(),i=[],r=function(){i.forEach((function(t){return t()})),i.length=0},s=function(){var s=o.column.isResizable(),a=!o.gridOptionsWrapper.isSuppressAutoSize()&&!n.suppressAutoSize;(s!==t||a!==e)&&(t=s,e=a,r(),function(){if(ke(o.eResize,t),t){var n=o.horizontalResizeService.addResizeBar({eResizeBar:o.eResize,onResizeStart:o.onResizeStart.bind(o),onResizing:o.onResizing.bind(o,!1),onResizeEnd:o.onResizing.bind(o,!0)});if(i.push(n),e){var r=o.gridOptionsWrapper.isSkipHeaderOnAutoSize(),s=function(){o.columnController.autoSizeColumn(o.column,r,"uiColumnResized")};o.eResize.addEventListener("dblclick",s);var a=new ci(o.eResize);a.addEventListener(ci.EVENT_DOUBLE_TAP,s),o.addDestroyFunc((function(){o.eResize.removeEventListener("dblclick",s),a.removeEventListener(ci.EVENT_DOUBLE_TAP,s),a.destroy()}))}}}())};s(),this.addDestroyFunc(r),this.refreshFunctions.push(s)},e.prototype.onResizing=function(t,e){var o=this.normaliseResizeAmount(e),n=[{key:this.column,newWidth:this.resizeStartWidth+o}];this.columnController.setColumnWidths(n,this.resizeWithShiftKey,t,"uiColumnDragged"),t&&xe(this.getGui(),"ag-column-resizing")},e.prototype.onResizeStart=function(t){this.resizeStartWidth=this.column.getActualWidth(),this.resizeWithShiftKey=t,Me(this.getGui(),"ag-column-resizing")},e.prototype.getTooltipParams=function(){var e=t.prototype.getTooltipParams.call(this);return e.location="header",e.colDef=this.column.getColDef(),e},e.prototype.setupTooltip=function(){var t=this,e=function(){var e=t.column.getColDef().headerTooltip;t.setTooltip(e)};e(),this.refreshFunctions.push(e)},e.prototype.setupMovingCss=function(){this.addManagedListener(this.column,yt.EVENT_MOVING_CHANGED,this.onColumnMovingChanged.bind(this)),this.onColumnMovingChanged()},e.prototype.addAttributes=function(){this.getGui().setAttribute("col-id",this.column.getColId())},e.prototype.setupWidth=function(){this.addManagedListener(this.column,yt.EVENT_WIDTH_CHANGED,this.onColumnWidthChanged.bind(this)),this.onColumnWidthChanged()},e.prototype.setupMenuClass=function(){this.addManagedListener(this.column,yt.EVENT_MENU_VISIBLE_CHANGED,this.onMenuVisible.bind(this))},e.prototype.onMenuVisible=function(){this.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())},e.prototype.onColumnWidthChanged=function(){this.getGui().style.width=this.column.getActualWidth()+"px"},e.prototype.normaliseResizeAmount=function(t){var e=t;return this.gridOptionsWrapper.isEnableRtl()?this.pinned!==ht.PINNED_LEFT&&(e*=-1):this.pinned===ht.PINNED_RIGHT&&(e*=-1),e},e.TEMPLATE='<div class="ag-header-cell" role="columnheader" unselectable="on" tabindex="-1">\n <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n <ag-checkbox ref="cbSelectAll" class="ag-header-select-all" role="presentation"></ag-checkbox>\n </div>',Xs([it("dragAndDropService")],e.prototype,"dragAndDropService",void 0),Xs([it("columnController")],e.prototype,"columnController",void 0),Xs([it("horizontalResizeService")],e.prototype,"horizontalResizeService",void 0),Xs([it("menuFactory")],e.prototype,"menuFactory",void 0),Xs([it("gridApi")],e.prototype,"gridApi",void 0),Xs([it("columnApi")],e.prototype,"columnApi",void 0),Xs([it("sortController")],e.prototype,"sortController",void 0),Xs([it("userComponentFactory")],e.prototype,"userComponentFactory",void 0),Xs([it("columnHoverService")],e.prototype,"columnHoverService",void 0),Xs([it("beans")],e.prototype,"beans",void 0),Xs([Wn("eResize")],e.prototype,"eResize",void 0),Xs([Wn("cbSelectAll")],e.prototype,"cbSelectAll",void 0),Xs([ot],e.prototype,"destroyHeaderComp",null),e}(Ys),$s=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Zs=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Js=function(t){function e(o,n){var i=t.call(this,e.TEMPLATE)||this;return i.removeChildListenersFuncs=[],i.column=o,i.pinned=n,i}return $s(e,t),e.prototype.postConstruct=function(){t.prototype.postConstruct.call(this),bs.addHeaderClassesFromColDef(this.getComponentHolder(),this.getGui(),this.gridOptionsWrapper,null,this.column);var e=this.columnController.getDisplayNameForColumnGroup(this.column,"header");this.appendHeaderGroupComp(e),this.setupResize(),this.addClasses(),this.setupWidth(),this.addAttributes(),this.setupMovingCss(),this.setupTooltip(),this.setupExpandable(),this.createManagedBean(new Ts(this.column.getOriginalColumnGroup().getLeafColumns(),this.getGui())),this.createManagedBean(new Ns(this.column,this.getGui(),this.beans))},e.prototype.onFocusIn=function(t){if(!this.getGui().contains(t.relatedTarget)){var e=this.getParentComponent();this.beans.focusController.setFocusedHeader(e.getRowIndex(),this.getColumn())}},e.prototype.handleKeyDown=function(t){var e=document.activeElement===this.getGui();if(this.expandable&&e&&t.keyCode===jn.ENTER){var o=this.getColumn(),n=!o.isExpanded();this.columnController.setColumnGroupOpened(o.getOriginalColumnGroup(),n,"uiColumnExpanded")}},e.prototype.onTabKeyDown=function(){},e.prototype.setupExpandable=function(){var t=this.getColumn().getOriginalColumnGroup();this.refreshExpanded(),this.addManagedListener(t,Ct.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(t,Ct.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))},e.prototype.refreshExpanded=function(){var t=this.getColumn(),e=this.getGui(),o=t.isExpandable(),n=t.isExpanded();this.expandable=o,o?Vo(e,n):e.removeAttribute("aria-expanded")},e.prototype.setupMovingCss=function(){var t=this;this.column.getOriginalColumnGroup().getLeafColumns().forEach((function(e){t.addManagedListener(e,yt.EVENT_MOVING_CHANGED,t.onColumnMovingChanged.bind(t))})),this.onColumnMovingChanged()},e.prototype.getComponentHolder=function(){return this.column.getColGroupDef()},e.prototype.getTooltipParams=function(){var e=t.prototype.getTooltipParams.call(this);return e.location="headerGroup",e.colDef=this.getComponentHolder(),e.column=this.getColumn(),e},e.prototype.setupTooltip=function(){var t=this.getComponentHolder(),e=t&&t.headerTooltip;null!=e&&this.setTooltip(e)},e.prototype.onColumnMovingChanged=function(){Ve(this.getGui(),"ag-header-cell-moving",this.column.isMoving())},e.prototype.addAttributes=function(){this.getGui().setAttribute("col-id",this.column.getUniqueId())},e.prototype.appendHeaderGroupComp=function(t){var e=this,o={displayName:t,columnGroup:this.column,setExpanded:function(t){e.columnController.setColumnGroupOpened(e.column.getOriginalColumnGroup(),t,"gridInitializing")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()};if(!t){for(var n=this.column,i=n.getLeafColumns();n.getParent()&&n.getParent().getLeafColumns().length===i.length;)n=n.getParent();var r=n.getColGroupDef();r&&(t=r.headerName),t||(t=i?this.columnController.getDisplayNameForColumn(i[0],"header",!0):"")}var s=this.afterHeaderCompCreated.bind(this,t);this.userComponentFactory.newHeaderGroupComponent(o).then(s)},e.prototype.afterHeaderCompCreated=function(t,e){var o=this;this.getGui().appendChild(e.getGui()),this.addDestroyFunc((function(){o.getContext().destroyBean(e)})),this.setupMove(e.getGui(),t)},e.prototype.addClasses=function(){var t=this.column.isPadding()?"no":"with";this.addCssClass("ag-header-group-cell-"+t+"-group")},e.prototype.setupMove=function(t,e){var o=this;if(t&&!this.isSuppressMoving()){var n=this.column.getOriginalColumnGroup().getLeafColumns(),i={type:$r.HeaderCell,eElement:t,defaultIconName:ns.ICON_HIDE,dragItemName:e,getDragItem:this.getDragItemForGroup.bind(this),onDragStarted:function(){return n.forEach((function(t){return t.setMoving(!0,"uiColumnDragged")}))},onDragStopped:function(){return n.forEach((function(t){return t.setMoving(!1,"uiColumnDragged")}))}};this.dragAndDropService.addDragSource(i,!0),this.addDestroyFunc((function(){return o.dragAndDropService.removeDragSource(i)}))}},e.prototype.getDragItemForGroup=function(){var t=this.column.getOriginalColumnGroup().getLeafColumns(),e={};t.forEach((function(t){return e[t.getId()]=t.isVisible()}));var o=[];return this.columnController.getAllDisplayedColumns().forEach((function(e){t.indexOf(e)>=0&&(o.push(e),g(t,e))})),t.forEach((function(t){return o.push(t)})),{columns:o,visibleState:e}},e.prototype.isSuppressMoving=function(){var t=!1;return this.column.getLeafColumns().forEach((function(e){(e.getColDef().suppressMovable||e.getColDef().lockPosition)&&(t=!0)})),t||this.gridOptionsWrapper.isSuppressMovableColumns()},e.prototype.setupWidth=function(){this.addListenersToChildrenColumns(),this.addManagedListener(this.column,mt.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))},e.prototype.onDisplayedChildrenChanged=function(){this.addListenersToChildrenColumns(),this.onWidthChanged()},e.prototype.addListenersToChildrenColumns=function(){var t=this;this.removeListenersOnChildrenColumns();var e=this.onWidthChanged.bind(this);this.column.getLeafColumns().forEach((function(o){o.addEventListener(yt.EVENT_WIDTH_CHANGED,e),o.addEventListener(yt.EVENT_VISIBLE_CHANGED,e),t.removeChildListenersFuncs.push((function(){o.removeEventListener(yt.EVENT_WIDTH_CHANGED,e),o.removeEventListener(yt.EVENT_VISIBLE_CHANGED,e)}))}))},e.prototype.removeListenersOnChildrenColumns=function(){this.removeChildListenersFuncs.forEach((function(t){return t()})),this.removeChildListenersFuncs=[]},e.prototype.onWidthChanged=function(){this.getGui().style.width=this.column.getActualWidth()+"px"},e.prototype.setupResize=function(){var t=this;if(this.eHeaderCellResize=this.getRefElement("agResize"),this.column.isResizable()){var e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eHeaderCellResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gridOptionsWrapper.isSuppressAutoSize()){var o=this.gridOptionsWrapper.isSkipHeaderOnAutoSize();this.eHeaderCellResize.addEventListener("dblclick",(function(e){var n=[];t.column.getDisplayedLeafColumns().forEach((function(t){t.getColDef().suppressAutoSize||n.push(t.getColId())})),n.length>0&&t.columnController.autoSizeColumns(n,o,"uiColumnResized")}))}}else to(this.eHeaderCellResize)},e.prototype.onResizeStart=function(t){var e=this,o=this.column.getDisplayedLeafColumns();this.resizeCols=o.filter((function(t){return t.isResizable()})),this.resizeStartWidth=0,this.resizeCols.forEach((function(t){return e.resizeStartWidth+=t.getActualWidth()})),this.resizeRatios=[],this.resizeCols.forEach((function(t){return e.resizeRatios.push(t.getActualWidth()/e.resizeStartWidth)}));var n=null;if(t&&(n=this.columnController.getDisplayedGroupAfter(this.column)),n){var i=n.getDisplayedLeafColumns();this.resizeTakeFromCols=i.filter((function(t){return t.isResizable()})),this.resizeTakeFromStartWidth=0,this.resizeTakeFromCols.forEach((function(t){return e.resizeTakeFromStartWidth+=t.getActualWidth()})),this.resizeTakeFromRatios=[],this.resizeTakeFromCols.forEach((function(t){return e.resizeTakeFromRatios.push(t.getActualWidth()/e.resizeTakeFromStartWidth)}))}else this.resizeTakeFromCols=null,this.resizeTakeFromStartWidth=null,this.resizeTakeFromRatios=null;Me(this.getGui(),"ag-column-resizing")},e.prototype.onResizing=function(t,e){var o=[],n=this.normaliseDragChange(e);o.push({columns:this.resizeCols,ratios:this.resizeRatios,width:this.resizeStartWidth+n}),this.resizeTakeFromCols&&o.push({columns:this.resizeTakeFromCols,ratios:this.resizeTakeFromRatios,width:this.resizeTakeFromStartWidth-n}),this.columnController.resizeColumnSets(o,t,"uiColumnDragged"),t&&xe(this.getGui(),"ag-column-resizing")},e.prototype.normaliseDragChange=function(t){var e=t;return this.gridOptionsWrapper.isEnableRtl()?this.pinned!==ht.PINNED_LEFT&&(e*=-1):this.pinned===ht.PINNED_RIGHT&&(e*=-1),e},e.TEMPLATE='<div class="ag-header-group-cell" role="columnheader" tabindex="-1">\n <div ref="agResize" class="ag-header-cell-resize" role="presentation"></div>\n </div>',Zs([it("columnController")],e.prototype,"columnController",void 0),Zs([it("horizontalResizeService")],e.prototype,"horizontalResizeService",void 0),Zs([it("dragAndDropService")],e.prototype,"dragAndDropService",void 0),Zs([it("userComponentFactory")],e.prototype,"userComponentFactory",void 0),Zs([it("beans")],e.prototype,"beans",void 0),Zs([it("gridApi")],e.prototype,"gridApi",void 0),Zs([it("columnApi")],e.prototype,"columnApi",void 0),e}(Ys),ta=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ea=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},oa=function(t){function e(){return t.call(this,'\n <div class="ag-floating-filter-input" role="presentation">\n <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>\n </div>')||this}return ta(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this)},e.prototype.init=function(t){this.params=t;var e=this.columnController.getDisplayNameForColumn(t.column,"header",!0),o=this.gridOptionsWrapper.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(e+" "+o("ariaFilterInput","Filter Input"))},e.prototype.onParentModelChanged=function(t){var e=this;t?this.params.parentFilterInstance((function(o){if(o.getModelAsString){var n=o.getModelAsString(t);e.eFloatingFilterText.setValue(n)}})):this.eFloatingFilterText.setValue("")},ea([Wn("eFloatingFilterText")],e.prototype,"eFloatingFilterText",void 0),ea([it("columnController")],e.prototype,"columnController",void 0),e}(xn),na=function(){function t(){}return t.getFloatingFilterType=function(t){return this.filterToFloatingFilterMapping[t]},t.filterToFloatingFilterMapping={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"},t}(),ia=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ra=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},sa=function(t){function e(o,n){var i=t.call(this,e.TEMPLATE)||this;return i.column=o,i.pinned=n,i}return ia(e,t),e.prototype.postConstruct=function(){t.prototype.postConstruct.call(this),this.setupFloatingFilter(),this.setupWidth(),this.setupLeftPositioning(),this.setupColumnHover(),this.createManagedBean(new Ts([this.column],this.getGui())),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this))},e.prototype.onTabKeyDown=function(t){var e=document.activeElement,o=this.getGui();if(!(e===o)){t.preventDefault();var n=this.focusController.findNextFocusableElement(o,null,t.shiftKey);n?n.focus():o.focus()}},e.prototype.handleKeyDown=function(t){var e=document.activeElement,o=this.getGui(),n=e===o;switch(t.keyCode){case jn.UP:case jn.DOWN:n||t.preventDefault();case jn.LEFT:case jn.RIGHT:if(n)return;t.stopPropagation();case jn.ENTER:n&&this.focusController.focusInto(o)&&t.preventDefault();break;case jn.ESCAPE:n||this.getGui().focus()}},e.prototype.onFocusIn=function(t){if(!this.getGui().contains(t.relatedTarget)){var e=this.getParentComponent();this.beans.focusController.setFocusedHeader(e.getRowIndex(),this.getColumn())}},e.prototype.setupFloatingFilter=function(){var t=this,e=this.column.getColDef();e.filter&&e.floatingFilter&&(this.floatingFilterCompPromise=this.getFloatingFilterInstance(),this.floatingFilterCompPromise&&this.floatingFilterCompPromise.then((function(e){e&&(t.setupWithFloatingFilter(e),t.setupSyncWithFilter())})))},e.prototype.setupLeftPositioning=function(){var t=new Ns(this.column,this.getGui(),this.beans);this.createManagedBean(t)},e.prototype.setupSyncWithFilter=function(){var t=this,e=function(e){t.onParentModelChanged(t.currentParentModel(),e)};this.addManagedListener(this.column,yt.EVENT_FILTER_CHANGED,e),this.filterManager.isFilterActive(this.column)&&e(null)},e.prototype.showParentFilter=function(){var t=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuFactory.showMenuAfterButtonClick(this.column,t,"filterMenuTab",["filterMenuTab"])},e.prototype.setupColumnHover=function(){this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_HOVER_CHANGED,this.onColumnHover.bind(this)),this.onColumnHover()},e.prototype.onColumnHover=function(){Ve(this.getGui(),"ag-column-hover",this.columnHoverService.isHovered(this.column))},e.prototype.setupWidth=function(){this.addManagedListener(this.column,yt.EVENT_WIDTH_CHANGED,this.onColumnWidthChanged.bind(this)),this.onColumnWidthChanged()},e.prototype.onColumnWidthChanged=function(){this.getGui().style.width=this.column.getActualWidth()+"px"},e.prototype.setupWithFloatingFilter=function(t){var e=this,o=function(){e.getContext().destroyBean(t)};if(this.isAlive()){this.addDestroyFunc(o);var n=t.getGui();Ve(this.eFloatingFilterBody,"ag-floating-filter-full-body",this.suppressFilterButton),Ve(this.eFloatingFilterBody,"ag-floating-filter-body",!this.suppressFilterButton),ke(this.eButtonWrapper,!this.suppressFilterButton);var i=cn("filter",this.gridOptionsWrapper,this.column);this.eButtonShowMainFilter.appendChild(i),this.eFloatingFilterBody.appendChild(n),t.afterGuiAttached&&t.afterGuiAttached()}else o()},e.prototype.parentFilterInstance=function(t){var e=this.getFilterComponent();e&&e.then(t)},e.prototype.getFilterComponent=function(t){return void 0===t&&(t=!0),this.filterManager.getFilterComponent(this.column,"NO_UI",t)},e.getDefaultFloatingFilterType=function(t){if(null==t)return null;var e=null;if("string"==typeof t.filter)e=na.getFloatingFilterType(t.filter);else if(t.filterFramework);else if(!0===t.filter){e=ft.isRegistered(pt.SetFilterModule)?"agSetColumnFloatingFilter":"agTextColumnFloatingFilter"}return e},e.prototype.getFloatingFilterInstance=function(){var t=this.column.getColDef(),o=e.getDefaultFloatingFilterType(t),n=this.filterManager.createFilterParams(this.column,t),i=this.userComponentFactory.createFinalParams(t,"filter",n),r={api:this.gridApi,column:this.column,filterParams:i,currentParentModel:this.currentParentModel.bind(this),parentFilterInstance:this.parentFilterInstance.bind(this),showParentFilter:this.showParentFilter.bind(this),onFloatingFilterChanged:this.onFloatingFilterChanged.bind(this),suppressFilterButton:!1};this.suppressFilterButton=!!t.floatingFilterComponentParams&&!!t.floatingFilterComponentParams.suppressFilterButton;var s=this.userComponentFactory.newFloatingFilterComponent(t,r,o);if(!s){var a=this.getFilterComponentPrototype(t);if(a&&a.prototype&&a.prototype.getModelAsString){var l=this.userComponentFactory.createUserComponentFromConcreteClass(oa,r);s=Tn.resolve(l)}}return s},e.prototype.createDynamicParams=function(){return{column:this.column,colDef:this.column.getColDef(),api:this.gridApi,columnApi:this.columnApi}},e.prototype.getFilterComponentPrototype=function(t){var e=this.userComponentFactory.lookupComponentClassDef(t,"filter",this.createDynamicParams());return e?e.component:null},e.prototype.currentParentModel=function(){var t=this.getFilterComponent(!1);return t?t.resolveNow(null,(function(t){return t&&t.getModel()})):null},e.prototype.onParentModelChanged=function(t,e){this.floatingFilterCompPromise&&this.floatingFilterCompPromise.then((function(o){return o&&o.onParentModelChanged(t,e)}))},e.prototype.onFloatingFilterChanged=function(){console.warn("AG Grid: since version 21.x, how floating filters are implemented has changed. Instead of calling params.onFloatingFilterChanged(), get a reference to the main filter via params.parentFilterInstance() and then set a value on the parent filter directly.")},e.TEMPLATE='<div class="ag-header-cell" role="columnheader" tabindex="-1">\n <div class="ag-floating-filter-full-body" ref="eFloatingFilterBody" role="presentation"></div>\n <div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">\n <button type="button" aria-label="Open Filter Menu" class="ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>\n </div>\n </div>',ra([it("columnHoverService")],e.prototype,"columnHoverService",void 0),ra([it("userComponentFactory")],e.prototype,"userComponentFactory",void 0),ra([it("gridApi")],e.prototype,"gridApi",void 0),ra([it("columnApi")],e.prototype,"columnApi",void 0),ra([it("filterManager")],e.prototype,"filterManager",void 0),ra([it("menuFactory")],e.prototype,"menuFactory",void 0),ra([it("beans")],e.prototype,"beans",void 0),ra([Wn("eFloatingFilterBody")],e.prototype,"eFloatingFilterBody",void 0),ra([Wn("eButtonWrapper")],e.prototype,"eButtonWrapper",void 0),ra([Wn("eButtonShowMainFilter")],e.prototype,"eButtonShowMainFilter",void 0),e}(Ys),aa=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),la=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/!function(t){t[t.COLUMN_GROUP=0]="COLUMN_GROUP",t[t.COLUMN=1]="COLUMN",t[t.FLOATING_FILTER=2]="FLOATING_FILTER"}(os||(os={}));var pa,ua=function(t){function e(e,o,n){var i=t.call(this,'<div class="ag-header-row" role="row"></div>')||this;i.headerComps={},i.setRowIndex(e),i.type=o,i.pinned=n;var r=os[o].toLowerCase().replace(/_/g,"-");return i.addCssClass("ag-header-row-"+r),Se()&&(i.getGui().style.transform="translateZ(0)"),i}return aa(e,t),e.prototype.forEachHeaderElement=function(t){var e=this;Object.keys(this.headerComps).forEach((function(o){t(e.headerComps[o])}))},e.prototype.setRowIndex=function(t){this.dept=t,Uo(this.getGui(),t+1)},e.prototype.getRowIndex=function(){return this.dept},e.prototype.getType=function(){return this.type},e.prototype.destroyAllChildComponents=function(){var t=Object.keys(this.headerComps);this.destroyChildComponents(t)},e.prototype.destroyChildComponents=function(t){var e=this;t.forEach((function(t){var o=e.headerComps[t];e.getGui().removeChild(o.getGui()),e.destroyBean(o),delete e.headerComps[t]}))},e.prototype.onRowHeightChanged=function(){var t,e,o=this.columnController.getHeaderRowCount(),n=[],i=0;this.columnController.isPivotMode()?(t=this.gridOptionsWrapper.getPivotGroupHeaderHeight(),e=this.gridOptionsWrapper.getPivotHeaderHeight()):(this.columnController.hasFloatingFilters()&&(o++,i=1),t=this.gridOptionsWrapper.getGroupHeaderHeight(),e=this.gridOptionsWrapper.getHeaderHeight());for(var r=o-(1+i),s=0;s<r;s++)n.push(t);n.push(e);for(s=0;s<i;s++)n.push(this.gridOptionsWrapper.getFloatingFiltersHeight());var a=0;for(s=0;s<this.dept;s++)a+=n[s];this.getGui().style.top=a+"px",this.getGui().style.height=n[this.dept]+"px"},e.prototype.init=function(){this.onRowHeightChanged(),this.onVirtualColumnsChanged(),this.setWidth(),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_PIVOT_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_GROUP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_PIVOT_GROUP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_FLOATING_FILTERS_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this))},e.prototype.onColumnResized=function(){this.setWidth()},e.prototype.setWidth=function(){var t=this.getWidthForRow();this.getGui().style.width=t+"px"},e.prototype.getWidthForRow=function(){return this.gridOptionsWrapper.getDomLayout()===ht.DOM_LAYOUT_PRINT?o(this.pinned)?this.columnController.getContainerWidth(ht.PINNED_RIGHT)+this.columnController.getContainerWidth(ht.PINNED_LEFT)+this.columnController.getContainerWidth(null):0:this.columnController.getContainerWidth(this.pinned)},e.prototype.onDisplayedColumnsChanged=function(){this.onVirtualColumnsChanged(),this.setWidth()},e.prototype.getColumnsInViewport=function(){return this.gridOptionsWrapper.getDomLayout()===ht.DOM_LAYOUT_PRINT?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()},e.prototype.getColumnsInViewportPrintLayout=function(){var t=this;if(null!=this.pinned)return[];var e=[],o=this.getActualDepth();return[ht.PINNED_LEFT,null,ht.PINNED_RIGHT].forEach((function(n){var i=t.columnController.getVirtualHeaderGroupRow(n,o);e=e.concat(i)})),e},e.prototype.getActualDepth=function(){return this.type==os.FLOATING_FILTER?this.dept-1:this.dept},e.prototype.getColumnsInViewportNormalLayout=function(){return this.columnController.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())},e.prototype.onVirtualColumnsChanged=function(){var t=this,e=Object.keys(this.headerComps),o=[];this.getColumnsInViewport().forEach((function(n){if(!n.isEmptyGroup()){var i=n.getUniqueId(),r=t.getGui(),s=t.headerComps[i];if(s&&s.getColumn()!=n&&(t.destroyChildComponents([i]),g(e,i),s=void 0),s)g(e,i);else{var a=t.createHeaderComp(n);t.headerComps[i]=a,r.appendChild(a.getGui())}o.push(i)}}));if(e.filter((function(e){var o=t.headerComps[e];return!!t.focusController.isHeaderWrapperFocused(o)&&t.columnController.isDisplayed(o.getColumn())})).forEach((function(t){g(e,t),o.push(t)})),this.destroyChildComponents(e),this.gridOptionsWrapper.isEnsureDomOrder()){var n=o.map((function(e){return t.headerComps[e].getGui()}));ao(this.getGui(),n)}},e.prototype.createHeaderComp=function(t){var e;switch(this.type){case os.COLUMN_GROUP:e=new Js(t,this.pinned);break;case os.FLOATING_FILTER:e=new sa(t,this.pinned);break;default:e=new Qs(t,this.pinned)}return this.createBean(e),e.setParentComponent(this),e},e.prototype.getHeaderComps=function(){return this.headerComps},la([it("columnController")],e.prototype,"columnController",void 0),la([it("focusController")],e.prototype,"focusController",void 0),la([ot],e.prototype,"destroyAllChildComponents",null),la([et],e.prototype,"init",null),e}(xn),ca=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},da=function(){function t(t,o){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.pinned=t,this.eContainer=o,this.centerContainer=!e(t)}return t.prototype.registerGridComp=function(t){this.gridPanel=t},t.prototype.init=function(){this.logger=this.loggerFactory.create("MoveColumnController")},t.prototype.getIconName=function(){return this.pinned?ns.ICON_PINNED:ns.ICON_MOVE},t.prototype.onDragEnter=function(t){var e=t.dragItem.columns;if(t.dragSource.type===$r.ToolPanel)this.setColumnsVisible(e,!0,"uiColumnDragged");else{var o=t.dragItem.visibleState,n=(e||[]).filter((function(t){return o[t.getId()]}));this.setColumnsVisible(n,!0,"uiColumnDragged")}this.setColumnsPinned(e,this.pinned,"uiColumnDragged"),this.onDragging(t,!0)},t.prototype.onDragLeave=function(t){if(!this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns()&&!t.fromNudge){var e=t.dragSource.getDragItem().columns;this.setColumnsVisible(e,!1,"uiColumnDragged")}this.ensureIntervalCleared()},t.prototype.setColumnsVisible=function(t,e,o){if(void 0===o&&(o="api"),t){var n=t.filter((function(t){return!t.getColDef().lockVisible}));this.columnController.setColumnsVisible(n,e,o)}},t.prototype.setColumnsPinned=function(t,e,o){if(void 0===o&&(o="api"),t){var n=t.filter((function(t){return!t.getColDef().lockPinned}));this.columnController.setColumnsPinned(n,e,o)}},t.prototype.onDragStop=function(){this.ensureIntervalCleared()},t.prototype.normaliseX=function(t){this.gridOptionsWrapper.isEnableRtl()&&(t=this.eContainer.clientWidth-t);return this.centerContainer&&(t+=this.gridPanel.getCenterViewportScrollLeft()),t},t.prototype.checkCenterForScrolling=function(t){if(this.centerContainer){var e=this.gridPanel.getCenterViewportScrollLeft(),o=e+this.gridPanel.getCenterWidth();this.gridOptionsWrapper.isEnableRtl()?(this.needToMoveRight=t<e+50,this.needToMoveLeft=t>o-50):(this.needToMoveLeft=t<e+50,this.needToMoveRight=t>o-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}},t.prototype.onDragging=function(t,e){var n=this;if(void 0===e&&(e=!1),this.lastDraggingEvent=t,!o(t.hDirection)){var i=this.normaliseX(t.x);e||this.checkCenterForScrolling(i);var r=this.normaliseDirection(t.hDirection),s=t.dragSource.type,a=t.dragSource.getDragItem().columns;a=a.filter((function(t){return!t.getColDef().lockPinned||t.getPinned()==n.pinned})),this.attemptMoveColumns(s,a,r,i,e)}},t.prototype.normaliseDirection=function(t){if(!this.gridOptionsWrapper.isEnableRtl())return t;switch(t){case Jr.Left:return Jr.Right;case Jr.Right:return Jr.Left;default:console.error("AG Grid: Unknown direction "+t)}},t.prototype.calculateOldIndex=function(t){var e=this.columnController.getAllGridColumns(),o=f(t.map((function(t){return e.indexOf(t)}))),n=o[0];return d(o)-n!==o.length-1?null:n},t.prototype.attemptMoveColumns=function(t,e,o,n,i){var r=o===Jr.Left,s=o===Jr.Right,a=e.slice();this.columnController.sortColumnsLikeGridColumns(a);var l=this.calculateValidMoves(a,s,n),p=this.calculateOldIndex(a);if(0!==l.length){var u=l[0],c=null!==p&&!i;if(t==$r.HeaderCell&&(c=null!==p),c){if(r&&u>=p)return;if(s&&u<=p)return}for(var d=0;d<l.length;d++){var h=l[d];if(this.columnController.doesMovePassRules(a,h))return void this.columnController.moveColumns(a,h,"uiColumnDragged")}}},t.prototype.calculateValidMoves=function(t,e,o){if(this.gridOptionsWrapper.isSuppressMovableColumns()||t.some((function(t){return t.getColDef().suppressMovable})))return[];var n,i=this.columnController.getDisplayedColumns(this.pinned),r=this.columnController.getAllGridColumns(),s=i.filter((function(e){return C(t,e)})),a=i.filter((function(e){return!C(t,e)})),l=r.filter((function(e){return!C(t,e)})),p=0,u=o;if(e){var c=0;s.forEach((function(t){return c+=t.getActualWidth()})),u-=c}if(u>0){for(var d=0;d<a.length;d++){if((u-=a[d].getActualWidth())<0)break;p++}e&&p++}if(p>0){var h=a[p-1];n=l.indexOf(h)+1}else-1===(n=l.indexOf(a[0]))&&(n=0);var f=[n],g=function(t,e){return t-e};if(e){for(var y=n+1,v=r.length-1;y<=v;)f.push(y),y++;f.sort(g)}else{y=n,v=r.length-1;for(var m=r[y];y<=v&&this.isColumnHidden(i,m);)y++,f.push(y),m=r[y];y=n-1;for(;y>=0;)f.push(y),y--;f.sort(g).reverse()}return f},t.prototype.isColumnHidden=function(t,e){return t.indexOf(e)<0},t.prototype.ensureIntervalStarted=function(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(ns.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(ns.ICON_RIGHT,!0))},t.prototype.ensureIntervalCleared=function(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(ns.ICON_MOVE))},t.prototype.moveInterval=function(){var t;this.intervalCount++,(t=10+5*this.intervalCount)>100&&(t=100);var e=null;if(this.needToMoveLeft?e=this.gridPanel.scrollHorizontally(-t):this.needToMoveRight&&(e=this.gridPanel.scrollHorizontally(t)),0!==e)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;var o=this.lastDraggingEvent.dragItem.columns.filter((function(t){return!t.getColDef().lockPinned}));if(o.length>0&&(this.dragAndDropService.setGhostIcon(ns.ICON_PINNED),this.failedMoveAttempts>7)){var n=this.needToMoveLeft?ht.PINNED_LEFT:ht.PINNED_RIGHT;this.setColumnsPinned(o,n,"uiColumnDragged"),this.dragAndDropService.nudge()}}},ca([it("loggerFactory")],t.prototype,"loggerFactory",void 0),ca([it("columnController")],t.prototype,"columnController",void 0),ca([it("dragAndDropService")],t.prototype,"dragAndDropService",void 0),ca([it("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),ca([et],t.prototype,"init",null),t}(),ha=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},fa=function(){function t(t){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=t}return t.prototype.onDragEnter=function(t){var e=this;if(this.clearColumnsList(),!this.gridOptionsWrapper.isFunctionsReadOnly()){var o=t.dragItem.columns;o&&o.forEach((function(t){t.isPrimary()&&(t.isAnyFunctionActive()||(t.isAllowValue()?e.columnsToAggregate.push(t):t.isAllowRowGroup()?e.columnsToGroup.push(t):t.isAllowPivot()&&e.columnsToPivot.push(t)))}))}},t.prototype.getIconName=function(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?ns.ICON_PINNED:ns.ICON_MOVE:null},t.prototype.onDragLeave=function(t){this.clearColumnsList()},t.prototype.clearColumnsList=function(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0},t.prototype.onDragging=function(t){},t.prototype.onDragStop=function(t){this.columnsToAggregate.length>0&&this.columnController.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnController.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnController.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")},ha([it("columnController")],t.prototype,"columnController",void 0),ha([it("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),t}(),ga=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ya=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/!function(t){t[t.ColumnMove=0]="ColumnMove",t[t.Pivot=1]="Pivot"}(pa||(pa={}));var va,ma=function(t){function e(e,o){var n=t.call(this)||this;return n.dropListeners={},n.pinned=e,n.eContainer=o,n}return ga(e,t),e.prototype.registerGridComp=function(t){switch(this.gridPanel=t,this.moveColumnController.registerGridComp(t),this.pinned){case ht.PINNED_LEFT:this.eSecondaryContainers=this.gridPanel.getDropTargetLeftContainers();break;case ht.PINNED_RIGHT:this.eSecondaryContainers=this.gridPanel.getDropTargetRightContainers();break;default:this.eSecondaryContainers=this.gridPanel.getDropTargetBodyContainers()}},e.prototype.isInterestedIn=function(t){return t===$r.HeaderCell||t===$r.ToolPanel&&this.gridOptionsWrapper.isAllowDragFromColumnsToolPanel()},e.prototype.getSecondaryContainers=function(){return this.eSecondaryContainers},e.prototype.getContainer=function(){return this.eContainer},e.prototype.init=function(){this.moveColumnController=this.createBean(new da(this.pinned,this.eContainer));var t=new fa(this.pinned);this.createBean(t),this.dropListeners[pa.ColumnMove]=this.moveColumnController,this.dropListeners[pa.Pivot]=t,this.dragAndDropService.addDropTarget(this)},e.prototype.getIconName=function(){return this.currentDropListener.getIconName()},e.prototype.getDropType=function(t){return this.columnController.isPivotMode()&&t.dragSource.type===$r.ToolPanel?pa.Pivot:pa.ColumnMove},e.prototype.onDragEnter=function(t){var e=this.getDropType(t);this.currentDropListener=this.dropListeners[e],this.currentDropListener.onDragEnter(t)},e.prototype.onDragLeave=function(t){this.currentDropListener.onDragLeave(t)},e.prototype.onDragging=function(t){this.currentDropListener.onDragging(t)},e.prototype.onDragStop=function(t){this.currentDropListener.onDragStop(t)},ya([it("dragAndDropService")],e.prototype,"dragAndDropService",void 0),ya([it("columnController")],e.prototype,"columnController",void 0),ya([et],e.prototype,"init",null),e}(Mt),Ca=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),wa=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ea=function(t){function e(e,o,n){var i=t.call(this)||this;return i.groupsRowComps=[],i.eContainer=e,i.pinned=n,i.eViewport=o,i}return Ca(e,t),e.prototype.forEachHeaderElement=function(t){this.groupsRowComps&&this.groupsRowComps.forEach((function(e){return e.forEachHeaderElement(t)})),this.columnsRowComp&&this.columnsRowComp.forEachHeaderElement(t),this.filtersRowComp&&this.filtersRowComp.forEachHeaderElement(t)},e.prototype.init=function(){this.addManagedListener(this.eventService,Wt.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this))},e.prototype.onColumnResized=function(){this.setWidthOfPinnedContainer()},e.prototype.onDisplayedColumnsChanged=function(){this.setWidthOfPinnedContainer()},e.prototype.onScrollVisibilityChanged=function(){this.setWidthOfPinnedContainer()},e.prototype.onScrollbarWidthChanged=function(){this.setWidthOfPinnedContainer()},e.prototype.setWidthOfPinnedContainer=function(){var t=this.pinned===ht.PINNED_LEFT,e=this.pinned===ht.PINNED_RIGHT,o=this.columnController,n=this.gridOptionsWrapper.isEnableRtl(),i=this.gridOptionsWrapper.getScrollbarWidth();if(t||e){var r=o[t?"getDisplayedColumnsLeftWidth":"getDisplayedColumnsRightWidth"]();this.scrollVisibleService.isVerticalScrollShowing()&&(n&&t||!n&&e)&&(r+=i),fo(this.eContainer,r)}},e.prototype.getRowComps=function(){var t=[];return this.groupsRowComps&&(t=t.concat(this.groupsRowComps)),this.columnsRowComp&&t.push(this.columnsRowComp),this.filtersRowComp&&t.push(this.filtersRowComp),t},e.prototype.onGridColumnsChanged=function(){this.refresh(!0)},e.prototype.refresh=function(t){void 0===t&&(t=!1),this.refreshRowComps(t)},e.prototype.setupDragAndDrop=function(t){var e=this.eViewport?this.eViewport:this.eContainer,o=new ma(this.pinned,e);this.createManagedBean(o),o.registerGridComp(t)},e.prototype.destroyRowComps=function(t){void 0===t&&(t=!1),this.groupsRowComps.forEach(this.destroyRowComp.bind(this)),this.groupsRowComps=[],this.destroyRowComp(this.filtersRowComp),this.filtersRowComp=void 0,t||(this.destroyRowComp(this.columnsRowComp),this.columnsRowComp=void 0)},e.prototype.destroyRowComp=function(t){t&&(this.destroyBean(t),this.eContainer.removeChild(t.getGui()))},e.prototype.refreshRowComps=function(t){var e=this;void 0===t&&(t=!1);var o=new Dn;!function(){var t=e.columnController.getHeaderRowCount()-1;e.groupsRowComps.forEach(e.destroyRowComp.bind(e)),e.groupsRowComps=[];for(var n=0;n<t;n++){var i=e.createBean(new ua(o.next(),os.COLUMN_GROUP,e.pinned));e.groupsRowComps.push(i)}}(),function(){var n=o.next();if(e.columnsRowComp){var i=e.columnsRowComp.getRowIndex()!==n;t&&!i||(e.destroyRowComp(e.columnsRowComp),e.columnsRowComp=void 0)}e.columnsRowComp||(e.columnsRowComp=e.createBean(new ua(n,os.COLUMN,e.pinned)))}(),function(){var n=function(){e.destroyRowComp(e.filtersRowComp),e.filtersRowComp=void 0};if(!e.columnController.isPivotMode()&&e.columnController.hasFloatingFilters()){var i=o.next();if(e.filtersRowComp){var r=e.filtersRowComp.getRowIndex()!==i;t&&!r||n()}e.filtersRowComp||(e.filtersRowComp=e.createBean(new ua(i,os.FLOATING_FILTER,e.pinned)))}else n()}(),this.getRowComps().forEach((function(t){return e.eContainer.appendChild(t.getGui())}))},wa([it("columnController")],e.prototype,"columnController",void 0),wa([it("scrollVisibleService")],e.prototype,"scrollVisibleService",void 0),wa([et],e.prototype,"init",null),wa([ot],e.prototype,"destroyRowComps",null),e}(Mt),Ra=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Oa=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/!function(t){t[t.UP=0]="UP",t[t.DOWN=1]="DOWN",t[t.LEFT=2]="LEFT",t[t.RIGHT=3]="RIGHT"}(va||(va={}));!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ra(e,t),e.prototype.registerGridComp=function(t){this.gridPanel=t},e.prototype.registerHeaderRoot=function(t){this.headerRoot=t},e.prototype.getHeaderRowCount=function(){return 0===this.headerRoot.getHeaderContainers().size?0:this.getHeaderContainer().getRowComps().length},e.prototype.getHeaderRowType=function(t){if(this.getHeaderRowCount())return this.getHeaderContainer().getRowComps()[t].getType()},e.prototype.getHeaderContainer=function(t){return void 0===t&&(t="center"),null===t&&(t="center"),this.headerRoot.getHeaderContainers().get(t)},e.prototype.navigateVertically=function(t,e,o){if(e||(e=this.focusController.getFocusedHeader()),!e)return!1;var n=e.headerRowIndex,i=e.column,r=this.getHeaderRowCount(),s=t===va.UP,a=s?n-1:n+1,l=null,p=!1;a<0&&(a=0,l=i,p=!0),a>=r&&(a=-1);var u=this.getHeaderRowType(n);if(!p){if(u===os.COLUMN_GROUP){var c=i;l=s?i.getParent():c.getDisplayedChildren()[0]}else if(u===os.FLOATING_FILTER)l=i;else{c=i;l=s?c.getParent():c}if(!l)return!1}return this.focusController.focusHeaderPosition({headerRowIndex:a,column:l},void 0,!1,!0,o)},e.prototype.navigateHorizontally=function(t,e,o){void 0===e&&(e=!1);var n,i,r=this.focusController.getFocusedHeader();return t===va.LEFT!==this.gridOptionsWrapper.isEnableRtl()?(i="Before",n=this.headerPositionUtils.findHeader(r,i)):(i="After",n=this.headerPositionUtils.findHeader(r,i)),n?this.focusController.focusHeaderPosition(n,i,e,!0,o):!e||this.focusNextHeaderRow(r,i,o)},e.prototype.focusNextHeaderRow=function(t,e,o){var n,i=t.headerRowIndex,r=null;return"Before"===e?i>0&&(n=i-1,r=this.headerPositionUtils.findColAtEdgeForHeaderRow(n,"end")):(n=i+1,r=this.headerPositionUtils.findColAtEdgeForHeaderRow(n,"start")),this.focusController.focusHeaderPosition(r,e,!0,!0,o)},e.prototype.scrollToColumn=function(t,e){if(void 0===e&&(e="After"),!t.getPinned()){var o;if(t instanceof mt){var n=t.getDisplayedLeafColumns();o="Before"===e?d(n):n[0]}else o=t;this.gridPanel.ensureColumnVisible(o),this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter(),this.animationFrameService.flushAllFrames()}},Oa([it("focusController")],e.prototype,"focusController",void 0),Oa([it("headerPositionUtils")],e.prototype,"headerPositionUtils",void 0),Oa([it("animationFrameService")],e.prototype,"animationFrameService",void 0),e=Oa([nt("headerNavigationService")],e)}(Mt);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/var Pa,Sa=function(){function t(){}return t.BACKSPACE="Backspace",t.TAB="Tab",t.ENTER="Enter",t.SHIFT="Shift",t.ESCAPE="Escape",t.SPACE=" ",t.LEFT="ArrowLeft",t.UP="ArrowUp",t.RIGHT="ArrowRight",t.DOWN="ArrowDown",t.DELETE="Delete",t.NUM_PAD_DELETE="Del",t.A="a",t.C="c",t.V="v",t.D="d",t.Z="z",t.Y="y",t.F2="F2",t.PAGE_UP="PageUp",t.PAGE_DOWN="PageDown",t.PAGE_HOME="Home",t.PAGE_END="End",t}(),ba=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Da=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Aa=(function(t){function o(){var e=t.call(this,o.TEMPLATE)||this;return e.headerContainers=new Map,e}ba(o,t),o.prototype.postConstruct=function(){var e=this;t.prototype.postConstruct.call(this),this.printLayout=this.gridOptionsWrapper.getDomLayout()===ht.DOM_LAYOUT_PRINT,this.gridApi.registerHeaderRootComp(this),this.autoWidthCalculator.registerHeaderRootComp(this),this.registerHeaderContainer(new Ea(this.eHeaderContainer,this.eHeaderViewport,null),"center"),this.registerHeaderContainer(new Ea(this.ePinnedLeftHeader,null,ht.PINNED_LEFT),"left"),this.registerHeaderContainer(new Ea(this.ePinnedRightHeader,null,ht.PINNED_RIGHT),"right"),this.headerContainers.forEach((function(t){return e.createManagedBean(t)})),this.headerNavigationService.registerHeaderRoot(this),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_DOM_LAYOUT,this.onDomLayoutChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.onPivotModeChanged(),this.addPreventHeaderScroll(),this.columnController.isReady()&&this.refreshHeader()},o.prototype.registerGridComp=function(t){this.gridPanel=t,this.headerContainers.forEach((function(e){return e.setupDragAndDrop(t)}))},o.prototype.registerHeaderContainer=function(t,e){this.headerContainers.set(e,t)},o.prototype.onTabKeyDown=function(t){var e=this.gridOptionsWrapper.isEnableRtl(),o=t.shiftKey!==e?va.LEFT:va.RIGHT;(this.headerNavigationService.navigateHorizontally(o,!0,t)||this.focusController.focusNextGridCoreContainer(t.shiftKey))&&t.preventDefault()},o.prototype.handleKeyDown=function(t){var o=null;switch(t.key){case Sa.LEFT:o=va.LEFT;case Sa.RIGHT:e(o)||(o=va.RIGHT),this.headerNavigationService.navigateHorizontally(o,!1,t);break;case Sa.UP:o=va.UP;case Sa.DOWN:e(o)||(o=va.DOWN),this.headerNavigationService.navigateVertically(o,null,t)&&t.preventDefault();break;default:return}},o.prototype.onFocusOut=function(t){var e=t.relatedTarget,o=this.getGui();!e&&o.contains(document.activeElement)||o.contains(e)||this.focusController.clearFocusedHeader()},o.prototype.onDomLayoutChanged=function(){var t=this.gridOptionsWrapper.getDomLayout()===ht.DOM_LAYOUT_PRINT;this.printLayout!==t&&(this.printLayout=t,this.refreshHeader())},o.prototype.setHorizontalScroll=function(t){this.eHeaderContainer.style.transform="translateX("+t+"px)"},o.prototype.forEachHeaderElement=function(t){this.headerContainers.forEach((function(e){return e.forEachHeaderElement(t)}))},o.prototype.refreshHeader=function(){this.headerContainers.forEach((function(t){return t.refresh()}))},o.prototype.onPivotModeChanged=function(){var t=this.columnController.isPivotMode();Ve(this.getGui(),"ag-pivot-on",t),Ve(this.getGui(),"ag-pivot-off",!t)},o.prototype.setHeight=function(t){var e=t+1+"px";this.getGui().style.height=e,this.getGui().style.minHeight=e},o.prototype.addPreventHeaderScroll=function(){var t=this;this.addManagedListener(this.eHeaderViewport,"scroll",(function(){var e=t.eHeaderViewport.scrollLeft;0!==e&&(t.gridPanel.scrollHorizontally(e),t.eHeaderViewport.scrollLeft=0)}))},o.prototype.getHeaderContainers=function(){return this.headerContainers},o.prototype.setHeaderContainerWidth=function(t){this.eHeaderContainer.style.width=t+"px"},o.prototype.setLeftVisible=function(t){ke(this.ePinnedLeftHeader,t)},o.prototype.setRightVisible=function(t){ke(this.ePinnedRightHeader,t)},o.TEMPLATE='<div class="ag-header" role="presentation">\n <div class="ag-pinned-left-header" ref="ePinnedLeftHeader" role="presentation"></div>\n <div class="ag-header-viewport" ref="eHeaderViewport" role="presentation">\n <div class="ag-header-container" ref="eHeaderContainer" role="rowgroup"></div>\n </div>\n <div class="ag-pinned-right-header" ref="ePinnedRightHeader" role="presentation"></div>\n </div>',Da([Wn("ePinnedLeftHeader")],o.prototype,"ePinnedLeftHeader",void 0),Da([Wn("ePinnedRightHeader")],o.prototype,"ePinnedRightHeader",void 0),Da([Wn("eHeaderContainer")],o.prototype,"eHeaderContainer",void 0),Da([Wn("eHeaderViewport")],o.prototype,"eHeaderViewport",void 0),Da([it("columnController")],o.prototype,"columnController",void 0),Da([it("gridApi")],o.prototype,"gridApi",void 0),Da([it("autoWidthCalculator")],o.prototype,"autoWidthCalculator",void 0),Da([it("headerNavigationService")],o.prototype,"headerNavigationService",void 0)}(Zn),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Ta=function(){return(Ta=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},_a=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Fa=(function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.allAdvancedFilters=new Map,e.activeAdvancedFilters=[],e.quickFilter=null,e.quickFilterParts=null,e.processingFilterChange=!1,e}var n;Aa(o,t),n=o,o.prototype.init=function(){this.addManagedListener(this.eventService,Wt.EVENT_ROW_DATA_CHANGED,this.onNewRowsLoaded.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.quickFilter=this.parseQuickFilter(this.gridOptionsWrapper.getQuickFilterText()),this.setQuickFilterParts(),this.allowShowChangeAfterFilter=this.gridOptionsWrapper.isAllowShowChangeAfterFilter(),this.checkExternalFilter()},o.prototype.setQuickFilterParts=function(){this.quickFilterParts=this.quickFilter?this.quickFilter.split(" "):null},o.prototype.setFilterModel=function(t){var e=this,o=[];if(t){var n=Rn(Object.keys(t));this.allAdvancedFilters.forEach((function(i,r){var s=t[r];o.push(e.setModelOnFilterWrapper(i.filterPromise,s)),n.delete(r)})),n.forEach((function(n){var i=e.columnController.getPrimaryColumn(n);if(i){var r=e.getOrCreateFilterWrapper(i,"NO_UI");o.push(e.setModelOnFilterWrapper(r.filterPromise,t[n]))}else console.warn("Warning ag-grid setFilterModel - no column found for colId "+n)}))}else this.allAdvancedFilters.forEach((function(t){o.push(e.setModelOnFilterWrapper(t.filterPromise,null))}));Tn.all(o).then((function(){return e.onFilterChanged()}))},o.prototype.setModelOnFilterWrapper=function(t,e){return new Tn((function(o){t.then((function(t){"function"!=typeof t.setModel&&(console.warn("Warning ag-grid - filter missing setModel method, which is needed for setFilterModel"),o()),(t.setModel(e)||Tn.resolve()).then((function(){return o()}))}))}))},o.prototype.getFilterModel=function(){var t={};return this.allAdvancedFilters.forEach((function(o,n){var i=o.filterPromise.resolveNow(null,(function(t){return t}));if(null==i)return null;if("function"==typeof i.getModel){var r=i.getModel();e(r)&&(t[n]=r)}else console.warn("Warning ag-grid - filter API missing getModel method, which is needed for getFilterModel")})),t},o.prototype.isAdvancedFilterPresent=function(){return this.activeAdvancedFilters.length>0},o.prototype.updateActiveFilters=function(){var t=this;this.activeAdvancedFilters.length=0,this.allAdvancedFilters.forEach((function(e){if(e.filterPromise.resolveNow(!1,(function(t){return t.isFilterActive()}))){var o=e.filterPromise.resolveNow(null,(function(t){return t}));t.activeAdvancedFilters.push(o)}}))},o.prototype.updateFilterFlagInColumns=function(t,e){this.allAdvancedFilters.forEach((function(o){var n=o.filterPromise.resolveNow(!1,(function(t){return t.isFilterActive()}));o.column.setFilterActive(n,t,e)}))},o.prototype.isAnyFilterPresent=function(){return this.isQuickFilterPresent()||this.isAdvancedFilterPresent()||this.externalFilterPresent},o.prototype.doAdvancedFiltersPass=function(t,e){for(var o=t.data,n=0;n<this.activeAdvancedFilters.length;n++){var i=this.activeAdvancedFilters[n];if(null!=i&&i!==e){if("function"!=typeof i.doesFilterPass)throw new Error("Filter is missing method doesFilterPass");if(!i.doesFilterPass({node:t,data:o}))return!1}}return!0},o.prototype.parseQuickFilter=function(t){return e(t)?this.gridOptionsWrapper.isRowModelDefault()?t.toUpperCase():(console.warn("ag-grid: quick filtering only works with the Client-Side Row Model"),null):null},o.prototype.setQuickFilter=function(t){var e=this.parseQuickFilter(t);this.quickFilter!==e&&(this.quickFilter=e,this.setQuickFilterParts(),this.onFilterChanged())},o.prototype.checkExternalFilter=function(){this.externalFilterPresent=this.gridOptionsWrapper.isExternalFilterPresent()},o.prototype.onFilterChanged=function(t,e){this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",e),this.checkExternalFilter(),this.allAdvancedFilters.forEach((function(e){e.filterPromise.then((function(e){e!==t&&e.onAnyFilterChanged&&e.onAnyFilterChanged()}))}));var o={type:Wt.EVENT_FILTER_CHANGED,api:this.gridApi,columnApi:this.columnApi};e&&G(o,e),this.processingFilterChange=!0,this.eventService.dispatchEvent(o),this.processingFilterChange=!1},o.prototype.isSuppressFlashingCellsBecauseFiltering=function(){return!this.allowShowChangeAfterFilter&&this.processingFilterChange},o.prototype.isQuickFilterPresent=function(){return null!==this.quickFilter},o.prototype.doesRowPassOtherFilters=function(t,e){return this.doesRowPassFilter({rowNode:e,filterInstanceToSkip:t})},o.prototype.doesRowPassQuickFilterNoCache=function(t,o){var n=this;return O(this.columnController.getAllColumnsForQuickFilter(),(function(i){var r=n.getQuickFilterTextForColumn(i,t);return e(r)&&r.indexOf(o)>=0}))},o.prototype.doesRowPassQuickFilterCache=function(t,e){return t.quickFilterAggregateText||this.aggregateRowForQuickFilter(t),t.quickFilterAggregateText.indexOf(e)>=0},o.prototype.doesRowPassQuickFilter=function(t){var e=this,o=this.gridOptionsWrapper.isCacheQuickFilter();return R(this.quickFilterParts,(function(n){return o?e.doesRowPassQuickFilterCache(t,n):e.doesRowPassQuickFilterNoCache(t,n)}))},o.prototype.doesRowPassFilter=function(t){return!(this.isQuickFilterPresent()&&!this.doesRowPassQuickFilter(t.rowNode))&&(!(this.externalFilterPresent&&!this.gridOptionsWrapper.doesExternalFilterPass(t.rowNode))&&!(this.isAdvancedFilterPresent()&&!this.doAdvancedFiltersPass(t.rowNode,t.filterInstanceToSkip)))},o.prototype.getQuickFilterTextForColumn=function(t,o){var n=this.valueService.getValue(t,o,!0),i=t.getColDef();if(i.getQuickFilterText){var r={value:n,node:o,data:o.data,column:t,colDef:i,context:this.gridOptionsWrapper.getContext()};n=i.getQuickFilterText(r)}return e(n)?n.toString().toUpperCase():null},o.prototype.aggregateRowForQuickFilter=function(t){var o=this,i=[];P(this.columnController.getAllColumnsForQuickFilter(),(function(n){var r=o.getQuickFilterTextForColumn(n,t);e(r)&&i.push(r)})),t.quickFilterAggregateText=i.join(n.QUICK_FILTER_SEPARATOR)},o.prototype.onNewRowsLoaded=function(t){this.allAdvancedFilters.forEach((function(t){t.filterPromise.then((function(t){t.onNewRowsLoaded&&t.onNewRowsLoaded()}))})),this.updateFilterFlagInColumns(t),this.updateActiveFilters()},o.prototype.createValueGetter=function(t){var e=this;return function(o){return e.valueService.getValue(t,o,!0)}},o.prototype.getFilterComponent=function(t,e,o){if(void 0===o&&(o=!0),o)return this.getOrCreateFilterWrapper(t,e).filterPromise;var n=this.cachedFilter(t);return n?n.filterPromise:null},o.prototype.isFilterActive=function(t){var e=this.cachedFilter(t);return!!e&&e.filterPromise.resolveNow(!1,(function(t){return t.isFilterActive()}))},o.prototype.getOrCreateFilterWrapper=function(t,e){var o=this.cachedFilter(t);return o?"NO_UI"!==e&&this.putIntoGui(o,e):(o=this.createFilterWrapper(t,e),this.allAdvancedFilters.set(t.getColId(),o)),o},o.prototype.cachedFilter=function(t){return this.allAdvancedFilters.get(t.getColId())},o.prototype.createFilterInstance=function(t,e){var o,n=this,i=ft.isRegistered(pt.SetFilterModule)?"agSetColumnFilter":"agTextColumnFilter",r=t.getColDef(),s=Ta(Ta({},this.createFilterParams(t,r,e)),{filterModifiedCallback:function(){var e={type:Wt.EVENT_FILTER_MODIFIED,api:n.gridApi,columnApi:n.columnApi,column:t,filterInstance:o};n.eventService.dispatchEvent(e)},filterChangedCallback:function(t){return n.onFilterChanged(o,t)},doesRowPassOtherFilter:function(t){return n.doesRowPassOtherFilters(o,t)}}),a=this.userComponentFactory.newFilterComponent(r,s,i);return a&&a.then((function(t){return o=t})),a},o.prototype.createFilterParams=function(t,e,o){void 0===o&&(o=null);var n={api:this.gridOptionsWrapper.getApi(),column:t,colDef:T(e),rowModel:this.rowModel,filterChangedCallback:function(){},filterModifiedCallback:function(){},valueGetter:this.createValueGetter(t),context:this.gridOptionsWrapper.getContext(),doesRowPassOtherFilter:function(){return!0}};return o&&(n.$scope=o),n},o.prototype.createFilterWrapper=function(t,e){var o={column:t,filterPromise:null,scope:null,compiledElement:null,guiPromise:Tn.resolve(null)};return o.scope=this.gridOptionsWrapper.isAngularCompileFilters()?this.$scope.$new():null,o.filterPromise=this.createFilterInstance(t,o.scope),o.filterPromise&&this.putIntoGui(o,e),o},o.prototype.putIntoGui=function(t,o){var n=this,i=document.createElement("div");i.className="ag-filter",t.guiPromise=new Tn((function(r){t.filterPromise.then((function(s){var a=s.getGui();if(e(a)||console.warn("getGui method from filter returned "+a+", it should be a DOM element or an HTML template string."),"string"==typeof a&&(a=oo(a)),i.appendChild(a),t.scope){var l=n.$compile(i)(t.scope);t.compiledElement=l,window.setTimeout((function(){return t.scope.$apply()}),0)}r(i),n.eventService.dispatchEvent({type:Wt.EVENT_FILTER_OPENED,column:t.column,source:o,eGui:i,api:n.gridApi,columnApi:n.columnApi})}))}))},o.prototype.onNewColumnsLoaded=function(){var t=this,e=!1;this.allAdvancedFilters.forEach((function(o){!t.columnController.getPrimaryColumn(o.column)&&(e=!0,t.disposeFilterWrapper(o,"filterDestroyed"))})),e&&this.onFilterChanged()},o.prototype.destroyFilter=function(t,e){void 0===e&&(e="api");var o=this.allAdvancedFilters.get(t.getColId());o&&(this.disposeFilterWrapper(o,e),this.onFilterChanged())},o.prototype.disposeFilterWrapper=function(t,e){var o=this;t.filterPromise.then((function(n){(n.setModel(null)||Tn.resolve()).then((function(){o.getContext().destroyBean(n),t.column.setFilterActive(!1,e),t.scope&&(t.compiledElement&&t.compiledElement.remove(),t.scope.$destroy()),o.allAdvancedFilters.delete(t.column.getColId())}))}))},o.prototype.destroy=function(){var e=this;t.prototype.destroy.call(this),this.allAdvancedFilters.forEach((function(t){return e.disposeFilterWrapper(t,"filterDestroyed")}))},o.QUICK_FILTER_SEPARATOR="\n",_a([it("$compile")],o.prototype,"$compile",void 0),_a([it("$scope")],o.prototype,"$scope",void 0),_a([it("valueService")],o.prototype,"valueService",void 0),_a([it("columnController")],o.prototype,"columnController",void 0),_a([it("rowModel")],o.prototype,"rowModel",void 0),_a([it("columnApi")],o.prototype,"columnApi",void 0),_a([it("gridApi")],o.prototype,"gridApi",void 0),_a([it("userComponentFactory")],o.prototype,"userComponentFactory",void 0),_a([et],o.prototype,"init",null),_a([ot],o.prototype,"destroy",null),o=n=_a([nt("filterManager")],o)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Na=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},La=(function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.initialised=!1,e}Fa(n,t),n.prototype.init=function(){this.cellExpressions=this.gridOptionsWrapper.isEnableCellExpressions(),this.initialised=!0},n.prototype.getValue=function(t,e,o,n){if(void 0===o&&(o=!1),void 0===n&&(n=!1),this.initialised||this.init(),e){var i,r=t.getColDef(),s=r.field,a=t.getId(),l=e.data,p=e.groupData&&void 0!==e.groupData[a],u=!n&&e.aggData&&void 0!==e.aggData[a];if(o&&r.filterValueGetter?i=this.executeFilterValueGetter(r.filterValueGetter,l,t,e):this.gridOptionsWrapper.isTreeData()&&u?i=e.aggData[a]:this.gridOptionsWrapper.isTreeData()&&r.valueGetter?i=this.executeValueGetter(r.valueGetter,l,t,e):this.gridOptionsWrapper.isTreeData()&&s&&l?i=V(l,s,t.isFieldContainsDots()):p?i=e.groupData[a]:u?i=e.aggData[a]:r.valueGetter?i=this.executeValueGetter(r.valueGetter,l,t,e):s&&l&&(i=V(l,s,t.isFieldContainsDots())),this.cellExpressions&&"string"==typeof i&&0===i.indexOf("=")){var c=i.substring(1);i=this.executeValueGetter(c,l,t,e)}if(null==i){var d=this.getOpenedGroup(e,t);if(null!=d)return d}return i}},n.prototype.getOpenedGroup=function(t,e){if(this.gridOptionsWrapper.isShowOpenedGroup()&&e.getColDef().showRowGroup)for(var o=e.getColDef().showRowGroup,n=t.parent;null!=n;){if(n.rowGroupColumn&&(!0===o||o===n.rowGroupColumn.getId()))return n.key;n=n.parent}},n.prototype.setValue=function(t,n,i,r){var s=this.columnController.getPrimaryColumn(n);if(t&&s){o(t.data)&&(t.data={});var a=s.getColDef(),l=a.field,p=a.newValueHandler,u=a.valueSetter;if(o(l)&&o(p)&&o(u))console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work");else{var c,d={node:t,data:t.data,oldValue:this.getValue(s,t),newValue:i,colDef:s.getColDef(),column:s,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()};if(d.newValue=i,void 0===(c=p&&e(p)?p(d):e(u)?this.expressionService.evaluate(u,d):this.setValueUsingField(t.data,l,i,s.isFieldContainsDots()))&&(c=!0),c){t.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),d.newValue=this.getValue(s,t);var h=s.getColDef().onCellValueChanged;"function"==typeof h&&setTimeout((function(){return h(d)}),0);var f={type:Wt.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:d.column,api:d.api,columnApi:d.columnApi,colDef:d.colDef,context:d.context,data:t.data,node:t,oldValue:d.oldValue,newValue:d.newValue,value:d.newValue,source:r};this.eventService.dispatchEvent(f)}}}},n.prototype.setValueUsingField=function(t,e,o,n){if(!e)return!1;if(n)for(var i=e.split("."),r=t;i.length>0&&r;){var s=i.shift();0===i.length?r[s]=o:r=r[s]}else t[e]=o;return!0},n.prototype.executeFilterValueGetter=function(t,e,o,n){var i={data:e,node:n,column:o,colDef:o.getColDef(),api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext(),getValue:this.getValueCallback.bind(this,n)};return this.expressionService.evaluate(t,i)},n.prototype.executeValueGetter=function(t,e,o,n){var i=o.getId(),r=this.valueCache.getValue(n,i);if(void 0!==r)return r;var s={data:e,node:n,column:o,colDef:o.getColDef(),api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext(),getValue:this.getValueCallback.bind(this,n)},a=this.expressionService.evaluate(t,s);return this.valueCache.setValue(n,i,a),a},n.prototype.getValueCallback=function(t,e){var o=this.columnController.getPrimaryColumn(e);return o?this.getValue(o,t):null},n.prototype.getKeyForNode=function(t,e){var o=this.getValue(t,e),n=t.getColDef().keyCreator,i=n?n({value:o}):o;return"string"==typeof i||null==i||"[object Object]"===(i=String(i))&&z((function(){console.warn("AG Grid: a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")}),"getKeyForNode - warn about [object,object]"),i},Na([it("expressionService")],n.prototype,"expressionService",void 0),Na([it("columnController")],n.prototype,"columnController",void 0),Na([it("valueCache")],n.prototype,"valueCache",void 0),Na([et],n.prototype,"init",null),n=Na([nt("valueService")],n)}(Mt),function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s}),Ia=function(){function t(t){this.childCount=0,this.rowTemplatesToAdd=[],this.afterGuiAttachedCallbacks=[],this.lastMadeVisibleTime=0,this.eContainer=t.eContainer,this.eViewport=t.eViewport,t.eWrapper&&(this.eWrapper=t.eWrapper),this.hideWhenNoChildren=!!t.hideWhenNoChildren}return t.prototype.setVerticalScrollPosition=function(t){this.scrollTop=t},t.prototype.postConstruct=function(){this.checkDomOrder(),this.checkVisibility(),this.gridOptionsWrapper.addEventListener(zr.PROP_DOM_LAYOUT,this.checkDomOrder.bind(this))},t.prototype.checkDomOrder=function(){this.domOrder=this.gridOptionsWrapper.isEnsureDomOrder()},t.prototype.getRowElement=function(t){return this.eContainer.querySelector('[comp-id="'+t+'"]')},t.prototype.setHeight=function(t){null!=t?(this.eContainer.style.height=t+"px",this.eWrapper&&(this.eWrapper.style.height=t+"px")):this.eContainer.style.height=""},t.prototype.flushRowTemplates=function(){if(0!==this.rowTemplatesToAdd.length){var t=this.rowTemplatesToAdd.join("");no(this.eContainer,t),this.rowTemplatesToAdd.length=0}this.afterGuiAttachedCallbacks.forEach((function(t){return t()})),this.afterGuiAttachedCallbacks.length=0,this.lastPlacedElement=null},t.prototype.appendRowTemplate=function(t,e){this.domOrder?this.lastPlacedElement=lo(this.eContainer,t,this.lastPlacedElement):this.rowTemplatesToAdd.push(t),this.afterGuiAttachedCallbacks.push(e),this.childCount++,this.checkVisibility()},t.prototype.ensureDomOrder=function(t){this.domOrder&&(so(this.eContainer,t,this.lastPlacedElement),this.lastPlacedElement=t)},t.prototype.removeRowElement=function(t){this.eContainer.removeChild(t),this.childCount--,this.checkVisibility()},t.prototype.checkVisibility=function(){if(this.hideWhenNoChildren){var t=this.eViewport?this.eViewport:this.eContainer,e=this.childCount>0;this.visible!==e&&(this.visible=e,this.lastMadeVisibleTime=(new Date).getTime(),ke(t,e),e&&this.eViewport&&(this.eViewport.scrollTop=this.scrollTop))}},t.prototype.isMadeVisibleRecently=function(){return(new Date).getTime()-this.lastMadeVisibleTime<500},La([it("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),La([et],t.prototype,"postConstruct",null),t}(),Ga=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Ma=function(){return(Ma=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},xa=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Va=function(){for(var t=0,e=0,o=arguments.length;e<o;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<o;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)n[i]=r[s];return n},Ha=function(t){function o(e,o){var n=t.call(this)||this;return n.isMultiRowDrag=!1,n.isGridSorted=!1,n.isGridFiltered=!1,n.isRowGroupActive=!1,n.eContainer=e,n.gridPanel=o,n}return Ga(o,t),o.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelDefault()&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,Wt.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onRowGroupChanged.bind(this)),this.onSortChanged(),this.onFilterChanged(),this.onRowGroupChanged()},o.prototype.onSortChanged=function(){this.isGridSorted=this.sortController.isSortActive()},o.prototype.onFilterChanged=function(){this.isGridFiltered=this.filterManager.isAnyFilterPresent()},o.prototype.onRowGroupChanged=function(){var t=this.columnController.getRowGroupColumns();this.isRowGroupActive=!n(t)},o.prototype.getContainer=function(){return this.eContainer},o.prototype.isInterestedIn=function(t){return t===$r.RowDrag},o.prototype.getIconName=function(){return this.gridOptionsWrapper.isRowDragManaged()&&this.shouldPreventRowMove()?ns.ICON_NOT_ALLOWED:ns.ICON_MOVE},o.prototype.shouldPreventRowMove=function(){return this.isGridSorted||this.isGridFiltered||this.isRowGroupActive},o.prototype.getRowNodes=function(t){if(!this.isFromThisGrid(t))return t.dragItem.rowNodes||[];var e=this.gridOptionsWrapper.isEnableMultiRowDragging(),o=this.selectionController.getSelectedNodes(),n=t.dragItem.rowNode;return e&&-1!==o.indexOf(n)?(this.isMultiRowDrag=!0,Va(o)):(this.isMultiRowDrag=!1,[n])},o.prototype.onDragEnter=function(t){this.dispatchGridEvent(Wt.EVENT_ROW_DRAG_ENTER,t),this.getRowNodes(t).forEach((function(t){t.setDragging(!0)})),this.onEnterOrDragging(t)},o.prototype.onDragging=function(t){this.onEnterOrDragging(t)},o.prototype.isFromThisGrid=function(t){return t.dragSource.dragSourceDomDataKey===this.gridOptionsWrapper.getDomDataKey()},o.prototype.isDropZoneWithinThisGrid=function(t){var e=this.gridPanel.getGui(),o=t.dropZoneTarget;return!e.contains(o)},o.prototype.onEnterOrDragging=function(t){this.dispatchGridEvent(Wt.EVENT_ROW_DRAG_MOVE,t),this.lastDraggingEvent=t;var e=this.mouseEventService.getNormalisedPosition(t).y;this.gridOptionsWrapper.isRowDragManaged()&&this.doManagedDrag(t,e),this.checkCenterForScrolling(e)},o.prototype.doManagedDrag=function(t,e){var o,n=this,i=this.isFromThisGrid(t);i?(o=[t.dragItem.rowNode],this.isMultiRowDrag&&(o=Va(this.selectionController.getSelectedNodes()).sort((function(t,e){return n.getRowIndexNumber(t)-n.getRowIndexNumber(e)}))),t.dragItem.rowNodes=o):o=t.dragItem.rowNodes,this.gridOptionsWrapper.isRowDragManaged()&&this.shouldPreventRowMove()||(this.gridOptionsWrapper.isSuppressMoveWhenRowDragging()||!i?this.isDropZoneWithinThisGrid(t)||this.clientSideRowModel.highlightRowAtPixel(o[0],e):this.moveRows(o,e))},o.prototype.getRowIndexNumber=function(t){return parseInt(d(t.getRowIndexString().split("-")),10)},o.prototype.moveRowAndClearHighlight=function(t){var e=this,o=this.clientSideRowModel.getLastHighlightedRowNode(),n=o&&"below"===o.highlighted,i=this.mouseEventService.getNormalisedPosition(t).y,r=t.dragItem.rowNodes,s=n?1:0;if(this.isFromThisGrid(t))r.forEach((function(t){t.rowTop<i&&(s-=1)})),this.moveRows(r,i,s);else{var a=this.gridOptionsWrapper.getRowNodeIdFunc(),l=this.clientSideRowModel.getRowIndexAtPixel(i)+1;"above"===this.clientSideRowModel.getHighlightPosition(i)&&l--,this.clientSideRowModel.updateRowData({add:r.map((function(t){return t.data})).filter((function(t){return!e.clientSideRowModel.getRowNode(a?a(t):t.id)})),addIndex:l})}this.clearRowHighlight()},o.prototype.clearRowHighlight=function(){this.clientSideRowModel.highlightRowAtPixel(null)},o.prototype.moveRows=function(t,e,o){void 0===o&&(o=0),this.clientSideRowModel.ensureRowsAtPixel(t,e,o)&&(this.focusController.clearFocusedCell(),this.rangeController&&this.rangeController.removeAllCellRanges())},o.prototype.checkCenterForScrolling=function(t){var e=this.gridPanel.getVScrollPosition();this.needToMoveUp=t<e.top+50,this.needToMoveDown=t>e.bottom-50,this.needToMoveUp||this.needToMoveDown?this.ensureIntervalStarted():this.ensureIntervalCleared()},o.prototype.ensureIntervalStarted=function(){this.movingIntervalId||(this.intervalCount=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100))},o.prototype.ensureIntervalCleared=function(){e(this.movingIntervalId)&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null)},o.prototype.moveInterval=function(){var t;this.intervalCount++,(t=10+5*this.intervalCount)>100&&(t=100);var e=null;this.needToMoveDown?e=this.gridPanel.scrollVertically(t):this.needToMoveUp&&(e=this.gridPanel.scrollVertically(-t)),0!==e&&this.onDragging(this.lastDraggingEvent)},o.prototype.addRowDropZone=function(t){var e=this;if(t.getContainer())if(this.dragAndDropService.findExternalZone(t))console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");else{var o={getContainer:t.getContainer};t.fromGrid?(t.fromGrid=void 0,o=t):(t.onDragEnter&&(o.onDragEnter=function(o){t.onDragEnter(e.draggingToRowDragEvent(Wt.EVENT_ROW_DRAG_ENTER,o))}),t.onDragLeave&&(o.onDragLeave=function(o){t.onDragLeave(e.draggingToRowDragEvent(Wt.EVENT_ROW_DRAG_LEAVE,o))}),t.onDragging&&(o.onDragging=function(o){t.onDragging(e.draggingToRowDragEvent(Wt.EVENT_ROW_DRAG_MOVE,o))}),t.onDragStop&&(o.onDragStop=function(o){t.onDragStop(e.draggingToRowDragEvent(Wt.EVENT_ROW_DRAG_END,o))})),this.dragAndDropService.addDropTarget(Ma({isInterestedIn:function(t){return t===$r.RowDrag},getIconName:function(){return ns.ICON_MOVE},external:!0},o))}else z((function(){return console.warn("AG Grid: addRowDropZone - A container target needs to be provided")}),"add-drop-zone-empty-target")},o.prototype.getRowDropZone=function(t){var e=this,o=this.getContainer.bind(this),n=this.onDragEnter.bind(this),i=this.onDragLeave.bind(this),r=this.onDragging.bind(this),s=this.onDragStop.bind(this);return t?{getContainer:o,onDragEnter:t.onDragEnter?function(o){n(o),t.onDragEnter(e.draggingToRowDragEvent(Wt.EVENT_ROW_DRAG_ENTER,o))}:n,onDragLeave:t.onDragLeave?function(o){i(o),t.onDragLeave(e.draggingToRowDragEvent(Wt.EVENT_ROW_DRAG_LEAVE,o))}:i,onDragging:t.onDragging?function(o){r(o),t.onDragging(e.draggingToRowDragEvent(Wt.EVENT_ROW_DRAG_MOVE,o))}:r,onDragStop:t.onDragStop?function(o){s(o),t.onDragStop(e.draggingToRowDragEvent(Wt.EVENT_ROW_DRAG_END,o))}:s,fromGrid:!0}:{getContainer:o,onDragEnter:n,onDragLeave:i,onDragging:r,onDragStop:s,fromGrid:!0}},o.prototype.draggingToRowDragEvent=function(t,e){var o,n=this.mouseEventService.getNormalisedPosition(e).y,i=-1,r=null;switch(n>this.paginationProxy.getCurrentPageHeight()||(i=this.rowModel.getRowIndexAtPixel(n),r=this.rowModel.getRow(i)),e.vDirection){case Zr.Down:o="down";break;case Zr.Up:o="up";break;default:o=null}return{type:t,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),event:e.event,node:e.dragItem.rowNode,nodes:e.dragItem.rowNodes,overIndex:i,overNode:r,y:n,vDirection:o}},o.prototype.dispatchGridEvent=function(t,e){var o=this.draggingToRowDragEvent(t,e);this.eventService.dispatchEvent(o)},o.prototype.onDragLeave=function(t){this.dispatchGridEvent(Wt.EVENT_ROW_DRAG_LEAVE,t),this.stopDragging(t),this.gridOptionsWrapper.isRowDragManaged()&&this.clearRowHighlight(),this.isFromThisGrid(t)&&(this.isMultiRowDrag=!1)},o.prototype.onDragStop=function(t){this.dispatchGridEvent(Wt.EVENT_ROW_DRAG_END,t),this.stopDragging(t),!this.gridOptionsWrapper.isRowDragManaged()||!this.gridOptionsWrapper.isSuppressMoveWhenRowDragging()&&this.isFromThisGrid(t)||this.isDropZoneWithinThisGrid(t)||this.moveRowAndClearHighlight(t)},o.prototype.stopDragging=function(t){this.ensureIntervalCleared(),this.getRowNodes(t).forEach((function(t){t.setDragging(!1)}))},xa([it("dragAndDropService")],o.prototype,"dragAndDropService",void 0),xa([it("rowModel")],o.prototype,"rowModel",void 0),xa([it("paginationProxy")],o.prototype,"paginationProxy",void 0),xa([it("columnController")],o.prototype,"columnController",void 0),xa([it("focusController")],o.prototype,"focusController",void 0),xa([it("sortController")],o.prototype,"sortController",void 0),xa([it("filterManager")],o.prototype,"filterManager",void 0),xa([it("selectionController")],o.prototype,"selectionController",void 0),xa([rt("rangeController")],o.prototype,"rangeController",void 0),xa([it("mouseEventService")],o.prototype,"mouseEventService",void 0),xa([et],o.prototype,"postConstruct",null),o}(Mt),Wa=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),ka=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};!function(t){function e(){var e=t.call(this,'<div class="ag-root ag-unselectable" role="grid" unselectable="on">\n <ag-header-root ref="headerRoot" unselectable="on"></ag-header-root>\n <div class="ag-floating-top" ref="eTop" role="presentation" unselectable="on">\n <div class="ag-pinned-left-floating-top" ref="eLeftTop" role="presentation" unselectable="on"></div>\n <div class="ag-floating-top-viewport" ref="eTopViewport" role="presentation" unselectable="on">\n <div class="ag-floating-top-container" ref="eTopContainer" role="presentation" unselectable="on"></div>\n </div>\n <div class="ag-pinned-right-floating-top" ref="eRightTop" role="presentation" unselectable="on"></div>\n <div class="ag-floating-top-full-width-container" ref="eTopFullWidthContainer" role="presentation" unselectable="on"></div>\n </div>\n <div class="ag-body-viewport" ref="eBodyViewport" role="presentation">\n <div class="ag-pinned-left-cols-container" ref="eLeftContainer" role="presentation" unselectable="on"></div>\n <div class="ag-center-cols-clipper" ref="eCenterColsClipper" role="presentation" unselectable="on">\n <div class="ag-center-cols-viewport" ref="eCenterViewport" role="presentation">\n <div class="ag-center-cols-container" ref="eCenterContainer" role="rowgroup" unselectable="on"></div>\n </div>\n </div>\n <div class="ag-pinned-right-cols-container" ref="eRightContainer" role="presentation" unselectable="on"></div>\n <div class="ag-full-width-container" ref="eFullWidthContainer" role="presentation" unselectable="on"></div>\n </div>\n <div class="ag-floating-bottom" ref="eBottom" role="presentation" unselectable="on">\n <div class="ag-pinned-left-floating-bottom" ref="eLeftBottom" role="presentation" unselectable="on"></div>\n <div class="ag-floating-bottom-viewport" ref="eBottomViewport" role="presentation" unselectable="on">\n <div class="ag-floating-bottom-container" ref="eBottomContainer" role="presentation" unselectable="on"></div>\n </div>\n <div class="ag-pinned-right-floating-bottom" ref="eRightBottom" role="presentation" unselectable="on"></div>\n <div class="ag-floating-bottom-full-width-container" ref="eBottomFullWidthContainer" role="presentation" unselectable="on"></div>\n </div>\n <div class="ag-body-horizontal-scroll" ref="eHorizontalScrollBody" aria-hidden="true">\n <div class="ag-horizontal-left-spacer" ref="eHorizontalLeftSpacer"></div>\n <div class="ag-body-horizontal-scroll-viewport" ref="eBodyHorizontalScrollViewport">\n <div class="ag-body-horizontal-scroll-container" ref="eBodyHorizontalScrollContainer"></div>\n </div>\n <div class="ag-horizontal-right-spacer" ref="eHorizontalRightSpacer"></div>\n </div>\n <ag-overlay-wrapper ref="overlayWrapper"></ag-overlay-wrapper>\n </div>')||this;return e.scrollLeft=-1,e.scrollTop=-1,e.nextScrollTop=-1,e.resetLastHorizontalScrollElementDebounced=$(e.resetLastHorizontalScrollElement.bind(e),500),e}Wa(e,t),e.prototype.getVScrollPosition=function(){return{top:this.eBodyViewport.scrollTop,bottom:this.eBodyViewport.scrollTop+this.eBodyViewport.offsetHeight}},e.prototype.getHScrollPosition=function(){return{left:this.eCenterViewport.scrollLeft,right:this.eCenterViewport.scrollLeft+this.eCenterViewport.offsetWidth}},e.prototype.onRowDataChanged=function(){this.showOrHideOverlay()},e.prototype.showOrHideOverlay=function(){var t=this.paginationProxy.isEmpty(),e=this.gridOptionsWrapper.isSuppressNoRowsOverlay();this[t&&!e?"showNoRowsOverlay":"hideOverlay"]()},e.prototype.onNewColumnsLoaded=function(){this.columnController.isReady()&&!this.paginationProxy.isEmpty()&&this.hideOverlay(),this.rowRenderer.forEachCellComp((function(t){return t.onNewColumnsLoaded()}))},e.prototype.init=function(){var t=this;this.enableRtl=this.gridOptionsWrapper.isEnableRtl(),this.printLayout=this.gridOptionsWrapper.getDomLayout()===ht.DOM_LAYOUT_PRINT,this.gridOptionsWrapper.addLayoutElement(this.getGui()),this.gridOptionsWrapper.addLayoutElement(this.eBodyViewport),this.suppressScrollOnFloatingRow(),this.setupRowAnimationCssClass(),this.buildRowContainerComponents(),this.addEventListeners(),this.addDragListeners(),this.addScrollListener(),this.gridOptionsWrapper.isRowModelDefault()&&!this.gridOptionsWrapper.getRowData()&&this.showLoadingOverlay(),this.setCellTextSelection(this.gridOptionsWrapper.isEnableCellTextSelect()),this.setPinnedContainerSize(),this.setHeaderAndFloatingHeights(),this.disableBrowserDragging(),this.addMouseListeners(),this.addPreventScrollWhileDragging(),this.addKeyboardEvents(),this.addBodyViewportListener(),this.addStopEditingWhenGridLosesFocus(),this.mockContextMenuForIPad(),this.addRowDragListener(),this.$scope&&this.addAngularApplyCheck(),this.onDisplayedColumnsWidthChanged(),this.gridApi.registerGridComp(this),this.alignedGridsService.registerGridComp(this),this.headerRootComp.registerGridComp(this),this.navigationService.registerGridComp(this),this.headerNavigationService.registerGridComp(this),this.heightScaler.registerGridComp(this),this.autoHeightCalculator.registerGridComp(this),this.columnAnimationService.registerGridComp(this),this.autoWidthCalculator.registerGridComp(this),this.paginationAutoPageSizeService.registerGridComp(this),this.mouseEventService.registerGridComp(this),this.beans.registerGridComp(this),this.rowRenderer.registerGridComp(this),this.animationFrameService.registerGridComp(this),this.contextMenuFactory&&this.contextMenuFactory.registerGridComp(this),this.menuFactory&&this.menuFactory.registerGridComp(this),(this.rangeController||this.gridOptionsWrapper.isRowSelectionMulti())&&(Bo(this.getGui(),!0),this.rangeController&&this.rangeController.registerGridComp(this)),[this.eCenterViewport,this.eBodyViewport].forEach((function(e){var o=t.resizeObserverService.observeResize(e,t.onCenterViewportResized.bind(t));t.addDestroyFunc((function(){return o()}))})),[this.eTop,this.eBodyViewport,this.eBottom].forEach((function(e){t.addManagedListener(e,"focusin",(function(){Me(e,"ag-has-focus")})),t.addManagedListener(e,"focusout",(function(t){e.contains(t.relatedTarget)||xe(e,"ag-has-focus")}))}))},e.prototype.onDomLayoutChanged=function(){var t=this.gridOptionsWrapper.getDomLayout()===ht.DOM_LAYOUT_PRINT;this.printLayout!==t&&(this.printLayout=t,this.setWidthsOfContainers(),this.setPinnedContainerSize())},e.prototype.onCenterViewportResized=function(){if(eo(this.eCenterViewport)){this.checkViewportAndScrolls();var t=this.getCenterWidth();t!==this.centerWidth&&(this.centerWidth=t,this.columnController.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0},e.prototype.setColumnMovingCss=function(t){this.addOrRemoveCssClass("ag-column-moving",t)},e.prototype.setCellTextSelection=function(t){void 0===t&&(t=!1),[this.eTop,this.eBodyViewport,this.eBottom].forEach((function(e){return Ve(e,"ag-selectable",t)}))},e.prototype.addRowDragListener=function(){this.rowDragFeature=this.createManagedBean(new Ha(this.eBodyViewport,this)),this.dragAndDropService.addDropTarget(this.rowDragFeature)},e.prototype.getRowDragFeature=function(){return this.rowDragFeature},e.prototype.addStopEditingWhenGridLosesFocus=function(){var t=this;if(this.gridOptionsWrapper.isStopEditingWhenGridLosesFocus()){var e=[this.eBodyViewport,this.eBottom,this.eTop],o=function(o){var n=o.relatedTarget;if(null!==Te(n)){var i=e.some((function(t){return t.contains(n)}));if(!i){var r=t.popupService;i=r.getActivePopups().some((function(t){return t.contains(n)}))||r.isElementWithinCustomPopup(n)}i||t.rowRenderer.stopEditing()}else t.rowRenderer.stopEditing()};e.forEach((function(e){return t.addManagedListener(e,"focusout",o)}))}},e.prototype.addAngularApplyCheck=function(){var t=this,e=!1,o=function(){e||(e=!0,window.setTimeout((function(){e=!1,t.$scope.$apply()}),0))};this.addManagedListener(this.eventService,Wt.EVENT_DISPLAYED_COLUMNS_CHANGED,o),this.addManagedListener(this.eventService,Wt.EVENT_VIRTUAL_COLUMNS_CHANGED,o)},e.prototype.disableBrowserDragging=function(){this.addGuiEventListener("dragstart",(function(t){if(t.target instanceof HTMLImageElement)return t.preventDefault(),!1}))},e.prototype.addEventListeners=function(){this.addManagedListener(this.eventService,Wt.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_PINNED_ROW_DATA_CHANGED,this.setHeaderAndFloatingHeights.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_ROW_DATA_CHANGED,this.onRowDataChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_ROW_DATA_UPDATED,this.onRowDataChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_HEADER_HEIGHT,this.setHeaderAndFloatingHeights.bind(this)),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_PIVOT_HEADER_HEIGHT,this.setHeaderAndFloatingHeights.bind(this)),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_GROUP_HEADER_HEIGHT,this.setHeaderAndFloatingHeights.bind(this)),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_PIVOT_GROUP_HEADER_HEIGHT,this.setHeaderAndFloatingHeights.bind(this)),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_FLOATING_FILTERS_HEIGHT,this.setHeaderAndFloatingHeights.bind(this)),this.addManagedListener(this.gridOptionsWrapper,zr.PROP_DOM_LAYOUT,this.onDomLayoutChanged.bind(this))},e.prototype.addDragListeners=function(){var t=this;this.gridOptionsWrapper.isEnableRangeSelection()&&!o(this.rangeController)&&[this.eLeftContainer,this.eRightContainer,this.eCenterContainer,this.eTop,this.eBottom].forEach((function(e){var o={eElement:e,onDragStart:t.rangeController.onDragStart.bind(t.rangeController),onDragStop:t.rangeController.onDragStop.bind(t.rangeController),onDragging:t.rangeController.onDragging.bind(t.rangeController)};t.dragService.addDragSource(o),t.addDestroyFunc((function(){return t.dragService.removeDragSource(o)}))}))},e.prototype.addMouseListeners=function(){var t=this;["dblclick","contextmenu","mouseover","mouseout","click","mousedown"].forEach((function(e){var o=t.processMouseEvent.bind(t,e);t.eAllCellContainers.forEach((function(n){return t.addManagedListener(n,e,o)}))}))},e.prototype.addPreventScrollWhileDragging=function(){var t=this,e=function(e){t.dragService.isDragging()&&e.cancelable&&e.preventDefault()};this.eAllCellContainers.forEach((function(t){t.addEventListener("touchmove",e,{passive:!1})})),this.addDestroyFunc((function(){t.eAllCellContainers.forEach((function(t){t.removeEventListener("touchmove",e)}))}))},e.prototype.addKeyboardEvents=function(){var t=this;["keydown","keypress"].forEach((function(e){var o=t.processKeyboardEvent.bind(t,e);t.eAllCellContainers.forEach((function(n){t.addManagedListener(n,e,o)}))}))},e.prototype.addBodyViewportListener=function(){var t=this;this.addManagedListener(this.eBodyViewport,"contextmenu",(function(e){var o=At(e);o!==t.eBodyViewport&&o!==t.eCenterViewport||(t.onContextMenu(e,null,null,null,null,t.getGui()),t.preventDefaultOnContextMenu(e))}))},e.prototype.getBodyClientRect=function(){if(this.eBodyViewport)return this.eBodyViewport.getBoundingClientRect()},e.prototype.getRowForEvent=function(t){for(var e=At(t);e;){var o=this.gridOptionsWrapper.getDomData(e,Es.DOM_DATA_KEY_RENDERED_ROW);if(o)return o;e=e.parentElement}return null},e.prototype.processKeyboardEvent=function(t,e){var o=Dt(this.gridOptionsWrapper,e,"cellComp"),n=Dt(this.gridOptionsWrapper,e,"renderedRow");e.defaultPrevented||(o?this.processCellKeyboardEvent(o,t,e):n&&n.isFullWidth()&&this.processFullWidthRowKeyboardEvent(n,t,e))},e.prototype.processCellKeyboardEvent=function(t,e,o){var n=t.getRenderedRow().getRowNode(),i=t.getColumn(),r=t.isEditing();if(!gn(this.gridOptionsWrapper,o,n,i,r))switch(e){case"keydown":!r&&this.navigationService.handlePageScrollingKey(o)||t.onKeyDown(o),this.doGridOperations(o,t);break;case"keypress":t.onKeyPress(o)}if("keydown"===e){var s=t.createEvent(o,Wt.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(s)}if("keypress"===e){var a=t.createEvent(o,Wt.EVENT_CELL_KEY_PRESS);this.eventService.dispatchEvent(a)}},e.prototype.processFullWidthRowKeyboardEvent=function(t,e,o){var n=t.getRowNode(),i=this.beans.focusController.getFocusedCell(),r=i&&i.column;if(!gn(this.gridOptionsWrapper,o,n,r,!1)){var s=o.key;if("keydown"===e)switch(s){case Sa.UP:case Sa.DOWN:t.onKeyboardNavigate(o);break;case Sa.TAB:t.onTabKeyDown(o)}}},e.prototype.doGridOperations=function(t,e){if((t.ctrlKey||t.metaKey)&&!e.isEditing()&&this.mouseEventService.isEventFromThisGrid(t))switch(t.which){case jn.A:return this.onCtrlAndA(t);case jn.C:return this.onCtrlAndC(t);case jn.V:return this.onCtrlAndV();case jn.D:return this.onCtrlAndD(t);case jn.Z:return t.shiftKey?this.undoRedoService.redo():this.undoRedoService.undo();case jn.Y:return this.undoRedoService.redo()}},e.prototype.scrollToTop=function(){this.eBodyViewport.scrollTop=0},e.prototype.processMouseEvent=function(t,e){if(this.mouseEventService.isEventFromThisGrid(e)&&!Pt(e)){var o=this.getRowForEvent(e),n=this.mouseEventService.getRenderedCellForEvent(e);"contextmenu"===t?(this.preventDefaultOnContextMenu(e),this.handleContextMenuMouseEvent(e,null,o,n)):(n&&n.onMouseEvent(t,e),o&&o.onMouseEvent(t,e))}},e.prototype.mockContextMenuForIPad=function(){var t=this;Ae()&&this.eAllCellContainers.forEach((function(e){var o=new ci(e);t.addManagedListener(o,ci.EVENT_LONG_TAP,(function(e){var o=t.getRowForEvent(e.touchEvent),n=t.mouseEventService.getRenderedCellForEvent(e.touchEvent);t.handleContextMenuMouseEvent(null,e.touchEvent,o,n)})),t.addDestroyFunc((function(){return o.destroy()}))}))},e.prototype.handleContextMenuMouseEvent=function(t,e,o,n){var i=o?o.getRowNode():null,r=n?n.getColumn():null,s=null;if(r){var a=t||e;n.dispatchCellContextMenuEvent(a),s=this.valueService.getValue(r,i)}var l=n?n.getGui():this.getGui();this.onContextMenu(t,e,i,r,s,l)},e.prototype.onContextMenu=function(t,e,o,n,i,r){if((this.gridOptionsWrapper.isAllowContextMenuWithControlKey()||!t||!t.ctrlKey&&!t.metaKey)&&this.contextMenuFactory&&!this.gridOptionsWrapper.isSuppressContextMenu()){var s=t||e.touches[0];if(this.contextMenuFactory.showMenu(o,n,i,s,r))(t||e).preventDefault()}},e.prototype.preventDefaultOnContextMenu=function(t){var e=this.gridOptionsWrapper,o=t.which;(e.isPreventDefaultOnContextMenu()||e.isSuppressMiddleClickScrolls()&&2===o)&&t.preventDefault()},e.prototype.onCtrlAndA=function(t){var e=this.pinnedRowModel,o=this.paginationProxy,i=this.rangeController,r=ht.PINNED_BOTTOM,s=ht.PINNED_TOP;if(i&&o.isRowsToRender()){var a=[e.isEmpty(s),e.isEmpty(r)],l=a[0]?null:s,p=void 0,u=void 0;a[1]?(p=null,u=this.paginationProxy.getRowCount()-1):(p=r,u=e.getPinnedBottomRowData().length-1);var c=this.columnController.getAllDisplayedColumns();if(n(c))return;i.setCellRange({rowStartIndex:0,rowStartPinned:l,rowEndIndex:u,rowEndPinned:p,columnStart:c[0],columnEnd:d(c)})}t.preventDefault()},e.prototype.onCtrlAndC=function(t){this.clipboardService&&!this.gridOptionsWrapper.isEnableCellTextSelection()&&(this.clipboardService.copyToClipboard(),t.preventDefault())},e.prototype.onCtrlAndV=function(){ft.isRegistered(pt.ClipboardModule)&&!this.gridOptionsWrapper.isSuppressClipboardPaste()&&this.clipboardService.pasteFromClipboard()},e.prototype.onCtrlAndD=function(t){ft.isRegistered(pt.ClipboardModule)&&!this.gridOptionsWrapper.isSuppressClipboardPaste()&&this.clipboardService.copyRangeDown(),t.preventDefault()},e.prototype.ensureIndexVisible=function(t,e){if(!this.printLayout){var o=this.paginationProxy.getRowCount();if("number"!=typeof t||t<0||t>=o)console.warn("invalid row index for ensureIndexVisible: "+t);else{this.gridOptionsWrapper.isPagination()&&!this.gridOptionsWrapper.isSuppressPaginationPanel()||this.paginationProxy.goToPageWithIndex(t);var n,i=this.paginationProxy.getRow(t);do{var r=i.rowTop,s=i.rowHeight,a=this.paginationProxy.getPixelOffset(),l=i.rowTop-a,p=l+i.rowHeight,u=this.getVScrollPosition(),c=this.heightScaler.getOffset(),d=u.top+c,h=u.bottom+c,f=h-d,g=this.heightScaler.getScrollPositionForPixel(l),y=this.heightScaler.getScrollPositionForPixel(p-f),v=Math.min((g+y)/2,l),m=null;"top"===e?m=g:"bottom"===e?m=y:"middle"===e?m=v:d>l?m=g:h<p&&(m=y),null!==m&&(this.eBodyViewport.scrollTop=m,this.rowRenderer.redrawAfterScroll()),n=r!==i.rowTop||s!==i.rowHeight}while(n);this.animationFrameService.flushAllFrames()}}},e.prototype.getCenterWidth=function(){return Ye(this.eCenterViewport)},e.prototype.isHorizontalScrollShowing=function(){return this.gridOptionsWrapper.isAlwaysShowHorizontalScroll()||uo(this.eCenterViewport)},e.prototype.isVerticalScrollShowing=function(){var t=this.gridOptionsWrapper.isAlwaysShowVerticalScroll();return Ve(this.eBodyViewport,"ag-force-vertical-scroll",t),t||co(this.eBodyViewport)},e.prototype.onScrollbarWidthChanged=function(){this.checkViewportAndScrolls()},e.prototype.checkViewportAndScrolls=function(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.setPinnedContainerSize(),this.scrollLeft!==this.getCenterViewportScrollLeft()&&this.onBodyHorizontalScroll(this.eCenterViewport)},e.prototype.updateScrollVisibleService=function(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)},e.prototype.updateScrollVisibleServiceImpl=function(){var t={horizontalScrollShowing:!1,verticalScrollShowing:!1};t.verticalScrollShowing=this.isVerticalScrollShowing(),t.horizontalScrollShowing=this.isHorizontalScrollShowing(),this.scrollVisibleService.setScrollsVisible(t),this.setHorizontalScrollVisible(t.horizontalScrollShowing),this.setVerticalScrollPaddingVisible(t.verticalScrollShowing)},e.prototype.setHorizontalScrollVisible=function(t){var e=this.gridOptionsWrapper.isSuppressHorizontalScroll(),o=t&&this.gridOptionsWrapper.getScrollbarWidth()||0,n=e?0:o,i=Oe()&&t;this.eCenterViewport.style.height="calc(100% + "+o+"px)",go(this.eHorizontalScrollBody,n),go(this.eBodyHorizontalScrollViewport,n+(i?1:0)),go(this.eBodyHorizontalScrollContainer,n)},e.prototype.setVerticalScrollPaddingVisible=function(t){var e=t?"scroll":"hidden";this.eTop.style.overflowY=this.eBottom.style.overflowY=e,this.setFakeHScrollSpacerWidths()},e.prototype.updateRowCount=function(){var t=this.headerNavigationService.getHeaderRowCount(),e=this.paginationProxy.getType(),o=-1;e===ht.ROW_MODEL_TYPE_CLIENT_SIDE&&(o=0,this.paginationProxy.forEachNode((function(t){t.group||o++})));var n=-1===o?-1:t+o;jo(this.getGui(),n)},e.prototype.updateColumnCount=function(){var t=this.columnController.getAllGridColumns();zo(this.getGui(),t.length)},e.prototype.ensureColumnVisible=function(t){var e=this.columnController.getGridColumn(t);if(e)if(e.isPinned())console.warn("calling ensureIndexVisible on a "+e.getPinned()+" pinned column doesn't make sense for column "+e.getColId());else if(this.columnController.isColumnDisplayed(e)){var o,n,i=e.getLeft(),r=i+e.getActualWidth(),s=this.getCenterWidth(),a=this.getCenterViewportScrollLeft(),l=this.columnController.getBodyContainerWidth();this.enableRtl?(o=l-a-s,n=l-a):(o=a,n=s+a);var p=o>i,u=n<r,c=s<e.getActualWidth(),d=p||c;if(d||u){var h=void 0;h=this.enableRtl?d?l-s-i:l-r:d?i:r-s,this.setCenterViewportScrollLeft(h)}this.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()}else console.warn("column is not currently visible")},e.prototype.showLoadingOverlay=function(){this.gridOptionsWrapper.isSuppressLoadingOverlay()||this.overlayWrapper.showLoadingOverlay()},e.prototype.showNoRowsOverlay=function(){this.gridOptionsWrapper.isSuppressNoRowsOverlay()||this.overlayWrapper.showNoRowsOverlay()},e.prototype.hideOverlay=function(){this.overlayWrapper.hideOverlay()},e.prototype.sizeColumnsToFit=function(t){var e=this,o=0;this.isVerticalScrollShowing()&&(o=this.gridOptionsWrapper.getScrollbarWidth());var n=Ye(this.eBodyViewport)-o;n>0?this.columnController.sizeColumnsToFit(n,"sizeColumnsToFit"):void 0===t?window.setTimeout((function(){e.sizeColumnsToFit(100)}),0):100===t?window.setTimeout((function(){e.sizeColumnsToFit(500)}),100):500===t?window.setTimeout((function(){e.sizeColumnsToFit(-1)}),500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")},e.prototype.getCenterContainer=function(){return this.eCenterContainer},e.prototype.getDropTargetBodyContainers=function(){return[this.eBodyViewport,this.eTopViewport,this.eBottomViewport]},e.prototype.getDropTargetLeftContainers=function(){return[this.eLeftContainer,this.eLeftBottom,this.eLeftTop]},e.prototype.getDropTargetRightContainers=function(){return[this.eRightContainer,this.eRightBottom,this.eRightTop]},e.prototype.buildRowContainerComponents=function(){var t=this;this.eAllCellContainers=[this.eLeftContainer,this.eRightContainer,this.eCenterContainer,this.eTop,this.eBottom,this.eFullWidthContainer],this.rowContainerComponents={body:new Ia({eContainer:this.eCenterContainer,eWrapper:this.eCenterColsClipper,eViewport:this.eBodyViewport}),fullWidth:new Ia({eContainer:this.eFullWidthContainer}),pinnedLeft:new Ia({eContainer:this.eLeftContainer}),pinnedRight:new Ia({eContainer:this.eRightContainer}),floatingTop:new Ia({eContainer:this.eTopContainer}),floatingTopPinnedLeft:new Ia({eContainer:this.eLeftTop}),floatingTopPinnedRight:new Ia({eContainer:this.eRightTop}),floatingTopFullWidth:new Ia({eContainer:this.eTopFullWidthContainer,hideWhenNoChildren:!0}),floatingBottom:new Ia({eContainer:this.eBottomContainer}),floatingBottomPinnedLeft:new Ia({eContainer:this.eLeftBottom}),floatingBottomPinnedRight:new Ia({eContainer:this.eRightBottom}),floatingBottomFullWidth:new Ia({eContainer:this.eBottomFullWidthContainer,hideWhenNoChildren:!0})},A(this.rowContainerComponents,(function(e,o){o&&t.getContext().createBean(o)}))},e.prototype.setupRowAnimationCssClass=function(){var t=this,e=function(){var e=t.gridOptionsWrapper.isAnimateRows()&&!t.heightScaler.isScaling();Ve(t.eBodyViewport,"ag-row-animation",e),Ve(t.eBodyViewport,"ag-row-no-animation",!e)};e(),this.addManagedListener(this.eventService,Wt.EVENT_HEIGHT_SCALE_CHANGED,e)},e.prototype.suppressScrollOnFloatingRow=function(){var t=this;this.addManagedListener(this.eTopViewport,"scroll",(function(){return t.eTopViewport.scrollLeft=0})),this.addManagedListener(this.eBottomViewport,"scroll",(function(){return t.eTopViewport.scrollLeft=0}))},e.prototype.getRowContainers=function(){return this.rowContainerComponents},e.prototype.getFloatingTopBottom=function(){return[this.eTop,this.eBottom]},e.prototype.onDisplayedColumnsChanged=function(){this.setPinnedContainerSize(),this.setHeaderAndFloatingHeights(),this.onHorizontalViewportChanged(),this.updateScrollVisibleService(),this.updateColumnCount()},e.prototype.onDisplayedColumnsWidthChanged=function(){this.setWidthsOfContainers(),this.onHorizontalViewportChanged(),this.updateScrollVisibleService(),this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()},e.prototype.setWidthsOfContainers=function(){this.setCenterWidth(),this.setPinnedContainerSize()},e.prototype.setCenterWidth=function(){var t=this.headerRootComp,e=this.columnController,o=e.getBodyContainerWidth();this.printLayout&&(o+=e.getDisplayedColumnsLeftWidth()+e.getDisplayedColumnsRightWidth());t.setHeaderContainerWidth(o);var n=o+"px";this.eCenterContainer.style.width=n,this.eBottomContainer.style.width=n,this.eTopContainer.style.width=n,this.printLayout||(this.eBodyHorizontalScrollContainer.style.width=n)},e.prototype.setPinnedLeftWidth=function(){var t=this,e=this.pinningLeft,o=this.columnController.getDisplayedColumnsLeftWidth(),n=this.pinningLeft=!this.printLayout&&o>0,i=[this.eLeftContainer,this.eLeftTop,this.eLeftBottom];e!==n&&this.headerRootComp.setLeftVisible(n),i.forEach((function(e){return ke(e,t.pinningLeft)})),n&&i.forEach((function(t){return fo(t,o)}))},e.prototype.setPinnedRightWidth=function(){var t=this.pinningRight,e=this.columnController.getDisplayedColumnsRightWidth(),o=this.pinningRight=!this.printLayout&&e>0,n=[this.eRightContainer,this.eRightTop,this.eRightBottom];t!==o&&this.headerRootComp.setRightVisible(o),n.forEach((function(t){return ke(t,o)})),o&&n.forEach((function(t){return fo(t,e)}))},e.prototype.setPinnedContainerSize=function(){this.setPinnedLeftWidth(),this.setPinnedRightWidth(),this.setFakeHScrollSpacerWidths()},e.prototype.setFakeHScrollSpacerWidths=function(){var t=this.columnController.getDisplayedColumnsRightWidth(),e=!this.enableRtl&&this.isVerticalScrollShowing(),o=this.gridOptionsWrapper.getScrollbarWidth();e&&(t+=o),fo(this.eHorizontalRightSpacer,t),Ve(this.eHorizontalRightSpacer,"ag-scroller-corner",t<=o);var n=this.columnController.getDisplayedColumnsLeftWidth();this.enableRtl&&this.isVerticalScrollShowing()&&(n+=o),fo(this.eHorizontalLeftSpacer,n),Ve(this.eHorizontalLeftSpacer,"ag-scroller-corner",n<=o)},e.prototype.checkBodyHeight=function(){var t=Ke(this.eBodyViewport);if(this.bodyHeight!==t){this.bodyHeight=t;var e={type:Wt.EVENT_BODY_HEIGHT_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)}},e.prototype.setHeaderAndFloatingHeights=function(){var t,e,o,n=this,i=n.columnController,r=n.gridOptionsWrapper,s=n.pinnedRowModel,a=n.eTop,l=n.eBottom,p=0,u=i.getHeaderRowCount();i.isPivotMode()?(e=r.getPivotGroupHeaderHeight(),o=r.getPivotHeaderHeight()):(i.hasFloatingFilters()&&(u++,p=1),e=r.getGroupHeaderHeight(),o=r.getHeaderHeight());var c=u-(1+p);t=p*r.getFloatingFiltersHeight(),t+=c*e,t+=o,this.headerRootComp.setHeight(t);var d=s.getPinnedTopTotalHeight();d&&(d+=1);var h=s.getPinnedBottomTotalHeight();h&&(h+=1);var f=d+"px",g=h+"px";a.style.minHeight=f,a.style.height=f,a.style.display=d?"inherit":"none",l.style.minHeight=g,l.style.height=g,l.style.display=h?"inherit":"none",this.checkBodyHeight()},e.prototype.getBodyHeight=function(){return this.bodyHeight},e.prototype.setHorizontalScrollPosition=function(t){var e=this.eCenterViewport.scrollWidth-this.getCenterWidth();this.shouldBlockScrollUpdate("horizontal",t)&&(t=Math.min(Math.max(t,0),e)),this.eCenterViewport.scrollLeft=t,this.doHorizontalScroll(t)},e.prototype.setVerticalScrollPosition=function(t){this.eBodyViewport.scrollTop=t},e.prototype.scrollHorizontally=function(t){var e=this.eCenterViewport.scrollLeft;return this.setHorizontalScrollPosition(e+t),this.eCenterViewport.scrollLeft-e},e.prototype.scrollVertically=function(t){var e=this.eBodyViewport.scrollTop;return this.setVerticalScrollPosition(e+t),this.eBodyViewport.scrollTop-e},e.prototype.addScrollListener=function(){this.addManagedListener(this.eCenterViewport,"scroll",this.onCenterViewportScroll.bind(this)),this.addManagedListener(this.eBodyHorizontalScrollViewport,"scroll",this.onFakeHorizontalScroll.bind(this));var t=this.gridOptionsWrapper.isDebounceVerticalScrollbar()?$(this.onVerticalScroll.bind(this),100):this.onVerticalScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",t)},e.prototype.onVerticalScroll=function(){var t=this.eBodyViewport.scrollTop;this.shouldBlockScrollUpdate("vertical",t,!0)||(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,this.gridOptionsWrapper.isSuppressAnimationFrame()?(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()):this.animationFrameService.schedule())},e.prototype.executeAnimationFrameScroll=function(){var t=this.scrollTop!=this.nextScrollTop;return t&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),t},e.prototype.shouldBlockScrollUpdate=function(t,e,o){if(void 0===o&&(o=!1),o&&!Ae())return!1;if("vertical"===t){var n=Ke(this.eBodyViewport),i=this.eBodyViewport.scrollHeight;if(e<0||e+n>i)return!0}if("horizontal"===t){var r=this.getCenterWidth(),s=this.eCenterViewport.scrollWidth;if(this.enableRtl&&Qe()){if(e>0)return!0}else if(e<0)return!0;if(Math.abs(e)+r>s)return!0}return!1},e.prototype.isControllingScroll=function(t){return this.lastHorizontalScrollElement?t===this.lastHorizontalScrollElement:(this.lastHorizontalScrollElement=t,!0)},e.prototype.onFakeHorizontalScroll=function(){this.isControllingScroll(this.eBodyHorizontalScrollViewport)&&this.onBodyHorizontalScroll(this.eBodyHorizontalScrollViewport)},e.prototype.onCenterViewportScroll=function(){this.isControllingScroll(this.eCenterViewport)&&this.onBodyHorizontalScroll(this.eCenterViewport)},e.prototype.onBodyHorizontalScroll=function(t){var e=this.eCenterViewport.scrollLeft;this.shouldBlockScrollUpdate("horizontal",e,!0)||(this.doHorizontalScroll(Math.floor($e(t,this.enableRtl))),this.resetLastHorizontalScrollElementDebounced())},e.prototype.resetLastHorizontalScrollElement=function(){this.lastHorizontalScrollElement=null},e.prototype.doHorizontalScroll=function(t){this.scrollLeft=t;var e={type:Wt.EVENT_BODY_SCROLL,api:this.gridApi,columnApi:this.columnApi,direction:"horizontal",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(e),this.horizontallyScrollHeaderCenterAndFloatingCenter(t),this.onHorizontalViewportChanged()},e.prototype.redrawRowsAfterScroll=function(){var t={type:Wt.EVENT_BODY_SCROLL,direction:"vertical",api:this.gridApi,columnApi:this.columnApi,left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t)},e.prototype.onHorizontalViewportChanged=function(){var t=this.getCenterWidth(),e=this.getCenterViewportScrollLeft();this.columnController.setViewportPosition(t,e)},e.prototype.getCenterViewportScrollLeft=function(){return $e(this.eCenterViewport,this.enableRtl)},e.prototype.setCenterViewportScrollLeft=function(t){Ze(this.eCenterViewport,t,this.enableRtl)},e.prototype.horizontallyScrollHeaderCenterAndFloatingCenter=function(t){void 0===t&&(t=this.getCenterViewportScrollLeft());var e=this.enableRtl?t:-t;this.headerRootComp.setHorizontalScroll(e),this.eBottomContainer.style.transform="translateX("+e+"px)",this.eTopContainer.style.transform="translateX("+e+"px)",Ze(this.lastHorizontalScrollElement===this.eCenterViewport?this.eBodyHorizontalScrollViewport:this.eCenterViewport,t,this.enableRtl)},e.prototype.addScrollEventListener=function(t){this.eBodyViewport.addEventListener("scroll",t)},e.prototype.removeScrollEventListener=function(t){this.eBodyViewport.removeEventListener("scroll",t)},ka([it("alignedGridsService")],e.prototype,"alignedGridsService",void 0),ka([it("rowRenderer")],e.prototype,"rowRenderer",void 0),ka([it("pinnedRowModel")],e.prototype,"pinnedRowModel",void 0),ka([it("animationFrameService")],e.prototype,"animationFrameService",void 0),ka([it("navigationService")],e.prototype,"navigationService",void 0),ka([it("autoHeightCalculator")],e.prototype,"autoHeightCalculator",void 0),ka([it("columnAnimationService")],e.prototype,"columnAnimationService",void 0),ka([it("autoWidthCalculator")],e.prototype,"autoWidthCalculator",void 0),ka([it("paginationAutoPageSizeService")],e.prototype,"paginationAutoPageSizeService",void 0),ka([it("beans")],e.prototype,"beans",void 0),ka([it("paginationProxy")],e.prototype,"paginationProxy",void 0),ka([it("columnApi")],e.prototype,"columnApi",void 0),ka([it("gridApi")],e.prototype,"gridApi",void 0),ka([it("dragService")],e.prototype,"dragService",void 0),ka([it("mouseEventService")],e.prototype,"mouseEventService",void 0),ka([it("$scope")],e.prototype,"$scope",void 0),ka([it("scrollVisibleService")],e.prototype,"scrollVisibleService",void 0),ka([it("valueService")],e.prototype,"valueService",void 0),ka([it("dragAndDropService")],e.prototype,"dragAndDropService",void 0),ka([it("maxDivHeightScaler")],e.prototype,"heightScaler",void 0),ka([it("resizeObserverService")],e.prototype,"resizeObserverService",void 0),ka([it("undoRedoService")],e.prototype,"undoRedoService",void 0),ka([it("columnController")],e.prototype,"columnController",void 0),ka([it("headerNavigationService")],e.prototype,"headerNavigationService",void 0),ka([it("popupService")],e.prototype,"popupService",void 0),ka([rt("rangeController")],e.prototype,"rangeController",void 0),ka([rt("contextMenuFactory")],e.prototype,"contextMenuFactory",void 0),ka([rt("menuFactory")],e.prototype,"menuFactory",void 0),ka([rt("clipboardService")],e.prototype,"clipboardService",void 0),ka([Wn("eBodyViewport")],e.prototype,"eBodyViewport",void 0),ka([Wn("eCenterContainer")],e.prototype,"eCenterContainer",void 0),ka([Wn("eCenterViewport")],e.prototype,"eCenterViewport",void 0),ka([Wn("eLeftContainer")],e.prototype,"eLeftContainer",void 0),ka([Wn("eRightContainer")],e.prototype,"eRightContainer",void 0),ka([Wn("eCenterColsClipper")],e.prototype,"eCenterColsClipper",void 0),ka([Wn("eHorizontalScrollBody")],e.prototype,"eHorizontalScrollBody",void 0),ka([Wn("eHorizontalLeftSpacer")],e.prototype,"eHorizontalLeftSpacer",void 0),ka([Wn("eHorizontalRightSpacer")],e.prototype,"eHorizontalRightSpacer",void 0),ka([Wn("eBodyHorizontalScrollViewport")],e.prototype,"eBodyHorizontalScrollViewport",void 0),ka([Wn("eBodyHorizontalScrollContainer")],e.prototype,"eBodyHorizontalScrollContainer",void 0),ka([Wn("eFullWidthContainer")],e.prototype,"eFullWidthContainer",void 0),ka([Wn("eTop")],e.prototype,"eTop",void 0),ka([Wn("eLeftTop")],e.prototype,"eLeftTop",void 0),ka([Wn("eRightTop")],e.prototype,"eRightTop",void 0),ka([Wn("eTopContainer")],e.prototype,"eTopContainer",void 0),ka([Wn("eTopViewport")],e.prototype,"eTopViewport",void 0),ka([Wn("eTopFullWidthContainer")],e.prototype,"eTopFullWidthContainer",void 0),ka([Wn("eBottom")],e.prototype,"eBottom",void 0),ka([Wn("eLeftBottom")],e.prototype,"eLeftBottom",void 0),ka([Wn("eRightBottom")],e.prototype,"eRightBottom",void 0),ka([Wn("eBottomContainer")],e.prototype,"eBottomContainer",void 0),ka([Wn("eBottomViewport")],e.prototype,"eBottomViewport",void 0),ka([Wn("eBottomFullWidthContainer")],e.prototype,"eBottomFullWidthContainer",void 0),ka([Wn("headerRoot")],e.prototype,"headerRootComp",void 0),ka([Wn("overlayWrapper")],e.prototype,"overlayWrapper",void 0),ka([et],e.prototype,"init",null)}(xn);!function(t){t.EVERYTHING="group",t.FILTER="filter",t.SORT="sort",t.MAP="map",t.AGGREGATE="aggregate",t.PIVOT="pivot",t.NOTHING="nothing"}(Pa||(Pa={}));
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var Ba,ja=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ua=(function(){function t(){this.detailGridInfoMap={},this.destroyCalled=!1}t.prototype.registerGridComp=function(t){this.gridPanel=t},t.prototype.registerGridCore=function(t){this.gridCore=t},t.prototype.registerHeaderRootComp=function(t){this.headerRootComp=t},t.prototype.init=function(){switch(this.rowModel.getType()){case ht.ROW_MODEL_TYPE_CLIENT_SIDE:this.clientSideRowModel=this.rowModel;break;case ht.ROW_MODEL_TYPE_INFINITE:this.infiniteRowModel=this.rowModel;break;case ht.ROW_MODEL_TYPE_SERVER_SIDE:this.serverSideRowModel=this.rowModel}},t.prototype.__getAlignedGridService=function(){return this.alignedGridsService},t.prototype.addDetailGridInfo=function(t,e){this.detailGridInfoMap[t]=e},t.prototype.removeDetailGridInfo=function(t){this.detailGridInfoMap[t]=void 0},t.prototype.getDetailGridInfo=function(t){return this.detailGridInfoMap[t]},t.prototype.forEachDetailGridInfo=function(t){var o=0;A(this.detailGridInfoMap,(function(n,i){e(i)&&(t(i,o),o++)}))},t.prototype.getDataAsCsv=function(t){if(ft.assertRegistered(pt.CsvExportModule,"api.getDataAsCsv"))return this.csvCreator.getDataAsCsv(t)},t.prototype.exportDataAsCsv=function(t){ft.assertRegistered(pt.CsvExportModule,"api.exportDataAsCSv")&&this.csvCreator.exportDataAsCsv(t)},t.prototype.getDataAsExcel=function(t){if(ft.assertRegistered(pt.ExcelExportModule,"api.getDataAsExcel"))return this.excelCreator.getDataAsExcel(t)},t.prototype.exportDataAsExcel=function(t){ft.assertRegistered(pt.ExcelExportModule,"api.exportDataAsExcel")&&this.excelCreator.exportDataAsExcel(t)},t.prototype.setEnterpriseDatasource=function(t){console.warn("ag-grid: since version 18.x, api.setEnterpriseDatasource() should be replaced with api.setServerSideDatasource()"),this.setServerSideDatasource(t)},t.prototype.setGridAriaProperty=function(t,e){if(t){var o=this.gridPanel.getGui(),n="aria-"+t;null===e?o.removeAttribute(n):o.setAttribute(n,e)}},t.prototype.setServerSideDatasource=function(t){this.serverSideRowModel?this.serverSideRowModel.setDatasource(t):console.warn("AG Grid: you can only use an enterprise datasource when gridOptions.rowModelType is '"+ht.ROW_MODEL_TYPE_SERVER_SIDE+"'")},t.prototype.setDatasource=function(t){this.gridOptionsWrapper.isRowModelInfinite()?this.rowModel.setDatasource(t):console.warn("AG Grid: you can only use a datasource when gridOptions.rowModelType is '"+ht.ROW_MODEL_TYPE_INFINITE+"'")},t.prototype.setViewportDatasource=function(t){this.gridOptionsWrapper.isRowModelViewport()?this.rowModel.setViewportDatasource(t):console.warn("AG Grid: you can only use a viewport datasource when gridOptions.rowModelType is '"+ht.ROW_MODEL_TYPE_VIEWPORT+"'")},t.prototype.setRowData=function(t){if(this.gridOptionsWrapper.isRowModelDefault())if(this.gridOptionsWrapper.isImmutableData()){var e=this.immutableService.createTransactionForRowData(t);if(!e)return;var o=e[0],n=e[1],i=this.clientSideRowModel.updateRowData(o,n);i&&this.rowRenderer.refreshFullWidthRows(i.update)}else this.selectionController.reset(),this.clientSideRowModel.setRowData(t);else console.warn("cannot call setRowData unless using normal row model")},t.prototype.setFloatingTopRowData=function(t){console.warn("AG Grid: since v12, api.setFloatingTopRowData() is now api.setPinnedTopRowData()"),this.setPinnedTopRowData(t)},t.prototype.setFloatingBottomRowData=function(t){console.warn("AG Grid: since v12, api.setFloatingBottomRowData() is now api.setPinnedBottomRowData()"),this.setPinnedBottomRowData(t)},t.prototype.getFloatingTopRowCount=function(){return console.warn("AG Grid: since v12, api.getFloatingTopRowCount() is now api.getPinnedTopRowCount()"),this.getPinnedTopRowCount()},t.prototype.getFloatingBottomRowCount=function(){return console.warn("AG Grid: since v12, api.getFloatingBottomRowCount() is now api.getPinnedBottomRowCount()"),this.getPinnedBottomRowCount()},t.prototype.getFloatingTopRow=function(t){return console.warn("AG Grid: since v12, api.getFloatingTopRow() is now api.getPinnedTopRow()"),this.getPinnedTopRow(t)},t.prototype.getFloatingBottomRow=function(t){return console.warn("AG Grid: since v12, api.getFloatingBottomRow() is now api.getPinnedBottomRow()"),this.getPinnedBottomRow(t)},t.prototype.setPinnedTopRowData=function(t){this.pinnedRowModel.setPinnedTopRowData(t)},t.prototype.setPinnedBottomRowData=function(t){this.pinnedRowModel.setPinnedBottomRowData(t)},t.prototype.getPinnedTopRowCount=function(){return this.pinnedRowModel.getPinnedTopRowCount()},t.prototype.getPinnedBottomRowCount=function(){return this.pinnedRowModel.getPinnedBottomRowCount()},t.prototype.getPinnedTopRow=function(t){return this.pinnedRowModel.getPinnedTopRow(t)},t.prototype.getPinnedBottomRow=function(t){return this.pinnedRowModel.getPinnedBottomRow(t)},t.prototype.setColumnDefs=function(t,e){void 0===e&&(e="api"),this.columnController.setColumnDefs(t,e)},t.prototype.setAutoGroupColumnDef=function(t,e){this.gridOptionsWrapper.setProperty("autoGroupColumnDef",t,!0)},t.prototype.expireValueCache=function(){this.valueCache.expire()},t.prototype.getVerticalPixelRange=function(){return this.gridPanel.getVScrollPosition()},t.prototype.getHorizontalPixelRange=function(){return this.gridPanel.getHScrollPosition()},t.prototype.setAlwaysShowHorizontalScroll=function(t){this.gridOptionsWrapper.setProperty("alwaysShowHorizontalScroll",t)},t.prototype.setAlwaysShowVerticalScroll=function(t){this.gridOptionsWrapper.setProperty("alwaysShowVerticalScroll",t)},t.prototype.refreshToolPanel=function(){this.gridCore.refreshSideBar()},t.prototype.refreshCells=function(t){void 0===t&&(t={}),Array.isArray(t)?console.warn("since AG Grid v11.1, refreshCells() now takes parameters, please see the documentation."):this.rowRenderer.refreshCells(t)},t.prototype.flashCells=function(t){void 0===t&&(t={}),this.rowRenderer.flashCells(t)},t.prototype.redrawRows=function(t){void 0===t&&(t={}),t&&t.rowNodes?this.rowRenderer.redrawRows(t.rowNodes):this.rowRenderer.redrawAfterModelUpdate()},t.prototype.timeFullRedraw=function(t){void 0===t&&(t=1);var e=0,o=0,n=0,i=this;!function r(){var s=(new Date).getTime();i.rowRenderer.redrawAfterModelUpdate();var a=(new Date).getTime();window.setTimeout((function(){var i=(new Date).getTime(),l=a-s,p=i-a;console.log("duration: processing = "+l+"ms, reflow = "+p+"ms"),e++,o+=l,n+=p,e<t?window.setTimeout(r,1e3):(console.log("tests complete. iteration count = "+e),console.log("average processing = "+o/e+"ms"),console.log("average reflow = "+n/e+"ms"))}),0)}()},t.prototype.refreshView=function(){console.warn("AG Grid: since v11.1, refreshView() is deprecated, please call refreshCells() or redrawRows() instead"),this.redrawRows()},t.prototype.refreshRows=function(t){console.warn("since AG Grid v11.1, refreshRows() is deprecated, please use refreshCells({rowNodes: rows}) or redrawRows({rowNodes: rows}) instead"),this.refreshCells({rowNodes:t})},t.prototype.rowDataChanged=function(t){console.warn("AG Grid: rowDataChanged is deprecated, either call refreshView() to refresh everything, or call rowNode.setRowData(newData) to set value on a particular node"),this.redrawRows()},t.prototype.softRefreshView=function(){console.error("AG Grid: since v16, softRefreshView() is no longer supported. Please check the documentation on how to refresh.")},t.prototype.refreshGroupRows=function(){console.warn("AG Grid: since v11.1, refreshGroupRows() is no longer supported, call refreshCells() instead. Because refreshCells() now does dirty checking, it will only refresh cells that have changed, so it should not be necessary to only refresh the group rows."),this.refreshCells()},t.prototype.setFunctionsReadOnly=function(t){this.gridOptionsWrapper.setProperty("functionsReadOnly",t)},t.prototype.refreshHeader=function(){this.headerRootComp.refreshHeader(),this.gridPanel.setHeaderAndFloatingHeights()},t.prototype.isAnyFilterPresent=function(){return this.filterManager.isAnyFilterPresent()},t.prototype.isAdvancedFilterPresent=function(){return console.warn("AG Grid: isAdvancedFilterPresent() is deprecated, please use isColumnFilterPresent()"),this.isColumnFilterPresent()},t.prototype.isColumnFilterPresent=function(){return this.filterManager.isAdvancedFilterPresent()},t.prototype.isQuickFilterPresent=function(){return this.filterManager.isQuickFilterPresent()},t.prototype.getModel=function(){return this.rowModel},t.prototype.setRowNodeExpanded=function(t,e){t&&t.setExpanded(e)},t.prototype.onGroupExpandedOrCollapsed=function(t){o(this.clientSideRowModel)&&console.warn("AG Grid: cannot call onGroupExpandedOrCollapsed unless using normal row model"),e(t)&&console.warn("AG Grid: api.onGroupExpandedOrCollapsed - refreshFromIndex parameter is no longer used, the grid will refresh all rows"),this.clientSideRowModel.refreshModel({step:Pa.MAP})},t.prototype.refreshInMemoryRowModel=function(t){console.warn("ag-grid: since version 18.x, api.refreshInMemoryRowModel() should be replaced with api.refreshClientSideRowModel()"),this.refreshClientSideRowModel(t)},t.prototype.refreshClientSideRowModel=function(t){o(this.clientSideRowModel)&&console.warn("cannot call refreshClientSideRowModel unless using normal row model");var n=Pa.EVERYTHING,i={group:Pa.EVERYTHING,filter:Pa.FILTER,map:Pa.MAP,aggregate:Pa.AGGREGATE,sort:Pa.SORT,pivot:Pa.PIVOT};if(e(t)&&(n=i[t]),o(n))console.error("AG Grid: invalid step "+t+", available steps are "+Object.keys(i).join(", "));else{var r={step:n,keepRenderedRows:!0,animate:!0,keepEditingRows:!0};this.clientSideRowModel.refreshModel(r)}},t.prototype.isAnimationFrameQueueEmpty=function(){return this.animationFrameService.isQueueEmpty()},t.prototype.getRowNode=function(t){return this.rowModel.getRowNode(t)},t.prototype.getSizesForCurrentTheme=function(){return{rowHeight:this.gridOptionsWrapper.getRowHeightAsNumber(),headerHeight:this.gridOptionsWrapper.getHeaderHeight()}},t.prototype.expandAll=function(){this.clientSideRowModel?this.clientSideRowModel.expandOrCollapseAll(!0):this.serverSideRowModel?this.serverSideRowModel.expandAll(!0):console.warn("AG Grid: expandAll only works with Client Side Row Model and Server Side Row Model")},t.prototype.collapseAll=function(){this.clientSideRowModel?this.clientSideRowModel.expandOrCollapseAll(!1):this.serverSideRowModel?this.serverSideRowModel.expandAll(!1):console.warn("AG Grid: collapseAll only works with Client Side Row Model and Server Side Row Model")},t.prototype.getToolPanelInstance=function(t){return this.gridCore.getToolPanelInstance(t)},t.prototype.addVirtualRowListener=function(t,e,o){"string"!=typeof t&&console.warn("AG Grid: addVirtualRowListener is deprecated, please use addRenderedRowListener."),this.addRenderedRowListener(t,e,o)},t.prototype.addRenderedRowListener=function(t,e,o){"virtualRowSelected"===t&&console.warn("AG Grid: event virtualRowSelected is deprecated, to register for individual row\n selection events, add a listener directly to the row node."),this.rowRenderer.addRenderedRowListener(t,e,o)},t.prototype.setQuickFilter=function(t){this.filterManager.setQuickFilter(t)},t.prototype.selectIndex=function(t,e,o){console.warn("AG Grid: do not use api for selection, call node.setSelected(value) instead"),o&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),this.selectionController.selectIndex(t,e)},t.prototype.deselectIndex=function(t,e){void 0===e&&(e=!1),console.warn("AG Grid: do not use api for selection, call node.setSelected(value) instead"),e&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),this.selectionController.deselectIndex(t)},t.prototype.selectNode=function(t,e,o){void 0===e&&(e=!1),void 0===o&&(o=!1),console.warn("AG Grid: API for selection is deprecated, call node.setSelected(value) instead"),o&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),t.setSelectedParams({newValue:!0,clearSelection:!e})},t.prototype.deselectNode=function(t,e){void 0===e&&(e=!1),console.warn("AG Grid: API for selection is deprecated, call node.setSelected(value) instead"),e&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),t.setSelectedParams({newValue:!1})},t.prototype.selectAll=function(){this.selectionController.selectAllRowNodes()},t.prototype.deselectAll=function(){this.selectionController.deselectAllRowNodes()},t.prototype.selectAllFiltered=function(){this.selectionController.selectAllRowNodes(!0)},t.prototype.deselectAllFiltered=function(){this.selectionController.deselectAllRowNodes(!0)},t.prototype.recomputeAggregates=function(){o(this.clientSideRowModel)&&console.warn("cannot call recomputeAggregates unless using normal row model"),console.warn("recomputeAggregates is deprecated, please call api.refreshClientSideRowModel('aggregate') instead"),this.clientSideRowModel.refreshModel({step:Pa.AGGREGATE})},t.prototype.sizeColumnsToFit=function(){this.gridPanel.sizeColumnsToFit()},t.prototype.showLoadingOverlay=function(){this.gridPanel.showLoadingOverlay()},t.prototype.showNoRowsOverlay=function(){this.gridPanel.showNoRowsOverlay()},t.prototype.hideOverlay=function(){this.gridPanel.hideOverlay()},t.prototype.isNodeSelected=function(t){return console.warn("AG Grid: no need to call api.isNodeSelected(), just call node.isSelected() instead"),t.isSelected()},t.prototype.getSelectedNodesById=function(){return console.error("AG Grid: since version 3.4, getSelectedNodesById no longer exists, use getSelectedNodes() instead"),null},t.prototype.getSelectedNodes=function(){return this.selectionController.getSelectedNodes()},t.prototype.getSelectedRows=function(){return this.selectionController.getSelectedRows()},t.prototype.getBestCostNodeSelection=function(){return this.selectionController.getBestCostNodeSelection()},t.prototype.getRenderedNodes=function(){return this.rowRenderer.getRenderedNodes()},t.prototype.ensureColIndexVisible=function(t){console.warn("AG Grid: ensureColIndexVisible(index) no longer supported, use ensureColumnVisible(colKey) instead.")},t.prototype.ensureColumnVisible=function(t){this.gridPanel.ensureColumnVisible(t)},t.prototype.ensureIndexVisible=function(t,e){this.gridPanel.ensureIndexVisible(t,e)},t.prototype.ensureNodeVisible=function(t,e){this.gridCore.ensureNodeVisible(t,e)},t.prototype.forEachLeafNode=function(t){o(this.clientSideRowModel)&&console.warn("cannot call forEachNode unless using normal row model"),this.clientSideRowModel.forEachLeafNode(t)},t.prototype.forEachNode=function(t){this.rowModel.forEachNode(t)},t.prototype.forEachNodeAfterFilter=function(t){o(this.clientSideRowModel)&&console.warn("cannot call forEachNodeAfterFilter unless using normal row model"),this.clientSideRowModel.forEachNodeAfterFilter(t)},t.prototype.forEachNodeAfterFilterAndSort=function(t){o(this.clientSideRowModel)&&console.warn("cannot call forEachNodeAfterFilterAndSort unless using normal row model"),this.clientSideRowModel.forEachNodeAfterFilterAndSort(t)},t.prototype.getFilterApiForColDef=function(t){return console.warn("ag-grid API method getFilterApiForColDef deprecated, use getFilterInstance instead"),this.getFilterInstance(t)},t.prototype.getFilterInstance=function(t,e){var o=this.columnController.getPrimaryColumn(t);if(o){var n=this.filterManager.getFilterComponent(o,"NO_UI"),i=n&&n.resolveNow(null,(function(t){return t}));return e&&(i?setTimeout(e,0,i):n&&n.then(e)),i}},t.prototype.getFilterApi=function(t){return console.warn("AG Grid: getFilterApi is deprecated, use getFilterInstance instead"),this.getFilterInstance(t)},t.prototype.destroyFilter=function(t){var e=this.columnController.getPrimaryColumn(t);if(e)return this.filterManager.destroyFilter(e,"filterDestroyed")},t.prototype.getStatusPanel=function(t){if(this.statusBarService)return this.statusBarService.getStatusPanel(t)},t.prototype.getColumnDef=function(t){var e=this.columnController.getPrimaryColumn(t);return e?e.getColDef():null},t.prototype.getColumnDefs=function(){return this.columnController.getColumnDefs()},t.prototype.onFilterChanged=function(){this.filterManager.onFilterChanged()},t.prototype.onSortChanged=function(){this.sortController.onSortChanged()},t.prototype.setSortModel=function(t,e){console.warn("AG Grid: as of version 24.0.0, setSortModel() is deprecated, sort information is now part of Column State. Please use columnApi.applyColumnState() instead.");var o=[];t&&t.forEach((function(t,e){o.push({colId:t.colId,sort:t.sort,sortIndex:e})})),this.columnController.applyColumnState({state:o,defaultState:{sort:null}})},t.prototype.getSortModel=function(){console.warn("AG Grid: as of version 24.0.0, getSortModel() is deprecated, sort information is now part of Column State. Please use columnApi.getColumnState() instead.");var t=this.columnController.getColumnState().filter((function(t){return null!=t.sort})),e={};t.forEach((function(t){var o=t.colId,n=t.sortIndex;e[o]=n}));var o=t.map((function(t){return{colId:t.colId,sort:t.sort}}));return o.sort((function(t,o){return e[t.colId]-e[o.colId]})),o},t.prototype.setFilterModel=function(t){this.filterManager.setFilterModel(t)},t.prototype.getFilterModel=function(){return this.filterManager.getFilterModel()},t.prototype.getFocusedCell=function(){return this.focusController.getFocusedCell()},t.prototype.clearFocusedCell=function(){return this.focusController.clearFocusedCell()},t.prototype.setFocusedCell=function(t,e,o){this.focusController.setFocusedCell(t,e,o,!0)},t.prototype.setSuppressRowDrag=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_SUPPRESS_ROW_DRAG,t)},t.prototype.setSuppressMoveWhenRowDragging=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_SUPPRESS_MOVE_WHEN_ROW_DRAG,t)},t.prototype.setSuppressRowClickSelection=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_SUPPRESS_ROW_CLICK_SELECTION,t)},t.prototype.addRowDropZone=function(t){this.gridPanel.getRowDragFeature().addRowDropZone(t)},t.prototype.removeRowDropZone=function(t){var e=this.dragAndDropService.findExternalZone(t);e&&this.dragAndDropService.removeDropTarget(e)},t.prototype.getRowDropZoneParams=function(t){return this.gridPanel.getRowDragFeature().getRowDropZone(t)},t.prototype.setHeaderHeight=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_HEADER_HEIGHT,t),this.doLayout()},t.prototype.setDomLayout=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_DOM_LAYOUT,t)},t.prototype.setEnableCellTextSelection=function(t){this.gridPanel.setCellTextSelection(t)},t.prototype.setFillHandleDirection=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_FILL_HANDLE_DIRECTION,t)},t.prototype.setGroupHeaderHeight=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_GROUP_HEADER_HEIGHT,t),this.doLayout()},t.prototype.setFloatingFiltersHeight=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_FLOATING_FILTERS_HEIGHT,t),this.doLayout()},t.prototype.setPivotGroupHeaderHeight=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_PIVOT_GROUP_HEADER_HEIGHT,t),this.doLayout()},t.prototype.setPivotHeaderHeight=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_PIVOT_HEADER_HEIGHT,t),this.doLayout()},t.prototype.isSideBarVisible=function(){return this.gridCore.isSideBarVisible()},t.prototype.setSideBarVisible=function(t){this.gridCore.setSideBarVisible(t)},t.prototype.setSideBarPosition=function(t){this.gridCore.setSideBarPosition(t)},t.prototype.openToolPanel=function(t){this.gridCore.openToolPanel(t)},t.prototype.closeToolPanel=function(){this.gridCore.closeToolPanel()},t.prototype.getOpenedToolPanel=function(){return this.gridCore.getOpenedToolPanel()},t.prototype.getSideBar=function(){return this.gridCore.getSideBar()},t.prototype.setSideBar=function(t){return this.gridCore.setSideBar(t)},t.prototype.setSuppressClipboardPaste=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_SUPPRESS_CLIPBOARD_PASTE,t)},t.prototype.isToolPanelShowing=function(){return this.gridCore.isToolPanelShowing()},t.prototype.doLayout=function(){this.gridPanel.checkViewportAndScrolls()},t.prototype.resetRowHeights=function(){e(this.clientSideRowModel)&&this.clientSideRowModel.resetRowHeights()},t.prototype.setGroupRemoveSingleChildren=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_GROUP_REMOVE_SINGLE_CHILDREN,t)},t.prototype.setGroupRemoveLowestSingleChildren=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,t)},t.prototype.onRowHeightChanged=function(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()},t.prototype.getValue=function(t,e){var n=this.columnController.getPrimaryColumn(t);return o(n)&&(n=this.columnController.getGridColumn(t)),o(n)?null:this.valueService.getValue(n,e)},t.prototype.addEventListener=function(t,e){var o=this.gridOptionsWrapper.useAsyncEvents();this.eventService.addEventListener(t,e,o)},t.prototype.addGlobalListener=function(t){var e=this.gridOptionsWrapper.useAsyncEvents();this.eventService.addGlobalListener(t,e)},t.prototype.removeEventListener=function(t,e){var o=this.gridOptionsWrapper.useAsyncEvents();this.eventService.removeEventListener(t,e,o)},t.prototype.removeGlobalListener=function(t){var e=this.gridOptionsWrapper.useAsyncEvents();this.eventService.removeGlobalListener(t,e)},t.prototype.dispatchEvent=function(t){this.eventService.dispatchEvent(t)},t.prototype.destroy=function(){this.destroyCalled||(this.destroyCalled=!0,this.context.destroyBean(this.gridCore),this.context.destroy())},t.prototype.cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid=function(){setTimeout(H.bind(window,this,"Grid API"),100)},t.prototype.warnIfDestroyed=function(t){return this.destroyCalled&&console.warn("AG Grid: Grid API method "+t+" was called on a grid that was destroyed."),this.destroyCalled},t.prototype.resetQuickFilter=function(){this.warnIfDestroyed("resetQuickFilter")||this.rowModel.forEachNode((function(t){return t.quickFilterAggregateText=null}))},t.prototype.getRangeSelections=function(){return console.warn("AG Grid: in v20.1.x, api.getRangeSelections() is gone, please use getCellRanges() instead.\n We had to change how cell selections works a small bit to allow charting to integrate. The return type of\n getCellRanges() is a bit different, please check the AG Grid documentation."),null},t.prototype.getCellRanges=function(){return this.rangeController?this.rangeController.getCellRanges():(console.warn("AG Grid: cell range selection is only available in AG Grid Enterprise"),null)},t.prototype.camelCaseToHumanReadable=function(t){return Yt(t)},t.prototype.addRangeSelection=function(t){console.warn("AG Grid: As of version 21.x, range selection changed slightly to allow charting integration. Please call api.addCellRange() instead of api.addRangeSelection()")},t.prototype.addCellRange=function(t){this.rangeController||console.warn("AG Grid: cell range selection is only available in AG Grid Enterprise"),this.rangeController.addCellRange(t)},t.prototype.clearRangeSelection=function(){this.rangeController||console.warn("AG Grid: cell range selection is only available in AG Grid Enterprise"),this.rangeController.removeAllCellRanges()},t.prototype.undoCellEditing=function(){this.undoRedoService.undo()},t.prototype.redoCellEditing=function(){this.undoRedoService.redo()},t.prototype.getCurrentUndoSize=function(){return this.undoRedoService.getCurrentUndoStackSize()},t.prototype.getCurrentRedoSize=function(){return this.undoRedoService.getCurrentRedoStackSize()},t.prototype.getChartModels=function(){if(ft.assertRegistered(pt.RangeSelectionModule,"api.getChartModels")&&ft.assertRegistered(pt.GridChartsModule,"api.getChartModels"))return this.chartService.getChartModels()},t.prototype.createRangeChart=function(t){if(ft.assertRegistered(pt.RangeSelectionModule,"api.createRangeChart")&&ft.assertRegistered(pt.GridChartsModule,"api.createRangeChart"))return this.chartService.createRangeChart(t)},t.prototype.createCrossFilterChart=function(t){if(ft.assertRegistered(pt.RangeSelectionModule,"api.createCrossFilterChart")&&ft.assertRegistered(pt.GridChartsModule,"api.createCrossFilterChart"))return this.chartService.createCrossFilterChart(t)},t.prototype.restoreChart=function(t,e){if(ft.assertRegistered(pt.RangeSelectionModule,"api.restoreChart")&&ft.assertRegistered(pt.GridChartsModule,"api.restoreChart"))return this.chartService.restoreChart(t,e)},t.prototype.createPivotChart=function(t){if(ft.assertRegistered(pt.RangeSelectionModule,"api.createPivotChart")&&ft.assertRegistered(pt.GridChartsModule,"api.createPivotChart"))return this.chartService.createPivotChart(t)},t.prototype.copySelectedRowsToClipboard=function(t,e){this.clipboardService||console.warn("AG Grid: clipboard is only available in AG Grid Enterprise"),this.clipboardService.copySelectedRowsToClipboard(t,e)},t.prototype.copySelectedRangeToClipboard=function(t){this.clipboardService||console.warn("AG Grid: clipboard is only available in AG Grid Enterprise"),this.clipboardService.copySelectedRangeToClipboard(t)},t.prototype.copySelectedRangeDown=function(){this.clipboardService||console.warn("AG Grid: clipboard is only available in AG Grid Enterprise"),this.clipboardService.copyRangeDown()},t.prototype.showColumnMenuAfterButtonClick=function(t,e){var o=this.columnController.getGridColumn(t);this.menuFactory.showMenuAfterButtonClick(o,e)},t.prototype.showColumnMenuAfterMouseClick=function(t,e){var o=this.columnController.getGridColumn(t);o||(o=this.columnController.getPrimaryColumn(t)),o?this.menuFactory.showMenuAfterMouseEvent(o,e):console.error("AG Grid: column '"+t+"' not found")},t.prototype.hidePopupMenu=function(){this.contextMenuFactory&&this.contextMenuFactory.hideActiveMenu(),this.menuFactory.hideActiveMenu()},t.prototype.setPopupParent=function(t){this.gridOptionsWrapper.setProperty(zr.PROP_POPUP_PARENT,t)},t.prototype.tabToNextCell=function(){return this.rowRenderer.tabToNextCell(!1)},t.prototype.tabToPreviousCell=function(){return this.rowRenderer.tabToNextCell(!0)},t.prototype.getCellRendererInstances=function(t){return void 0===t&&(t={}),this.rowRenderer.getCellRendererInstances(t)},t.prototype.getCellEditorInstances=function(t){return void 0===t&&(t={}),this.rowRenderer.getCellEditorInstances(t)},t.prototype.getEditingCells=function(){return this.rowRenderer.getEditingCells()},t.prototype.stopEditing=function(t){void 0===t&&(t=!1),this.rowRenderer.stopEditing(t)},t.prototype.startEditingCell=function(t){var e=this.columnController.getGridColumn(t.colKey);if(e){var n={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e};o(t.rowPinned)&&this.gridPanel.ensureIndexVisible(t.rowIndex),this.rowRenderer.startEditingCell(n,t.keyPress,t.charPress)}else console.warn("AG Grid: no column found for "+t.colKey)},t.prototype.addAggFunc=function(t,e){this.aggFuncService&&this.aggFuncService.addAggFunc(t,e)},t.prototype.addAggFuncs=function(t){this.aggFuncService&&this.aggFuncService.addAggFuncs(t)},t.prototype.clearAggFuncs=function(){this.aggFuncService&&this.aggFuncService.clear()},t.prototype.applyServerSideTransaction=function(t){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransaction(t);console.warn("AG Grid: Cannot apply Server Side Transaction if not using the Server Side Row Model.")},t.prototype.applyServerSideTransactionAsync=function(t,e){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransactionAsync(t,e);console.warn("AG Grid: Cannot apply Server Side Transaction if not using the Server Side Row Model.")},t.prototype.retryServerSideLoads=function(){this.serverSideRowModel?this.serverSideRowModel.retryLoads():console.warn("AG Grid: API retryServerSideLoads() can only be used when using Server-Side Row Model.")},t.prototype.flushServerSideAsyncTransactions=function(){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.flushAsyncTransactions();console.warn("AG Grid: Cannot flush Server Side Transaction if not using the Server Side Row Model.")},t.prototype.applyTransaction=function(t){if(this.clientSideRowModel){var e=this.clientSideRowModel.updateRowData(t);return this.rowRenderer.refreshFullWidthRows(e.update),this.gridOptionsWrapper.isSuppressChangeDetection()||this.rowRenderer.refreshCells(),e}console.error("AG Grid: updateRowData() only works with ClientSideRowModel. Working with InfiniteRowModel was deprecated in v23.1 and removed in v24.1")},t.prototype.updateRowData=function(t){return z((function(){return console.warn("AG Grid: as of v23.1, grid API updateRowData(transaction) is now called applyTransaction(transaction). updateRowData is deprecated and will be removed in a future major release.")}),"updateRowData deprecated"),this.applyTransaction(t)},t.prototype.applyTransactionAsync=function(t,e){this.clientSideRowModel?this.clientSideRowModel.batchUpdateRowData(t,e):console.error("AG Grid: api.applyTransactionAsync() only works with ClientSideRowModel.")},t.prototype.flushAsyncTransactions=function(){this.clientSideRowModel?this.clientSideRowModel.flushAsyncTransactions():console.error("AG Grid: api.applyTransactionAsync() only works with ClientSideRowModel.")},t.prototype.batchUpdateRowData=function(t,e){z((function(){return console.warn("AG Grid: as of v23.1, grid API batchUpdateRowData(transaction, callback) is now called applyTransactionAsync(transaction, callback). batchUpdateRowData is deprecated and will be removed in a future major release.")}),"batchUpdateRowData deprecated"),this.applyTransactionAsync(t,e)},t.prototype.insertItemsAtIndex=function(t,e,o){console.warn("AG Grid: insertItemsAtIndex() is deprecated, use updateRowData(transaction) instead."),this.updateRowData({add:e,addIndex:t,update:null,remove:null})},t.prototype.removeItems=function(t,e){console.warn("AG Grid: removeItems() is deprecated, use updateRowData(transaction) instead.");var o=t.map((function(t){return t.data}));this.updateRowData({add:null,addIndex:null,update:null,remove:o})},t.prototype.addItems=function(t,e){console.warn("AG Grid: addItems() is deprecated, use updateRowData(transaction) instead."),this.updateRowData({add:t,addIndex:null,update:null,remove:null})},t.prototype.refreshVirtualPageCache=function(){console.warn("AG Grid: refreshVirtualPageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead"),this.refreshInfiniteCache()},t.prototype.refreshInfinitePageCache=function(){console.warn("AG Grid: refreshInfinitePageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead"),this.refreshInfiniteCache()},t.prototype.refreshInfiniteCache=function(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():console.warn("AG Grid: api.refreshInfiniteCache is only available when rowModelType='infinite'.")},t.prototype.purgeVirtualPageCache=function(){console.warn("AG Grid: purgeVirtualPageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead"),this.purgeInfinitePageCache()},t.prototype.purgeInfinitePageCache=function(){console.warn("AG Grid: purgeInfinitePageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead"),this.purgeInfiniteCache()},t.prototype.purgeInfiniteCache=function(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():console.warn("AG Grid: api.purgeInfiniteCache is only available when rowModelType='infinite'.")},t.prototype.purgeEnterpriseCache=function(t){console.warn("ag-grid: since version 18.x, api.purgeEnterpriseCache() should be replaced with api.purgeServerSideCache()"),this.purgeServerSideCache(t)},t.prototype.purgeServerSideCache=function(t){void 0===t&&(t=[]),this.serverSideRowModel?(console.warn("AG Grid: since v25.0, api.purgeServerSideCache is deprecated. Please use api.refreshServerSideStore({purge: true}) instead."),this.refreshServerSideStore({route:t,purge:!0})):console.warn("AG Grid: api.purgeServerSideCache is only available when rowModelType='serverSide'.")},t.prototype.refreshServerSideStore=function(t){this.serverSideRowModel?this.serverSideRowModel.refreshStore(t):console.warn("AG Grid: api.refreshServerSideStore is only available when rowModelType='serverSide'.")},t.prototype.getServerSideStoreState=function(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(console.warn("AG Grid: api.getServerSideStoreState is only available when rowModelType='serverSide'."),[])},t.prototype.getVirtualRowCount=function(){return console.warn("AG Grid: getVirtualRowCount() is now called getInfiniteRowCount(), please call getInfiniteRowCount() instead"),this.getInfiniteRowCount()},t.prototype.getInfiniteRowCount=function(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();console.warn("AG Grid: api.getVirtualRowCount is only available when rowModelType='virtual'.")},t.prototype.isMaxRowFound=function(){return console.warn("AG Grid: api.isLastRowIndexKnown is deprecated, please use api.isLastRowIndexKnown()"),this.isLastRowIndexKnown()},t.prototype.isLastRowIndexKnown=function(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();console.warn("AG Grid: api.isMaxRowFound is only available when rowModelType='virtual'.")},t.prototype.setVirtualRowCount=function(t,e){console.warn("AG Grid: setVirtualRowCount() is now called setInfiniteRowCount(), please call setInfiniteRowCount() instead"),this.setRowCount(t,e)},t.prototype.setInfiniteRowCount=function(t,e){console.warn("AG Grid: setInfiniteRowCount() is now called setRowCount(), please call setRowCount() instead"),this.setRowCount(t,e)},t.prototype.setRowCount=function(t,e){this.infiniteRowModel?this.infiniteRowModel.setRowCount(t,e):console.warn("AG Grid: api.setRowCount is only available for Infinite Row Model.")},t.prototype.getVirtualPageState=function(){return console.warn("AG Grid: getVirtualPageState() is now called getCacheBlockState(), please call getCacheBlockState() instead"),this.getCacheBlockState()},t.prototype.getInfinitePageState=function(){return console.warn("AG Grid: getInfinitePageState() is now called getCacheBlockState(), please call getCacheBlockState() instead"),this.getCacheBlockState()},t.prototype.getCacheBlockState=function(){return this.rowNodeBlockLoader.getBlockState()},t.prototype.checkGridSize=function(){this.gridPanel.setHeaderAndFloatingHeights()},t.prototype.getFirstRenderedRow=function(){return console.warn("in AG Grid v12, getFirstRenderedRow() was renamed to getFirstDisplayedRow()"),this.getFirstDisplayedRow()},t.prototype.getFirstDisplayedRow=function(){return this.rowRenderer.getFirstVirtualRenderedRow()},t.prototype.getLastRenderedRow=function(){return console.warn("in AG Grid v12, getLastRenderedRow() was renamed to getLastDisplayedRow()"),this.getLastDisplayedRow()},t.prototype.getLastDisplayedRow=function(){return this.rowRenderer.getLastVirtualRenderedRow()},t.prototype.getDisplayedRowAtIndex=function(t){return this.rowModel.getRow(t)},t.prototype.getDisplayedRowCount=function(){return this.rowModel.getRowCount()},t.prototype.paginationIsLastPageFound=function(){return this.paginationProxy.isLastPageFound()},t.prototype.paginationGetPageSize=function(){return this.paginationProxy.getPageSize()},t.prototype.paginationSetPageSize=function(t){this.gridOptionsWrapper.setProperty("paginationPageSize",t)},t.prototype.paginationGetCurrentPage=function(){return this.paginationProxy.getCurrentPage()},t.prototype.paginationGetTotalPages=function(){return this.paginationProxy.getTotalPages()},t.prototype.paginationGetRowCount=function(){return this.paginationProxy.getMasterRowCount()},t.prototype.paginationGoToNextPage=function(){this.paginationProxy.goToNextPage()},t.prototype.paginationGoToPreviousPage=function(){this.paginationProxy.goToPreviousPage()},t.prototype.paginationGoToFirstPage=function(){this.paginationProxy.goToFirstPage()},t.prototype.paginationGoToLastPage=function(){this.paginationProxy.goToLastPage()},t.prototype.paginationGoToPage=function(t){this.paginationProxy.goToPage(t)},ja([rt("immutableService")],t.prototype,"immutableService",void 0),ja([rt("csvCreator")],t.prototype,"csvCreator",void 0),ja([rt("excelCreator")],t.prototype,"excelCreator",void 0),ja([it("rowRenderer")],t.prototype,"rowRenderer",void 0),ja([it("filterManager")],t.prototype,"filterManager",void 0),ja([it("columnController")],t.prototype,"columnController",void 0),ja([it("selectionController")],t.prototype,"selectionController",void 0),ja([it("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),ja([it("valueService")],t.prototype,"valueService",void 0),ja([it("alignedGridsService")],t.prototype,"alignedGridsService",void 0),ja([it("eventService")],t.prototype,"eventService",void 0),ja([it("pinnedRowModel")],t.prototype,"pinnedRowModel",void 0),ja([it("context")],t.prototype,"context",void 0),ja([it("rowModel")],t.prototype,"rowModel",void 0),ja([it("sortController")],t.prototype,"sortController",void 0),ja([it("paginationProxy")],t.prototype,"paginationProxy",void 0),ja([it("focusController")],t.prototype,"focusController",void 0),ja([it("dragAndDropService")],t.prototype,"dragAndDropService",void 0),ja([rt("rangeController")],t.prototype,"rangeController",void 0),ja([rt("clipboardService")],t.prototype,"clipboardService",void 0),ja([rt("aggFuncService")],t.prototype,"aggFuncService",void 0),ja([it("menuFactory")],t.prototype,"menuFactory",void 0),ja([rt("contextMenuFactory")],t.prototype,"contextMenuFactory",void 0),ja([it("valueCache")],t.prototype,"valueCache",void 0),ja([it("animationFrameService")],t.prototype,"animationFrameService",void 0),ja([rt("statusBarService")],t.prototype,"statusBarService",void 0),ja([rt("chartService")],t.prototype,"chartService",void 0),ja([rt("undoRedoService")],t.prototype,"undoRedoService",void 0),ja([rt("rowNodeBlockLoader")],t.prototype,"rowNodeBlockLoader",void 0),ja([rt("ssrmTransactionManager")],t.prototype,"serverSideTransactionManager",void 0),ja([et],t.prototype,"init",null),ja([ot],t.prototype,"cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid",null),t=ja([nt("gridApi")],t)}(),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),za=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ka=function(t,e){return function(o,n){e(o,n,t)}},Ya=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.expressionToFunctionCache={},e}Ua(e,t),e.prototype.setBeans=function(t){this.logger=t.create("ExpressionService")},e.prototype.evaluate=function(t,e){if("function"==typeof t)return t(e);if("string"==typeof t){var o=t;return this.evaluateExpression(o,e)}console.error("AG Grid: value should be either a string or a function",t)},e.prototype.evaluateExpression=function(t,e){try{return this.createExpressionFunction(t)(e.value,e.context,e.oldValue,e.newValue,e.value,e.node,e.data,e.colDef,e.rowIndex,e.api,e.columnApi,e.getValue,e.column,e.columnGroup)}catch(o){return console.log("Processing of the expression failed"),console.log("Expression = "+t),console.log("Params =",e),console.log("Exception = "+o),null}},e.prototype.createExpressionFunction=function(t){if(this.expressionToFunctionCache[t])return this.expressionToFunctionCache[t];var e=this.createFunctionBody(t),o=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",e);return this.expressionToFunctionCache[t]=o,o},e.prototype.createFunctionBody=function(t){return t.indexOf("return")>=0?t:"return "+t+";"},za([Ka(0,at("loggerFactory"))],e.prototype,"setBeans",null),e=za([nt("expressionService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),qa=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Xa=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.templateCache={},e.waitingCallbacks={},e}Ya(e,t),e.prototype.getTemplate=function(t,e){var o=this.templateCache[t];if(o)return o;var n=this.waitingCallbacks[t],i=this;if(!n){n=[],this.waitingCallbacks[t]=n;var r=new XMLHttpRequest;r.onload=function(){i.handleHttpResult(this,t)},r.open("GET",t),r.send()}return e&&n.push(e),null},e.prototype.handleHttpResult=function(t,e){if(200===t.status&&null!==t.response){this.templateCache[e]=t.response||t.responseText;for(var o=this.waitingCallbacks[e],n=0;n<o.length;n++){(0,o[n])()}if(this.$scope){var i=this;window.setTimeout((function(){i.$scope.$apply()}),0)}}else console.warn("Unable to get template error "+t.status+" - "+e)},qa([it("$scope")],e.prototype,"$scope",void 0),e=qa([nt("templateService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Qa=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},$a=function(){for(var t=0,e=0,o=arguments.length;e<o;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<o;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,i++)n[i]=r[s];return n},Za=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}var n;return Xa(o,e),n=o,o.addKeyboardModeEvents=function(t,e){var o=n.instancesMonitored.get(t);o&&o.length>0?-1===o.indexOf(e)&&o.push(e):(n.instancesMonitored.set(t,[e]),t.addEventListener("keydown",n.toggleKeyboardMode),t.addEventListener("mousedown",n.toggleKeyboardMode))},o.removeKeyboardModeEvents=function(t,e){var o=n.instancesMonitored.get(t),i=[];o&&o.length&&(i=$a(o).filter((function(t){return t!==e})),n.instancesMonitored.set(t,i)),0===i.length&&(t.removeEventListener("keydown",n.toggleKeyboardMode),t.removeEventListener("mousedown",n.toggleKeyboardMode))},o.toggleKeyboardMode=function(t){var e=n.keyboardModeActive,o="keydown"===t.type;if(!(o&&(t.ctrlKey||t.metaKey||t.altKey)||e&&o||!e&&!o)){n.keyboardModeActive=o;var i=t.target.ownerDocument;if(i){var r=n.instancesMonitored.get(i);r&&r.forEach((function(t){t.dispatchEvent({type:o?Wt.EVENT_KEYBOARD_FOCUS:Wt.EVENT_MOUSE_FOCUS})}))}}},o.prototype.init=function(){var t=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_PIVOT_MODE_CHANGED,t),this.addManagedListener(this.eventService,Wt.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_GROUP_OPENED,t),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_ROW_GROUP_CHANGED,t)},o.prototype.registerGridCore=function(t){var e=this;this.gridCore=t;var o=this.gridOptionsWrapper.getDocument();n.addKeyboardModeEvents(o,t),this.addDestroyFunc((function(){return e.unregisterGridCore(t)}))},o.prototype.unregisterGridCore=function(t){var e=this.gridOptionsWrapper.getDocument();n.removeKeyboardModeEvents(e,t)},o.prototype.onColumnEverythingChanged=function(){if(this.focusedCellPosition){var t=this.focusedCellPosition.column,e=this.columnController.getGridColumn(t.getId());t!==e&&this.clearFocusedCell()}},o.prototype.isKeyboardMode=function(){return n.keyboardModeActive},o.prototype.getFocusCellToUseAfterRefresh=function(){return this.gridOptionsWrapper.isSuppressFocusAfterRefresh()||!this.focusedCellPosition?null:this.getGridCellForDomElement(document.activeElement)?this.focusedCellPosition:null},o.prototype.getGridCellForDomElement=function(t){for(var e=t;e;){var o=this.gridOptionsWrapper.getDomData(e,vs.DOM_DATA_KEY_CELL_COMP);if(o)return o.getCellPosition();e=e.parentNode}return null},o.prototype.clearFocusedCell=function(){this.focusedCellPosition=null,this.onCellFocused(!1)},o.prototype.getFocusedCell=function(){return this.focusedCellPosition},o.prototype.setFocusedCell=function(e,o,n,i){void 0===i&&(i=!1);var r=this.columnController.getGridColumn(o);r?(this.focusedCellPosition=r?{rowIndex:e,rowPinned:t(n),column:r}:null,this.onCellFocused(i)):this.focusedCellPosition=null},o.prototype.isCellFocused=function(t){return null!=this.focusedCellPosition&&(this.focusedCellPosition.column===t.column&&this.isRowFocused(t.rowIndex,t.rowPinned))},o.prototype.isRowNodeFocused=function(t){return this.isRowFocused(t.rowIndex,t.rowPinned)},o.prototype.isHeaderWrapperFocused=function(t){if(null==this.focusedHeaderPosition)return!1;var e=t.getColumn(),o=t.getParentComponent().getRowIndex(),n=t.getPinned(),i=this.focusedHeaderPosition,r=i.column,s=i.headerRowIndex;return e===r&&o===s&&n==r.getPinned()},o.prototype.clearFocusedHeader=function(){this.focusedHeaderPosition=null},o.prototype.getFocusedHeader=function(){return this.focusedHeaderPosition},o.prototype.setFocusedHeader=function(t,e){this.focusedHeaderPosition={headerRowIndex:t,column:e}},o.prototype.focusHeaderPosition=function(t,e,o,n,i){if(void 0===e&&(e=null),void 0===o&&(o=!1),void 0===n&&(n=!1),n){var r,s=this.gridOptionsWrapper,a=this.getFocusedHeader(),l=this.headerNavigationService.getHeaderRowCount();if(o){if(r=s.getTabToNextHeaderFunc())t=r({backwards:"Before"===e,previousHeaderPosition:a,nextHeaderPosition:t,headerRowCount:l})}else if((r=s.getNavigateToNextHeaderFunc())&&i)t=r({key:i.key,previousHeaderPosition:a,nextHeaderPosition:t,headerRowCount:l,event:i})}if(!t)return!1;if(-1===t.headerRowIndex)return this.focusGridView(t.column);this.headerNavigationService.scrollToColumn(t.column,e);var p=this.headerNavigationService.getHeaderContainer(t.column.getPinned()).getRowComps()[t.headerRowIndex].getHeaderComps()[t.column.getUniqueId()];return!!p&&(p.getFocusableElement().focus(),!0)},o.prototype.isAnyCellFocused=function(){return!!this.focusedCellPosition},o.prototype.isRowFocused=function(e,o){return null!=this.focusedCellPosition&&(this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===t(o))},o.prototype.findFocusableElements=function(t,e,o){void 0===o&&(o=!1);var n=ht.FOCUSABLE_SELECTOR,i=ht.FOCUSABLE_EXCLUDE;e&&(i+=", "+e),o&&(i+=', [tabindex="-1"]');var r=Array.prototype.slice.apply(t.querySelectorAll(n)),s=Array.prototype.slice.apply(t.querySelectorAll(i));if(!s.length)return r;var a;return a=s,r.filter((function(t){return-1===a.indexOf(t)}))},o.prototype.focusInto=function(t,e,o){void 0===e&&(e=!1),void 0===o&&(o=!1);var n=this.findFocusableElements(t,null,o),i=e?d(n):n[0];return!!i&&(i.focus(),!0)},o.prototype.findNextFocusableElement=function(t,e,o){var n=this.findFocusableElements(t,e?':not([tabindex="-1"])':null),i=(e?E(n,(function(t){return t.contains(document.activeElement)})):n.indexOf(document.activeElement))+(o?-1:1);return i<0||i>=n.length?null:n[i]},o.prototype.isFocusUnderManagedComponent=function(t){var e=t.querySelectorAll("."+Zn.FOCUS_MANAGED_CLASS);if(!e.length)return!1;for(var o=0;o<e.length;o++)if(e[o].contains(document.activeElement))return!0;return!1},o.prototype.findTabbableParent=function(t,e){void 0===e&&(e=5);for(var o=0;t&&null===Te(t)&&++o<=e;)t=t.parentElement;return null===Te(t)?null:t},o.prototype.onCellFocused=function(t){var e={type:Wt.EVENT_CELL_FOCUSED,forceBrowserFocus:t,rowIndex:null,column:null,floating:null,api:this.gridApi,columnApi:this.columnApi,rowPinned:null};this.focusedCellPosition&&(e.rowIndex=this.focusedCellPosition.rowIndex,e.column=this.focusedCellPosition.column,e.rowPinned=this.focusedCellPosition.rowPinned),this.eventService.dispatchEvent(e)},o.prototype.focusGridView=function(e,o){var n=o?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!n)return!1;var i=n.rowIndex,r=n.rowPinned,s=this.getFocusedHeader();if(!e&&s&&(e=s.column),null==i||!e)return!1;if(this.rowRenderer.ensureCellVisible({rowIndex:i,column:e,rowPinned:r}),this.setFocusedCell(i,e,t(r),!0),this.rangeController){var a={rowIndex:i,rowPinned:r,column:e};this.rangeController.setRangeToCell(a)}return!0},o.prototype.focusNextGridCoreContainer=function(t){return!!this.gridCore.focusNextInnerContainer(t)||(t||this.gridCore.forceFocusOutOfContainer(),!1)},o.AG_KEYBOARD_FOCUS="ag-keyboard-focus",o.keyboardModeActive=!1,o.instancesMonitored=new Map,Qa([it("columnController")],o.prototype,"columnController",void 0),Qa([it("headerNavigationService")],o.prototype,"headerNavigationService",void 0),Qa([it("columnApi")],o.prototype,"columnApi",void 0),Qa([it("gridApi")],o.prototype,"gridApi",void 0),Qa([it("rowRenderer")],o.prototype,"rowRenderer",void 0),Qa([it("rowPositionUtils")],o.prototype,"rowPositionUtils",void 0),Qa([rt("rangeController")],o.prototype,"rangeController",void 0),Qa([et],o.prototype,"init",null),o=n=Qa([nt("focusController")],o)}(Mt),Ja=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),tl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},el=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.popupList=[],e}Ja(e,t),e.prototype.registerGridCore=function(t){var e=this;this.gridCore=t,this.addManagedListener(this.gridCore,Wt.EVENT_KEYBOARD_FOCUS,(function(){P(e.popupList,(function(t){return Me(t.element,Za.AG_KEYBOARD_FOCUS)}))})),this.addManagedListener(this.gridCore,Wt.EVENT_MOUSE_FOCUS,(function(){P(e.popupList,(function(t){return xe(t.element,Za.AG_KEYBOARD_FOCUS)}))}))},e.prototype.getPopupParent=function(){var t=this.gridOptionsWrapper.getPopupParent();return t||this.gridCore.getRootGui()},e.prototype.positionPopupForMenu=function(t){var e=t.eventSource.getBoundingClientRect(),o=this.getParentRect(),n=this.keepYWithinBounds(t,e.top-o.top),i=t.ePopup.clientWidth>0?t.ePopup.clientWidth:200;t.ePopup.style.minWidth=i+"px";var r,s=o.right-o.left-i;function a(){return e.right-o.left-2}function l(){return e.left-o.left-i}this.gridOptionsWrapper.isEnableRtl()?((r=l())<0&&(r=a()),r>s&&(r=0)):((r=a())>s&&(r=l()),r<0&&(r=0)),t.ePopup.style.left=r+"px",t.ePopup.style.top=n+"px"},e.prototype.positionPopupUnderMouseEvent=function(t){var e=this.calculatePointerAlign(t.mouseEvent),o=e.x,n=e.y,i=t.ePopup,r=t.nudgeX,s=t.nudgeY;this.positionPopup({ePopup:i,x:o,y:n,nudgeX:r,nudgeY:s,keepWithinBounds:!0}),this.callPostProcessPopup(t.type,t.ePopup,null,t.mouseEvent,t.column,t.rowNode)},e.prototype.calculatePointerAlign=function(t){var e=this.getParentRect();return{x:t.clientX-e.left,y:t.clientY-e.top}},e.prototype.positionPopupUnderComponent=function(t){var e=t.eventSource.getBoundingClientRect(),o=t.alignSide||"left",n=this.getParentRect(),i=e.left-n.left;"right"===o&&(i-=t.ePopup.offsetWidth-e.width),this.positionPopup({ePopup:t.ePopup,minWidth:t.minWidth,minHeight:t.minHeight,nudgeX:t.nudgeX,nudgeY:t.nudgeY,x:i,y:e.top-n.top+e.height,keepWithinBounds:t.keepWithinBounds}),this.callPostProcessPopup(t.type,t.ePopup,t.eventSource,null,t.column,t.rowNode)},e.prototype.positionPopupOverComponent=function(t){var e=t.eventSource.getBoundingClientRect(),o=this.getParentRect();this.positionPopup({ePopup:t.ePopup,minWidth:t.minWidth,nudgeX:t.nudgeX,nudgeY:t.nudgeY,x:e.left-o.left,y:e.top-o.top,keepWithinBounds:t.keepWithinBounds}),this.callPostProcessPopup(t.type,t.ePopup,t.eventSource,null,t.column,t.rowNode)},e.prototype.callPostProcessPopup=function(t,e,o,n,i,r){var s=this.gridOptionsWrapper.getPostProcessPopupFunc();s&&s({column:i,rowNode:r,ePopup:e,type:t,eventSource:o,mouseEvent:n})},e.prototype.positionPopup=function(t){var e=t.x,o=t.y;t.nudgeX&&(e+=t.nudgeX),t.nudgeY&&(o+=t.nudgeY),t.keepWithinBounds&&(e=this.keepXWithinBounds(t,e),o=this.keepYWithinBounds(t,o)),t.ePopup.style.left=e+"px",t.ePopup.style.top=o+"px"},e.prototype.getActivePopups=function(){return this.popupList.map((function(t){return t.element}))},e.prototype.getParentRect=function(){var t=this.getPopupParent(),e=this.gridOptionsWrapper.getDocument();t===e.body&&(t=e.documentElement);var o=getComputedStyle(t),n=t.getBoundingClientRect();return{top:n.top+parseFloat(o.borderTopWidth)||0,left:n.left+parseFloat(o.borderLeftWidth)||0,right:n.right+parseFloat(o.borderRightWidth)||0,bottom:n.bottom+parseFloat(o.borderBottomWidth)||0}},e.prototype.keepYWithinBounds=function(t,e){var o=this.gridOptionsWrapper.getDocument(),n=o.documentElement,i=this.getPopupParent(),r=i.getBoundingClientRect(),s=o.documentElement.getBoundingClientRect(),a=i===o.body,l=Math.min(200,r.height),p=0;t.minHeight&&t.minHeight<l?l=t.minHeight:t.ePopup.offsetHeight>0&&(l=t.ePopup.clientHeight,p=qe(t.ePopup)-l);var u=a?qe(n)+n.scrollTop:r.height;a&&(u-=Math.abs(s.top-r.top));var c=u-l-p;return Math.min(Math.max(e,0),Math.abs(c))},e.prototype.keepXWithinBounds=function(t,e){var o=this.gridOptionsWrapper.getDocument(),n=o.documentElement,i=this.getPopupParent(),r=i.getBoundingClientRect(),s=o.documentElement.getBoundingClientRect(),a=i===o.body,l=t.ePopup,p=Math.min(200,r.width),u=0;t.minWidth&&t.minWidth<p?p=t.minWidth:l.offsetWidth>0&&(p=l.offsetWidth,l.style.minWidth=p+"px",u=Xe(l)-p);var c=a?Xe(n)+n.scrollLeft:r.width;a&&(c-=Math.abs(s.left-r.left));var d=c-p-u;return Math.min(Math.max(e,0),Math.abs(d))},e.prototype.keepPopupPositionedRelativeTo=function(t){var e=this.getPopupParent(),o=e.getBoundingClientRect(),n=t.element.getBoundingClientRect(),i=o.top-n.top,r=o.left-n.left,s=i,a=r,l=t.ePopup.style.top,p=parseInt(l.substring(0,l.length-1),10),u=t.ePopup.style.left,c=parseInt(u.substring(0,u.length-1),10),d=window.setInterval((function(){var o=e.getBoundingClientRect(),n=t.element.getBoundingClientRect();if(0==n.top&&0==n.left&&0==n.height&&0==n.width)t.hidePopup();else{var l=o.top-n.top;if(l!=s){var u=p+i-l;t.ePopup.style.top=u+"px"}s=l;var d=o.left-n.left;if(d!=a){var h=c+r-d;t.ePopup.style.left=h+"px"}a=d}}),200);return function(){null!=d&&window.clearInterval(d),d=void 0}},e.prototype.addPopup=function(t){var e=this,o=t.modal,n=t.eChild,i=t.closeOnEsc,r=t.closedCallback,s=t.click,a=t.alwaysOnTop,l=t.afterGuiAttached,p=t.positionCallback,u=t.anchorToElement,c=this.gridOptionsWrapper.getDocument();if(c){var d=E(this.popupList,(function(t){return t.element===n}));if(-1!==d){var h=this.popupList[d];return{hideFunc:h.hideFunc,stopAnchoringFunc:h.stopAnchoringFunc}}var f=this.getPopupParent();f.appendChild(n),null==n.style.top&&(n.style.top="0px"),null==n.style.left&&(n.style.left="0px");var g=document.createElement("div"),y=this.environment.getTheme().theme;y&&Me(g,y),Me(g,"ag-popup"),Me(n,this.gridOptionsWrapper.isEnableRtl()?"ag-rtl":"ag-ltr"),Me(n,"ag-popup-child"),this.focusController.isKeyboardMode()&&Me(n,Za.AG_KEYBOARD_FOCUS),g.appendChild(n),f.appendChild(g),a?this.setAlwaysOnTop(g,!0):this.bringPopupToFront(g);var v,m=!1,C=function(t){g.contains(document.activeElement)&&((t.which||t.keyCode)===jn.ESCAPE&&O({keyboardEvent:t}))},w=function(t){return O({mouseEvent:t})},R=function(t){return O({touchEvent:t})},O=function(t){void 0===t&&(t={});var o=t.mouseEvent,i=t.touchEvent,a=t.keyboardEvent;e.isEventFromCurrentPopup({mouseEvent:o,touchEvent:i},n)||e.isEventSameChainAsOriginalEvent({originalMouseEvent:s,mouseEvent:o,touchEvent:i})||m||(m=!0,f.removeChild(g),c.removeEventListener("keydown",C),c.removeEventListener("mousedown",w),c.removeEventListener("touchstart",R),c.removeEventListener("contextmenu",w),e.eventService.removeEventListener(Wt.EVENT_DRAG_STARTED,w),r&&r(o||i||a),e.popupList=e.popupList.filter((function(t){return t.element!==n})),v&&v())};return l&&l({hidePopup:O}),window.setTimeout((function(){i&&c.addEventListener("keydown",C),o&&(c.addEventListener("mousedown",w),e.eventService.addEventListener(Wt.EVENT_DRAG_STARTED,w),c.addEventListener("touchstart",R),c.addEventListener("contextmenu",w))}),0),p&&p(),u&&(v=this.keepPopupPositionedRelativeTo({element:u,ePopup:n,hidePopup:O})),this.popupList.push({element:n,hideFunc:O,stopAnchoringFunc:v}),{hideFunc:O,stopAnchoringFunc:v}}console.warn("ag-grid: could not find the document, document is empty")},e.prototype.isEventFromCurrentPopup=function(t,e){var o=t.mouseEvent,n=t.touchEvent,i=o||n;if(!i)return!1;var r=E(this.popupList,(function(t){return t.element===e}));if(-1===r)return!1;for(var s=r;s<this.popupList.length;s++){if(Tt(this.popupList[s].element,i))return!0}return this.isElementWithinCustomPopup(i.target)},e.prototype.isElementWithinCustomPopup=function(t){if(!this.popupList.length)return!1;for(;t&&t!==document.body;){if(t.classList.contains("ag-custom-component-popup")||null===t.parentElement)return!0;t=t.parentElement}return!1},e.prototype.isEventSameChainAsOriginalEvent=function(t){var e=t.originalMouseEvent,o=t.mouseEvent,n=t.touchEvent,i=null;if(o?i=o:n&&(i=n.touches[0]),i&&e){var r=o?o.screenX:0,s=o?o.screenY:0,a=Math.abs(e.screenX-r)<5,l=Math.abs(e.screenY-s)<5;if(a&&l)return!0}return!1},e.prototype.getWrapper=function(t){for(;!He(t,"ag-popup")&&t.parentElement;)t=t.parentElement;return He(t,"ag-popup")?t:null},e.prototype.setAlwaysOnTop=function(t,e){var o=this.getWrapper(t);o&&(Ve(o,"ag-always-on-top",!!e),e&&this.bringPopupToFront(o))},e.prototype.bringPopupToFront=function(t){var e=this.getPopupParent(),o=Array.prototype.slice.call(e.querySelectorAll(".ag-popup")),n=o.length,i=Array.prototype.slice.call(e.querySelectorAll(".ag-popup.ag-always-on-top")),r=i.length,s=this.getWrapper(t);if(s&&!(n<=1)&&e.contains(t)){var a=o.indexOf(s);if(r)He(s,"ag-always-on-top")?a!==n-1&&d(i).insertAdjacentElement("afterend",s):a!==n-r-1&&i[0].insertAdjacentElement("beforebegin",s);else a!==n-1&&d(o).insertAdjacentElement("afterend",s);var l={type:"popupToFront",api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),eWrapper:s};this.eventService.dispatchEvent(l)}},tl([it("environment")],e.prototype,"environment",void 0),tl([it("focusController")],e.prototype,"focusController",void 0),e=tl([nt("popupService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),ol=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},nl=function(t,e){return function(o,n){e(o,n,t)}},il=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}el(e,t),e.prototype.setBeans=function(t){this.logging=t.isDebug()},e.prototype.create=function(t){return new il(t,this.isLogging.bind(this))},e.prototype.isLogging=function(){return this.logging},ol([nl(0,at("gridOptionsWrapper"))],e.prototype,"setBeans",null),e=ol([nt("loggerFactory")],e)}(Mt),function(){function t(t,e){this.name=t,this.isLoggingFunc=e}return t.prototype.isLogging=function(){return this.isLoggingFunc()},t.prototype.log=function(t){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+t)},t}()),rl=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),sl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},al=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}rl(e,t),e.prototype.registerGridComp=function(t){this.gridPanel=t},e.prototype.registerHeaderRootComp=function(t){this.headerRootComp=t},e.prototype.getPreferredWidthForColumn=function(t,e){var o=this.getHeaderCellForColumn(t);if(!o)return-1;var n=document.createElement("span");n.style.position="fixed";var i=this.gridPanel.getCenterContainer();i.appendChild(n),this.putRowCellsIntoDummyContainer(t,n),e||this.cloneItemIntoDummy(o,n);var r=n.offsetWidth;return i.removeChild(n),r+this.gridOptionsWrapper.getAutoSizePadding()},e.prototype.getHeaderCellForColumn=function(t){var e=null;return this.headerRootComp.forEachHeaderElement((function(o){if(o instanceof Qs){var n=o;n.getColumn()===t&&(e=n)}})),e?e.getGui():null},e.prototype.putRowCellsIntoDummyContainer=function(t,e){var o=this;this.rowRenderer.getAllCellsForColumn(t).forEach((function(t){return o.cloneItemIntoDummy(t,e)}))},e.prototype.cloneItemIntoDummy=function(t,e){var o=t.cloneNode(!0);o.style.width="",o.style.position="static",o.style.left="";var n=document.createElement("div");He(o,"ag-header-cell")?(Me(n,"ag-header"),Me(n,"ag-header-row"),n.style.position="static"):Me(n,"ag-row"),n.style.display="table-row",n.appendChild(o),e.appendChild(n)},sl([it("rowRenderer")],e.prototype,"rowRenderer",void 0),e=sl([nt("autoWidthCalculator")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),ll=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},pl=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}al(e,t),e.prototype.addResizeBar=function(t){var e=this,o={dragStartPixels:t.dragStartPixels||0,eElement:t.eResizeBar,onDragStart:this.onDragStart.bind(this,t),onDragStop:this.onDragStop.bind(this,t),onDragging:this.onDragging.bind(this,t)};this.dragService.addDragSource(o,!0);return function(){return e.dragService.removeDragSource(o)}},e.prototype.onDragStart=function(t,e){this.dragStartX=e.clientX,this.setResizeIcons();var o=e instanceof MouseEvent&&!0===e.shiftKey;t.onResizeStart(o)},e.prototype.setResizeIcons=function(){this.oldBodyCursor=this.eGridDiv.style.cursor,this.oldUserSelect=this.eGridDiv.style.userSelect,this.oldWebkitUserSelect=this.eGridDiv.style.webkitUserSelect,this.eGridDiv.style.cursor="ew-resize",this.eGridDiv.style.userSelect="none",this.eGridDiv.style.webkitUserSelect="none"},e.prototype.onDragStop=function(t,e){t.onResizeEnd(this.resizeAmount),this.resetIcons()},e.prototype.resetIcons=function(){this.eGridDiv.style.cursor=this.oldBodyCursor,this.eGridDiv.style.userSelect=this.oldUserSelect,this.eGridDiv.style.webkitUserSelect=this.oldWebkitUserSelect},e.prototype.onDragging=function(t,e){this.resizeAmount=e.clientX-this.dragStartX,t.onResizing(this.resizeAmount)},ll([it("dragService")],e.prototype,"dragService",void 0),ll([it("eGridDiv")],e.prototype,"eGridDiv",void 0),e=ll([nt("horizontalResizeService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),ul=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},cl=(function(t){function e(){return t.call(this,void 0,!0)||this}pl(e,t),e.prototype.postConstruct=function(){var e=this;this.logger=this.loggerFactory.create("GridCore");var o=this.createTemplate();if(this.setTemplate(o),[this.gridApi,this.rowRenderer,this.popupService,this.focusController].forEach((function(t){return t.registerGridCore(e)})),ft.isRegistered(pt.ClipboardModule)&&this.clipboardService.registerGridCore(this),this.gridOptionsWrapper.addLayoutElement(this.getGui()),this.eGridDiv.appendChild(this.getGui()),this.addDestroyFunc((function(){e.eGridDiv.removeChild(e.getGui())})),this.$scope){var n=this.$scope.$watch(this.quickFilterOnScope,(function(t){return e.filterManager.setQuickFilter(t)}));this.addDestroyFunc(n)}this.addRtlSupport(),this.logger.log("ready"),this.gridOptionsWrapper.addLayoutElement(this.eRootWrapperBody);var i=this.resizeObserverService.observeResize(this.eGridDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc((function(){return i()}));var r=this.getGui();this.addManagedListener(this,Wt.EVENT_KEYBOARD_FOCUS,(function(){Me(r,Za.AG_KEYBOARD_FOCUS)})),this.addManagedListener(this,Wt.EVENT_MOUSE_FOCUS,(function(){xe(r,Za.AG_KEYBOARD_FOCUS)})),t.prototype.postConstruct.call(this)},e.prototype.getFocusableElement=function(){return this.eRootWrapperBody},e.prototype.createTemplate=function(){var t=ft.isRegistered(pt.SideBarModule),e=ft.isRegistered(pt.StatusBarModule);return'<div ref="eRootWrapper" class="ag-root-wrapper">\n '+(ft.isRegistered(pt.RowGroupingModule)?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"")+'\n <div class="ag-root-wrapper-body" ref="rootWrapperBody">\n <ag-grid-comp ref="gridPanel"></ag-grid-comp>\n '+(t?'<ag-side-bar ref="sideBar"></ag-side-bar>':"")+"\n </div>\n "+(e?'<ag-status-bar ref="statusBar"></ag-status-bar>':"")+"\n <ag-pagination></ag-pagination>\n "+(ft.isRegistered(pt.EnterpriseCoreModule)?"<ag-watermark></ag-watermark>":"")+"\n </div>"},e.prototype.getFocusableContainers=function(){var t=[this.gridPanel.getGui()];return this.sideBarComp&&t.push(this.sideBarComp.getGui()),t.filter((function(t){return eo(t)}))},e.prototype.focusNextInnerContainer=function(t){var e=this.getFocusableContainers(),o=E(e,(function(t){return t.contains(document.activeElement)}))+(t?-1:1);return!(o<0||o>=e.length)&&(0===o?this.focusGridHeader():this.focusController.focusInto(e[o]))},e.prototype.focusInnerElement=function(t){var e=this.getFocusableContainers();if(t){if(e.length>1)return this.focusController.focusInto(d(e));var o=d(this.columnController.getAllDisplayedColumns());if(this.focusController.focusGridView(o,!0))return!0}return this.focusGridHeader()},e.prototype.focusGridHeader=function(){var t=this.columnController.getAllDisplayedColumns()[0];return!!t&&(t.getParent()&&(t=this.columnController.getColumnGroupAtLevel(t,0)),this.focusController.focusHeaderPosition({headerRowIndex:0,column:t}),!0)},e.prototype.onGridSizeChanged=function(){var t={type:Wt.EVENT_GRID_SIZE_CHANGED,api:this.gridApi,columnApi:this.columnApi,clientWidth:this.eGridDiv.clientWidth,clientHeight:this.eGridDiv.clientHeight};this.eventService.dispatchEvent(t)},e.prototype.addRtlSupport=function(){var t=this.gridOptionsWrapper.isEnableRtl()?"ag-rtl":"ag-ltr";Me(this.getGui(),t)},e.prototype.getRootGui=function(){return this.getGui()},e.prototype.isSideBarVisible=function(){return!!this.sideBarComp&&this.sideBarComp.isDisplayed()},e.prototype.setSideBarVisible=function(t){this.sideBarComp?this.sideBarComp.setDisplayed(t):t&&console.warn("AG Grid: sideBar is not loaded")},e.prototype.setSideBarPosition=function(t){this.sideBarComp?this.sideBarComp.setSideBarPosition(t):console.warn("AG Grid: sideBar is not loaded")},e.prototype.closeToolPanel=function(){this.sideBarComp?this.sideBarComp.close():console.warn("AG Grid: toolPanel is only available in AG Grid Enterprise")},e.prototype.getSideBar=function(){return this.gridOptions.sideBar},e.prototype.getToolPanelInstance=function(t){if(this.sideBarComp)return this.sideBarComp.getToolPanelInstance(t);console.warn("AG Grid: toolPanel is only available in AG Grid Enterprise")},e.prototype.refreshSideBar=function(){this.sideBarComp&&this.sideBarComp.refresh()},e.prototype.setSideBar=function(t){this.sideBarComp&&(this.eRootWrapperBody.removeChild(this.sideBarComp.getGui()),this.gridOptions.sideBar=xr.parse(t),this.sideBarComp.reset(),this.eRootWrapperBody.appendChild(this.sideBarComp.getGui()))},e.prototype.getOpenedToolPanel=function(){return this.sideBarComp?this.sideBarComp.openedItem():null},e.prototype.openToolPanel=function(t){this.sideBarComp?this.sideBarComp.openToolPanel(t):console.warn("AG Grid: toolPanel is only available in AG Grid Enterprise")},e.prototype.isToolPanelShowing=function(){return this.sideBarComp.isToolPanelShowing()},e.prototype.destroy=function(){this.logger.log("Grid DOM removed"),t.prototype.destroy.call(this)},e.prototype.ensureNodeVisible=function(t,e){if(void 0===e&&(e=null),this.doingVirtualPaging)throw new Error("Cannot use ensureNodeVisible when doing virtual paging, as we cannot check rows that are not in memory");for(var o=this.rowModel.getRowCount(),n="function"==typeof t,i=-1,r=0;r<o;r++){var s=this.rowModel.getRow(r);if(n){if(t(s)){i=r;break}}else if(t===s||t===s.data){i=r;break}}i>=0&&this.gridPanel.ensureIndexVisible(i,e)},e.prototype.onTabKeyDown=function(){},ul([it("gridOptions")],e.prototype,"gridOptions",void 0),ul([it("rowModel")],e.prototype,"rowModel",void 0),ul([it("resizeObserverService")],e.prototype,"resizeObserverService",void 0),ul([it("rowRenderer")],e.prototype,"rowRenderer",void 0),ul([it("filterManager")],e.prototype,"filterManager",void 0),ul([it("eGridDiv")],e.prototype,"eGridDiv",void 0),ul([it("$scope")],e.prototype,"$scope",void 0),ul([it("quickFilterOnScope")],e.prototype,"quickFilterOnScope",void 0),ul([it("popupService")],e.prototype,"popupService",void 0),ul([it("columnController")],e.prototype,"columnController",void 0),ul([it("loggerFactory")],e.prototype,"loggerFactory",void 0),ul([it("columnApi")],e.prototype,"columnApi",void 0),ul([it("gridApi")],e.prototype,"gridApi",void 0),ul([rt("clipboardService")],e.prototype,"clipboardService",void 0),ul([Wn("gridPanel")],e.prototype,"gridPanel",void 0),ul([Wn("sideBar")],e.prototype,"sideBarComp",void 0),ul([Wn("rootWrapperBody")],e.prototype,"eRootWrapperBody",void 0)}(Zn),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),dl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},hl=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}cl(e,t),e.prototype.registerGridComp=function(t){this.gridPanel=t},e.prototype.hideActiveMenu=function(){this.hidePopup&&this.hidePopup()},e.prototype.showMenuAfterMouseEvent=function(t,e){var o=this;this.showPopup(t,(function(n){o.popupService.positionPopupUnderMouseEvent({column:t,type:"columnMenu",mouseEvent:e,ePopup:n})}),e.target)},e.prototype.showMenuAfterButtonClick=function(t,e){var o=this;this.showPopup(t,(function(n){o.popupService.positionPopupUnderComponent({type:"columnMenu",eventSource:e,ePopup:n,keepWithinBounds:!0,column:t})}),e)},e.prototype.showPopup=function(t,e,o){var n,i=this,r=this.filterManager.getOrCreateFilterWrapper(t,"COLUMN_MENU"),s=document.createElement("div");s.setAttribute("role","presentation"),Me(s,"ag-menu"),this.tabListener=this.addManagedListener(s,"keydown",(function(t){return i.trapFocusWithin(t,s)})),r.guiPromise.then((function(t){return s.appendChild(t)}));var a=o||this.gridPanel.getGui(),l=this.popupService.addPopup({modal:!0,eChild:s,closeOnEsc:!0,closedCallback:function(e){t.setMenuVisible(!1,"contextMenu");var n=e instanceof KeyboardEvent;if(i.tabListener&&(i.tabListener=i.tabListener()),n&&o&&eo(o)){var r=i.focusController.findTabbableParent(o);r&&r.focus()}},positionCallback:function(){return e(s)},anchorToElement:a});l&&(this.hidePopup=n=l.hideFunc),r.filterPromise.then((function(t){e(s),t.afterGuiAttached&&t.afterGuiAttached({container:"columnMenu",hidePopup:n})})),t.setMenuVisible(!0,"contextMenu")},e.prototype.trapFocusWithin=function(t,e){t.keyCode!==jn.TAB||t.defaultPrevented||this.focusController.findNextFocusableElement(e,!1,t.shiftKey)||(t.preventDefault(),this.focusController.focusInto(e,t.shiftKey))},e.prototype.isMenuEnabled=function(t){return t.isFilterAllowed()},dl([it("filterManager")],e.prototype,"filterManager",void 0),dl([it("popupService")],e.prototype,"popupService",void 0),dl([it("focusController")],e.prototype,"focusController",void 0),e=dl([nt("menuFactory")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),fl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},gl=(function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.dragEndFunctions=[],e.dragSources=[],e}hl(o,t),o.prototype.init=function(){this.logger=this.loggerFactory.create("DragService")},o.prototype.removeAllListeners=function(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0},o.prototype.removeListener=function(t){var e=t.dragSource.eElement,o=t.mouseDownListener;if(e.removeEventListener("mousedown",o),t.touchEnabled){var n=t.touchStartListener;e.removeEventListener("touchstart",n,{passive:!0})}},o.prototype.removeDragSource=function(t){var e=a(this.dragSources,(function(e){return e.dragSource===t}));e&&(this.removeListener(e),g(this.dragSources,e))},o.prototype.setNoSelectToBody=function(t){var o=this.gridOptionsWrapper.getDocument().querySelector("body");e(o)&&Ve(o,"ag-unselectable",t)},o.prototype.isDragging=function(){return this.dragging},o.prototype.addDragSource=function(t,e){void 0===e&&(e=!1);var o=this.onMouseDown.bind(this,t);t.eElement.addEventListener("mousedown",o);var n=null,i=this.gridOptionsWrapper.isSuppressTouch();e&&!i&&(n=this.onTouchStart.bind(this,t),t.eElement.addEventListener("touchstart",n,{passive:!0})),this.dragSources.push({dragSource:t,mouseDownListener:o,touchStartListener:n,touchEnabled:e})},o.prototype.onTouchStart=function(t,e){var o=this;this.currentDragParams=t,this.dragging=!1;var n=e.touches[0];this.touchLastTime=n,this.touchStart=n;var i=function(e){return o.onTouchUp(e,t.eElement)},r=t.eElement,s=[{target:document,type:"touchmove",listener:function(t){t.cancelable&&t.preventDefault()},options:{passive:!1}},{target:r,type:"touchmove",listener:function(e){return o.onTouchMove(e,t.eElement)},options:{passive:!0}},{target:r,type:"touchend",listener:i,options:{passive:!0}},{target:r,type:"touchcancel",listener:i,options:{passive:!0}}];this.addTemporaryEvents(s),0===t.dragStartPixels&&this.onCommonMove(n,this.touchStart,t.eElement)},o.prototype.onMouseDown=function(t,e){var o=this,n=e;if(!(t.skipMouseEvent&&t.skipMouseEvent(e)||n._alreadyProcessedByDragService||(n._alreadyProcessedByDragService=!0,0!==e.button))){this.currentDragParams=t,this.dragging=!1,this.mouseStartEvent=e;var i=this.gridOptionsWrapper.getDocument();this.setNoSelectToBody(!0);var r=[{target:i,type:"mousemove",listener:function(e){return o.onMouseMove(e,t.eElement)}},{target:i,type:"mouseup",listener:function(e){return o.onMouseUp(e,t.eElement)}},{target:i,type:"contextmenu",listener:function(t){return t.preventDefault()}}];this.addTemporaryEvents(r),0===t.dragStartPixels&&this.onMouseMove(e,t.eElement)}},o.prototype.addTemporaryEvents=function(t){t.forEach((function(t){var e=t.target,o=t.type,n=t.listener,i=t.options;e.addEventListener(o,n,i)})),this.dragEndFunctions.push((function(){t.forEach((function(t){var e=t.target,o=t.type,n=t.listener,i=t.options;e.removeEventListener(o,n,i)}))}))},o.prototype.isEventNearStartEvent=function(t,o){var n=this.currentDragParams.dragStartPixels;return Cn(t,o,e(n)?n:4)},o.prototype.getFirstActiveTouch=function(t){for(var e=0;e<t.length;e++)if(t[e].identifier===this.touchStart.identifier)return t[e];return null},o.prototype.onCommonMove=function(t,e,o){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(t,e))return;this.dragging=!0;var n={type:Wt.EVENT_DRAG_STARTED,api:this.gridApi,columnApi:this.columnApi,target:o};this.eventService.dispatchEvent(n),this.currentDragParams.onDragStart(e),this.currentDragParams.onDragging(e)}this.currentDragParams.onDragging(t)},o.prototype.onTouchMove=function(t,e){var o=this.getFirstActiveTouch(t.touches);o&&this.onCommonMove(o,this.touchStart,e)},o.prototype.onMouseMove=function(t,e){this.onCommonMove(t,this.mouseStartEvent,e)},o.prototype.onTouchUp=function(t,e){var o=this.getFirstActiveTouch(t.changedTouches);o||(o=this.touchLastTime),this.onUpCommon(o,e)},o.prototype.onMouseUp=function(t,e){this.onUpCommon(t,e)},o.prototype.onUpCommon=function(t,e){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(t);var o={type:Wt.EVENT_DRAG_STOPPED,api:this.gridApi,columnApi:this.columnApi,target:e};this.eventService.dispatchEvent(o)}this.setNoSelectToBody(!1),this.mouseStartEvent=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach((function(t){return t()})),this.dragEndFunctions.length=0},fl([it("loggerFactory")],o.prototype,"loggerFactory",void 0),fl([it("columnApi")],o.prototype,"columnApi",void 0),fl([it("gridApi")],o.prototype,"gridApi",void 0),fl([et],o.prototype,"init",null),fl([ot],o.prototype,"removeAllListeners",null),o=fl([nt("dragService")],o)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),yl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},vl=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var o;gl(e,t),o=e,e.prototype.progressSort=function(t,e,o){void 0===o&&(o="api");var n=this.getNextSortDirection(t);this.setSortForColumn(t,n,e,o)},e.prototype.setSortForColumn=function(t,e,o,n){void 0===n&&(n="api"),e!==ht.SORT_ASC&&e!==ht.SORT_DESC&&(e=null),t.setSort(e,n),o&&!this.gridOptionsWrapper.isSuppressMultiSort()||this.clearSortBarThisColumn(t,n),this.updateSortIndex(t),this.dispatchSortChangedEvents()},e.prototype.updateSortIndex=function(t){var e=this.getColumnsWithSortingOrdered(),o=0;e.forEach((function(e){e!==t&&(e.setSortIndex(o),o++)})),t.getSort()&&t.setSortIndex(o),this.columnController.getPrimaryAndSecondaryAndAutoColumns().filter((function(t){return null==t.getSort()})).forEach((function(t){return t.setSortIndex()}))},e.prototype.onSortChanged=function(){this.dispatchSortChangedEvents()},e.prototype.isSortActive=function(){var t=this.columnController.getPrimaryAndSecondaryAndAutoColumns().filter((function(t){return!!t.getSort()}));return t&&t.length>0},e.prototype.dispatchSortChangedEvents=function(){var t={type:Wt.EVENT_SORT_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t)},e.prototype.clearSortBarThisColumn=function(t,e){this.columnController.getPrimaryAndSecondaryAndAutoColumns().forEach((function(o){o!==t&&o.setSort(void 0,e)}))},e.prototype.getNextSortDirection=function(t){var e;if(e=t.getColDef().sortingOrder?t.getColDef().sortingOrder:this.gridOptionsWrapper.getSortingOrder()?this.gridOptionsWrapper.getSortingOrder():o.DEFAULT_SORTING_ORDER,!Array.isArray(e)||e.length<=0)return console.warn("ag-grid: sortingOrder must be an array with at least one element, currently it's "+e),null;var n,i=e.indexOf(t.getSort()),r=i<0,s=i==e.length-1;return n=r||s?e[0]:e[i+1],o.DEFAULT_SORTING_ORDER.indexOf(n)<0?(console.warn("ag-grid: invalid sort type "+n),null):n},e.prototype.getColumnsWithSortingOrdered=function(){var t=this.columnController.getPrimaryAndSecondaryAndAutoColumns(),e=t.filter((function(t){return!!t.getSort()})),o={};return t.forEach((function(t,e){return o[t.getId()]=e})),e.sort((function(t,e){var n=t.getSortIndex(),i=e.getSortIndex();return null!=n&&null!=i?n-i:null==n&&null==i?o[t.getId()]>o[e.getId()]?1:-1:null==i?-1:1})),e},e.prototype.getSortModel=function(){return this.getColumnsWithSortingOrdered().map((function(t){return{sort:t.getSort(),colId:t.getId()}}))},e.prototype.getSortOptions=function(){return this.getColumnsWithSortingOrdered().map((function(t){return{sort:t.getSort(),column:t}}))},e.DEFAULT_SORTING_ORDER=[ht.SORT_ASC,ht.SORT_DESC,null],yl([it("columnController")],e.prototype,"columnController",void 0),yl([it("columnApi")],e.prototype,"columnApi",void 0),yl([it("gridApi")],e.prototype,"gridApi",void 0),e=o=yl([nt("sortController")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),ml=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Cl=(function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.gridInstanceId=n.gridInstanceSequence.next(),e}var n;vl(o,t),n=o,o.prototype.init=function(){this.stampDomElementWithGridInstance()},o.prototype.registerGridComp=function(t){this.gridPanel=t},o.prototype.stampDomElementWithGridInstance=function(){this.eGridDiv[n.GRID_DOM_KEY]=this.gridInstanceId},o.prototype.getRenderedCellForEvent=function(t){return Dt(this.gridOptionsWrapper,t,"cellComp")},o.prototype.isEventFromThisGrid=function(t){for(var o=Ft(t),i=0;i<o.length;i++){var r=o[i][n.GRID_DOM_KEY];if(e(r))return r===this.gridInstanceId}return!1},o.prototype.getCellPositionForEvent=function(t){var e=this.getRenderedCellForEvent(t);return e?e.getCellPosition():null},o.prototype.getNormalisedPosition=function(t){var e,o,n=this.gridOptionsWrapper.getDomLayout()===ht.DOM_LAYOUT_NORMAL,i=t;if(null!=i.clientX||null!=i.clientY?(e=i.clientX,o=i.clientY):(e=i.x,o=i.y),n){var r=this.gridPanel.getVScrollPosition();e+=this.gridPanel.getHScrollPosition().left,o+=r.top}return{x:e,y:o}},o.gridInstanceSequence=new Dn,o.GRID_DOM_KEY="__ag_grid_instance",ml([it("eGridDiv")],o.prototype,"eGridDiv",void 0),ml([et],o.prototype,"init",null),o=n=ml([nt("mouseEventService")],o)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),wl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},El=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Cl(e,t),e.prototype.getNextCellToFocus=function(t,e){for(var o=e,n=!1;!n;){switch(t){case jn.UP:o=this.getCellAbove(o);break;case jn.DOWN:o=this.getCellBelow(o);break;case jn.RIGHT:o=this.gridOptionsWrapper.isEnableRtl()?this.getCellToLeft(o):this.getCellToRight(o);break;case jn.LEFT:o=this.gridOptionsWrapper.isEnableRtl()?this.getCellToRight(o):this.getCellToLeft(o);break;default:o=null,console.warn("AG Grid: unknown key for navigation "+t)}n=!o||this.isCellGoodToFocusOn(o)}return o},e.prototype.isCellGoodToFocusOn=function(t){var e,o=t.column;switch(t.rowPinned){case ht.PINNED_TOP:e=this.pinnedRowModel.getPinnedTopRow(t.rowIndex);break;case ht.PINNED_BOTTOM:e=this.pinnedRowModel.getPinnedBottomRow(t.rowIndex);break;default:e=this.rowModel.getRow(t.rowIndex)}return!!e&&!o.isSuppressNavigable(e)},e.prototype.getCellToLeft=function(t){if(!t)return null;var e=this.columnController.getDisplayedColBefore(t.column);return e?{rowIndex:t.rowIndex,column:e,rowPinned:t.rowPinned}:null},e.prototype.getCellToRight=function(t){if(!t)return null;var e=this.columnController.getDisplayedColAfter(t.column);return e?{rowIndex:t.rowIndex,column:e,rowPinned:t.rowPinned}:null},e.prototype.getRowBelow=function(t){var e=t.rowIndex,o=t.rowPinned;if(this.isLastRowInContainer(t))switch(o){case ht.PINNED_BOTTOM:return null;case ht.PINNED_TOP:return this.rowModel.isRowsToRender()?{rowIndex:this.paginationProxy.getPageFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender(ht.PINNED_BOTTOM)?{rowIndex:0,rowPinned:ht.PINNED_BOTTOM}:null;default:return this.pinnedRowModel.isRowsToRender(ht.PINNED_BOTTOM)?{rowIndex:0,rowPinned:ht.PINNED_BOTTOM}:null}return{rowIndex:e+1,rowPinned:o}},e.prototype.getCellBelow=function(t){if(!t)return null;var e=this.getRowBelow(t);return e?{rowIndex:e.rowIndex,column:t.column,rowPinned:e.rowPinned}:null},e.prototype.isLastRowInContainer=function(t){var e=t.rowPinned,o=t.rowIndex;return e===ht.PINNED_TOP?this.pinnedRowModel.getPinnedTopRowData().length-1<=o:e===ht.PINNED_BOTTOM?this.pinnedRowModel.getPinnedBottomRowData().length-1<=o:this.paginationProxy.getPageLastRow()<=o},e.prototype.getRowAbove=function(t){var e=t.rowIndex,o=t.rowPinned;return(o?0===e:e===this.paginationProxy.getPageFirstRow())?o===ht.PINNED_TOP?null:o&&this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender(ht.PINNED_TOP)?this.getLastFloatingTopRow():null:{rowIndex:e-1,rowPinned:o}},e.prototype.getCellAbove=function(t){if(!t)return null;var e=this.getRowAbove({rowIndex:t.rowIndex,rowPinned:t.rowPinned});return e?{rowIndex:e.rowIndex,column:t.column,rowPinned:e.rowPinned}:null},e.prototype.getLastBodyCell=function(){return{rowIndex:this.paginationProxy.getPageLastRow(),rowPinned:null}},e.prototype.getLastFloatingTopRow=function(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:ht.PINNED_TOP}},e.prototype.getNextTabbedCell=function(t,e){return e?this.getNextTabbedCellBackwards(t):this.getNextTabbedCellForwards(t)},e.prototype.getNextTabbedCellForwards=function(t){var e=this.columnController.getAllDisplayedColumns(),n=t.rowIndex,i=t.rowPinned,r=this.columnController.getDisplayedColAfter(t.column);if(!r){r=e[0];var s=this.getRowBelow(t);if(o(s))return null;if(!s.rowPinned&&!this.paginationProxy.isRowInPage(s))return null;n=s?s.rowIndex:null,i=s?s.rowPinned:null}return{rowIndex:n,column:r,rowPinned:i}},e.prototype.getNextTabbedCellBackwards=function(t){var e=this.columnController.getAllDisplayedColumns(),n=t.rowIndex,i=t.rowPinned,r=this.columnController.getDisplayedColBefore(t.column);if(!r){r=d(e);var s=this.getRowAbove({rowIndex:t.rowIndex,rowPinned:t.rowPinned});if(o(s))return null;if(!s.rowPinned&&!this.paginationProxy.isRowInPage(s))return null;n=s?s.rowIndex:null,i=s?s.rowPinned:null}return{rowIndex:n,column:r,rowPinned:i}},wl([it("columnController")],e.prototype,"columnController",void 0),wl([it("rowModel")],e.prototype,"rowModel",void 0),wl([it("pinnedRowModel")],e.prototype,"pinnedRowModel",void 0),wl([it("paginationProxy")],e.prototype,"paginationProxy",void 0),e=wl([nt("cellNavigationService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Rl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ol=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}El(e,t),e.prototype.formatValue=function(t,e,o,n,i,r){void 0===r&&(r=!0);var s,a=null,l=t.getColDef();if(i?s=i:r&&(s=e&&e.rowPinned&&l.pinnedRowValueFormatter?l.pinnedRowValueFormatter:l.valueFormatter),s){var p={value:n,node:e,data:e?e.data:null,colDef:l,column:t,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()};p.$scope=o,a=this.expressionService.evaluate(s,p)}else if(l.refData)return l.refData[n]||"";return null==a&&Array.isArray(n)&&(a=n.join(", ")),a},Rl([it("expressionService")],e.prototype,"expressionService",void 0),e=Rl([nt("valueFormatterService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Pl=(function(t){function e(e){return t.call(this,e,"ag-radio-button","radio")||this}Ol(e,t),e.prototype.isSelected=function(){return this.eInput.checked},e.prototype.toggle=function(){this.isSelected()||this.setValue(!0)},e.prototype.addInputListeners=function(){t.prototype.addInputListeners.call(this),this.addManagedListener(this.eventService,Wt.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))},e.prototype.onChange=function(t){t.selected&&t.name&&this.eInput.name&&this.eInput.name===t.name&&t.id&&this.eInput.id!==t.id&&this.setValue(!1,!0)}}(Bs),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Sl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},bl=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Pl(e,t),e.prototype.setScrollsVisible=function(t){if(this.horizontalScrollShowing!==t.horizontalScrollShowing||this.verticalScrollShowing!==t.verticalScrollShowing){this.horizontalScrollShowing=t.horizontalScrollShowing,this.verticalScrollShowing=t.verticalScrollShowing;var e={type:Wt.EVENT_SCROLL_VISIBILITY_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)}},e.prototype.isHorizontalScrollShowing=function(){return this.horizontalScrollShowing},e.prototype.isVerticalScrollShowing=function(){return this.verticalScrollShowing},Sl([it("columnApi")],e.prototype,"columnApi",void 0),Sl([it("gridApi")],e.prototype,"gridApi",void 0),e=Sl([nt("scrollVisibleService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Dl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Al=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}bl(e,t),e.prototype.processAllCellClasses=function(t,e,o,n){this.processClassRules(t.cellClassRules,e,o,n),this.processStaticCellClasses(t,e,o)},e.prototype.processClassRules=function(t,e,o,n){if(W(t))for(var i=Object.keys(t),r=0;r<i.length;r++){var s=i[r],a=t[s],l=void 0;"string"==typeof a?l=this.expressionService.evaluate(a,e):"function"==typeof a&&(l=a(e)),l?o(s):n&&n(s)}},e.prototype.processStaticCellClasses=function(t,e,o){if(t.cellClass){var n=void 0;if("function"==typeof t.cellClass)n=(0,t.cellClass)(e);else n=t.cellClass;"string"==typeof n?o(n):Array.isArray(n)&&n.forEach((function(t){o(t)}))}},Dl([it("expressionService")],e.prototype,"expressionService",void 0),e=Dl([nt("stylingService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Tl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},_l=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Al(e,t),e.prototype.setMouseOver=function(t){this.selectedColumns=t;var e={type:Wt.EVENT_COLUMN_HOVER_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)},e.prototype.clearMouseOver=function(){this.selectedColumns=null;var t={type:Wt.EVENT_COLUMN_HOVER_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t)},e.prototype.isHovered=function(t){return!!this.selectedColumns&&this.selectedColumns.indexOf(t)>=0},Tl([it("columnApi")],e.prototype,"columnApi",void 0),Tl([it("gridApi")],e.prototype,"gridApi",void 0),e=Tl([nt("columnHoverService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Fl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Nl=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.executeNextFuncs=[],e.executeLaterFuncs=[],e.active=!1,e.animationThreadCount=0,e}_l(e,t),e.prototype.registerGridComp=function(t){this.gridPanel=t},e.prototype.isActive=function(){return this.active},e.prototype.start=function(){this.active||this.gridOptionsWrapper.isSuppressColumnMoveAnimation()||this.gridOptionsWrapper.isEnableRtl()||(this.ensureAnimationCssClassPresent(),this.active=!0)},e.prototype.finish=function(){this.active&&(this.flush(),this.active=!1)},e.prototype.executeNextVMTurn=function(t){this.active?this.executeNextFuncs.push(t):t()},e.prototype.executeLaterVMTurn=function(t){this.active?this.executeLaterFuncs.push(t):t()},e.prototype.ensureAnimationCssClassPresent=function(){var t=this;this.animationThreadCount++;var e=this.animationThreadCount;this.gridPanel.setColumnMovingCss(!0),this.executeLaterFuncs.push((function(){t.animationThreadCount===e&&t.gridPanel.setColumnMovingCss(!1)}))},e.prototype.flush=function(){var t=this.executeNextFuncs;this.executeNextFuncs=[];var e=this.executeLaterFuncs;this.executeLaterFuncs=[],0===t.length&&0===e.length||(window.setTimeout((function(){return t.forEach((function(t){return t()}))}),0),window.setTimeout((function(){return e.forEach((function(t){return t()}))}),300))},e=Fl([nt("columnAnimationService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Ll=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Il=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;Nl(e,t),n=e,e.prototype.createAutoGroupColumns=function(t){var e=this,o=[],n=this.gridOptionsWrapper.isTreeData(),i=this.gridOptionsWrapper.isGroupMultiAutoColumn();return n&&i&&(console.warn("AG Grid: you cannot mix groupMultiAutoColumn with treeData, only one column can be used to display groups when doing tree data"),i=!1),i?t.forEach((function(t,n){o.push(e.createOneAutoGroupColumn(t,n))})):o.push(this.createOneAutoGroupColumn()),o},e.prototype.createOneAutoGroupColumn=function(t,e){var i,r=this.generateDefaultColDef(t);(i=t?ht.GROUP_AUTO_COLUMN_ID+"-"+t.getId():n.GROUP_AUTO_COLUMN_BUNDLE_ID,G(r,this.gridOptionsWrapper.getAutoGroupColumnDef()),(r=this.columnFactory.mergeColDefs(r)).colId=i,this.gridOptionsWrapper.isTreeData())||o(r.field)&&o(r.valueGetter)&&o(r.filterValueGetter)&&(r.filter=!1);e&&e>0&&(r.headerCheckboxSelection=!1);var s=new yt(r,null,i,!0);return this.context.createBean(s),s},e.prototype.generateDefaultColDef=function(t){var e=this.gridOptionsWrapper.getAutoGroupColumnDef(),o={headerName:this.gridOptionsWrapper.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererFramework)||(o.cellRenderer="agGroupCellRenderer"),t){var n=t.getColDef();M(o,{headerName:this.columnController.getDisplayNameForColumn(t,"header"),headerValueGetter:n.headerValueGetter}),n.cellRenderer&&M(o,{cellRendererParams:{innerRenderer:n.cellRenderer,innerRendererParams:n.cellRendererParams}}),o.showRowGroup=t.getColId()}else o.showRowGroup=!0;return o},e.GROUP_AUTO_COLUMN_BUNDLE_ID=ht.GROUP_AUTO_COLUMN_ID,Ll([it("columnController")],e.prototype,"columnController",void 0),Ll([it("columnFactory")],e.prototype,"columnFactory",void 0),e=n=Ll([nt("autoGroupColService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Gl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ml=(function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.currentPage=0,e.topDisplayedRowIndex=0,e.bottomDisplayedRowIndex=0,e.pixelOffset=0,e.masterRowCount=0,e}Il(n,t),n.prototype.postConstruct=function(){this.active=this.gridOptionsWrapper.isPagination(),this.paginateChildRows=this.gridOptionsWrapper.isPaginateChildRows(),this.addManagedListener(this.eventService,Wt.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedListener(this.gridOptionsWrapper,"paginationPageSize",this.onPaginationPageSizeChanged.bind(this)),this.onModelUpdated()},n.prototype.ensureRowHeightsValid=function(t,e,o,n){var i=this.rowModel.ensureRowHeightsValid(t,e,this.getPageFirstRow(),this.getPageLastRow());return i&&this.calculatePages(),i},n.prototype.onModelUpdated=function(t){this.calculatePages();var e={type:Wt.EVENT_PAGINATION_CHANGED,animate:!!t&&t.animate,newData:!!t&&t.newData,newPage:!!t&&t.newPage,keepRenderedRows:!!t&&t.keepRenderedRows,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)},n.prototype.onPaginationPageSizeChanged=function(){this.calculatePages();var t={type:Wt.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,keepRenderedRows:!0,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t)},n.prototype.goToPage=function(t){if(this.active&&this.currentPage!==t){this.currentPage=t;var e={type:Wt.EVENT_MODEL_UPDATED,animate:!1,keepRenderedRows:!1,newData:!1,newPage:!0,api:this.gridApi,columnApi:this.columnApi};this.onModelUpdated(e)}},n.prototype.getPixelOffset=function(){return this.pixelOffset},n.prototype.getRow=function(t){return this.rowModel.getRow(t)},n.prototype.getRowNode=function(t){return this.rowModel.getRowNode(t)},n.prototype.getRowIndexAtPixel=function(t){return this.rowModel.getRowIndexAtPixel(t)},n.prototype.getCurrentPageHeight=function(){return o(this.topRowBounds)||o(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)},n.prototype.getCurrentPagePixelRange=function(){return{pageFirstPixel:this.topRowBounds?this.topRowBounds.rowTop:0,pageLastPixel:this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0}},n.prototype.isRowPresent=function(t){return!!this.rowModel.isRowPresent(t)&&(t.rowIndex>=this.topDisplayedRowIndex&&t.rowIndex<=this.bottomDisplayedRowIndex)},n.prototype.isEmpty=function(){return this.rowModel.isEmpty()},n.prototype.isRowsToRender=function(){return this.rowModel.isRowsToRender()},n.prototype.getNodesInRangeForSelection=function(t,e){return this.rowModel.getNodesInRangeForSelection(t,e)},n.prototype.forEachNode=function(t){return this.rowModel.forEachNode(t)},n.prototype.getType=function(){return this.rowModel.getType()},n.prototype.getRowBounds=function(t){var e=this.rowModel.getRowBounds(t);return e.rowIndex=t,e},n.prototype.getPageFirstRow=function(){return this.topRowBounds?this.topRowBounds.rowIndex:-1},n.prototype.getPageLastRow=function(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1},n.prototype.getRowCount=function(){return this.rowModel.getRowCount()},n.prototype.getPageForIndex=function(t){return Math.floor(t/this.pageSize)},n.prototype.goToPageWithIndex=function(t){if(this.active){var e=this.getPageForIndex(t);this.goToPage(e)}},n.prototype.isRowInPage=function(t){return!this.active||this.getPageForIndex(t.rowIndex)===this.currentPage},n.prototype.isLastPageFound=function(){return this.rowModel.isLastRowIndexKnown()},n.prototype.getCurrentPage=function(){return this.currentPage},n.prototype.goToNextPage=function(){this.goToPage(this.currentPage+1)},n.prototype.goToPreviousPage=function(){this.goToPage(this.currentPage-1)},n.prototype.goToFirstPage=function(){this.goToPage(0)},n.prototype.goToLastPage=function(){var t=this.rowModel.getRowCount(),e=Math.floor(t/this.pageSize);this.goToPage(e)},n.prototype.getPageSize=function(){return this.pageSize},n.prototype.getTotalPages=function(){return this.totalPages},n.prototype.setPageSize=function(){this.pageSize=this.gridOptionsWrapper.getPaginationPageSize(),(null==this.pageSize||this.pageSize<1)&&(this.pageSize=100)},n.prototype.calculatePages=function(){this.active?(this.setPageSize(),this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly()):this.calculatedPagesNotActive(),this.topRowBounds=this.rowModel.getRowBounds(this.topDisplayedRowIndex),this.topRowBounds&&(this.topRowBounds.rowIndex=this.topDisplayedRowIndex),this.bottomRowBounds=this.rowModel.getRowBounds(this.bottomDisplayedRowIndex),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=this.bottomDisplayedRowIndex),this.setPixelOffset(e(this.topRowBounds)?this.topRowBounds.rowTop:0)},n.prototype.setPixelOffset=function(t){this.pixelOffset!==t&&(this.pixelOffset=t,this.eventService.dispatchEvent({type:Wt.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED}))},n.prototype.setZeroRows=function(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0},n.prototype.calculatePagesMasterRowsOnly=function(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0)this.setZeroRows();else{var t=this.masterRowCount-1;this.totalPages=Math.floor(t/this.pageSize)+1,this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!ee(this.currentPage)||this.currentPage<0)&&(this.currentPage=0);var e=this.pageSize*this.currentPage,o=this.pageSize*(this.currentPage+1)-1;if(o>t&&(o=t),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(e),o===t)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{var n=this.rowModel.getTopLevelRowDisplayedIndex(o+1);this.bottomDisplayedRowIndex=n-1}}},n.prototype.getMasterRowCount=function(){return this.masterRowCount},n.prototype.calculatePagesAllRows=function(){if(this.masterRowCount=this.rowModel.getRowCount(),0!==this.masterRowCount){var t=this.masterRowCount-1;this.totalPages=Math.floor(t/this.pageSize)+1,this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!ee(this.currentPage)||this.currentPage<0)&&(this.currentPage=0),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>t&&(this.bottomDisplayedRowIndex=t)}else this.setZeroRows()},n.prototype.calculatedPagesNotActive=function(){this.pageSize=this.rowModel.getRowCount(),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1},Gl([it("rowModel")],n.prototype,"rowModel",void 0),Gl([it("columnApi")],n.prototype,"columnApi",void 0),Gl([it("gridApi")],n.prototype,"gridApi",void 0),Gl([et],n.prototype,"postConstruct",null),n=Gl([nt("paginationProxy")],n)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),xl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Vl=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ml(e,t),e.prototype.registerGridComp=function(t){this.gridPanel=t,this.addManagedListener(this.eventService,Wt.EVENT_BODY_HEIGHT_CHANGED,this.onBodyHeightChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.checkPageSize()},e.prototype.notActive=function(){return!this.gridOptionsWrapper.isPaginationAutoPageSize()},e.prototype.onScrollVisibilityChanged=function(){this.checkPageSize()},e.prototype.onBodyHeightChanged=function(){this.checkPageSize()},e.prototype.checkPageSize=function(){if(!this.notActive()){var t=this.gridOptionsWrapper.getRowHeightAsNumber(),e=this.gridPanel.getBodyHeight();if(e>0){var o=Math.floor(e/t);this.gridOptionsWrapper.setProperty("paginationPageSize",o)}}},e=xl([nt("paginationAutoPageSizeService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Hl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Wl=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cacheVersion=0,e}Vl(e,t),e.prototype.init=function(){this.active=this.gridOptionsWrapper.isValueCache(),this.neverExpires=this.gridOptionsWrapper.isValueCacheNeverExpires()},e.prototype.onDataChanged=function(){this.neverExpires||this.expire()},e.prototype.expire=function(){this.cacheVersion++},e.prototype.setValue=function(t,e,o){this.active&&(t.__cacheVersion!==this.cacheVersion&&(t.__cacheVersion=this.cacheVersion,t.__cacheData={}),t.__cacheData[e]=o)},e.prototype.getValue=function(t,e){if(this.active&&t.__cacheVersion===this.cacheVersion)return t.__cacheData[e]},Hl([et],e.prototype,"init",null),e=Hl([nt("valueCache")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),kl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Bl=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Wl(e,t),e.prototype.init=function(){this.rowModel.getType()===ht.ROW_MODEL_TYPE_CLIENT_SIDE&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,Wt.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))},e.prototype.onCellValueChanged=function(t){t.source!==ht.SOURCE_PASTE&&this.doChangeDetection(t.node,t.column)},e.prototype.doChangeDetection=function(t,e){if(!this.gridOptionsWrapper.isSuppressChangeDetection()){if(this.clientSideRowModel&&!t.isRowPinned()){var o=this.gridOptionsWrapper.isAggregateOnlyChangedColumns(),n=new Kr(o,this.clientSideRowModel.getRootNode());n.addParentNode(t.parent,[e]),this.clientSideRowModel.doAggregate(n)}this.rowRenderer.refreshCells()}},kl([it("rowModel")],e.prototype,"rowModel",void 0),kl([it("rowRenderer")],e.prototype,"rowRenderer",void 0),kl([et],e.prototype,"init",null),e=kl([nt("changeDetectionService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),jl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ul=function(t,e){return function(o,n){e(o,n,t)}},zl=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.consuming=!1,e}Bl(e,t),e.prototype.setBeans=function(t){this.logger=t.create("AlignedGridsService")},e.prototype.registerGridComp=function(t){this.gridPanel=t},e.prototype.init=function(){this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))},e.prototype.fireEvent=function(t){if(!this.consuming){var e=this.gridOptionsWrapper.getAlignedGrids();e&&e.forEach((function(e){if(e.api){var o=e.api.__getAlignedGridService();t(o)}}))}},e.prototype.onEvent=function(t){this.consuming=!0,t(),this.consuming=!1},e.prototype.fireColumnEvent=function(t){this.fireEvent((function(e){e.onColumnEvent(t)}))},e.prototype.fireScrollEvent=function(t){"horizontal"===t.direction&&this.fireEvent((function(e){e.onScrollEvent(t)}))},e.prototype.onScrollEvent=function(t){var e=this;this.onEvent((function(){e.gridPanel.setHorizontalScrollPosition(t.left)}))},e.prototype.getMasterColumns=function(t){var e=[];return t.columns?t.columns.forEach((function(t){e.push(t)})):t.column&&e.push(t.column),e},e.prototype.getColumnIds=function(t){var e=[];return t.columns?t.columns.forEach((function(t){e.push(t.getColId())})):t.column&&e.push(t.column.getColId()),e},e.prototype.onColumnEvent=function(t){var e=this;this.onEvent((function(){switch(t.type){case Wt.EVENT_COLUMN_MOVED:case Wt.EVENT_COLUMN_VISIBLE:case Wt.EVENT_COLUMN_PINNED:case Wt.EVENT_COLUMN_RESIZED:var o=t;e.processColumnEvent(o);break;case Wt.EVENT_COLUMN_GROUP_OPENED:var n=t;e.processGroupOpenedEvent(n);break;case Wt.EVENT_COLUMN_PIVOT_CHANGED:console.warn("AG Grid: pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.")}}))},e.prototype.processGroupOpenedEvent=function(t){var e=t.columnGroup,o=null;if(e){var n=e.getGroupId();o=this.columnController.getOriginalColumnGroup(n)}e&&!o||(this.logger.log("onColumnEvent-> processing "+t+" expanded = "+e.isExpanded()),this.columnController.setColumnGroupOpened(o,e.isExpanded(),"alignedGridChanged"))},e.prototype.processColumnEvent=function(t){var e=this,o=t.column,n=null;if(o&&(n=this.columnController.getPrimaryColumn(o.getColId())),!o||n){var i=this.getMasterColumns(t);switch(t.type){case Wt.EVENT_COLUMN_MOVED:var r=t,s=t.columnApi.getColumnState().map((function(t){return{colId:t.colId}}));this.columnController.applyColumnState({state:s,applyOrder:!0},"alignedGridChanged"),this.logger.log("onColumnEvent-> processing "+t.type+" toIndex = "+r.toIndex);break;case Wt.EVENT_COLUMN_VISIBLE:var a=t;s=t.columnApi.getColumnState().map((function(t){return{colId:t.colId,hide:t.hide}}));this.columnController.applyColumnState({state:s},"alignedGridChanged"),this.logger.log("onColumnEvent-> processing "+t.type+" visible = "+a.visible);break;case Wt.EVENT_COLUMN_PINNED:var l=t;s=t.columnApi.getColumnState().map((function(t){return{colId:t.colId,pinned:t.pinned}}));this.columnController.applyColumnState({state:s},"alignedGridChanged"),this.logger.log("onColumnEvent-> processing "+t.type+" pinned = "+l.pinned);break;case Wt.EVENT_COLUMN_RESIZED:var p=t;i.forEach((function(o){e.logger.log("onColumnEvent-> processing "+t.type+" actualWidth = "+o.getActualWidth());var n=[{key:o.getColId(),newWidth:o.getActualWidth()}];e.columnController.setColumnWidths(n,!1,p.finished,"alignedGridChanged")}))}var u=this.gridPanel.isVerticalScrollShowing(),c=this.gridOptionsWrapper.getAlignedGrids();c&&c.forEach((function(t){t.api&&t.api.setAlwaysShowVerticalScroll(u)}))}},jl([it("columnController")],e.prototype,"columnController",void 0),jl([Ul(0,at("loggerFactory"))],e.prototype,"setBeans",null),jl([et],e.prototype,"init",null),e=jl([nt("alignedGridsService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Kl=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Yl=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}zl(e,t),e.prototype.adaptFunction=function(t,e,o,n){if(null==e)return{component:null,componentFromFramework:o,source:n,paramsFromSelector:null};var i=this.componentMetadataProvider.retrieve(t);return i&&i.functionAdapter?{componentFromFramework:o,component:i.functionAdapter(e),source:n,paramsFromSelector:null}:null},e.prototype.adaptCellRendererFunction=function(t){return function(){function e(){}return e.prototype.refresh=function(t){return!1},e.prototype.getGui=function(){var e=t(this.params),o=typeof e;return"string"===o||"number"===o||"boolean"===o?oo("<span>"+e+"</span>"):e},e.prototype.init=function(t){this.params=t},e}()},e.prototype.doesImplementIComponent=function(t){return!!t&&(t.prototype&&"getGui"in t.prototype)},Kl([it("componentMetadataProvider")],e.prototype,"componentMetadataProvider",void 0),e=Kl([nt("agComponentUtils")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),ql=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Xl=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Yl(e,t),e.prototype.postConstruct=function(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[]},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:[]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:[]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached"]},floatingFilterWrapperComponent:{mandatoryMethodList:[],optionalMethodList:[]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},pinnedRowCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged"]},filterComponent:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]}}},e.prototype.retrieve=function(t){return this.componentMetaData[t]},ql([it("agComponentUtils")],e.prototype,"agComponentUtils",void 0),ql([et],e.prototype,"postConstruct",null),e=ql([nt("componentMetadataProvider")],e)}(Mt),function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s}),Ql=(function(){function t(){}t.prototype.registerGridComp=function(t){this.gridPanel=t},t.prototype.postConstruct=function(){this.doingMasterDetail=this.gridOptionsWrapper.isMasterDetail(),this.gridOptionsWrapper.isRowModelDefault()&&(this.clientSideRowModel=this.rowModel),this.gridOptionsWrapper.isRowModelServerSide()&&(this.serverSideRowModel=this.rowModel)},Xl([it("resizeObserverService")],t.prototype,"resizeObserverService",void 0),Xl([it("paginationProxy")],t.prototype,"paginationProxy",void 0),Xl([it("context")],t.prototype,"context",void 0),Xl([it("columnApi")],t.prototype,"columnApi",void 0),Xl([it("gridApi")],t.prototype,"gridApi",void 0),Xl([it("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),Xl([it("expressionService")],t.prototype,"expressionService",void 0),Xl([it("rowRenderer")],t.prototype,"rowRenderer",void 0),Xl([it("$compile")],t.prototype,"$compile",void 0),Xl([it("templateService")],t.prototype,"templateService",void 0),Xl([it("valueService")],t.prototype,"valueService",void 0),Xl([it("eventService")],t.prototype,"eventService",void 0),Xl([it("columnController")],t.prototype,"columnController",void 0),Xl([it("headerNavigationService")],t.prototype,"headerNavigationService",void 0),Xl([it("columnAnimationService")],t.prototype,"columnAnimationService",void 0),Xl([rt("rangeController")],t.prototype,"rangeController",void 0),Xl([it("focusController")],t.prototype,"focusController",void 0),Xl([rt("contextMenuFactory")],t.prototype,"contextMenuFactory",void 0),Xl([it("popupService")],t.prototype,"popupService",void 0),Xl([it("valueFormatterService")],t.prototype,"valueFormatterService",void 0),Xl([it("stylingService")],t.prototype,"stylingService",void 0),Xl([it("columnHoverService")],t.prototype,"columnHoverService",void 0),Xl([it("userComponentFactory")],t.prototype,"userComponentFactory",void 0),Xl([it("animationFrameService")],t.prototype,"taskQueue",void 0),Xl([it("dragAndDropService")],t.prototype,"dragAndDropService",void 0),Xl([it("sortController")],t.prototype,"sortController",void 0),Xl([it("filterManager")],t.prototype,"filterManager",void 0),Xl([it("maxDivHeightScaler")],t.prototype,"maxDivHeightScaler",void 0),Xl([it("frameworkOverrides")],t.prototype,"frameworkOverrides",void 0),Xl([it("detailRowCompCache")],t.prototype,"detailRowCompCache",void 0),Xl([it("cellPositionUtils")],t.prototype,"cellPositionUtils",void 0),Xl([it("rowPositionUtils")],t.prototype,"rowPositionUtils",void 0),Xl([it("selectionController")],t.prototype,"selectionController",void 0),Xl([rt("selectionHandleFactory")],t.prototype,"selectionHandleFactory",void 0),Xl([it("rowCssClassCalculator")],t.prototype,"rowCssClassCalculator",void 0),Xl([it("rowModel")],t.prototype,"rowModel",void 0),Xl([et],t.prototype,"postConstruct",null),t=Xl([nt("beans")],t)}(),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),$l=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Zl={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:20,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:56,headerCellMinWidth:48,listItemHeight:32,rowHeight:48,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:32,headerCellMinWidth:24,listItemHeight:24,rowHeight:28,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:240}},Jl={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]},tp={},ep=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ql(e,t),e.prototype.getSassVariable=function(t,e){var o="ag-theme-"+(t.match("material")?"material":t.match("balham")?"balham":t.match("alpine")?"alpine":"custom"),n=Zl[o][e],i=0;tp[t]||(tp[t]={});var r=tp[t][e];if(null!=r)return r;if(Jl[e]){var s=Jl[e],a=document.createElement("div");Me(a,t),a.style.position="absolute";var l=s.reduce((function(t,e){var o=document.createElement("div");return o.style.position="static",Me(o,e),t.appendChild(o),o}),a);if(document.body){document.body.appendChild(a);var p=-1!==e.toLowerCase().indexOf("height")?"height":"width";i=parseInt(window.getComputedStyle(l)[p],10),document.body.removeChild(a)}}return tp[t][e]=i||n,tp[t][e]},e.prototype.isThemeDark=function(){var t=this.getTheme().theme;return!!t&&t.indexOf("dark")>=0},e.prototype.chartMenuPanelWidth=function(){var t=this.getTheme().themeFamily;return this.getSassVariable(t,"chartMenuPanelWidth")},e.prototype.getTheme=function(){for(var t=/\bag-(material|(?:theme-([\w\-]*)))\b/,e=this.eGridDiv,o=null;e&&!(o=t.exec(e.className));)e=e.parentElement||void 0;if(!o)return{};var n=o[0];if(void 0===o[2]){var i=n.replace("ag-","ag-theme-");z((function(){return console.warn("AG Grid: As of v19 old theme are no longer provided. Please replace "+n+" with "+i+".")}),"using-old-theme")}return{theme:n,el:e,themeFamily:n.replace(/-dark$/,"")}},$l([it("eGridDiv")],e.prototype,"eGridDiv",void 0),e=$l([nt("environment")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),op=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},np=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.createTasksP1={list:[],sorted:!1},e.createTasksP2={list:[],sorted:!1},e.destroyTasks=[],e.ticking=!1,e.scrollGoingDown=!0,e.lastScrollTop=0,e.taskCount=0,e.cancelledTasks=new Set,e}ep(e,t),e.prototype.setScrollTop=function(t){this.scrollGoingDown=t>this.lastScrollTop,this.lastScrollTop=t},e.prototype.init=function(){this.useAnimationFrame=!this.gridOptionsWrapper.isSuppressAnimationFrame()},e.prototype.registerGridComp=function(t){this.gridPanel=t},e.prototype.verifyAnimationFrameOn=function(t){!1===this.useAnimationFrame&&console.warn("AG Grid: AnimationFrameService."+t+" called but animation frames are off")},e.prototype.createTask=function(t,e,o){this.verifyAnimationFrameOn(o);var n={task:t,index:e,createOrder:++this.taskCount};this.addTaskToList(this[o],n),this.schedule()},e.prototype.cancelTask=function(t){this.cancelledTasks.add(t)},e.prototype.addTaskToList=function(t,e){t.list.push(e),t.sorted=!1},e.prototype.sortTaskList=function(t){if(!t.sorted){var e=this.scrollGoingDown?1:-1;t.list.sort((function(t,o){return t.index!==o.index?e*(o.index-t.index):o.createOrder-t.createOrder})),t.sorted=!0}},e.prototype.addDestroyTask=function(t){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(t),this.schedule()},e.prototype.executeFrame=function(t){this.verifyAnimationFrameOn("executeFrame");for(var e=this.createTasksP1,o=e.list,n=this.createTasksP2,i=n.list,r=this.destroyTasks,s=(new Date).getTime(),a=(new Date).getTime()-s,l=t<=0;l||a<t;){if(!this.gridPanel.executeAnimationFrameScroll()){var p=void 0;if(o.length)this.sortTaskList(e),p=o.pop().task;else if(i.length)this.sortTaskList(n),p=i.pop().task;else{if(!r.length){this.cancelledTasks.clear();break}p=r.pop()}this.cancelledTasks.has(p)||p()}a=(new Date).getTime()-s}o.length||i.length||r.length?this.requestFrame():this.stopTicking()},e.prototype.stopTicking=function(){this.ticking=!1;var t={type:Wt.EVENT_ANIMATION_QUEUE_EMPTY,columnApi:this.gridOptionsWrapper.getColumnApi(),api:this.gridOptionsWrapper.getApi()};this.eventService.dispatchEvent(t)},e.prototype.flushAllFrames=function(){this.useAnimationFrame&&this.executeFrame(-1)},e.prototype.schedule=function(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))},e.prototype.requestFrame=function(){var t=this.executeFrame.bind(this,60);window.requestAnimationFrame?window.requestAnimationFrame(t):window.webkitRequestAnimationFrame?window.webkitRequestAnimationFrame(t):window.setTimeout(t,0)},e.prototype.isQueueEmpty=function(){return!this.ticking},op([et],e.prototype,"init",null),e=op([nt("animationFrameService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),ip=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},rp=(function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeLastPageEventProcessed=0,e}np(o,t),o.prototype.registerGridComp=function(t){this.gridPanel=t},o.prototype.handlePageScrollingKey=function(t){var e=t.which||t.keyCode,o=t.altKey,n=t.ctrlKey||t.metaKey,i=this.mouseEventService.getCellPositionForEvent(t);if(!i)return!1;var r=!1;switch(e){case jn.PAGE_HOME:case jn.PAGE_END:n||o||(this.onHomeOrEndKey(e),r=!0);break;case jn.LEFT:case jn.RIGHT:n&&!o&&(this.onCtrlLeftOrRight(e,i),r=!0);break;case jn.UP:case jn.DOWN:n&&!o&&(this.onCtrlUpOrDown(e,i),r=!0);break;case jn.PAGE_DOWN:n||o||(this.onPageDown(i),r=!0);break;case jn.PAGE_UP:n||o||(this.onPageUp(i),r=!0)}return r&&t.preventDefault(),r},o.prototype.isTimeSinceLastPageEventToRecent=function(){return(new Date).getTime()-this.timeLastPageEventProcessed<100},o.prototype.setTimeLastPageEventProcessed=function(){this.timeLastPageEventProcessed=(new Date).getTime()},o.prototype.navigateTo=function(t){var o=t.scrollIndex,n=t.scrollType,i=t.scrollColumn,r=t.focusIndex,s=t.focusColumn;if(e(i)&&this.gridPanel.ensureColumnVisible(i),e(o)&&this.gridPanel.ensureIndexVisible(o,n),this.animationFrameService.flushAllFrames(),this.focusController.setFocusedCell(r,s,null,!0),this.rangeController){var a={rowIndex:r,rowPinned:null,column:s};this.rangeController.setRangeToCell(a)}},o.prototype.onPageDown=function(t){if(!this.isTimeSinceLastPageEventToRecent()){var e=this.gridPanel.getVScrollPosition(),o=this.gridOptionsWrapper.getScrollbarWidth(),n=e.bottom-e.top;this.gridPanel.isHorizontalScrollShowing()&&(n-=o);var i=this.paginationProxy.getPixelOffset(),r=e.top+n,s=this.paginationProxy.getRowIndexAtPixel(r+i),a=this.paginationProxy.getRow(t.rowIndex).rowTop+n-i,l=this.paginationProxy.getRowIndexAtPixel(a+i),p=this.paginationProxy.getPageLastRow();l>p&&(l=p),s>p&&(s=p),this.navigateTo({scrollIndex:s,scrollType:"top",scrollColumn:null,focusIndex:l,focusColumn:t.column}),this.setTimeLastPageEventProcessed()}},o.prototype.onPageUp=function(t){if(!this.isTimeSinceLastPageEventToRecent()){var e=this.gridPanel.getVScrollPosition(),o=this.gridOptionsWrapper.getScrollbarWidth(),n=e.bottom-e.top;this.gridPanel.isHorizontalScrollShowing()&&(n-=o);var i=this.paginationProxy.getPixelOffset(),r=e.top,s=this.paginationProxy.getRowIndexAtPixel(r+i),a=this.paginationProxy.getRow(t.rowIndex),l=a.rowTop+a.rowHeight-n-i,p=this.paginationProxy.getRowIndexAtPixel(l+i),u=this.paginationProxy.getPageFirstRow();p<u&&(p=u),s<u&&(s=u),this.navigateTo({scrollIndex:s,scrollType:"bottom",scrollColumn:null,focusIndex:p,focusColumn:t.column}),this.setTimeLastPageEventProcessed()}},o.prototype.getIndexToFocus=function(t,e){var o=t;if(e){var n=this.paginationProxy.getRow(t);n&&n.stub&&(o-=1)}return o},o.prototype.onCtrlUpOrDown=function(t,e){var o=t===jn.UP,n=o?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:n,scrollType:null,scrollColumn:e.column,focusIndex:this.getIndexToFocus(n,!o),focusColumn:e.column})},o.prototype.onCtrlLeftOrRight=function(t,e){var o=t===jn.LEFT,n=this.columnController.getAllDisplayedColumns(),i=o?n[0]:d(n);this.navigateTo({scrollIndex:e.rowIndex,scrollType:null,scrollColumn:i,focusIndex:e.rowIndex,focusColumn:i})},o.prototype.onHomeOrEndKey=function(t){var e=t===jn.PAGE_HOME,o=this.columnController.getAllDisplayedColumns(),n=e?o[0]:d(o),i=e?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:i,scrollType:null,scrollColumn:n,focusIndex:this.getIndexToFocus(i,!e),focusColumn:n})},ip([it("mouseEventService")],o.prototype,"mouseEventService",void 0),ip([it("paginationProxy")],o.prototype,"paginationProxy",void 0),ip([it("focusController")],o.prototype,"focusController",void 0),ip([it("animationFrameService")],o.prototype,"animationFrameService",void 0),ip([rt("rangeController")],o.prototype,"rangeController",void 0),ip([it("columnController")],o.prototype,"columnController",void 0),o=ip([nt("navigationService")],o)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),sp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ap=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.scrollY=0,e.uiBodyHeight=0,e}rp(e,t),e.prototype.postConstruct=function(){this.addManagedListener(this.eventService,Wt.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=_e()},e.prototype.registerGridComp=function(t){this.gridPanel=t},e.prototype.isScaling=function(){return this.scaling},e.prototype.getOffset=function(){return this.offset},e.prototype.updateOffset=function(){if(this.scaling){var t=this.gridPanel.getVScrollPosition().top,e=this.getUiBodyHeight();(t!==this.scrollY||e!==this.uiBodyHeight)&&(this.scrollY=t,this.uiBodyHeight=e,this.calculateOffset())}},e.prototype.calculateOffset=function(){this.uiContainerHeight=this.maxDivHeight,this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;var t=this.scrollY/this.maxScrollY;this.setOffset(t*this.pixelsToShave)},e.prototype.clearOffset=function(){this.uiContainerHeight=this.modelHeight,this.pixelsToShave=0,this.setOffset(0)},e.prototype.setOffset=function(t){var e="number"==typeof t?Math.floor(t):null;this.offset!==e&&(this.offset=e,this.eventService.dispatchEvent({type:Wt.EVENT_HEIGHT_SCALE_CHANGED}))},e.prototype.setModelHeight=function(t){this.modelHeight=t,this.scaling=this.maxDivHeight>0&&t>this.maxDivHeight,this.scaling?this.calculateOffset():this.clearOffset()},e.prototype.getUiContainerHeight=function(){return this.uiContainerHeight},e.prototype.getRealPixelPosition=function(t){return t-this.offset},e.prototype.getUiBodyHeight=function(){var t=this.gridPanel.getVScrollPosition();return t.bottom-t.top},e.prototype.getScrollPositionForPixel=function(t){if(this.pixelsToShave<=0)return t;var e=t/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*e},sp([et],e.prototype,"postConstruct",null),e=sp([nt("maxDivHeightScaler")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),lp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},pp=(function(t){function o(){return null!==t&&t.apply(this,arguments)||this}ap(o,t),o.prototype.init=function(){this.groupSelectsChildren=this.gridOptionsWrapper.isGroupSelectsChildren(),this.isRowSelectableFunc=this.gridOptionsWrapper.getIsRowSelectableFunc()},o.prototype.updateSelectableAfterGrouping=function(t){if(this.isRowSelectableFunc){this.recurseDown(t.childrenAfterGroup,(function(t){return t.childrenAfterGroup}))}},o.prototype.updateSelectableAfterFiltering=function(t){if(this.isRowSelectableFunc){this.recurseDown(t.childrenAfterGroup,(function(t){return t.childrenAfterFilter}))}},o.prototype.recurseDown=function(t,o){var n=this;t&&t.forEach((function(t){if(t.group){var i;if(t.hasChildren()&&n.recurseDown(o(t),o),n.groupSelectsChildren)i=e(a(o(t),"selectable",!0));else i=!!n.isRowSelectableFunc&&n.isRowSelectableFunc(t);t.setRowSelectable(i)}}))},lp([et],o.prototype,"init",null),o=lp([nt("selectableService")],o)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),up=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},cp=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}pp(e,t),e.prototype.registerGridComp=function(t){this.gridPanel=t},e.prototype.getPreferredHeightForRow=function(t){var e=this,o=document.createElement("div");this.addInRowCssClasses(t,o);var n=this.gridPanel.getCenterContainer();n.appendChild(o);var i=Cs.createChildScopeOrNull(t,this.$scope,this.beans.gridOptionsWrapper),r=i?i.scope:void 0,s=i?i.scopeDestroyFunc:void 0,a=[],l=this.columnController.getAllAutoRowHeightCols(),p=this.columnController.getAllDisplayedColumns();l.filter((function(t){return p.indexOf(t)>=0})).forEach((function(n){var i=new vs(r,e.beans,n,t,null,!0,!1);i.setParentRow(o),a.push(i)}));var u=a.map((function(t){return t.getCreateTemplate()})).join(" ");o.innerHTML=u,a.forEach((function(t){return t.afterAttached()})),r&&this.$compile(o)(r);for(var c=0,d=0;d<o.children.length;d++){var h=o.children[d];h.offsetHeight>c&&(c=h.offsetHeight)}return n.removeChild(o),a.forEach((function(t){t.detach(),t.destroy()})),s&&s(),c},e.prototype.addInRowCssClasses=function(t,e){var o=t.rowIndex,n={rowNode:t,rowIsEven:o%2==0,rowLevel:this.rowCssClassCalculator.calculateRowLevel(t),firstRowOnPage:o===this.beans.paginationProxy.getPageFirstRow(),lastRowOnPage:o===this.beans.paginationProxy.getPageLastRow(),printLayout:!1,expandable:t.isExpandable()};Me(e,this.rowCssClassCalculator.getInitialRowClasses(n).join(" "))},up([it("beans")],e.prototype,"beans",void 0),up([it("$scope")],e.prototype,"$scope",void 0),up([it("columnController")],e.prototype,"columnController",void 0),up([it("rowCssClassCalculator")],e.prototype,"rowCssClassCalculator",void 0),up([it("$compile")],e.prototype,"$compile",void 0),e=up([nt("autoHeightCalculator")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),dp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},hp=(function(t){function e(){var e=t.call(this)||this;return e.previousAndFirstButtonsDisabled=!1,e.nextButtonDisabled=!1,e.lastButtonDisabled=!1,e}cp(e,t),e.prototype.postConstruct=function(){var t=this,e=this.gridOptionsWrapper.isEnableRtl();this.setTemplate(this.getTemplate()),this.btFirst.insertAdjacentElement("afterbegin",cn(e?"last":"first",this.gridOptionsWrapper)),this.btPrevious.insertAdjacentElement("afterbegin",cn(e?"next":"previous",this.gridOptionsWrapper)),this.btNext.insertAdjacentElement("afterbegin",cn(e?"previous":"next",this.gridOptionsWrapper)),this.btLast.insertAdjacentElement("afterbegin",cn(e?"first":"last",this.gridOptionsWrapper)),this.gridOptionsWrapper.isPagination()&&!this.gridOptionsWrapper.isSuppressPaginationPanel()?(this.addManagedListener(this.eventService,Wt.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach((function(e){var o=e.el,n=e.fn;t.addManagedListener(o,"click",n),t.addManagedListener(o,"keydown",(function(t){t.keyCode!==jn.ENTER&&t.keyCode!==jn.SPACE||(t.preventDefault(),n())}))})),this.onPaginationChanged()):this.setDisplayed(!1)},e.prototype.onPaginationChanged=function(){this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels()},e.prototype.onBtFirst=function(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()},e.prototype.setCurrentPageLabel=function(){var t=this.paginationProxy.getTotalPages()>0,e=this.paginationProxy.getCurrentPage(),o=t?e+1:0;this.lbCurrent.innerHTML=this.formatNumber(o)},e.prototype.formatNumber=function(t){var e=this.gridOptionsWrapper.getPaginationNumberFormatterFunc();return e?e({value:t}):ne(t)},e.prototype.getTemplate=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),e=t("page","Page"),o=t("to","to"),n=t("of","of"),i=t("firstPage","First Page"),r=t("previousPage","Previous Page"),s=t("nextPage","Next Page"),a=t("lastPage","Last Page"),l=this.getCompId();return'<div class="ag-paging-panel ag-unselectable" id="ag-'+l+'" aria-live="polite" aria-describedby="'+("ag-"+l+"-start-page ag-"+l+"-start-page-number ag-"+l+"-of-page ag-"+l+"-of-page-number")+" "+("ag-"+l+"-first-row ag-"+l+"-to ag-"+l+"-last-row ag-"+l+"-of ag-"+l+"-row-count")+'">\n <span class="ag-paging-row-summary-panel" aria-hidden="true">\n <span id="ag-'+l+'-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n <span id="ag-'+l+'-to">'+o+'</span>\n <span id="ag-'+l+'-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n <span id="ag-'+l+'-of">'+n+'</span>\n <span id="ag-'+l+'-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>\n </span>\n <span class="ag-paging-page-summary-panel" role="presentation">\n <div ref="btFirst" class="ag-paging-button" role="button" aria-label="'+i+'" tabindex="0"></div>\n <div ref="btPrevious" class="ag-paging-button" role="button" aria-label="'+r+'" tabindex="0"></div>\n <span class="ag-paging-description" aria-hidden="true">\n <span id="ag-'+l+'-start-page">'+e+'</span>\n <span id="ag-'+l+'-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>\n <span id="ag-'+l+'-of-page">'+n+'</span>\n <span id="ag-'+l+'-of-page-number" ref="lbTotal" class="ag-paging-number"></span>\n </span>\n <div ref="btNext" class="ag-paging-button" role="button" aria-label="'+s+'" tabindex="0"></div>\n <div ref="btLast" class="ag-paging-button" role="button" aria-label="'+a+'" tabindex="0"></div>\n </span>\n </div>'},e.prototype.onBtNext=function(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()},e.prototype.onBtPrevious=function(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()},e.prototype.onBtLast=function(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()},e.prototype.enableOrDisableButtons=function(){var t=this.paginationProxy.getCurrentPage(),e=this.paginationProxy.isLastPageFound(),o=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=0===t,Ve(this.btFirst,"ag-disabled",this.previousAndFirstButtonsDisabled),xo(this.btFirst,this.previousAndFirstButtonsDisabled),Ve(this.btPrevious,"ag-disabled",this.previousAndFirstButtonsDisabled),xo(this.btPrevious,this.previousAndFirstButtonsDisabled);var n=this.isZeroPagesToDisplay(),i=e&&t===o-1;this.nextButtonDisabled=i||n,Ve(this.btNext,"ag-disabled",this.nextButtonDisabled),xo(this.btNext,this.nextButtonDisabled),this.lastButtonDisabled=!e||n||t===o-1,Ve(this.btLast,"ag-disabled",this.lastButtonDisabled),xo(this.btLast,this.lastButtonDisabled)},e.prototype.updateRowLabels=function(){var t,e,o=this.paginationProxy.getCurrentPage(),n=this.paginationProxy.getPageSize(),i=this.paginationProxy.isLastPageFound(),r=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;this.isZeroPagesToDisplay()?t=e=0:(e=(t=n*o+1)+n-1,i&&e>r&&(e=r)),this.lbFirstRowOnPage.innerHTML=this.formatNumber(t),this.rowNodeBlockLoader.isLoading()?this.lbLastRowOnPage.innerHTML="?":this.lbLastRowOnPage.innerHTML=this.formatNumber(e)},e.prototype.isZeroPagesToDisplay=function(){var t=this.paginationProxy.isLastPageFound(),e=this.paginationProxy.getTotalPages();return t&&0===e},e.prototype.setTotalLabels=function(){var t=this.paginationProxy.isLastPageFound(),e=this.paginationProxy.getTotalPages(),o=t?this.paginationProxy.getMasterRowCount():null;if(t)this.lbTotal.innerHTML=this.formatNumber(e),this.lbRecordCount.innerHTML=this.formatNumber(o);else{var n=this.gridOptionsWrapper.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=n,this.lbRecordCount.innerHTML=n}},dp([it("paginationProxy")],e.prototype,"paginationProxy",void 0),dp([it("rowModel")],e.prototype,"rowModel",void 0),dp([it("rowNodeBlockLoader")],e.prototype,"rowNodeBlockLoader",void 0),dp([Wn("btFirst")],e.prototype,"btFirst",void 0),dp([Wn("btPrevious")],e.prototype,"btPrevious",void 0),dp([Wn("btNext")],e.prototype,"btNext",void 0),dp([Wn("btLast")],e.prototype,"btLast",void 0),dp([Wn("lbRecordCount")],e.prototype,"lbRecordCount",void 0),dp([Wn("lbFirstRowOnPage")],e.prototype,"lbFirstRowOnPage",void 0),dp([Wn("lbLastRowOnPage")],e.prototype,"lbLastRowOnPage",void 0),dp([Wn("lbCurrent")],e.prototype,"lbCurrent",void 0),dp([Wn("lbTotal")],e.prototype,"lbTotal",void 0),dp([et],e.prototype,"postConstruct",null)}(xn),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),fp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},gp=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}hp(e,t),e.prototype.observeResize=function(t,e,o){void 0===o&&(o=50);var n,i,r,s,a,l=this.getFrameworkOverrides(),p=$(e,o),u=this.gridOptionsWrapper.isSuppressBrowserResizeObserver();return!!window.ResizeObserver&&!u?((a=new window.ResizeObserver(p)).observe(t),function(){return a.disconnect()}):(n=ro(t),i=io(t),r=!0,(s=function(){if(r){var a=ro(t),p=io(t);(a!==n||p!==i)&&(n=a,i=p,e()),l.setTimeout(s,o)}})(),function(){return r=!1})},e=fp([nt("resizeObserverService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),yp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};!function(t){t[t.Loading=0]="Loading",t[t.NoRows=1]="NoRows"}(Ba||(Ba={}));!function(t){function e(){var o=t.call(this,e.TEMPLATE)||this;return o.inProgress=!1,o.destroyRequested=!1,o}gp(e,t),e.prototype.postConstruct=function(){this.gridOptionsWrapper.addLayoutElement(this.eOverlayWrapper),this.setDisplayed(!1)},e.prototype.setWrapperTypeClass=function(t){Ve(this.eOverlayWrapper,"ag-overlay-loading-wrapper",t===Ba.Loading),Ve(this.eOverlayWrapper,"ag-overlay-no-rows-wrapper",t===Ba.NoRows)},e.prototype.showLoadingOverlay=function(){var t=this.userComponentFactory.newLoadingOverlayComponent({api:this.gridOptionsWrapper.getApi()});this.showOverlay(t,Ba.Loading)},e.prototype.showNoRowsOverlay=function(){var t=this.userComponentFactory.newNoRowsOverlayComponent({api:this.gridOptionsWrapper.getApi()});this.showOverlay(t,Ba.NoRows)},e.prototype.showOverlay=function(t,e){var o=this;this.inProgress||(this.setWrapperTypeClass(e),this.destroyActiveOverlay(),this.inProgress=!0,t&&t.then((function(t){o.inProgress=!1,o.eOverlayWrapper.appendChild(t.getGui()),o.activeOverlay=t,o.destroyRequested&&(o.destroyRequested=!1,o.destroyActiveOverlay())})),this.setDisplayed(!0))},e.prototype.destroyActiveOverlay=function(){this.inProgress?this.destroyRequested=!0:this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),Je(this.eOverlayWrapper))},e.prototype.hideOverlay=function(){this.destroyActiveOverlay(),this.setDisplayed(!1)},e.prototype.destroy=function(){this.destroyActiveOverlay(),t.prototype.destroy.call(this)},e.TEMPLATE='\n <div class="ag-overlay" aria-hidden="true">\n <div class="ag-overlay-panel">\n <div class="ag-overlay-wrapper" ref="eOverlayWrapper"></div>\n </div>\n </div>',yp([it("userComponentFactory")],e.prototype,"userComponentFactory",void 0),yp([Wn("eOverlayWrapper")],e.prototype,"eOverlayWrapper",void 0),yp([et],e.prototype,"postConstruct",null)}(xn);
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/var vp,mp=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Cp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},wp=(function(t){function e(o){void 0===o&&(o={});var n=t.call(this,e.getTemplate(o))||this;n.suppressEnabledCheckbox=!0,n.suppressOpenCloseIcons=!1;var i=o.title,r=o.enabled,s=o.items,a=o.suppressEnabledCheckbox,l=o.suppressOpenCloseIcons;return n.title=i,n.cssIdentifier=o.cssIdentifier||"default",n.enabled=null==r||r,n.items=s||[],n.alignItems=o.alignItems||"center",null!=a&&(n.suppressEnabledCheckbox=a),null!=l&&(n.suppressOpenCloseIcons=l),n}mp(e,t),e.getTemplate=function(t){var e=t.cssIdentifier||"default";return'<div class="ag-group ag-'+e+'-group">\n <div class="ag-group-title-bar ag-'+e+'-group-title-bar ag-unselectable" ref="eTitleBar">\n <span class="ag-group-title-bar-icon ag-'+e+'-group-title-bar-icon" ref="eGroupOpenedIcon"></span>\n <span class="ag-group-title-bar-icon ag-'+e+'-group-title-bar-icon" ref="eGroupClosedIcon"></span>\n <span ref="eTitle" class="ag-group-title ag-'+e+'-group-title"></span>\n </div>\n <div ref="eToolbar" class="ag-group-toolbar ag-'+e+'-group-toolbar">\n <ag-checkbox ref="cbGroupEnabled"></ag-checkbox>\n </div>\n <div ref="eContainer" class="ag-group-container ag-group-container-'+(t.direction||"vertical")+" ag-"+e+'-group-container"></div>\n </div>'},e.prototype.postConstruct=function(){if(this.items.length){var t=this.items;this.items=[],this.addItems(t)}var e=this.gridOptionsWrapper.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.title&&this.setTitle(this.title),this.enabled&&this.setEnabled(this.enabled),this.setAlignItems(this.alignItems),this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract(),this.refreshChildDisplay()},e.prototype.setupExpandContract=function(){var t=this;this.eGroupClosedIcon.appendChild(un("columnSelectClosed",this.gridOptionsWrapper,null)),this.eGroupOpenedIcon.appendChild(un("columnSelectOpen",this.gridOptionsWrapper,null)),this.addManagedListener(this.eTitleBar,"click",(function(){return t.toggleGroupExpand()})),this.addManagedListener(this.eTitleBar,"keydown",(function(e){switch(e.keyCode){case jn.ENTER:t.toggleGroupExpand();break;case jn.RIGHT:t.toggleGroupExpand(!0);break;case jn.LEFT:t.toggleGroupExpand(!1)}}))},e.prototype.refreshChildDisplay=function(){var t=!this.suppressOpenCloseIcons;ke(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),ke(this.eGroupOpenedIcon,t&&this.expanded),ke(this.eGroupClosedIcon,t&&!this.expanded)},e.prototype.isExpanded=function(){return this.expanded},e.prototype.setAlignItems=function(t){var e=this.getGui();return this.alignItems!==t&&xe(e,"ag-group-item-alignment-"+this.alignItems),this.alignItems=t,Me(e,"ag-group-item-alignment-"+this.alignItems),this},e.prototype.toggleGroupExpand=function(t){return this.suppressOpenCloseIcons?(this.expanded=!0,this.refreshChildDisplay(),ke(this.eContainer,!0),this):(t=null!=t?t:!this.expanded,this.expanded===t||(this.expanded=t,this.refreshChildDisplay(),ke(this.eContainer,t),this.dispatchEvent({type:this.expanded?e.EVENT_EXPANDED:e.EVENT_COLLAPSED})),this)},e.prototype.addItems=function(t){var e=this;t.forEach((function(t){return e.addItem(t)}))},e.prototype.addItem=function(t){var e=this.eContainer,o=t instanceof xn?t.getGui():t;Me(o,"ag-group-item"),Me(o,"ag-"+this.cssIdentifier+"-group-item"),e.appendChild(o),this.items.push(o)},e.prototype.hideItem=function(t,e){Ve(this.items[e],"ag-hidden",t)},e.prototype.setTitle=function(t){return this.eTitle.innerText=t,this},e.prototype.addCssClassToTitleBar=function(t){Me(this.eTitleBar,t)},e.prototype.setEnabled=function(t,e){return this.enabled=t,this.refreshDisabledStyles(),this.toggleGroupExpand(t),e||this.cbGroupEnabled.setValue(t),this},e.prototype.isEnabled=function(){return this.enabled},e.prototype.onEnableChange=function(t){var e=this;return this.cbGroupEnabled.onValueChange((function(o){e.setEnabled(o,!0),t(o)})),this},e.prototype.hideEnabledCheckbox=function(t){return this.suppressEnabledCheckbox=t,this.refreshChildDisplay(),this.refreshDisabledStyles(),this},e.prototype.hideOpenCloseIcons=function(t){return this.suppressOpenCloseIcons=t,t&&this.toggleGroupExpand(!0),this},e.prototype.refreshDisabledStyles=function(){Ve(this.getGui(),"ag-disabled",!this.enabled),this.suppressEnabledCheckbox&&!this.enabled?(Me(this.eTitleBar,"ag-disabled-group-title-bar"),this.eTitleBar.removeAttribute("tabindex")):(xe(this.eTitleBar,"ag-disabled-group-title-bar"),this.eTitleBar.setAttribute("tabindex","0")),Ve(this.eContainer,"ag-disabled-group-container",!this.enabled)},e.EVENT_EXPANDED="expanded",e.EVENT_COLLAPSED="collapsed",Cp([Wn("eTitleBar")],e.prototype,"eTitleBar",void 0),Cp([Wn("eGroupOpenedIcon")],e.prototype,"eGroupOpenedIcon",void 0),Cp([Wn("eGroupClosedIcon")],e.prototype,"eGroupClosedIcon",void 0),Cp([Wn("eToolbar")],e.prototype,"eToolbar",void 0),Cp([Wn("cbGroupEnabled")],e.prototype,"cbGroupEnabled",void 0),Cp([Wn("eTitle")],e.prototype,"eTitle",void 0),Cp([Wn("eContainer")],e.prototype,"eContainer",void 0),Cp([et],e.prototype,"postConstruct",null)}(xn),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Ep=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Rp=function(t){function e(o){var n=t.call(this,e.getTemplate(o))||this;return n.closable=!0,n.positioned=!1,n.dragStartPosition={x:0,y:0},n.position={x:0,y:0},n.size={width:void 0,height:void 0},n.config=o,n}return wp(e,t),e.getTemplate=function(t){var e=t&&t.cssIdentifier||"default";return'<div class="ag-panel ag-'+e+'-panel" tabindex="-1">\n <div ref="eTitleBar" class="ag-panel-title-bar ag-'+e+'-panel-title-bar ag-unselectable">\n <span ref="eTitle" class="ag-panel-title-bar-title ag-'+e+'-panel-title-bar-title"></span>\n <div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-'+e+'-panel-title-bar-buttons"></div>\n </div>\n <div ref="eContentWrapper" class="ag-panel-content-wrapper ag-'+e+'-panel-content-wrapper"></div>\n </div>'},e.prototype.postConstruct=function(){var t=this,e=this.config,o=e.component,n=e.closable,i=e.hideTitleBar,r=e.title,s=e.minWidth,a=e.width,l=e.minHeight,p=e.height,u=e.centered,c=e.x,d=e.y,h=this.getGui();o&&this.setBodyComponent(o),i?Me(this.eTitleBar,"ag-hidden"):(r&&this.setTitle(r),this.setClosable(null!=n?n:this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",(function(e){if(h.contains(e.relatedTarget)||h.contains(document.activeElement)||t.eTitleBarButtons.contains(e.target))e.preventDefault();else{var o=t.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");o&&o.focus()}})),this.positioned||(this.minHeight=null!=l?l:250,this.minWidth=null!=s?s:250,this.popupParent=this.popupService.getPopupParent(),a&&this.setWidth(a),p&&this.setHeight(p),this.renderComponent&&this.renderComponent(),a&&p||this.refreshSize(),u?this.center():(c||d)&&this.offsetElement(c,d),this.positioned=!0,this.eContentWrapper.style.height="0")},e.prototype.renderComponent=function(){var t=this,e=this.getGui();e.focus(),this.close=function(){e.parentElement.removeChild(e),t.destroy()}},e.prototype.updateDragStartPosition=function(t,e){this.dragStartPosition={x:t,y:e}},e.prototype.calculateMouseMovement=function(t){var e=this.popupParent.getBoundingClientRect(),o=t.e,n=t.isLeft,i=t.isTop,r=t.anywhereWithin,s=t.topBuffer,a=o.clientX-this.dragStartPosition.x,l=o.clientY-this.dragStartPosition.y,p=this.getWidth(),u=this.getHeight(),c=e.left>=o.clientX&&this.position.x<=0||e.right<=o.clientX&&e.right<=this.position.x+e.left+p;return c||(c=n?a<0&&o.clientX>this.position.x+e.left||a>0&&o.clientX<this.position.x+e.left:r?a<0&&o.clientX>this.position.x+e.left+p||a>0&&o.clientX<this.position.x+e.left:a<0&&o.clientX>this.position.x+e.left+p||a>0&&o.clientX<this.position.x+e.left+p),{movementX:a=c?0:a,movementY:l=e.top>=o.clientY&&this.position.y<=0||e.bottom<=o.clientY&&e.bottom<=this.position.y+e.top+u||i&&(l<0&&o.clientY>this.position.y+e.top+(s||0)||l>0&&o.clientY<this.position.y+e.top)||!i&&(l<0&&o.clientY>this.position.y+e.top+u||l>0&&o.clientY<this.position.y+e.top+u)?0:l}},e.prototype.refreshSize=function(){var t=this.size,e=t.width,o=t.height;e||this.setWidth(this.getGui().offsetWidth),o||this.setHeight(this.getGui().offsetHeight)},e.prototype.offsetElement=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var o=this.getGui();this.popupService.positionPopup({ePopup:o,x:t,y:e,minWidth:this.minWidth,minHeight:this.minHeight,keepWithinBounds:!0}),this.position.x=parseInt(o.style.left,10),this.position.y=parseInt(o.style.top,10)},e.prototype.getHeight=function(){return this.size.height},e.prototype.setHeight=function(t){var e=this.getGui(),o=!1;if("string"==typeof t&&-1!==t.indexOf("%"))go(e,t),t=qe(e),o=!0;else{t=Math.max(this.minHeight,t);var n=e.offsetParent;n&&n.clientHeight&&t+this.position.y>n.clientHeight&&(t=n.clientHeight-this.position.y)}this.size.height!==t&&(this.size.height=t,o?(e.style.maxHeight="unset",e.style.minHeight="unset"):go(e,t))},e.prototype.getWidth=function(){return this.size.width},e.prototype.setWidth=function(t){var e=this.getGui(),o=!1;if("string"==typeof t&&-1!==t.indexOf("%"))fo(e,t),t=Xe(e),o=!0;else{t=Math.max(this.minWidth,t);var n=e.offsetParent;n&&n.clientWidth&&t+this.position.x>n.clientWidth&&(t=n.clientWidth-this.position.x)}this.size.width!==t&&(this.size.width=t,o?(e.style.maxWidth="unset",e.style.minWidth="unset"):fo(e,t))},e.prototype.center=function(){var t=this.getGui(),e=t.offsetParent.clientWidth/2-this.getWidth()/2,o=t.offsetParent.clientHeight/2-this.getHeight()/2;this.offsetElement(e,o)},e.prototype.setClosable=function(t){if(t!==this.closable&&(this.closable=t),t){var o=this.closeButtonComp=new xn(e.CLOSE_BTN_TEMPLATE);this.getContext().createBean(o),(n=o.getGui()).appendChild(Me(cn("close",this.gridOptionsWrapper),"ag-panel-title-bar-button-icon")),this.addTitleBarButton(o),o.addManagedListener(n,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){var n;(n=this.closeButtonComp.getGui()).parentElement.removeChild(n),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}},e.prototype.setBodyComponent=function(t){t.setParentComponent(this),this.eContentWrapper.appendChild(t.getGui())},e.prototype.addTitleBarButton=function(t,e){var o=this.eTitleBarButtons,n=o.children,i=n.length;null==e&&(e=i),e=Math.max(0,Math.min(e,i));var r=t.getGui();Me(r,"ag-panel-title-bar-button"),0===e?o.insertAdjacentElement("afterbegin",r):e===i?o.insertAdjacentElement("beforeend",r):n[e-1].insertAdjacentElement("afterend",r),t.setParentComponent(this)},e.prototype.getBodyHeight=function(){return Ke(this.eContentWrapper)},e.prototype.getBodyWidth=function(){return Ye(this.eContentWrapper)},e.prototype.setTitle=function(t){this.eTitle.innerText=t},e.prototype.onBtClose=function(){this.close()},e.prototype.destroy=function(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));var e=this.getGui();e&&e.offsetParent&&this.close(),t.prototype.destroy.call(this)},e.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>',Ep([it("popupService")],e.prototype,"popupService",void 0),Ep([Wn("eContentWrapper")],e.prototype,"eContentWrapper",void 0),Ep([Wn("eTitleBar")],e.prototype,"eTitleBar",void 0),Ep([Wn("eTitleBarButtons")],e.prototype,"eTitleBarButtons",void 0),Ep([Wn("eTitle")],e.prototype,"eTitle",void 0),Ep([et],e.prototype,"postConstruct",null),e}(xn),Op=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Pp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Sp=function(t){function e(e){var o=t.call(this,e)||this;return o.RESIZE_TEMPLATE='<div class="ag-resizer-wrapper">\n <div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>\n <div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>\n <div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>\n <div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>\n <div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>\n <div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>\n <div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>\n <div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>\n </div>',o.resizable={},o.movable=!1,o.isMoving=!1,o.isMaximizable=!1,o.isMaximized=!1,o.maximizeListeners=[],o.resizeListenerDestroy=null,o.isResizing=!1,o.lastPosition={x:0,y:0,width:0,height:0},o}return Op(e,t),e.prototype.postConstruct=function(){var e=this,o=this.getGui(),n=this.config,i=n.movable,r=n.resizable,s=n.maximizable;Me(o,"ag-dialog"),this.moveElement=this.eTitleBar,t.prototype.postConstruct.call(this),this.addManagedListener(o,"focusin",(function(t){o.contains(t.relatedTarget)||e.popupService.bringPopupToFront(o)})),i&&this.setMovable(i),s&&this.setMaximizable(s),this.addResizers(),r&&this.setResizable(r)},e.prototype.renderComponent=function(){var t=this.getGui(),e=this.config,o=e.alwaysOnTop,n=e.modal,i=this.popupService.addPopup({modal:n,eChild:t,closeOnEsc:!0,closedCallback:this.destroy.bind(this),alwaysOnTop:o});i&&(this.close=i.hideFunc)},e.prototype.addResizers=function(){var t=this.getGui();if(t){var e=(new DOMParser).parseFromString(this.RESIZE_TEMPLATE,"text/html").body;t.appendChild(e.firstChild),this.createMap()}},e.prototype.createMap=function(){var t=this.getGui();this.resizerMap={topLeft:{element:t.querySelector("[ref=eTopLeftResizer]")},top:{element:t.querySelector("[ref=eTopResizer]")},topRight:{element:t.querySelector("[ref=eTopRightResizer]")},right:{element:t.querySelector("[ref=eRightResizer]")},bottomRight:{element:t.querySelector("[ref=eBottomRightResizer]")},bottom:{element:t.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:t.querySelector("[ref=eBottomLeftResizer]")},left:{element:t.querySelector("[ref=eLeftResizer]")}}},e.prototype.getResizerElement=function(t){return this.resizerMap[t].element},e.prototype.onResizeStart=function(t){this.isResizing=!0,this.updateDragStartPosition(t.clientX,t.clientY)},e.prototype.onResize=function(t,e){if(this.isResizing){var o=!!e.match(/left/i),n=!!e.match(/right/i),i=!!e.match(/top/i),r=!!e.match(/bottom/i),s=o||n,a=i||r,l=this.calculateMouseMovement({e:t,isLeft:o,isTop:i}),p=l.movementX,u=l.movementY,c=0,d=0;if(s&&p){var h=o?-1:1,f=this.getWidth(),g=f+p*h,y=!1;o&&(c=f-g,(this.position.x+c<=0||g<=this.minWidth)&&(y=!0,c=0)),y||this.setWidth(g)}if(a&&u){h=i?-1:1;var v=this.getHeight(),m=v+u*h,C=!1;i&&(d=v-m,(this.position.y+d<=0||m<=this.minHeight)&&(C=!0,d=0)),C||this.setHeight(m)}this.updateDragStartPosition(t.clientX,t.clientY),(c||d)&&this.offsetElement(this.position.x+c,this.position.y+d)}},e.prototype.onResizeEnd=function(){this.isResizing=!1;var t={type:"resize",api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()};this.dispatchEvent(t)},e.prototype.onMoveStart=function(t){this.isMoving=!0,this.updateDragStartPosition(t.clientX,t.clientY)},e.prototype.onMove=function(t){if(this.isMoving){var e=this.position,o=e.x,n=e.y,i=this.calculateMouseMovement({e:t,isTop:!0,anywhereWithin:!0,topBuffer:this.getHeight()-this.getBodyHeight()}),r=i.movementX,s=i.movementY;this.offsetElement(o+r,n+s),this.updateDragStartPosition(t.clientX,t.clientY)}},e.prototype.onMoveEnd=function(){this.isMoving=!1},e.prototype.toggleMaximize=function(){if(this.isMaximized){var t=this.lastPosition,e=t.x,o=t.y,n=t.width,i=t.height;this.setWidth(n),this.setHeight(i),this.offsetElement(e,o)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=this.position.x,this.lastPosition.y=this.position.y,this.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()},e.prototype.refreshMaximizeIcon=function(){ke(this.maximizeIcon,!this.isMaximized),ke(this.minimizeIcon,this.isMaximized)},e.prototype.clearMaximizebleListeners=function(){this.maximizeListeners.length&&(this.maximizeListeners.forEach((function(t){return t()})),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)},e.prototype.destroy=function(){this.setResizable(!1),this.setMovable(!1),this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),t.prototype.destroy.call(this)},e.prototype.setResizable=function(t){var e=this;"boolean"==typeof t&&(t={topLeft:t,top:t,topRight:t,right:t,bottomRight:t,bottom:t,bottomLeft:t,left:t}),Object.keys(t).forEach((function(o){var n=o,i=!!t[n],r=e.getResizerElement(n),s=e.resizerMap[n].dragSource||{eElement:r,onDragStart:e.onResizeStart.bind(e),onDragging:function(t){return e.onResize(t,n)},onDragStop:e.onResizeEnd.bind(e)};!!e.resizable[n]===i&&(e.isAlive()||i)||(i?(e.dragService.addDragSource(s),r.style.pointerEvents="all"):(e.dragService.removeDragSource(s),r.style.pointerEvents="none"),e.resizerMap[n].dragSource=i?s:void 0)}))},e.prototype.setMovable=function(t){if(t!==this.movable){this.movable=t;var e=this.moveElementDragListener||{eElement:this.moveElement,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};t?(this.dragService.addDragSource(e),this.moveElementDragListener=e):(this.dragService.removeDragSource(e),this.moveElementDragListener=void 0)}},e.prototype.setMaximizable=function(t){var e=this;if(!t)return this.clearMaximizebleListeners(),void(this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0));var o=this.eTitleBar;if(o&&t!==this.isMaximizable){var n=this.maximizeButtonComp=this.createBean(new xn('<div class="ag-dialog-button"></span>')),i=n.getGui();i.appendChild(this.maximizeIcon=cn("maximize",this.gridOptionsWrapper)),Me(this.maximizeIcon,"ag-panel-title-bar-button-icon"),i.appendChild(this.minimizeIcon=cn("minimize",this.gridOptionsWrapper)),Me(this.minimizeIcon,"ag-panel-title-bar-button-icon"),Me(this.minimizeIcon,"ag-hidden"),n.addManagedListener(i,"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(n,0),this.maximizeListeners.push(this.addManagedListener(o,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",(function(){e.isMaximized=!1,e.refreshMaximizeIcon()}))}},Pp([it("dragService")],e.prototype,"dragService",void 0),e}(Rp),bp=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Dp=function(t){function o(e,o,n){return void 0===o&&(o="ag-text-field"),void 0===n&&(n="text"),t.call(this,e,o,n)||this}return bp(o,t),o.prototype.postConstruct=function(){t.prototype.postConstruct.call(this),this.config.allowedCharPattern&&this.preventDisallowedCharacters()},o.prototype.setValue=function(o,n){var i=t.prototype.setValue.call(this,o,n);return this.eInput.value!==o&&(this.eInput.value=e(o)?o:""),i},o.prototype.preventDisallowedCharacters=function(){var t=new RegExp("["+this.config.allowedCharPattern+"]");this.addManagedListener(this.eInput,"keypress",(function(e){e.key&&!t.test(e.key)&&e.preventDefault()})),this.addManagedListener(this.eInput,"paste",(function(e){O(e.clipboardData.getData("text"),(function(e){return!t.test(e)}))&&e.preventDefault()}))},o}(Ws),Ap=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Tp=(function(t){function e(e){return t.call(this,e,"ag-text-area",null,"textarea")||this}Ap(e,t),e.prototype.setValue=function(e,o){var n=t.prototype.setValue.call(this,e,o);return this.eInput.value=e,n},e.prototype.setCols=function(t){return this.eInput.cols=t,this},e.prototype.setRows=function(t){return this.eInput.rows=t,this}}(Ws),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),_p=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Fp=(function(t){function e(o){var n=t.call(this,o,e.TEMPLATE)||this;return n.labelAlignment="top",n}Tp(e,t),e.prototype.init=function(){Me(this.eSlider.getGui(),"ag-slider-field")},e.prototype.onValueChange=function(t){var e=this,o=xs.EVENT_CHANGED;return this.addManagedListener(this.eText,o,(function(){var o=parseFloat(e.eText.getValue());e.eSlider.setValue(o.toString(),!0),t(o||0)})),this.addManagedListener(this.eSlider,o,(function(){var o=e.eSlider.getValue();e.eText.setValue(o,!0),t(parseFloat(o))})),this},e.prototype.setSliderWidth=function(t){return this.eSlider.setWidth(t),this},e.prototype.setTextFieldWidth=function(t){return this.eText.setWidth(t),this},e.prototype.setMinValue=function(t){return this.eSlider.setMinValue(t),this.eText.setMin(t),this},e.prototype.setMaxValue=function(t){return this.eSlider.setMaxValue(t),this.eText.setMax(t),this},e.prototype.getValue=function(){return this.eText.getValue()},e.prototype.setValue=function(t){return this.getValue()===t||(this.eText.setValue(t,!0),this.eSlider.setValue(t,!0),this.dispatchEvent({type:xs.EVENT_CHANGED})),this},e.prototype.setStep=function(t){return this.eSlider.setStep(t),this.eText.setStep(t),this},e.TEMPLATE='<div class="ag-slider">\n <label ref="eLabel"></label>\n <div class="ag-wrapper ag-slider-wrapper">\n <ag-input-range ref="eSlider"></ag-input-range>\n <ag-input-number-field ref="eText"></ag-input-number-field>\n </div>\n </div>',_p([Wn("eLabel")],e.prototype,"eLabel",void 0),_p([Wn("eSlider")],e.prototype,"eSlider",void 0),_p([Wn("eText")],e.prototype,"eText",void 0),_p([et],e.prototype,"init",null)}(Gs),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Np=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Lp=function(t){function o(e){var n=t.call(this,o.TEMPLATE)||this;return n.H=1,n.S=1,n.B=1,n.A=1,n.isSpectrumDragging=!1,n.isSpectrumHueDragging=!1,n.isSpectrumAlphaDragging=!1,n.colorChanged=!1,n.picker=e.picker,n}return Fp(o,t),o.prototype.postConstruct=function(){var t=this.getGui();this.initRecentColors(),this.addManagedListener(this.spectrumVal,"mousedown",this.onSpectrumDraggerDown.bind(this)),this.addManagedListener(t,"mousemove",this.onSpectrumDraggerMove.bind(this)),this.addManagedListener(this.spectrumHue,"mousedown",this.onSpectrumHueDown.bind(this)),this.addManagedListener(t,"mousemove",this.onSpectrumHueMove.bind(this)),this.addManagedListener(this.spectrumAlpha,"mousedown",this.onSpectrumAlphaDown.bind(this)),this.addManagedListener(t,"mousemove",this.onSpectrumAlphaMove.bind(this)),this.addManagedListener(document,"mouseup",this.onMouseUp.bind(this)),this.addManagedListener(this.recentColors,"click",this.onRecentColorClick.bind(this))},o.prototype.refreshSpectrumRect=function(){return this.spectrumValRect=this.spectrumVal.getBoundingClientRect()},o.prototype.refreshHueRect=function(){return this.spectrumHueRect=this.spectrumHue.getBoundingClientRect()},o.prototype.refreshAlphaRect=function(){return this.spectrumAlphaRect=this.spectrumAlpha.getBoundingClientRect()},o.prototype.onSpectrumDraggerDown=function(t){this.refreshSpectrumRect(),this.isSpectrumDragging=!0,this.moveDragger(t)},o.prototype.onSpectrumDraggerMove=function(t){this.isSpectrumDragging&&this.moveDragger(t)},o.prototype.onSpectrumHueDown=function(t){this.refreshHueRect(),this.isSpectrumHueDragging=!0,this.moveHueSlider(t)},o.prototype.onSpectrumHueMove=function(t){this.isSpectrumHueDragging&&this.moveHueSlider(t)},o.prototype.onSpectrumAlphaDown=function(t){this.refreshAlphaRect(),this.isSpectrumAlphaDragging=!0,this.moveAlphaSlider(t)},o.prototype.onSpectrumAlphaMove=function(t){this.isSpectrumAlphaDragging&&this.moveAlphaSlider(t)},o.prototype.onMouseUp=function(){this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1},o.prototype.moveDragger=function(t){var e=this.spectrumValRect;if(e){var o=t.clientX-e.left,n=t.clientY-e.top;o=Math.max(o,0),o=Math.min(o,e.width),n=Math.max(n,0),n=Math.min(n,e.height),this.setSpectrumValue(o/e.width,1-n/e.height)}},o.prototype.moveHueSlider=function(t){var e=this.spectrumHueRect;if(e){var o=this.spectrumHueSlider,n=o.getBoundingClientRect(),i=t.clientX-e.left;i=Math.max(i,0),i=Math.min(i,e.width),this.H=1-i/e.width,o.style.left=i+n.width/2+"px",this.update()}},o.prototype.moveAlphaSlider=function(t){var e=this.spectrumAlphaRect;if(e){var o=this.spectrumAlphaSlider,n=o.getBoundingClientRect(),i=t.clientX-e.left;i=Math.max(i,0),i=Math.min(i,e.width),this.A=i/e.width,o.style.left=i+n.width/2+"px",this.update()}},o.prototype.update=function(){var t=ge.fromHSB(360*this.H,this.S,this.B,this.A),e=ge.fromHSB(360*this.H,1,1),o=t.toRgbaString(),n=this.picker;ge.fromString(n.getValue()).toRgbaString()!==o&&(this.colorChanged=!0),n.setValue(o),this.spectrumColor.style.backgroundColor=e.toRgbaString(),this.spectrumDragger.style.backgroundColor=o},o.prototype.setSpectrumValue=function(t,e){var o=this.spectrumValRect||this.refreshSpectrumRect();if(o){var n=this.spectrumDragger,i=n.getBoundingClientRect();t=Math.max(0,t),t=Math.min(1,t),e=Math.max(0,e),e=Math.min(1,e),this.S=t,this.B=e,n.style.left=t*o.width-i.width/2+"px",n.style.top=(1-e)*o.height-i.height/2+"px",this.update()}},o.prototype.initRecentColors=function(){var t=o.recentColors.map((function(t,e){return'<div class="ag-recent-color" id='+e+' style="background-color: '+t+'; width: 15px; height: 15px;" recent-color="'+t+'"></div>'}));this.recentColors.innerHTML=t.join("")},o.prototype.setValue=function(t){var e=ge.fromString(t),o=e.toHSB(),n=o[0],i=o[1],r=o[2];this.H=(isNaN(n)?0:n)/360,this.A=e.a;var s=this.spectrumHueRect||this.refreshHueRect(),a=this.spectrumAlphaRect||this.refreshAlphaRect();this.spectrumHueSlider.style.left=(this.H-1)*-s.width+"px",this.spectrumAlphaSlider.style.left=this.A*a.width+"px",this.setSpectrumValue(i,r)},o.prototype.onRecentColorClick=function(t){var n=t.target;if(e(n.id)){var i=parseInt(n.id,10);this.setValue(o.recentColors[i]),this.destroy()}},o.prototype.addRecentColor=function(){var t=ge.fromHSB(360*this.H,this.S,this.B,this.A).toRgbaString(),e=o.recentColors;this.colorChanged&&e[0]!==t&&(e=e.filter((function(e){return e!=t})),(e=[t].concat(e)).length>o.maxRecentColors&&(e=e.slice(0,o.maxRecentColors)),o.recentColors=e)},o.prototype.destroy=function(){this.addRecentColor(),t.prototype.destroy.call(this)},o.maxRecentColors=8,o.recentColors=[],o.TEMPLATE='<div class="ag-color-panel">\n <div ref="spectrumColor" class="ag-spectrum-color">\n <div class="ag-spectrum-sat ag-spectrum-fill">\n <div ref="spectrumVal" class="ag-spectrum-val ag-spectrum-fill">\n <div ref="spectrumDragger" class="ag-spectrum-dragger"></div>\n </div>\n </div>\n </div>\n <div class="ag-spectrum-tools">\n <div ref="spectrumHue" class="ag-spectrum-hue ag-spectrum-tool">\n <div class="ag-spectrum-hue-background"></div>\n <div ref="spectrumHueSlider" class="ag-spectrum-slider"></div>\n </div>\n <div ref="spectrumAlpha" class="ag-spectrum-alpha ag-spectrum-tool">\n <div class="ag-spectrum-alpha-background"></div>\n <div ref="spectrumAlphaSlider" class="ag-spectrum-slider"></div>\n </div>\n <div ref="recentColors" class="ag-recent-colors"></div>\n </div>\n </div>',Np([Wn("spectrumColor")],o.prototype,"spectrumColor",void 0),Np([Wn("spectrumVal")],o.prototype,"spectrumVal",void 0),Np([Wn("spectrumDragger")],o.prototype,"spectrumDragger",void 0),Np([Wn("spectrumHue")],o.prototype,"spectrumHue",void 0),Np([Wn("spectrumHueSlider")],o.prototype,"spectrumHueSlider",void 0),Np([Wn("spectrumAlpha")],o.prototype,"spectrumAlpha",void 0),Np([Wn("spectrumAlphaSlider")],o.prototype,"spectrumAlphaSlider",void 0),Np([Wn("recentColors")],o.prototype,"recentColors",void 0),Np([et],o.prototype,"postConstruct",null),o}(xn),Ip=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Gp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Mp=function(t){function o(e,o,n,i){var r=t.call(this,e,'<div class="ag-picker-field" role="presentation">\n <div ref="eLabel"></div>\n <div ref="eWrapper"\n class="ag-wrapper ag-picker-field-wrapper"\n tabIndex="-1"\n '+(i?'aria-haspopup="'+i+'"':"")+'\n >\n <div ref="eDisplayField" class="ag-picker-field-display"></div>\n <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n </div>\n </div>',o)||this;return r.pickerIcon=n,r.isPickerDisplayed=!1,r.isDestroyingPicker=!1,r.skipClick=!1,r}return Ip(o,t),o.prototype.postConstruct=function(){var e=this;t.prototype.postConstruct.call(this);var o=this.getCompId()+"-display";this.eDisplayField.setAttribute("id",o),Mo(this.eWrapper,o);var n=function(){e.skipClick?e.skipClick=!1:e.isDisabled()||(e.pickerComponent=e.showPicker())},i=this.getGui();if(this.addManagedListener(i,"mousedown",(function(t){!e.skipClick&&e.pickerComponent&&e.pickerComponent.isAlive()&&eo(e.pickerComponent.getGui())&&i.contains(t.target)&&(e.skipClick=!0)})),this.addManagedListener(i,"keydown",(function(t){switch(t.keyCode){case jn.UP:case jn.DOWN:case jn.ENTER:case jn.SPACE:n();case jn.ESCAPE:e.isPickerDisplayed&&t.preventDefault()}})),this.addManagedListener(this.eWrapper,"click",n),this.addManagedListener(this.eLabel,"click",n),this.pickerIcon){var r=cn(this.pickerIcon,this.gridOptionsWrapper);r&&this.eIcon.appendChild(r)}},o.prototype.refreshLabel=function(){e(this.getLabel())?Go(this.eWrapper,this.getLabelId()):this.eWrapper.removeAttribute("aria-labelledby"),t.prototype.refreshLabel.call(this)},o.prototype.setAriaLabel=function(t){return Io(this.eWrapper,t),this},o.prototype.setInputWidth=function(t){return ho(this.eWrapper,t),this},o.prototype.getFocusableElement=function(){return this.eWrapper},Gp([Wn("eLabel")],o.prototype,"eLabel",void 0),Gp([Wn("eWrapper")],o.prototype,"eWrapper",void 0),Gp([Wn("eDisplayField")],o.prototype,"eDisplayField",void 0),Gp([Wn("eIcon")],o.prototype,"eIcon",void 0),o}(xs),xp=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Vp=(function(t){function e(e){var o=t.call(this,e,"ag-color-picker","colorPicker")||this;return e&&e.color&&(o.value=e.color),o}xp(e,t),e.prototype.postConstruct=function(){t.prototype.postConstruct.call(this),this.value&&this.setValue(this.value)},e.prototype.showPicker=function(){var t=this,e=this.getGui().getBoundingClientRect(),o=this.createBean(new Sp({closable:!1,modal:!0,hideTitleBar:!0,minWidth:190,width:190,height:250,x:e.right-190,y:e.top-250}));this.isPickerDisplayed=!0,Me(o.getGui(),"ag-color-dialog");var n=this.createBean(new Lp({picker:this}));return n.addDestroyFunc((function(){o.isAlive()&&t.destroyBean(o)})),o.setParentComponent(this),o.setBodyComponent(n),n.setValue(this.getValue()),o.addDestroyFunc((function(){t.isDestroyingPicker?t.isDestroyingPicker=!1:(t.isDestroyingPicker=!0,n.isAlive()&&t.destroyBean(n)),t.isAlive()&&t.getFocusableElement().focus(),t.isPickerDisplayed=!1})),o},e.prototype.setValue=function(e){return this.value===e?this:(this.eDisplayField.style.backgroundColor=e,t.prototype.setValue.call(this,e))},e.prototype.getValue=function(){return this.value}}(Mp),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Hp=(function(t){function e(e){return t.call(this,e,"ag-number-field","number")||this}Vp(e,t),e.prototype.postConstruct=function(){var e=this;t.prototype.postConstruct.call(this),this.addManagedListener(this.eInput,"blur",(function(){var t=parseFloat(e.eInput.value),o=isNaN(t)?"":e.normalizeValue(t.toString());e.value!==o&&e.setValue(o)}))},e.prototype.normalizeValue=function(t){if(""===t)return"";this.precision&&(t=this.adjustPrecision(t));var e=parseFloat(t);return null!=this.min&&e<this.min?t=this.min.toString():null!=this.max&&e>this.max&&(t=this.max.toString()),t},e.prototype.adjustPrecision=function(t){if(this.precision){var e=parseFloat(t).toFixed(this.precision);t=parseFloat(e).toString()}return t},e.prototype.setMin=function(t){return this.min===t||(this.min=t,Ro(this.eInput,"min",t)),this},e.prototype.setMax=function(t){return this.max===t||(this.max=t,Ro(this.eInput,"max",t)),this},e.prototype.setPrecision=function(t){return this.precision=t,this},e.prototype.setStep=function(t){return this.step===t||(this.step=t,Ro(this.eInput,"step",t)),this},e.prototype.setValue=function(e,o){return(e=this.adjustPrecision(e))!=this.normalizeValue(e)?this:t.prototype.setValue.call(this,e,o)}}(Dp),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Wp=(function(t){function e(e){return t.call(this,e,"ag-range-field","range")||this}Hp(e,t),e.prototype.postConstruct=function(){t.prototype.postConstruct.call(this);var e=this.config,o=e.min,n=e.max,i=e.step;null!=o&&this.setMinValue(o),null!=n&&this.setMaxValue(n),this.setStep(i||1)},e.prototype.addInputListeners=function(){var t=this,e=Oe()?"change":"input";this.addManagedListener(this.eInput,e,(function(e){var o=e.target.value;t.setValue(o)}))},e.prototype.setMinValue=function(t){return this.min=t,this.eInput.setAttribute("min",t.toString()),this},e.prototype.setMaxValue=function(t){return this.max=t,this.eInput.setAttribute("max",t.toString()),this},e.prototype.setStep=function(t){return this.eInput.setAttribute("step",t.toString()),this},e.prototype.setValue=function(e,o){null!=this.min&&(e=Math.max(parseFloat(e),this.min).toString()),null!=this.max&&(e=Math.min(parseFloat(e),this.max).toString());var n=t.prototype.setValue.call(this,e,o);return this.eInput.value=e,n}}(Ws),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),kp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Bp=function(t){function e(e){void 0===e&&(e="default");var o=t.call(this,'<div class="ag-list ag-'+e+'-list" role="listbox"></div>')||this;return o.cssIdentifier=e,o.options=[],o.itemEls=[],o}return Wp(e,t),e.prototype.init=function(){this.addManagedListener(this.getGui(),"keydown",this.handleKeyDown.bind(this))},e.prototype.handleKeyDown=function(t){var e=t.keyCode;switch(e){case jn.ENTER:if(this.highlightedEl){var o=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(o)}else this.setValue(this.getValue());break;case jn.DOWN:case jn.UP:var n=e===jn.DOWN,i=void 0;if(t.preventDefault(),this.highlightedEl){var r=this.itemEls.indexOf(this.highlightedEl)+(n?1:-1);r=Math.min(Math.max(r,0),this.itemEls.length-1),i=this.itemEls[r]}else i=this.itemEls[n?0:this.itemEls.length-1];this.highlightItem(i)}},e.prototype.addOptions=function(t){var e=this;return t.forEach((function(t){return e.addOption(t)})),this},e.prototype.addOption=function(t){var e=t.value,o=Kt(t.text||e);return this.options.push({value:e,text:o}),this.renderOption(e,o),this},e.prototype.renderOption=function(t,e){var o=this,n=document.createElement("div");n.setAttribute("role","option"),Me(n,"ag-list-item"),Me(n,"ag-"+this.cssIdentifier+"-list-item"),n.innerHTML="<span>"+e+"</span>",n.tabIndex=-1,this.itemEls.push(n),this.addManagedListener(n,"mouseover",(function(){return o.highlightItem(n)})),this.addManagedListener(n,"mouseleave",(function(){return o.clearHighlighted()})),this.addManagedListener(n,"click",(function(){return o.setValue(t)})),this.getGui().appendChild(n)},e.prototype.setValue=function(t,e){if(this.value===t)return this.fireItemSelected(),this;if(null==t)return this.reset(),this;var o=E(this.options,(function(e){return e.value===t}));if(-1!==o){var n=this.options[o];this.value=n.value,this.displayValue=null!=n.text?n.text:n.value,this.highlightItem(this.itemEls[o]),e||this.fireChangeEvent()}return this},e.prototype.setValueByIndex=function(t){return this.setValue(this.options[t].value)},e.prototype.getValue=function(){return this.value},e.prototype.getDisplayValue=function(){return this.displayValue},e.prototype.refreshHighlighted=function(){var t=this;this.clearHighlighted();var e=E(this.options,(function(e){return e.value===t.value}));-1!==e&&this.highlightItem(this.itemEls[e])},e.prototype.reset=function(){this.value=null,this.displayValue=null,this.clearHighlighted(),this.fireChangeEvent()},e.prototype.highlightItem=function(t){t.offsetParent&&(this.clearHighlighted(),this.highlightedEl=t,Me(this.highlightedEl,e.ACTIVE_CLASS),Qo(this.highlightedEl,!0),this.highlightedEl.focus())},e.prototype.clearHighlighted=function(){this.highlightedEl&&this.highlightedEl.offsetParent&&(xe(this.highlightedEl,e.ACTIVE_CLASS),Qo(this.highlightedEl,!1),this.highlightedEl=null)},e.prototype.fireChangeEvent=function(){this.dispatchEvent({type:xs.EVENT_CHANGED}),this.fireItemSelected()},e.prototype.fireItemSelected=function(){this.dispatchEvent({type:e.EVENT_ITEM_SELECTED})},e.EVENT_ITEM_SELECTED="selectedItem",e.ACTIVE_CLASS="ag-active-item",kp([et],e.prototype,"init",null),e}(xn),jp=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Up=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},zp=(function(t){function e(e){return t.call(this,e,"ag-select","smallDown","listbox")||this}jp(e,t),e.prototype.init=function(){var t=this;this.listComponent=this.createBean(new Bp("select")),this.listComponent.setParentComponent(this),this.eWrapper.tabIndex=0,this.listComponent.addManagedListener(this.listComponent,Bp.EVENT_ITEM_SELECTED,(function(){t.hideList&&t.hideList()})),this.listComponent.addManagedListener(this.listComponent,xs.EVENT_CHANGED,(function(){t.setValue(t.listComponent.getValue(),!1,!0),t.hideList&&t.hideList()}))},e.prototype.showPicker=function(){var t=this,e=this.listComponent.getGui(),o=this.addManagedListener(document.body,"wheel",(function(o){!e.contains(o.target)&&t.hideList&&t.hideList()})),n=this.addManagedListener(e,"focusout",(function(o){!e.contains(o.relatedTarget)&&t.hideList&&t.hideList()})),i=this.popupService.addPopup({modal:!0,eChild:e,closeOnEsc:!0,closedCallback:function(){t.hideList=null,t.isPickerDisplayed=!1,n(),o(),t.isAlive()&&t.getFocusableElement().focus()}});return i&&(this.hideList=i.hideFunc),this.isPickerDisplayed=!0,ho(e,Xe(this.eWrapper)),e.style.maxHeight=Ke(this.popupService.getPopupParent())+"px",e.style.position="absolute",this.popupService.positionPopupUnderComponent({type:"ag-list",eventSource:this.eWrapper,ePopup:e,keepWithinBounds:!0}),this.listComponent.refreshHighlighted(),this.listComponent},e.prototype.addOptions=function(t){var e=this;return t.forEach((function(t){return e.addOption(t)})),this},e.prototype.addOption=function(t){return this.listComponent.addOption(t),this},e.prototype.setValue=function(e,o,n){return this.value===e?this:(n||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue()?this:(this.eDisplayField.innerHTML=this.listComponent.getDisplayValue(),t.prototype.setValue.call(this,e,o)))},e.prototype.destroy=function(){this.hideList&&this.hideList(),this.destroyBean(this.listComponent),t.prototype.destroy.call(this)},Up([it("popupService")],e.prototype,"popupService",void 0),Up([et],e.prototype,"init",null)}(Mp),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Kp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Yp=(function(t){function o(e){var n=t.call(this,e,o.TEMPLATE)||this;return n.radius=0,n.offsetX=0,n.offsetY=0,n}zp(o,t),o.prototype.postConstruct=function(){var o=this;t.prototype.postConstruct.call(this),this.dragListener={eElement:this.eParentCircle,dragStartPixels:0,onDragStart:function(t){o.parentCircleRect=o.eParentCircle.getBoundingClientRect()},onDragging:function(t){return o.calculateAngleDrag(t)},onDragStop:function(){}},this.dragService.addDragSource(this.dragListener),this.eAngleValue.setLabel("").setLabelWidth(5).setInputWidth(45).setMin(0).setMax(360).setValue(""+this.degrees).onValueChange((function(t){null!=t&&""!==t||(t="0"),t=o.eAngleValue.normalizeValue(t);var e=parseFloat(t);e>180&&(e-=360),o.setValue(e)})),this.updateNumberInput(),e(this.getValue())&&this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString()),this.addManagedListener(this,xs.EVENT_CHANGED,(function(){o.eAngleValue.getInputElement().contains(document.activeElement)||o.updateNumberInput()}))},o.prototype.updateNumberInput=function(){var t=this.normalizeNegativeValue(this.getValue());this.eAngleValue.setValue(t.toString())},o.prototype.positionChildCircle=function(t){var e=this.parentCircleRect||{width:24,height:24},o=this.eChildCircle,n=e.width/2,i=e.height/2;o.style.left=n+8*Math.cos(t)+"px",o.style.top=i+8*Math.sin(t)+"px"},o.prototype.calculatePolar=function(){var t=this.offsetX,e=this.offsetY,o=Math.atan2(e,t);this.degrees=this.toDegrees(o),this.radius=Math.sqrt(t*t+e*e),this.positionChildCircle(o)},o.prototype.calculateCartesian=function(){var t=this.toRadians(this.getValue()),e=this.getRadius();this.setOffsetX(Math.cos(t)*e).setOffsetY(Math.sin(t)*e)},o.prototype.setOffsetX=function(t){return this.offsetX!==t&&(this.offsetX=t,this.calculatePolar()),this},o.prototype.setOffsetY=function(t){return this.offsetY!==t&&(this.offsetY=t,this.calculatePolar()),this},o.prototype.calculateAngleDrag=function(t){var e=this.parentCircleRect,o=e.width/2,n=e.height/2,i=t.clientX-e.left-o,r=t.clientY-e.top-n,s=Math.atan2(r,i);this.setValue(s,!0)},o.prototype.toDegrees=function(t){return t/Math.PI*180},o.prototype.toRadians=function(t){return t/180*Math.PI},o.prototype.normalizeNegativeValue=function(t){return t<0?360+t:t},o.prototype.normalizeAngle180=function(t){return(t%=2*Math.PI)<-Math.PI?t+=2*Math.PI:t>=Math.PI&&(t-=2*Math.PI),t},o.prototype.getRadius=function(){return this.radius},o.prototype.setRadius=function(t){return this.radius===t||(this.radius=t,this.calculateCartesian()),this},o.prototype.onValueChange=function(t){var e=this;return this.addManagedListener(this,xs.EVENT_CHANGED,(function(){t(e.degrees)})),this},o.prototype.getValue=function(t){return t?this.toRadians(this.degrees):this.degrees},o.prototype.setValue=function(t,e){var o;return o=e?t:this.normalizeAngle180(this.toRadians(t)),t=this.toDegrees(o),this.degrees!==t&&(this.degrees=Math.floor(t),this.calculateCartesian(),this.positionChildCircle(o),this.dispatchEvent({type:xs.EVENT_CHANGED})),this},o.prototype.setWidth=function(t){return fo(this.getGui(),t),this},o.prototype.destroy=function(){this.dragService.removeDragSource(this.dragListener),t.prototype.destroy.call(this)},o.TEMPLATE='<div class="ag-angle-select">\n <div ref="eLabel"></div>\n <div class="ag-wrapper ag-angle-select-wrapper">\n <div ref="eAngleSelectField" class="ag-angle-select-field">\n <div ref="eParentCircle" class="ag-angle-select-parent-circle">\n <div ref="eChildCircle" class="ag-angle-select-child-circle"></div>\n </div>\n </div>\n <ag-input-number-field ref="eAngleValue"></ag-input-number-field>\n </div>\n </div>',Kp([Wn("eLabel")],o.prototype,"eLabel",void 0),Kp([Wn("eParentCircle")],o.prototype,"eParentCircle",void 0),Kp([Wn("eChildCircle")],o.prototype,"eChildCircle",void 0),Kp([Wn("eAngleValue")],o.prototype,"eAngleValue",void 0),Kp([it("dragService")],o.prototype,"dragService",void 0)}(Gs),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),qp=(function(t){function e(e){return t.call(this,e,"ag-toggle-button")||this}Yp(e,t),e.prototype.setValue=function(e,o){return t.prototype.setValue.call(this,e,o),Ve(this.getGui(),"ag-selected",this.getValue()),this}}(Bs),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Xp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Qp=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cacheItems=[],e}qp(e,t),e.prototype.postConstruct=function(){this.active=this.gridOptionsWrapper.isKeepDetailRows(),this.maxCacheSize=this.gridOptionsWrapper.getKeepDetailRowsCount()},e.prototype.addOrDestroy=function(t,e,o){if(!this.active||!t.detail)this.destroyFullWidthRow(o);else{var n=this.getCacheItem(t,!0);switch(e){case ht.PINNED_LEFT:this.destroyFullWidthRow(n.left),n.left=o;break;case ht.PINNED_RIGHT:this.destroyFullWidthRow(n.right),n.right=o;break;default:this.destroyFullWidthRow(n.center),n.center=o}this.cacheItems.sort((function(t,e){return e.lastAccessedTime-t.lastAccessedTime})),this.purgeCache(this.maxCacheSize)}},e.prototype.getCacheItem=function(t,e){void 0===e&&(e=!1);for(var o=null,n=0;n<this.cacheItems.length;n++){var i=this.cacheItems[n];if(i.rowNode===t){o=i;break}}return!o&&e&&(o={rowNode:t},this.cacheItems.push(o)),o&&this.stampCacheItem(o),o},e.prototype.stampCacheItem=function(t){t.lastAccessedTime=(new Date).getTime()},e.prototype.destroyFullWidthRow=function(t){this.getContext().destroyBean(t)},e.prototype.purgeCache=function(t){for(var e=t;e<this.cacheItems.length;e++){var o=this.cacheItems[e];this.destroyFullWidthRow(o.center),this.destroyFullWidthRow(o.left),this.destroyFullWidthRow(o.right)}this.cacheItems.length>t&&(this.cacheItems.length=t)},e.prototype.get=function(t,e){if(t.detail){var o,n=this.getCacheItem(t);if(n)switch(e){case ht.PINNED_LEFT:n.left&&(o=n.left,n.left=void 0);break;case ht.PINNED_RIGHT:n.right&&(o=n.right,n.right=void 0);break;default:n.center&&(o=n.center,n.center=void 0)}return o}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.purgeCache(0)},Xp([et],e.prototype,"postConstruct",null),Xp([ot],e.prototype,"destroy",null),e=Xp([nt("detailRowCompCache")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),$p=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Zp=(function(t){function o(){return null!==t&&t.apply(this,arguments)||this}Qp(o,t),o.prototype.getFirstRow=function(){var t,e=0;return this.pinnedRowModel.getPinnedTopRowCount()?t=ht.PINNED_TOP:this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(t=ht.PINNED_BOTTOM),void 0===t?null:{rowIndex:e,rowPinned:t}},o.prototype.getLastRow=function(){var t,e,o=this.pinnedRowModel.getPinnedBottomRowCount(),n=this.pinnedRowModel.getPinnedTopRowCount();return o?(e=ht.PINNED_BOTTOM,t=o-1):this.rowModel.getRowCount()?(e=null,t=this.paginationProxy.getPageLastRow()):n&&(e=ht.PINNED_TOP,t=n-1),void 0===t?null:{rowIndex:t,rowPinned:e}},o.prototype.getRowNode=function(t){switch(t.rowPinned){case ht.PINNED_TOP:return this.pinnedRowModel.getPinnedTopRowData()[t.rowIndex];case ht.PINNED_BOTTOM:return this.pinnedRowModel.getPinnedBottomRowData()[t.rowIndex];default:return this.rowModel.getRow(t.rowIndex)}},o.prototype.sameRow=function(t,e){return!t&&!e||!(t&&!e||!t&&e)&&(t.rowIndex===e.rowIndex&&t.rowPinned==e.rowPinned)},o.prototype.before=function(t,o){switch(t.rowPinned){case ht.PINNED_TOP:if(o.rowPinned!==ht.PINNED_TOP)return!0;break;case ht.PINNED_BOTTOM:if(o.rowPinned!==ht.PINNED_BOTTOM)return!1;break;default:if(e(o.rowPinned))return o.rowPinned!==ht.PINNED_TOP}return t.rowIndex<o.rowIndex},$p([it("rowModel")],o.prototype,"rowModel",void 0),$p([it("pinnedRowModel")],o.prototype,"pinnedRowModel",void 0),$p([it("paginationProxy")],o.prototype,"paginationProxy",void 0),o=$p([nt("rowPositionUtils")],o)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Jp=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},tu=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Zp(e,t),e.prototype.createId=function(t){var e=t.rowIndex,o=t.rowPinned,n=t.column;return this.createIdFromValues(e,n,o)},e.prototype.createIdFromValues=function(t,e,o){return t+"."+(null==o?"null":o)+"."+e.getId()},e.prototype.equals=function(t,e){var o=t.column===e.column,n=t.rowPinned===e.rowPinned,i=t.rowIndex===e.rowIndex;return o&&n&&i},e=Jp([nt("cellPositionUtils")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),eu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ou=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}tu(e,t),e.prototype.init=function(){this.setPinnedTopRowData(this.gridOptionsWrapper.getPinnedTopRowData()),this.setPinnedBottomRowData(this.gridOptionsWrapper.getPinnedBottomRowData())},e.prototype.isEmpty=function(t){return n(t===ht.PINNED_TOP?this.pinnedTopRows:this.pinnedBottomRows)},e.prototype.isRowsToRender=function(t){return!this.isEmpty(t)},e.prototype.getRowAtPixel=function(t,e){var o=e===ht.PINNED_TOP?this.pinnedTopRows:this.pinnedBottomRows;if(n(o))return 0;for(var i=0;i<o.length;i++){var r=o[i];if(r.rowTop+r.rowHeight-1>=t)return i}return o.length-1},e.prototype.setPinnedTopRowData=function(t){this.pinnedTopRows=this.createNodesFromData(t,!0);var e={type:Wt.EVENT_PINNED_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)},e.prototype.setPinnedBottomRowData=function(t){this.pinnedBottomRows=this.createNodesFromData(t,!1);var e={type:Wt.EVENT_PINNED_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(e)},e.prototype.createNodesFromData=function(t,e){var o=this,n=[];if(t){var i=0;t.forEach((function(t,r){var s=new Ci;o.context.createBean(s),s.data=t;var a=e?Ci.ID_PREFIX_TOP_PINNED:Ci.ID_PREFIX_BOTTOM_PINNED;s.id=a+r,s.rowPinned=e?ht.PINNED_TOP:ht.PINNED_BOTTOM,s.setRowTop(i),s.setRowHeight(o.gridOptionsWrapper.getRowHeightForNode(s).height),s.setRowIndex(r),i+=s.rowHeight,n.push(s)}))}return n},e.prototype.getPinnedTopRowData=function(){return this.pinnedTopRows},e.prototype.getPinnedBottomRowData=function(){return this.pinnedBottomRows},e.prototype.getPinnedTopTotalHeight=function(){return this.getTotalHeight(this.pinnedTopRows)},e.prototype.getPinnedTopRowCount=function(){return this.pinnedTopRows?this.pinnedTopRows.length:0},e.prototype.getPinnedBottomRowCount=function(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0},e.prototype.getPinnedTopRow=function(t){return this.pinnedTopRows[t]},e.prototype.getPinnedBottomRow=function(t){return this.pinnedBottomRows[t]},e.prototype.forEachPinnedTopRow=function(t){n(this.pinnedTopRows)||this.pinnedTopRows.forEach(t)},e.prototype.forEachPinnedBottomRow=function(t){n(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(t)},e.prototype.getPinnedBottomTotalHeight=function(){return this.getTotalHeight(this.pinnedBottomRows)},e.prototype.getTotalHeight=function(t){if(!t||0===t.length)return 0;var e=d(t);return e.rowTop+e.rowHeight},eu([it("columnApi")],e.prototype,"columnApi",void 0),eu([it("gridApi")],e.prototype,"gridApi",void 0),eu([et],e.prototype,"init",null),e=eu([nt("pinnedRowModel")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),nu=function(t){this.cellValueChanges=t},iu=function(t){function e(e,o,n){var i=t.call(this,e)||this;return i.initialRange=o,i.finalRange=n,i}return ou(e,t),e}(nu),ru=function(){function t(e){this.actionStack=[],this.maxStackSize=e||t.DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}return t.prototype.pop=function(){return this.actionStack.pop()},t.prototype.push=function(t){t.cellValueChanges&&t.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(t))},t.prototype.clear=function(){this.actionStack=[]},t.prototype.getCurrentStackSize=function(){return this.actionStack.length},t.DEFAULT_STACK_SIZE=10,t}(),su=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),au=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},lu=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cellValueChanges=[],e.isCellEditing=!1,e.isRowEditing=!1,e.isPasting=!1,e.isFilling=!1,e.onCellValueChanged=function(t){if(e.isCellEditing||e.isRowEditing||e.isPasting||e.isFilling){var o=t.rowPinned,n=t.rowIndex,i=t.column,r=t.oldValue,s=t.value,a={rowPinned:o,rowIndex:n,columnId:i.getColId(),newValue:s,oldValue:r};e.cellValueChanges.push(a)}},e.clearStacks=function(){e.undoStack.clear(),e.redoStack.clear()},e}su(e,t),e.prototype.init=function(){if(this.gridOptionsWrapper.isUndoRedoCellEditing()){var t=this.gridOptionsWrapper.getUndoRedoCellEditingLimit();t<=0||(this.undoStack=new ru(t),this.redoStack=new ru(t),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addManagedListener(this.eventService,Wt.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,Wt.EVENT_MODEL_UPDATED,this.clearStacks),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,Wt.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,Wt.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,Wt.EVENT_ROW_DRAG_END,this.clearStacks))}},e.prototype.getCurrentUndoStackSize=function(){return this.undoStack?this.undoStack.getCurrentStackSize():0},e.prototype.getCurrentRedoStackSize=function(){return this.redoStack?this.redoStack.getCurrentStackSize():0},e.prototype.undo=function(){if(this.undoStack){var t=this.undoStack.pop();t&&t.cellValueChanges&&(this.processAction(t,(function(t){return t.oldValue})),t instanceof iu?this.processRangeAndCellFocus(t.cellValueChanges,t.initialRange):this.processRangeAndCellFocus(t.cellValueChanges),this.redoStack.push(t))}},e.prototype.redo=function(){if(this.redoStack){var t=this.redoStack.pop();t&&t.cellValueChanges&&(this.processAction(t,(function(t){return t.newValue})),t instanceof iu?this.processRangeAndCellFocus(t.cellValueChanges,t.finalRange):this.processRangeAndCellFocus(t.cellValueChanges),this.undoStack.push(t))}},e.prototype.processAction=function(t,e){var o=this;t.cellValueChanges.forEach((function(t){var n=t.rowIndex,i=t.rowPinned,r=t.columnId,s={rowIndex:n,rowPinned:i},a=o.getRowNode(s);a.displayed&&a.setDataValue(r,e(t))}))},e.prototype.processRangeAndCellFocus=function(t,e){var o;if(e){var n=e.startRow,i=e.endRow;o={rowPinned:n.rowPinned,rowIndex:n.rowIndex,columnId:e.startColumn.getColId()},this.setLastFocusedCell(o);var r={rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnStart:e.startColumn,columns:e.columns};this.gridApi.addCellRange(r)}else{var s=t[0],a={rowIndex:s.rowIndex,rowPinned:s.rowPinned},l=this.getRowNode(a);o={rowPinned:s.rowPinned,rowIndex:l.rowIndex,columnId:s.columnId},this.setLastFocusedCell(o)}},e.prototype.setLastFocusedCell=function(t){var e=t.rowIndex,o=t.columnId,n=t.rowPinned;this.gridApi.ensureIndexVisible(e),this.gridApi.ensureColumnVisible(o),ft.isRegistered(pt.RangeSelectionModule)&&this.gridApi.clearRangeSelection(),this.focusController.setFocusedCell(e,o,n,!0)},e.prototype.addRowEditingListeners=function(){var t=this;this.addManagedListener(this.eventService,Wt.EVENT_ROW_EDITING_STARTED,(function(){t.isRowEditing=!0})),this.addManagedListener(this.eventService,Wt.EVENT_ROW_EDITING_STOPPED,(function(){var e=new nu(t.cellValueChanges);t.pushActionsToUndoStack(e),t.isRowEditing=!1}))},e.prototype.addCellEditingListeners=function(){var t=this;this.addManagedListener(this.eventService,Wt.EVENT_CELL_EDITING_STARTED,(function(){t.isCellEditing=!0})),this.addManagedListener(this.eventService,Wt.EVENT_CELL_EDITING_STOPPED,(function(){if(t.isCellEditing=!1,!t.isRowEditing&&!t.isPasting&&!t.isFilling){var e=new nu(t.cellValueChanges);t.pushActionsToUndoStack(e)}}))},e.prototype.addPasteListeners=function(){var t=this;this.addManagedListener(this.eventService,Wt.EVENT_PASTE_START,(function(){t.isPasting=!0})),this.addManagedListener(this.eventService,Wt.EVENT_PASTE_END,(function(){var e=new nu(t.cellValueChanges);t.pushActionsToUndoStack(e),t.isPasting=!1}))},e.prototype.addFillListeners=function(){var t=this;this.addManagedListener(this.eventService,Wt.EVENT_FILL_START,(function(){t.isFilling=!0})),this.addManagedListener(this.eventService,Wt.EVENT_FILL_END,(function(e){var o=new iu(t.cellValueChanges,e.initialRange,e.finalRange);t.pushActionsToUndoStack(o),t.isFilling=!1}))},e.prototype.pushActionsToUndoStack=function(t){this.undoStack.push(t),this.cellValueChanges=[],this.redoStack.clear()},e.prototype.getRowNode=function(t){switch(t.rowPinned){case ht.PINNED_TOP:return this.pinnedRowModel.getPinnedTopRowData()[t.rowIndex];case ht.PINNED_BOTTOM:return this.pinnedRowModel.getPinnedBottomRowData()[t.rowIndex];default:return this.rowModel.getRow(t.rowIndex)}},au([it("focusController")],e.prototype,"focusController",void 0),au([it("gridApi")],e.prototype,"gridApi",void 0),au([it("rowModel")],e.prototype,"rowModel",void 0),au([it("pinnedRowModel")],e.prototype,"pinnedRowModel",void 0),au([et],e.prototype,"init",null),e=au([nt("undoRedoService")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),pu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},uu=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.componentsMappedByName={},e}lu(e,t),e.prototype.setupComponents=function(t){var e=this;t&&t.forEach((function(t){return e.addComponent(t)}))},e.prototype.addComponent=function(t){var e=t.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[e]=t.componentClass},e.prototype.getComponentClass=function(t){return this.componentsMappedByName[t]},e=pu([nt("agStackComponentsRegistry")],e)}(Mt),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),cu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},du=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}uu(e,t),e.prototype.findHeader=function(t,e){var o,n,i;if(t.column instanceof mt?(n="getDisplayedGroup"+e,o=this.columnController[n](t.column)):(i="getDisplayedCol"+e,o=this.columnController[i](t.column)),o)return{column:o,headerRowIndex:t.headerRowIndex}},e.prototype.findColAtEdgeForHeaderRow=function(t,e){var o=this.columnController.getAllDisplayedColumns(),n=o["start"===e?0:o.length-1];if(n){var i=this.headerNavigationService.getHeaderContainer(n.getPinned()).getRowComps()[t];return(i&&i.getType())==os.COLUMN_GROUP?{headerRowIndex:t,column:this.columnController.getColumnGroupAtLevel(n,t)}:{headerRowIndex:i?t:-1,column:n}}},cu([it("columnController")],e.prototype,"columnController",void 0),cu([it("headerNavigationService")],e.prototype,"headerNavigationService",void 0),e=cu([nt("headerPositionUtils")],e)}(Mt),function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s}),hu=(function(){function t(){}t.prototype.buildColumnDefs=function(t,e,o){var n=this,i=[],r={};return t.forEach((function(t){for(var s=!0,a=n.createDefFromColumn(t,e,o),l=t;l.getParent();){var p=l.getParent(),u=null;if(p.isPadding())l=p;else{var c=r[p.getGroupId()];if(c){c.children.push(a),s=!1;break}(u=n.createDefFromGroup(p))&&(u.children=[a],r[u.groupId]=u,a=u,l=p)}}s&&i.push(a)})),i},t.prototype.createDefFromGroup=function(t){var e=_(t.getColGroupDef(),["children"]);return e&&(e.groupId=t.getGroupId()),e},t.prototype.createDefFromColumn=function(t,e,o){var n=_(t.getColDef());return n.colId=t.getColId(),n.width=t.getActualWidth(),n.rowGroup=t.isRowGroupActive(),n.rowGroupIndex=t.isRowGroupActive()?e.indexOf(t):null,n.pivot=t.isPivotActive(),n.pivotIndex=t.isPivotActive()?o.indexOf(t):null,n.aggFunc=t.isValueActive()?t.getAggFunc():null,n.hide=!t.isVisible()||void 0,n.pinned=t.isPinned()?t.getPinned():null,n.sort=t.getSort()?t.getSort():null,n.sortIndex=null!=t.getSortIndex()?t.getSortIndex():null,n},t=du([nt("columnDefFactory")],t)}(),function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s}),fu=(function(){function t(){}t.prototype.getInitialRowClasses=function(t){var o=[];return e(t.extraCssClass)&&o.push(t.extraCssClass),o.push("ag-row"),o.push(t.rowFocused?"ag-row-focus":"ag-row-no-focus"),t.fadeRowIn&&o.push("ag-opacity-zero"),o.push(t.rowIsEven?"ag-row-even":"ag-row-odd"),t.rowNode.isRowPinned()&&o.push("ag-row-pinned"),t.rowNode.isSelected()&&o.push("ag-row-selected"),t.rowNode.footer&&o.push("ag-row-footer"),o.push("ag-row-level-"+t.rowLevel),t.rowNode.stub&&o.push("ag-row-loading"),t.fullWidthRow&&o.push("ag-full-width-row"),t.expandable&&(o.push("ag-row-group"),o.push(t.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),t.rowNode.dragging&&o.push("ag-row-dragging"),w(o,this.processClassesFromGridOptions(t.rowNode,t.scope)),w(o,this.preProcessRowClassRules(t.rowNode,t.scope)),o.push(t.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),t.firstRowOnPage&&o.push("ag-row-first"),t.lastRowOnPage&&o.push("ag-row-last"),o},t.prototype.processClassesFromGridOptions=function(t,e){var o=[],n=function(t){"string"==typeof t?o.push(t):Array.isArray(t)&&t.forEach((function(t){return o.push(t)}))},i=this.gridOptionsWrapper.getRowClass();if(i){if("function"==typeof i)return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];n(i)}var r=this.gridOptionsWrapper.getRowClassFunc();r&&n(r({data:t.data,node:t,rowIndex:t.rowIndex,$scope:e,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()}));return o},t.prototype.preProcessRowClassRules=function(t,e){var o=[];return this.processRowClassRules(t,e,(function(t){o.push(t)}),(function(t){})),o},t.prototype.processRowClassRules=function(t,e,o,n){var i={data:t.data,node:t,rowIndex:t.rowIndex,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),$scope:e,context:this.gridOptionsWrapper.getContext()};this.stylingService.processClassRules(this.gridOptionsWrapper.rowClassRules(),i,o,n)},t.prototype.calculateRowLevel=function(t){return t.group?t.level:t.parent?t.parent.level+1:0},hu([it("stylingService")],t.prototype,"stylingService",void 0),hu([it("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),t=hu([nt("rowCssClassCalculator")],t)}(),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),gu=function(t){function e(o){var n=t.call(this)||this;return n.state=e.STATE_WAITING_TO_LOAD,n.version=0,n.id=o,n}return fu(e,t),e.prototype.getId=function(){return this.id},e.prototype.load=function(){this.state=e.STATE_LOADING,this.loadFromDatasource()},e.prototype.getVersion=function(){return this.version},e.prototype.setStateWaitingToLoad=function(){this.version++,this.state=e.STATE_WAITING_TO_LOAD},e.prototype.getState=function(){return this.state},e.prototype.pageLoadFailed=function(t){this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_FAILED,this.processServerFail()),this.dispatchLoadCompleted(!1)},e.prototype.success=function(t,e){this.successCommon(t,e)},e.prototype.pageLoaded=function(t,e,o){this.successCommon(t,{rowData:e,rowCount:o})},e.prototype.isRequestMostRecentAndLive=function(t){var e=t===this.version,o=this.isAlive();return e&&o},e.prototype.successCommon=function(t,o){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_LOADED,this.processServerResult(o))},e.prototype.dispatchLoadCompleted=function(t){void 0===t&&(t=!0);var o={type:e.EVENT_LOAD_COMPLETE,success:t,block:this};this.dispatchEvent(o)},e.EVENT_LOAD_COMPLETE="loadComplete",e.STATE_WAITING_TO_LOAD="needsLoading",e.STATE_LOADING="loading",e.STATE_LOADED="loaded",e.STATE_FAILED="failed",e}(Mt),yu=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),vu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},mu=function(t,e){return function(o,n){e(o,n,t)}},Cu=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.activeBlockLoadsCount=0,e.blocks=[],e.active=!0,e}var o;yu(e,t),o=e,e.prototype.postConstruct=function(){this.maxConcurrentRequests=this.gridOptionsWrapper.getMaxConcurrentDatasourceRequests();var t=this.gridOptionsWrapper.getBlockLoadDebounceMillis();t&&t>0&&(this.checkBlockToLoadDebounce=bn.debounce(this.performCheckBlocksToLoad.bind(this),t))},e.prototype.setBeans=function(t){this.logger=t.create("RowNodeBlockLoader")},e.prototype.addBlock=function(t){this.blocks.push(t),t.addEventListener(gu.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()},e.prototype.removeBlock=function(t){bn.removeFromArray(this.blocks,t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.active=!1},e.prototype.loadComplete=function(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),0==this.activeBlockLoadsCount&&this.dispatchEvent({type:o.BLOCK_LOADER_FINISHED_EVENT})},e.prototype.checkBlockToLoad=function(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()},e.prototype.performCheckBlocksToLoad=function(){if(this.active)if(this.printCacheStatus(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)this.logger.log("checkBlockToLoad: max loads exceeded");else{var t=null;this.blocks.forEach((function(e){e.getState()===gu.STATE_WAITING_TO_LOAD&&(t=e)})),t&&(t.load(),this.activeBlockLoadsCount++,this.printCacheStatus())}},e.prototype.getBlockState=function(){var t={};return this.blocks.forEach((function(e){var o=e.getBlockStateJson(),n=o.id,i=o.state;t[n]=i})),t},e.prototype.printCacheStatus=function(){this.logger.isLogging()&&this.logger.log("printCacheStatus: activePageLoadsCount = "+this.activeBlockLoadsCount+", blocks = "+JSON.stringify(this.getBlockState()))},e.prototype.isLoading=function(){return this.activeBlockLoadsCount>0},e.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished",vu([et],e.prototype,"postConstruct",null),vu([mu(0,at("loggerFactory"))],e.prototype,"setBeans",null),e=o=vu([nt("rowNodeBlockLoader")],e)}(Mt),function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s}),wu=(function(){function t(){}t.prototype.doFullSort=function(t,e){var o=t.map((function(t,e){return{currentPos:e,rowNode:t}}));return o.sort(this.compareRowNodes.bind(this,e)),o.map((function(t){return t.rowNode}))},t.prototype.compareRowNodes=function(t,e,o){for(var n=e.rowNode,i=o.rowNode,r=0,s=t.length;r<s;r++){var a=t[r],l=a.sort===ht.SORT_DESC,p=this.getValue(n,a.column),u=this.getValue(i,a.column),c=void 0,d=a.column.getColDef().comparator;if(0!==(c=d?d(p,u,n,i,l):bn.defaultComparator(p,u,this.gridOptionsWrapper.isAccentedSort())))return a.sort===ht.SORT_ASC?c:-1*c}return e.currentPos-o.currentPos},t.prototype.getValue=function(t,e){return this.valueService.getValue(e,t)},Cu([it("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),Cu([it("valueService")],t.prototype,"valueService",void 0),t=Cu([nt("rowNodeSorter")],t)}(),function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}()),Eu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};!function(t){function e(o){var n=t.call(this,e.getTemplate(o.cssClass))||this;return n.items=[],n.params=o,o.items&&o.items.forEach((function(t){return n.addItem(t)})),n}wu(e,t),e.getTemplate=function(t){return'<div class="ag-tabs '+t+'">\n <div ref="eHeader" role="menu" class="ag-tabs-header '+(t?t+"-header":"")+'"></div>\n <div ref="eBody" role="presentation" class="ag-tabs-body '+(t?t+"-body":"")+'"></div>\n </div>'},e.prototype.handleKeyDown=function(t){switch(t.keyCode){case jn.RIGHT:case jn.LEFT:if(!this.eHeader.contains(document.activeElement))return;var e=this.items.indexOf(this.activeItem),o=t.keyCode===jn.RIGHT?Math.min(e+1,this.items.length-1):Math.max(e-1,0);if(e===o)return;t.preventDefault();var n=this.items[o];this.showItemWrapper(n),n.eHeaderButton.focus();break;case jn.UP:case jn.DOWN:t.stopPropagation()}},e.prototype.onTabKeyDown=function(t){if(!t.defaultPrevented){var e=this.focusController,o=this.eHeader,n=this.eBody,i=this.activeItem,r=document.activeElement;if(t.preventDefault(),o.contains(r))e.focusInto(n,t.shiftKey);else if(e.isFocusUnderManagedComponent(n))i.eHeaderButton.focus();else{var s=e.findNextFocusableElement(n,!1,t.shiftKey);s?s.focus():i.eHeaderButton.focus()}}},e.prototype.setAfterAttachedParams=function(t){this.afterAttachedParams=t},e.prototype.getMinDimensions=function(){var t=this.getGui().cloneNode(!0),e=t.querySelector('[ref="eBody"]');t.style.position="fixed",this.getGui().appendChild(t);var o=0,n=0;return this.items.forEach((function(i){Je(e);var r=i.tabbedItem.bodyPromise.resolveNow(null,(function(t){return t.cloneNode(!0)}));null!=r&&(e.appendChild(r),o<t.offsetWidth&&(o=t.offsetWidth),n<t.offsetHeight&&(n=t.offsetHeight))})),this.getGui().removeChild(t),{height:n,width:o}},e.prototype.showFirstItem=function(){this.items.length>0&&this.showItemWrapper(this.items[0])},e.prototype.addItem=function(t){var e=document.createElement("span");e.setAttribute("tabIndex","-1"),e.setAttribute("role","menuitem"),e.appendChild(t.title),Me(e,"ag-tab"),this.eHeader.appendChild(e),Io(e,t.titleLabel);var o={tabbedItem:t,eHeaderButton:e};this.items.push(o),e.addEventListener("click",this.showItemWrapper.bind(this,o))},e.prototype.showItem=function(t){var e=a(this.items,(function(e){return e.tabbedItem===t}));e&&this.showItemWrapper(e)},e.prototype.showItemWrapper=function(t){var e=this;this.params.onItemClicked&&this.params.onItemClicked({item:t.tabbedItem}),this.activeItem!==t?(Je(this.eBody),t.tabbedItem.bodyPromise.then((function(o){e.eBody.appendChild(o);var n=!e.focusController.isKeyboardMode();e.focusController.focusInto(e.eBody,!1,n),t.tabbedItem.afterAttachedCallback&&t.tabbedItem.afterAttachedCallback(e.afterAttachedParams)})),this.activeItem&&xe(this.activeItem.eHeaderButton,"ag-tab-selected"),Me(t.eHeaderButton,"ag-tab-selected"),this.activeItem=t):Z(this.params.onActiveItemClicked)},Eu([Wn("eHeader")],e.prototype,"eHeader",void 0),Eu([Wn("eBody")],e.prototype,"eBody",void 0)}(Zn);!function(t){t.StoreNotFound="StoreNotFound",t.StoreLoading="StoreLoading",t.StoreWaitingToLoad="StoreWaitingToLoad",t.StoreLoadingFailed="StoreLoadingFailed",t.StoreWrongType="StoreWrongType",t.Applied="Applied",t.Cancelled="Cancelled"}(vp||(vp={}));
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var Ru,Ou,Pu,Su=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),bu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};!function(t){function e(o,n){void 0===o&&(o="default"),void 0===n&&(n="listbox");var i=t.call(this,e.getTemplate(o),!0)||this;return i.cssIdentifier=o,i.ariaRole=n,i.renderedRows=new Map,i.rowHeight=20,i.isDestroyed=!1,i}Su(e,t),e.prototype.postConstruct=function(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),t.prototype.postConstruct.call(this)},e.prototype.addResizeObserver=function(){var t=this.drawVirtualRows.bind(this),e=this.resizeObserverService.observeResize(this.getGui(),t);this.addDestroyFunc(e)},e.prototype.focusInnerElement=function(t){this.focusRow(t?this.model.getRowCount()-1:0)},e.prototype.onFocusIn=function(e){t.prototype.onFocusIn.call(this,e);var o=e.target;He(o,"ag-virtual-list-item")&&(this.lastFocusedRowIndex=No(o)-1)},e.prototype.onFocusOut=function(e){t.prototype.onFocusOut.call(this,e),this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)},e.prototype.handleKeyDown=function(t){switch(t.keyCode){case jn.UP:case jn.DOWN:this.navigate(t.keyCode===jn.UP)&&t.preventDefault()}},e.prototype.onTabKeyDown=function(t){this.navigate(t.shiftKey)?t.preventDefault():this.focusController.focusInto(this.getGui(),!t.shiftKey)},e.prototype.navigate=function(t){if(null==this.lastFocusedRowIndex)return!1;var e=this.lastFocusedRowIndex+(t?-1:1);return!(e<0||e>=this.model.getRowCount())&&(this.focusRow(e),!0)},e.prototype.getLastFocusedRow=function(){return this.lastFocusedRowIndex},e.prototype.focusRow=function(t){var e=this;this.ensureIndexVisible(t),window.setTimeout((function(){var o=e.renderedRows.get(t);o&&o.eDiv.focus()}),10)},e.prototype.getComponentAt=function(t){var e=this.renderedRows.get(t);return e&&e.rowComponent},e.getTemplate=function(t){return'\n <div class="ag-virtual-list-viewport ag-'+t+'-virtual-list-viewport" role="listbox">\n <div class="ag-virtual-list-container ag-'+t+'-virtual-list-container" ref="eContainer"></div>\n </div>'},e.prototype.getItemHeight=function(){return this.gridOptionsWrapper.getListItemHeight()},e.prototype.ensureIndexVisible=function(t){var e=this.model.getRowCount();if("number"!=typeof t||t<0||t>=e)console.warn("invalid row index for ensureIndexVisible: "+t);else{var o=t*this.rowHeight,n=o+this.rowHeight,i=this.getGui(),r=i.scrollTop,s=i.offsetHeight,a=r+s<n;if(r>o)i.scrollTop=o;else if(a){var l=n-s;i.scrollTop=l}}},e.prototype.setComponentCreator=function(t){this.componentCreator=t},e.prototype.getRowHeight=function(){return this.rowHeight},e.prototype.getScrollTop=function(){return this.getGui().scrollTop},e.prototype.setRowHeight=function(t){this.rowHeight=t,this.refresh()},e.prototype.refresh=function(){var t=this;if(null!=this.model&&!this.isDestroyed){var e=this.model.getRowCount();this.eContainer.style.height=e*this.rowHeight+"px",setTimeout((function(){t.isDestroyed||(t.clearVirtualRows(),t.drawVirtualRows())}),0)}},e.prototype.clearVirtualRows=function(){var t=this;this.renderedRows.forEach((function(e,o){return t.removeRow(o)}))},e.prototype.drawVirtualRows=function(){var t=this.getGui(),e=t.scrollTop,o=e+t.offsetHeight,n=Math.floor(e/this.rowHeight),i=Math.floor(o/this.rowHeight);this.ensureRowsRendered(n,i)},e.prototype.ensureRowsRendered=function(t,e){var o=this;this.renderedRows.forEach((function(n,i){(i<t||i>e)&&i!==o.lastFocusedRowIndex&&o.removeRow(i)}));for(var n=t;n<=e;n++)this.renderedRows.has(n)||n<this.model.getRowCount()&&this.insertRow(n)},e.prototype.insertRow=function(t){var e=this,o=this.model.getRow(t),n=document.createElement("div");if(Me(n,"ag-virtual-list-item"),Me(n,"ag-"+this.cssIdentifier+"-virtual-list-item"),n.setAttribute("role","tree"===this.ariaRole?"treeitem":"option"),Wo(n,this.model.getRowCount()),ko(n,t+1),n.setAttribute("tabindex","-1"),"function"==typeof this.model.isRowSelected){var i=this.model.isRowSelected(t);Qo(n,!!i),$o(n,i)}n.style.height=this.rowHeight+"px",n.style.top=this.rowHeight*t+"px";var r=this.componentCreator(o,n);r.addGuiEventListener("focusin",(function(){return e.lastFocusedRowIndex=t})),n.appendChild(r.getGui()),this.renderedRows.has(t-1)?this.renderedRows.get(t-1).eDiv.insertAdjacentElement("afterend",n):this.renderedRows.has(t+1)?this.renderedRows.get(t+1).eDiv.insertAdjacentElement("beforebegin",n):this.eContainer.appendChild(n),this.renderedRows.set(t,{rowComponent:r,eDiv:n})},e.prototype.removeRow=function(t){var e=this.renderedRows.get(t);this.eContainer.removeChild(e.eDiv),this.destroyBean(e.rowComponent),this.renderedRows.delete(t)},e.prototype.addScrollListener=function(){var t=this;this.addGuiEventListener("scroll",(function(){return t.drawVirtualRows()}))},e.prototype.setModel=function(t){this.model=t},e.prototype.destroy=function(){this.isDestroyed||(this.clearVirtualRows(),this.isDestroyed=!0,t.prototype.destroy.call(this))},bu([it("resizeObserverService")],e.prototype,"resizeObserverService",void 0),bu([Wn("eContainer")],e.prototype,"eContainer",void 0)}(Zn);!function(t){t.Full="full",t.Partial="partial"}(Ru||(Ru={})),function(t){t.Column="column",t.GroupedColumn="groupedColumn",t.StackedColumn="stackedColumn",t.NormalizedColumn="normalizedColumn",t.Bar="bar",t.GroupedBar="groupedBar",t.StackedBar="stackedBar",t.NormalizedBar="normalizedBar",t.Line="line",t.Scatter="scatter",t.Bubble="bubble",t.Pie="pie",t.Doughnut="doughnut",t.Area="area",t.StackedArea="stackedArea",t.NormalizedArea="normalizedArea",t.Histogram="histogram"}(Ou||(Ou={})),function(t){t.Top="top",t.Right="right",t.Bottom="bottom",t.Left="left"}(Pu||(Pu={}));
/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v25.1.0
* @link http://www.ag-grid.com/
* @license MIT
*/
var Du="undefined"==typeof global?{}:global;Du.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,Du.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,Du.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,Du.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,Du.Node="undefined"==typeof Node?{}:Node,Du.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent;var Au=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Tu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},_u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.watermarkMessage=void 0,e}var o;return Au(e,t),o=e,e.prototype.validateLicense=function(){if(bn.missingOrEmpty(o.licenseKey))this.outputMissingLicenseKey();else if(o.licenseKey.length>32){var t=o.extractLicenseComponents(o.licenseKey),e=t.md5,n=t.license,i=t.version,r=t.isTrial;e===this.md5.md5(n)?bn.exists(i)&&i?this.validateLicenseKeyForVersion(i,!!r,n):this.validateLegacyKey(n):this.outputInvalidLicenseKey()}else this.outputInvalidLicenseKey()},e.extractExpiry=function(t){var e=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(o.decode(e),10))},e.extractLicenseComponents=function(t){var e=t.replace(/[\u200B-\u200D\uFEFF]/g,""),n=(e=e.replace(/\r?\n|\r/g,"")).length-32,i=e.substring(n),r=e.substring(0,n),s=o.extractBracketedInformation(e);return{md5:i,license:r,version:s[0],isTrial:s[1]}},e.prototype.getLicenseDetails=function(t){var e=o.extractLicenseComponents(t),n=e.md5,i=e.license,r=e.version,s=e.isTrial,a=n===this.md5.md5(i),l=null;return a&&(l=o.extractExpiry(i),a=!isNaN(l.getTime())),{licenseKey:t,valid:a,expiry:a?o.formatDate(l):null,version:r||"legacy",isTrial:s}},e.prototype.isDisplayWatermark=function(){return!bn.missingOrEmpty(this.watermarkMessage)},e.prototype.getWatermarkMessage=function(){return this.watermarkMessage||""},e.formatDate=function(t){var e=t.getDate(),o=t.getMonth(),n=t.getFullYear();return e+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][o]+" "+n},e.getGridReleaseDate=function(){return new Date(parseInt(o.decode(o.RELEASE_INFORMATION),10))},e.decode=function(t){for(var e,n,i,r,s,a,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p="",u=0,c=t.replace(/[^A-Za-z0-9+/=]/g,"");u<c.length;)e=l.indexOf(c.charAt(u++))<<2|(r=l.indexOf(c.charAt(u++)))>>4,n=(15&r)<<4|(s=l.indexOf(c.charAt(u++)))>>2,i=(3&s)<<6|(a=l.indexOf(c.charAt(u++))),p+=String.fromCharCode(e),64!=s&&(p+=String.fromCharCode(n)),64!=a&&(p+=String.fromCharCode(i));return p=o.utf8_decode(p)},e.utf8_decode=function(t){t=t.replace(/rn/g,"n");for(var e="",o=0;o<t.length;o++){var n=t.charCodeAt(o);n<128?e+=String.fromCharCode(n):n>127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e},e.setLicenseKey=function(t){o.licenseKey=t},e.extractBracketedInformation=function(t){var e=t.split("[").filter((function(t){return t.indexOf("]")>-1})).map((function(t){return t.split("]")[0]}));if(!e||0===e.length)return[null,null];var o=1===e.filter((function(t){return"TRIAL"===t})).length;return[e.filter((function(t){return 0===t.indexOf("v")})).map((function(t){return t.replace(/^v/,"")}))[0],o]},e.prototype.validateLicenseKeyForVersion=function(t,e,o){"2"===t&&(e?this.validateForTrial(o):this.validateLegacyKey(o))},e.prototype.validateLegacyKey=function(t){var e=o.getGridReleaseDate(),n=o.extractExpiry(t),i=!1,r=!1;if(isNaN(n.getTime())||(i=!0,r=e<n),i){if(!r){var s=o.formatDate(n),a=o.formatDate(e);this.outputIncompatibleVersion(s,a)}}else this.outputInvalidLicenseKey()},e.prototype.validateForTrial=function(t){var e=o.extractExpiry(t),n=new Date,i=!1,r=!1;if(isNaN(e.getTime())||(i=!0,r=e>n),i){if(!r){var s=o.formatDate(e);this.outputExpiredTrialKey(s)}}else this.outputInvalidLicenseKey()},e.prototype.outputInvalidLicenseKey=function(){console.error("*****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License ********************************************"),console.error("********************************************* Invalid License ***************************************************"),console.error("* Your license for AG Grid Enterprise is not valid - please contact [email protected] to obtain a valid license. *"),console.error("*****************************************************************************************************************"),console.error("*****************************************************************************************************************"),this.watermarkMessage="Invalid License"},e.prototype.outputExpiredTrialKey=function(t){console.error("****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License *******************************************"),console.error("***************************************** Trial Period Expired. *******************************************"),console.error("* Your license for AG Grid Enterprise expired on "+t+". *"),console.error("* Please email [email protected] to purchase a license. *"),console.error("****************************************************************************************************************"),console.error("****************************************************************************************************************"),this.watermarkMessage="Trial Period Expired"},e.prototype.outputMissingLicenseKey=function(){console.error("****************************************************************************************************************"),console.error("***************************************** AG Grid Enterprise License *******************************************"),console.error("****************************************** License Key Not Found ***********************************************"),console.error("* All AG Grid Enterprise features are unlocked. *"),console.error("* This is an evaluation only version, it is not licensed for development projects intended for production. *"),console.error("* If you want to hide the watermark, please email [email protected] for a trial license. *"),console.error("****************************************************************************************************************"),console.error("****************************************************************************************************************"),this.watermarkMessage="For Trial Use Only"},e.prototype.outputIncompatibleVersion=function(t,e){console.error("****************************************************************************************************************************"),console.error("****************************************************************************************************************************"),console.error("* AG Grid Enterprise License *"),console.error("* License not compatible with installed version of AG Grid Enterprise. *"),console.error("* *"),console.error("* Your AG Grid License entitles you to all versions of AG Grid that we release within the time covered by your license *"),console.error("* - typically we provide one year licenses which entitles you to all releases / updates of AG Grid within that year. *"),console.error("* Your license has an end (expiry) date which stops the license key working with versions of AG Grid released after the *"),console.error("* license end date. The license key that you have expires on "+t+", however the version of AG Grid you *"),console.error("* are trying to use was released on "+e+". *"),console.error("* *"),console.error("* Please contact [email protected] to renew your subscription to new versions and get a new license key to work with this *"),console.error("* version of AG Grid. *"),console.error("****************************************************************************************************************************"),console.error("****************************************************************************************************************************"),this.watermarkMessage="License Expired"},e.RELEASE_INFORMATION="MTYxMzQ2MjUzMTEzNw==",Tu([it("md5")],e.prototype,"md5",void 0),Tu([tt],e.prototype,"validateLicense",null),e=o=Tu([nt("licenseManager")],e)}(Mt),Fu=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Nu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Lu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ieCompatibility=!1,e}return Fu(e,t),e.prototype.init=function(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")},e.prototype.md5cycle=function(t,e){var o=t[0],n=t[1],i=t[2],r=t[3];o=this.ff(o,n,i,r,e[0],7,-680876936),r=this.ff(r,o,n,i,e[1],12,-389564586),i=this.ff(i,r,o,n,e[2],17,606105819),n=this.ff(n,i,r,o,e[3],22,-1044525330),o=this.ff(o,n,i,r,e[4],7,-176418897),r=this.ff(r,o,n,i,e[5],12,1200080426),i=this.ff(i,r,o,n,e[6],17,-1473231341),n=this.ff(n,i,r,o,e[7],22,-45705983),o=this.ff(o,n,i,r,e[8],7,1770035416),r=this.ff(r,o,n,i,e[9],12,-1958414417),i=this.ff(i,r,o,n,e[10],17,-42063),n=this.ff(n,i,r,o,e[11],22,-1990404162),o=this.ff(o,n,i,r,e[12],7,1804603682),r=this.ff(r,o,n,i,e[13],12,-40341101),i=this.ff(i,r,o,n,e[14],17,-1502002290),n=this.ff(n,i,r,o,e[15],22,1236535329),o=this.gg(o,n,i,r,e[1],5,-165796510),r=this.gg(r,o,n,i,e[6],9,-1069501632),i=this.gg(i,r,o,n,e[11],14,643717713),n=this.gg(n,i,r,o,e[0],20,-373897302),o=this.gg(o,n,i,r,e[5],5,-701558691),r=this.gg(r,o,n,i,e[10],9,38016083),i=this.gg(i,r,o,n,e[15],14,-660478335),n=this.gg(n,i,r,o,e[4],20,-405537848),o=this.gg(o,n,i,r,e[9],5,568446438),r=this.gg(r,o,n,i,e[14],9,-1019803690),i=this.gg(i,r,o,n,e[3],14,-187363961),n=this.gg(n,i,r,o,e[8],20,1163531501),o=this.gg(o,n,i,r,e[13],5,-1444681467),r=this.gg(r,o,n,i,e[2],9,-51403784),i=this.gg(i,r,o,n,e[7],14,1735328473),n=this.gg(n,i,r,o,e[12],20,-1926607734),o=this.hh(o,n,i,r,e[5],4,-378558),r=this.hh(r,o,n,i,e[8],11,-2022574463),i=this.hh(i,r,o,n,e[11],16,1839030562),n=this.hh(n,i,r,o,e[14],23,-35309556),o=this.hh(o,n,i,r,e[1],4,-1530992060),r=this.hh(r,o,n,i,e[4],11,1272893353),i=this.hh(i,r,o,n,e[7],16,-155497632),n=this.hh(n,i,r,o,e[10],23,-1094730640),o=this.hh(o,n,i,r,e[13],4,681279174),r=this.hh(r,o,n,i,e[0],11,-358537222),i=this.hh(i,r,o,n,e[3],16,-722521979),n=this.hh(n,i,r,o,e[6],23,76029189),o=this.hh(o,n,i,r,e[9],4,-640364487),r=this.hh(r,o,n,i,e[12],11,-421815835),i=this.hh(i,r,o,n,e[15],16,530742520),n=this.hh(n,i,r,o,e[2],23,-995338651),o=this.ii(o,n,i,r,e[0],6,-198630844),r=this.ii(r,o,n,i,e[7],10,1126891415),i=this.ii(i,r,o,n,e[14],15,-1416354905),n=this.ii(n,i,r,o,e[5],21,-57434055),o=this.ii(o,n,i,r,e[12],6,1700485571),r=this.ii(r,o,n,i,e[3],10,-1894986606),i=this.ii(i,r,o,n,e[10],15,-1051523),n=this.ii(n,i,r,o,e[1],21,-2054922799),o=this.ii(o,n,i,r,e[8],6,1873313359),r=this.ii(r,o,n,i,e[15],10,-30611744),i=this.ii(i,r,o,n,e[6],15,-1560198380),n=this.ii(n,i,r,o,e[13],21,1309151649),o=this.ii(o,n,i,r,e[4],6,-145523070),r=this.ii(r,o,n,i,e[11],10,-1120210379),i=this.ii(i,r,o,n,e[2],15,718787259),n=this.ii(n,i,r,o,e[9],21,-343485551),t[0]=this.add32(o,t[0]),t[1]=this.add32(n,t[1]),t[2]=this.add32(i,t[2]),t[3]=this.add32(r,t[3])},e.prototype.cmn=function(t,e,o,n,i,r){return e=this.add32(this.add32(e,t),this.add32(n,r)),this.add32(e<<i|e>>>32-i,o)},e.prototype.ff=function(t,e,o,n,i,r,s){return this.cmn(e&o|~e&n,t,e,i,r,s)},e.prototype.gg=function(t,e,o,n,i,r,s){return this.cmn(e&n|o&~n,t,e,i,r,s)},e.prototype.hh=function(t,e,o,n,i,r,s){return this.cmn(e^o^n,t,e,i,r,s)},e.prototype.ii=function(t,e,o,n,i,r,s){return this.cmn(o^(e|~n),t,e,i,r,s)},e.prototype.md51=function(t){var e,o=t.length,n=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)this.md5cycle(n,this.md5blk(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)i[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(this.md5cycle(n,i),e=0;e<16;e++)i[e]=0;return i[14]=8*o,this.md5cycle(n,i),n},e.prototype.md5blk=function(t){for(var e=[],o=0;o<64;o+=4)e[o>>2]=t.charCodeAt(o)+(t.charCodeAt(o+1)<<8)+(t.charCodeAt(o+2)<<16)+(t.charCodeAt(o+3)<<24);return e},e.prototype.rhex=function(t){for(var e="0123456789abcdef".split(""),o="",n=0;n<4;n++)o+=e[t>>8*n+4&15]+e[t>>8*n&15];return o},e.prototype.hex=function(t){for(var e=0;e<t.length;e++)t[e]=this.rhex(t[e]);return t.join("")},e.prototype.md5=function(t){return this.hex(this.md51(t))},e.prototype.add32=function(t,e){return this.ieCompatibility?this.add32Compat(t,e):this.add32Std(t,e)},e.prototype.add32Std=function(t,e){return t+e&4294967295},e.prototype.add32Compat=function(t,e){var o=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(o>>16)<<16|65535&o},Nu([et],e.prototype,"init",null),e=Nu([nt("md5")],e)}(Mt),Iu=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Gu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Mu=function(t){function e(){return t.call(this,'<div class="ag-watermark">\n <div ref="eLicenseTextRef" class="ag-watermark-text"></div>\n </div>')||this}return Iu(e,t),e.prototype.postConstruct=function(){var t=this,e=this.shouldDisplayWatermark();bn.addOrRemoveCssClass(this.getGui(),"ag-hidden",!e),e&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout((function(){return t.addCssClass("ag-opacity-zero")}),0),window.setTimeout((function(){return t.addCssClass("ag-hidden")}),5e3))},e.prototype.shouldDisplayWatermark=function(){var t=this.licenseManager.isDisplayWatermark(),e=null!=location.hostname.match("^127.0.0.1|localhost|www.ag-grid.com$");return!!location.pathname&&-1!==location.pathname.indexOf("forceWatermark")||t&&!e},Gu([it("licenseManager")],e.prototype,"licenseManager",void 0),Gu([Wn("eLicenseTextRef")],e.prototype,"eLicenseTextRef",void 0),Gu([et],e.prototype,"postConstruct",null),e}(xn),xu={moduleName:pt.EnterpriseCoreModule,beans:[_u,Lu],agStackComponents:[{componentName:"AgWatermark",componentClass:Mu}]},Vu=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Hu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Wu=function(t){function e(){var e=t.call(this)||this;return e.allComponents={},e}return Vu(e,t),e.prototype.registerStatusPanel=function(t,e){this.allComponents[t]=e},e.prototype.getStatusPanel=function(t){return this.allComponents[t]},e=Hu([nt("statusBarService")],e)}(Mt),ku=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Bu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ju=function(t){function e(){return t.call(this,e.TEMPLATE)||this}return ku(e,t),e.prototype.postConstruct=function(){if(this.gridOptions.statusBar&&this.gridOptions.statusBar.statusPanels){var t=this.gridOptions.statusBar.statusPanels.filter((function(t){return"left"===t.align}));this.createAndRenderComponents(t,this.eStatusBarLeft);var e=this.gridOptions.statusBar.statusPanels.filter((function(t){return"center"===t.align}));this.createAndRenderComponents(e,this.eStatusBarCenter);var o=this.gridOptions.statusBar.statusPanels.filter((function(t){return!t.align||"right"===t.align}));this.createAndRenderComponents(o,this.eStatusBarRight)}else this.setDisplayed(!1)},e.prototype.createAndRenderComponents=function(t,e){var o=this,n=[];t.forEach((function(t){var e={api:o.gridOptionsWrapper.getApi(),columnApi:o.gridOptionsWrapper.getColumnApi(),context:o.gridOptionsWrapper.getContext()},i=o.userComponentFactory.newStatusPanelComponent(t,e);n.push({key:t.key||t.statusPanel,promise:i})})),Tn.all(n.map((function(t){return t.promise}))).then((function(){n.forEach((function(t){t.promise.then((function(n){var i=function(){o.getContext().destroyBean(n)};o.isAlive()?(o.statusBarService.registerStatusPanel(t.key,n),e.appendChild(n.getGui()),o.addDestroyFunc(i)):i()}))}))}))},e.TEMPLATE='<div class="ag-status-bar">\n <div ref="eStatusBarLeft" class="ag-status-bar-left"></div>\n <div ref="eStatusBarCenter" class="ag-status-bar-center"></div>\n <div ref="eStatusBarRight" class="ag-status-bar-right"></div>\n </div>',Bu([it("gridOptions")],e.prototype,"gridOptions",void 0),Bu([it("userComponentFactory")],e.prototype,"userComponentFactory",void 0),Bu([it("statusBarService")],e.prototype,"statusBarService",void 0),Bu([Wn("eStatusBarLeft")],e.prototype,"eStatusBarLeft",void 0),Bu([Wn("eStatusBarCenter")],e.prototype,"eStatusBarCenter",void 0),Bu([Wn("eStatusBarRight")],e.prototype,"eStatusBarRight",void 0),Bu([et],e.prototype,"postConstruct",null),e}(xn),Uu=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),zu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Ku=function(t){function e(){return t.call(this,e.TEMPLATE)||this}return Uu(e,t),e.prototype.setLabel=function(t,e){this.setDisplayed(!1);var o=this.gridOptionsWrapper.getLocaleTextFunc();this.eLabel.innerHTML=o(t,e)},e.prototype.setValue=function(t){this.eValue.innerHTML=t},e.TEMPLATE='<div class="ag-status-name-value">\n <span ref="eLabel"></span>: \n <span ref="eValue" class="ag-status-name-value-value"></span>\n </div>',zu([Wn("eLabel")],e.prototype,"eLabel",void 0),zu([Wn("eValue")],e.prototype,"eValue",void 0),e}(xn),Yu=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),qu=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Xu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Yu(e,t),e.prototype.postConstruct=function(){"clientSide"===this.gridApi.getModel().getType()?(this.setLabel("totalAndFilteredRows","Rows"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,Wt.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this))):console.warn("AG Grid: agTotalAndFilteredRowCountComponent should only be used with the client side row model.")},e.prototype.onDataChanged=function(){var t=bn.formatNumberCommas(this.getFilteredRowCountValue()),e=bn.formatNumberCommas(this.getTotalRowCount());if(t===e)this.setValue(t);else{var o=this.gridOptionsWrapper.getLocaleTextFunc();this.setValue(t+" "+o("of","of")+" "+e)}},e.prototype.getFilteredRowCountValue=function(){var t=0;return this.gridApi.forEachNodeAfterFilter((function(e){e.group||t++})),t},e.prototype.getTotalRowCount=function(){var t=0;return this.gridApi.forEachNode((function(e){e.group||t++})),t},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},qu([it("gridApi")],e.prototype,"gridApi",void 0),qu([et],e.prototype,"postConstruct",null),e}(Ku),Qu=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),$u=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},Zu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Qu(e,t),e.prototype.postConstruct=function(){if(this.setLabel("filteredRows","Filtered"),"clientSide"===this.gridApi.getModel().getType()){this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);var t=this.onDataChanged.bind(this);this.addManagedListener(this.eventService,Wt.EVENT_MODEL_UPDATED,t)}else console.warn("AG Grid: agFilteredRowCountComponent should only be used with the client side row model.")},e.prototype.onDataChanged=function(){var t=this.getTotalRowCountValue(),e=this.getFilteredRowCountValue();this.setValue(bn.formatNumberCommas(e)),this.setDisplayed(t!==e)},e.prototype.getTotalRowCountValue=function(){var t=0;return this.gridApi.forEachNode((function(e){return t+=1})),t},e.prototype.getFilteredRowCountValue=function(){var t=0;return this.gridApi.forEachNodeAfterFilter((function(e){e.group||(t+=1)})),t},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},$u([it("gridApi")],e.prototype,"gridApi",void 0),$u([et],e.prototype,"postConstruct",null),e}(Ku),Ju=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),tc=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ec=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ju(e,t),e.prototype.postConstruct=function(){this.setLabel("totalRows","Total Rows"),"clientSide"===this.gridApi.getModel().getType()?(this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,Wt.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this))):console.warn("AG Grid: agTotalRowCountComponent should only be used with the client side row model.")},e.prototype.onDataChanged=function(){this.setValue(bn.formatNumberCommas(this.getRowCountValue()))},e.prototype.getRowCountValue=function(){var t=0;return this.gridApi.forEachLeafNode((function(e){return t+=1})),t},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},tc([it("gridApi")],e.prototype,"gridApi",void 0),tc([et],e.prototype,"postConstruct",null),e}(Ku),oc=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),nc=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ic=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return oc(e,t),e.prototype.postConstruct=function(){if(this.isValidRowModel()){this.setLabel("selectedRows","Selected"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-selected-row-count");var t=this.gridApi.getSelectedRows().length;this.setValue(bn.formatNumberCommas(t)),this.setDisplayed(t>0);var e=this.onRowSelectionChanged.bind(this);this.addManagedListener(this.eventService,Wt.EVENT_MODEL_UPDATED,e),this.addManagedListener(this.eventService,Wt.EVENT_SELECTION_CHANGED,e)}else console.warn("AG Grid: agSelectedRowCountComponent should only be used with the client and server side row model.")},e.prototype.isValidRowModel=function(){var t=this.gridApi.getModel().getType();return"clientSide"===t||"serverSide"===t},e.prototype.onRowSelectionChanged=function(){var t=this.gridApi.getSelectedRows().length;this.setValue(bn.formatNumberCommas(t)),this.setDisplayed(t>0)},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},nc([it("gridApi")],e.prototype,"gridApi",void 0),nc([et],e.prototype,"postConstruct",null),e}(Ku),rc=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),sc=function(t,e,o,n){var i,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,o,s):i(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s},ac=function(t){function e(){return t.call(this,e.TEMPLATE)||this}return rc(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this)},e.prototype.postConstruct=function(){this.isValidRowModel()?(this.avgAggregationComp.setLabel("average","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedListener(this.eventService,Wt.EVENT_RANGE_SELECTION_CHANGED,this.onRangeSelectionChanged.bind(this)),this.addManagedListener(this.eventService,Wt.EVENT_MODEL_UPDATED,this.onRangeSelectionChanged.bind(this))):console.warn("AG Grid: agAggregationComponent should only be used with the client and server side row model.")},e.prototype.isValidRowModel=function(){var t=this.gridApi.getModel().getType();return"clientSide"===t||"serverSide"===t},e.prototype.init=function(){},e.prototype.setAggregationComponentValue=function(t,e,o){var n=this.getAggregationValueComponent(t);bn.exists(n)&&n&&(n.setValue(bn.formatNumberTwoDecimalPlacesAndCommas(e)),n.setDisplayed(o))},e.prototype.getAggregationValueComponent=function(t){var e=t+"AggregationComp",o=null,n=bn.exists(this.gridOptions.statusBar)&&this.gridOptions.statusBar?bn.find(this.gridOptions.statusBar.statusPanels,(function(t){return"agAggregationComponent"===t.statusPanel})):null;return bn.exists(n)&&n?(!bn.exists(n.statusPanelParams)||bn.exists(n.statusPanelParams)&&bn.exists(n.statusPanelParams.aggFuncs)&&bn.exists(bn.find(n.statusPanelParams.aggFuncs,(function(e){return e===t}))))&&(o=this[e]):o=this[e],o},e.prototype.onRangeSelectionChanged=function(){var t=this,e=this.rangeController?this.rangeController.getCellRanges():void 0,o=0,n=0,i=0,r=null,s=null,a={};e&&!bn.missingOrEmpty(e)&&e.forEach((function(e){for(var l=t.rangeController.getRangeStartRow(e),p=t.rangeController.getRangeEndRow(e);;){if(bn.missing(l)||!l||t.rowPositionUtils.before(p,l)||!l||!e.columns)break;e.columns.forEach((function(e){if(null!==l){var p=t.cellPositionUtils.createId({rowPinned:l.rowPinned,column:e,rowIndex:l.rowIndex});if(!a[p]){a[p]=!0;var u=t.rowRenderer.getRowNode(l);if(!bn.missing(u)){var c=t.valueService.getValue(e,u);bn.missing(c)||""===c||(c.value&&(c=c.value),"string"==typeof c&&(c=Number(c)),"number"!=typeof c||isNaN(c)||(o+=c,(null===s||c>s)&&(s=c),(null===r||c<r)&&(r=c),i++),n++)}}}})),l=t.cellNavigationService.getRowBelow(l)}}));var l=n>1,p=i>1;this.setAggregationComponentValue("count",n,l),this.setAggregationComponentValue("sum",o,p),this.setAggregationComponentValue("min",r,p),this.setAggregationComponentValue("max",s,p),this.setAggregationComponentValue("avg",o/i,p)},e.TEMPLATE='<div class="ag-status-panel ag-status-panel-aggregations">\n <ag-name-value ref="avgAggregationComp"></ag-name-value>\n <ag-name-value ref="countAggregationComp"></ag-name-value>\n <ag-name-value ref="minAggregationComp"></ag-name-value>\n <ag-name-value ref="maxAggregationComp"></ag-name-value>\n <ag-name-value ref="sumAggregationComp"></ag-name-value>\n </div>',sc([rt("rangeController")],e.prototype,"rangeController",void 0),sc([it("valueService")],e.prototype,"valueService",void 0),sc([it("cellNavigationService")],e.prototype,"cellNavigationService",void 0),sc([it("rowRenderer")],e.prototype,"rowRenderer",void 0),sc([it("gridOptions")],e.prototype,"gridOptions",void 0),sc([it("gridApi")],e.prototype,"gridApi",void 0),sc([it("cellPositionUtils")],e.prototype,"cellPositionUtils",void 0),sc([it("rowPositionUtils")],e.prototype,"rowPositionUtils",void 0),sc([Wn("sumAggregationComp")],e.prototype,"sumAggregationComp",void 0),sc([Wn("countAggregationComp")],e.prototype,"countAggregationComp",void 0),sc([Wn("minAggregationComp")],e.prototype,"minAggregationComp",void 0),sc([Wn("maxAggregationComp")],e.prototype,"maxAggregationComp",void 0),sc([Wn("avgAggregationComp")],e.prototype,"avgAggregationComp",void 0),sc([et],e.prototype,"postConstruct",null),e}(xn),lc={moduleName:pt.StatusBarModule,beans:[Wu],agStackComponents:[{componentName:"AgStatusBar",componentClass:ju},{componentName:"AgNameValue",componentClass:Ku}],userComponents:[{componentName:"agAggregationComponent",componentClass:ac},{componentName:"agSelectedRowCountComponent",componentClass:ic},{componentName:"agTotalRowCountComponent",componentClass:ec},{componentName:"agFilteredRowCountComponent",componentClass:Zu},{componentName:"agTotalAndFilteredRowCountComponent",componentClass:Xu}],dependantModules:[xu]};export{lc as StatusBarModule}; |
src/components/common/svg-icons/device/settings-system-daydream.js | abzfarah/Pearson.NAPLAN.GnomeH | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let DeviceSettingsSystemDaydream = (props) => (
<SvgIcon {...props}>
<path d="M9 16h6.5c1.38 0 2.5-1.12 2.5-2.5S16.88 11 15.5 11h-.05c-.24-1.69-1.69-3-3.45-3-1.4 0-2.6.83-3.16 2.02h-.16C7.17 10.18 6 11.45 6 13c0 1.66 1.34 3 3 3zM21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16.01H3V4.99h18v14.02z"/>
</SvgIcon>
);
DeviceSettingsSystemDaydream = pure(DeviceSettingsSystemDaydream);
DeviceSettingsSystemDaydream.displayName = 'DeviceSettingsSystemDaydream';
DeviceSettingsSystemDaydream.muiName = 'SvgIcon';
export default DeviceSettingsSystemDaydream;
|
ajax/libs/rxjs/2.2.28/rx.lite.js | samthor/cdnjs | // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
;(function (undefined) {
var objectTypes = {
'boolean': false,
'function': true,
'object': true,
'number': false,
'string': false,
'undefined': false
};
var root = (objectTypes[typeof window] && window) || this,
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = objectTypes[typeof global] && global;
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
root = freeGlobal;
}
var Rx = {
internals: {},
config: {
Promise: root.Promise // Detect if promise exists
},
helpers: { }
};
// Defaults
var noop = Rx.helpers.noop = function () { },
identity = Rx.helpers.identity = function (x) { return x; },
pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
just = Rx.helpers.just = function (value) { return function () { return value; }; },
defaultNow = Rx.helpers.defaultNow = Date.now,
defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); },
defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); },
defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); },
defaultError = Rx.helpers.defaultError = function (err) { throw err; },
isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.then === 'function' && p.then !== Rx.Observable.prototype.then; },
asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); },
not = Rx.helpers.not = function (a) { return !a; };
// Errors
var sequenceContainsNoElements = 'Sequence contains no elements.';
var argumentOutOfRange = 'Argument out of range';
var objectDisposed = 'Object has been disposed';
function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } }
// Shim in iterator support
var $iterator$ = (typeof Symbol === 'object' && Symbol.iterator) ||
'_es6shim_iterator_';
// Firefox ships a partial implementation using the name @@iterator.
// https://bugzilla.mozilla.org/show_bug.cgi?id=907077#c14
// So use that name if we detect it.
if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
$iterator$ = '@@iterator';
}
var doneEnumerator = { done: true, value: undefined };
/** `Object#toString` result shortcuts */
var argsClass = '[object Arguments]',
arrayClass = '[object Array]',
boolClass = '[object Boolean]',
dateClass = '[object Date]',
errorClass = '[object Error]',
funcClass = '[object Function]',
numberClass = '[object Number]',
objectClass = '[object Object]',
regexpClass = '[object RegExp]',
stringClass = '[object String]';
var toString = Object.prototype.toString,
hasOwnProperty = Object.prototype.hasOwnProperty,
supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
suportNodeClass,
errorProto = Error.prototype,
objectProto = Object.prototype,
propertyIsEnumerable = objectProto.propertyIsEnumerable;
try {
suportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
} catch(e) {
suportNodeClass = true;
}
var shadowedProps = [
'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'
];
var nonEnumProps = {};
nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
nonEnumProps[objectClass] = { 'constructor': true };
var support = {};
(function () {
var ctor = function() { this.x = 1; },
props = [];
ctor.prototype = { 'valueOf': 1, 'y': 1 };
for (var key in new ctor) { props.push(key); }
for (key in arguments) { }
// Detect if `name` or `message` properties of `Error.prototype` are enumerable by default.
support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
// Detect if `prototype` properties are enumerable by default.
support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
// Detect if `arguments` object indexes are non-enumerable
support.nonEnumArgs = key != 0;
// Detect if properties shadowing those on `Object.prototype` are non-enumerable.
support.nonEnumShadows = !/valueOf/.test(props);
}(1));
function isObject(value) {
// check if the value is the ECMAScript language type of Object
// http://es5.github.io/#x8
// and avoid a V8 bug
// https://code.google.com/p/v8/issues/detail?id=2291
var type = typeof value;
return value && (type == 'function' || type == 'object') || false;
}
function keysIn(object) {
var result = [];
if (!isObject(object)) {
return result;
}
if (support.nonEnumArgs && object.length && isArguments(object)) {
object = slice.call(object);
}
var skipProto = support.enumPrototypes && typeof object == 'function',
skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error);
for (var key in object) {
if (!(skipProto && key == 'prototype') &&
!(skipErrorProps && (key == 'message' || key == 'name'))) {
result.push(key);
}
}
if (support.nonEnumShadows && object !== objectProto) {
var ctor = object.constructor,
index = -1,
length = shadowedProps.length;
if (object === (ctor && ctor.prototype)) {
var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
nonEnum = nonEnumProps[className];
}
while (++index < length) {
key = shadowedProps[index];
if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) {
result.push(key);
}
}
}
return result;
}
function internalFor(object, callback, keysFunc) {
var index = -1,
props = keysFunc(object),
length = props.length;
while (++index < length) {
var key = props[index];
if (callback(object[key], key, object) === false) {
break;
}
}
return object;
}
function internalForIn(object, callback) {
return internalFor(object, callback, keysIn);
}
function isNode(value) {
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
// methods that are `typeof` "string" and still can coerce nodes to strings
return typeof value.toString != 'function' && typeof (value + '') == 'string';
}
function isArguments(value) {
return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
}
// fallback for browsers that can't detect `arguments` objects by [[Class]]
if (!supportsArgsClass) {
isArguments = function(value) {
return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
};
}
function isFunction(value) {
return typeof value == 'function' || false;
}
// fallback for older versions of Chrome and Safari
if (isFunction(/x/)) {
isFunction = function(value) {
return typeof value == 'function' && toString.call(value) == funcClass;
};
}
var isEqual = Rx.internals.isEqual = function (x, y) {
return deepEquals(x, y, [], []);
};
/** @private
* Used for deep comparison
**/
function deepEquals(a, b, stackA, stackB) {
// exit early for identical values
if (a === b) {
// treat `+0` vs. `-0` as not equal
return a !== 0 || (1 / a == 1 / b);
}
var type = typeof a,
otherType = typeof b;
// exit early for unlike primitive values
if (a === a && (a == null || b == null ||
(type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
return false;
}
// compare [[Class]] names
var className = toString.call(a),
otherClass = toString.call(b);
if (className == argsClass) {
className = objectClass;
}
if (otherClass == argsClass) {
otherClass = objectClass;
}
if (className != otherClass) {
return false;
}
switch (className) {
case boolClass:
case dateClass:
// coerce dates and booleans to numbers, dates to milliseconds and booleans
// to `1` or `0` treating invalid dates coerced to `NaN` as not equal
return +a == +b;
case numberClass:
// treat `NaN` vs. `NaN` as equal
return (a != +a)
? b != +b
// but treat `-0` vs. `+0` as not equal
: (a == 0 ? (1 / a == 1 / b) : a == +b);
case regexpClass:
case stringClass:
// coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
// treat string primitives and their corresponding object instances as equal
return a == String(b);
}
var isArr = className == arrayClass;
if (!isArr) {
// exit for functions and DOM nodes
if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
return false;
}
// in older versions of Opera, `arguments` objects have `Array` constructors
var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
// non `Object` object instances with different constructors are not equal
if (ctorA != ctorB &&
!(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) &&
!(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
('constructor' in a && 'constructor' in b)
) {
return false;
}
}
// assume cyclic structures are equal
// the algorithm for detecting cyclic structures is adapted from ES 5.1
// section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
var initedStack = !stackA;
stackA || (stackA = []);
stackB || (stackB = []);
var length = stackA.length;
while (length--) {
if (stackA[length] == a) {
return stackB[length] == b;
}
}
var size = 0;
result = true;
// add `a` and `b` to the stack of traversed objects
stackA.push(a);
stackB.push(b);
// recursively compare objects and arrays (susceptible to call stack limits)
if (isArr) {
// compare lengths to determine if a deep comparison is necessary
length = a.length;
size = b.length;
result = size == length;
if (result) {
// deep compare the contents, ignoring non-numeric properties
while (size--) {
var index = length,
value = b[size];
if (!(result = deepEquals(a[size], value, stackA, stackB))) {
break;
}
}
}
}
else {
// deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
// which, in this case, is more costly
internalForIn(b, function(value, key, b) {
if (hasOwnProperty.call(b, key)) {
// count the number of properties.
size++;
// deep compare each property value.
return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB));
}
});
if (result) {
// ensure both objects have the same number of properties
internalForIn(a, function(value, key, a) {
if (hasOwnProperty.call(a, key)) {
// `size` will be `-1` if `a` has more properties than `b`
return (result = --size > -1);
}
});
}
}
stackA.pop();
stackB.pop();
return result;
}
var slice = Array.prototype.slice;
function argsOrArray(args, idx) {
return args.length === 1 && Array.isArray(args[idx]) ?
args[idx] :
slice.call(args);
}
var hasProp = {}.hasOwnProperty;
/** @private */
var inherits = this.inherits = Rx.internals.inherits = function (child, parent) {
function __() { this.constructor = child; }
__.prototype = parent.prototype;
child.prototype = new __();
};
/** @private */
var addProperties = Rx.internals.addProperties = function (obj) {
var sources = slice.call(arguments, 1);
for (var i = 0, len = sources.length; i < len; i++) {
var source = sources[i];
for (var prop in source) {
obj[prop] = source[prop];
}
}
};
// Rx Utils
var addRef = Rx.internals.addRef = function (xs, r) {
return new AnonymousObservable(function (observer) {
return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
});
};
// Collection polyfills
function arrayInitialize(count, factory) {
var a = new Array(count);
for (var i = 0; i < count; i++) {
a[i] = factory();
}
return a;
}
// Collections
var IndexedItem = function (id, value) {
this.id = id;
this.value = value;
};
IndexedItem.prototype.compareTo = function (other) {
var c = this.value.compareTo(other.value);
if (c === 0) {
c = this.id - other.id;
}
return c;
};
// Priority Queue for Scheduling
var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
this.items = new Array(capacity);
this.length = 0;
};
var priorityProto = PriorityQueue.prototype;
priorityProto.isHigherPriority = function (left, right) {
return this.items[left].compareTo(this.items[right]) < 0;
};
priorityProto.percolate = function (index) {
if (index >= this.length || index < 0) {
return;
}
var parent = index - 1 >> 1;
if (parent < 0 || parent === index) {
return;
}
if (this.isHigherPriority(index, parent)) {
var temp = this.items[index];
this.items[index] = this.items[parent];
this.items[parent] = temp;
this.percolate(parent);
}
};
priorityProto.heapify = function (index) {
if (index === undefined) {
index = 0;
}
if (index >= this.length || index < 0) {
return;
}
var left = 2 * index + 1,
right = 2 * index + 2,
first = index;
if (left < this.length && this.isHigherPriority(left, first)) {
first = left;
}
if (right < this.length && this.isHigherPriority(right, first)) {
first = right;
}
if (first !== index) {
var temp = this.items[index];
this.items[index] = this.items[first];
this.items[first] = temp;
this.heapify(first);
}
};
priorityProto.peek = function () { return this.items[0].value; };
priorityProto.removeAt = function (index) {
this.items[index] = this.items[--this.length];
delete this.items[this.length];
this.heapify();
};
priorityProto.dequeue = function () {
var result = this.peek();
this.removeAt(0);
return result;
};
priorityProto.enqueue = function (item) {
var index = this.length++;
this.items[index] = new IndexedItem(PriorityQueue.count++, item);
this.percolate(index);
};
priorityProto.remove = function (item) {
for (var i = 0; i < this.length; i++) {
if (this.items[i].value === item) {
this.removeAt(i);
return true;
}
}
return false;
};
PriorityQueue.count = 0;
/**
* Represents a group of disposable resources that are disposed together.
* @constructor
*/
var CompositeDisposable = Rx.CompositeDisposable = function () {
this.disposables = argsOrArray(arguments, 0);
this.isDisposed = false;
this.length = this.disposables.length;
};
var CompositeDisposablePrototype = CompositeDisposable.prototype;
/**
* Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
* @param {Mixed} item Disposable to add.
*/
CompositeDisposablePrototype.add = function (item) {
if (this.isDisposed) {
item.dispose();
} else {
this.disposables.push(item);
this.length++;
}
};
/**
* Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
* @param {Mixed} item Disposable to remove.
* @returns {Boolean} true if found; false otherwise.
*/
CompositeDisposablePrototype.remove = function (item) {
var shouldDispose = false;
if (!this.isDisposed) {
var idx = this.disposables.indexOf(item);
if (idx !== -1) {
shouldDispose = true;
this.disposables.splice(idx, 1);
this.length--;
item.dispose();
}
}
return shouldDispose;
};
/**
* Disposes all disposables in the group and removes them from the group.
*/
CompositeDisposablePrototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var currentDisposables = this.disposables.slice(0);
this.disposables = [];
this.length = 0;
for (var i = 0, len = currentDisposables.length; i < len; i++) {
currentDisposables[i].dispose();
}
}
};
/**
* Removes and disposes all disposables from the CompositeDisposable, but does not dispose the CompositeDisposable.
*/
CompositeDisposablePrototype.clear = function () {
var currentDisposables = this.disposables.slice(0);
this.disposables = [];
this.length = 0;
for (var i = 0, len = currentDisposables.length; i < len; i++) {
currentDisposables[i].dispose();
}
};
/**
* Determines whether the CompositeDisposable contains a specific disposable.
* @param {Mixed} item Disposable to search for.
* @returns {Boolean} true if the disposable was found; otherwise, false.
*/
CompositeDisposablePrototype.contains = function (item) {
return this.disposables.indexOf(item) !== -1;
};
/**
* Converts the existing CompositeDisposable to an array of disposables
* @returns {Array} An array of disposable objects.
*/
CompositeDisposablePrototype.toArray = function () {
return this.disposables.slice(0);
};
/**
* Provides a set of static methods for creating Disposables.
*
* @constructor
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
*/
var Disposable = Rx.Disposable = function (action) {
this.isDisposed = false;
this.action = action || noop;
};
/** Performs the task of cleaning up resources. */
Disposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.action();
this.isDisposed = true;
}
};
/**
* Creates a disposable object that invokes the specified action when disposed.
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
* @return {Disposable} The disposable object that runs the given action upon disposal.
*/
var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
/**
* Gets the disposable that does nothing when disposed.
*/
var disposableEmpty = Disposable.empty = { dispose: noop };
var BooleanDisposable = (function () {
function BooleanDisposable (isSingle) {
this.isSingle = isSingle;
this.isDisposed = false;
this.current = null;
}
var booleanDisposablePrototype = BooleanDisposable.prototype;
/**
* Gets the underlying disposable.
* @return The underlying disposable.
*/
booleanDisposablePrototype.getDisposable = function () {
return this.current;
};
/**
* Sets the underlying disposable.
* @param {Disposable} value The new underlying disposable.
*/
booleanDisposablePrototype.setDisposable = function (value) {
if (this.current && this.isSingle) {
throw new Error('Disposable has already been assigned');
}
var shouldDispose = this.isDisposed, old;
if (!shouldDispose) {
old = this.current;
this.current = value;
}
if (old) {
old.dispose();
}
if (shouldDispose && value) {
value.dispose();
}
};
/**
* Disposes the underlying disposable as well as all future replacements.
*/
booleanDisposablePrototype.dispose = function () {
var old;
if (!this.isDisposed) {
this.isDisposed = true;
old = this.current;
this.current = null;
}
if (old) {
old.dispose();
}
};
return BooleanDisposable;
}());
/**
* Represents a disposable resource which only allows a single assignment of its underlying disposable resource.
* If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an Error.
*/
var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = (function (super_) {
inherits(SingleAssignmentDisposable, super_);
function SingleAssignmentDisposable() {
super_.call(this, true);
}
return SingleAssignmentDisposable;
}(BooleanDisposable));
/**
* Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource.
*/
var SerialDisposable = Rx.SerialDisposable = (function (super_) {
inherits(SerialDisposable, super_);
function SerialDisposable() {
super_.call(this, false);
}
return SerialDisposable;
}(BooleanDisposable));
/**
* Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
*/
var RefCountDisposable = Rx.RefCountDisposable = (function () {
function InnerDisposable(disposable) {
this.disposable = disposable;
this.disposable.count++;
this.isInnerDisposed = false;
}
InnerDisposable.prototype.dispose = function () {
if (!this.disposable.isDisposed) {
if (!this.isInnerDisposed) {
this.isInnerDisposed = true;
this.disposable.count--;
if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
this.disposable.isDisposed = true;
this.disposable.underlyingDisposable.dispose();
}
}
}
};
/**
* Initializes a new instance of the RefCountDisposable with the specified disposable.
* @constructor
* @param {Disposable} disposable Underlying disposable.
*/
function RefCountDisposable(disposable) {
this.underlyingDisposable = disposable;
this.isDisposed = false;
this.isPrimaryDisposed = false;
this.count = 0;
}
/**
* Disposes the underlying disposable only when all dependent disposables have been disposed
*/
RefCountDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
if (!this.isPrimaryDisposed) {
this.isPrimaryDisposed = true;
if (this.count === 0) {
this.isDisposed = true;
this.underlyingDisposable.dispose();
}
}
}
};
/**
* Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
* @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
*/
RefCountDisposable.prototype.getDisposable = function () {
return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
};
return RefCountDisposable;
})();
var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
this.scheduler = scheduler;
this.state = state;
this.action = action;
this.dueTime = dueTime;
this.comparer = comparer || defaultSubComparer;
this.disposable = new SingleAssignmentDisposable();
}
ScheduledItem.prototype.invoke = function () {
this.disposable.setDisposable(this.invokeCore());
};
ScheduledItem.prototype.compareTo = function (other) {
return this.comparer(this.dueTime, other.dueTime);
};
ScheduledItem.prototype.isCancelled = function () {
return this.disposable.isDisposed;
};
ScheduledItem.prototype.invokeCore = function () {
return this.action(this.scheduler, this.state);
};
/** Provides a set of static properties to access commonly used schedulers. */
var Scheduler = Rx.Scheduler = (function () {
function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
this.now = now;
this._schedule = schedule;
this._scheduleRelative = scheduleRelative;
this._scheduleAbsolute = scheduleAbsolute;
}
function invokeRecImmediate(scheduler, pair) {
var state = pair.first, action = pair.second, group = new CompositeDisposable(),
recursiveAction = function (state1) {
action(state1, function (state2) {
var isAdded = false, isDone = false,
d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
};
recursiveAction(state);
return group;
}
function invokeRecDate(scheduler, pair, method) {
var state = pair.first, action = pair.second, group = new CompositeDisposable(),
recursiveAction = function (state1) {
action(state1, function (state2, dueTime1) {
var isAdded = false, isDone = false,
d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
};
recursiveAction(state);
return group;
}
function invokeAction(scheduler, action) {
action();
return disposableEmpty;
}
var schedulerProto = Scheduler.prototype;
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
schedulerProto.schedulePeriodic = function (period, action) {
return this.schedulePeriodicWithState(null, period, function () {
action();
});
};
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Mixed} state Initial state passed to the action upon the first iteration.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed, potentially updating the state.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
schedulerProto.schedulePeriodicWithState = function (state, period, action) {
var s = state, id = setInterval(function () {
s = action(s);
}, period);
return disposableCreate(function () {
clearInterval(id);
});
};
/**
* Schedules an action to be executed.
* @param {Function} action Action to execute.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.schedule = function (action) {
return this._schedule(action, invokeAction);
};
/**
* Schedules an action to be executed.
* @param state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithState = function (state, action) {
return this._schedule(state, action);
};
/**
* Schedules an action to be executed after the specified relative due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelative = function (dueTime, action) {
return this._scheduleRelative(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed after dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative(state, dueTime, action);
};
/**
* Schedules an action to be executed at the specified absolute due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
return this._scheduleAbsolute(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed at dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number}dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute(state, dueTime, action);
};
/**
* Schedules an action to be executed recursively.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursive = function (action) {
return this.scheduleRecursiveWithState(action, function (_action, self) {
_action(function () {
self(_action);
});
});
};
/**
* Schedules an action to be executed recursively.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithState = function (state, action) {
return this.scheduleWithState({ first: state, second: action }, function (s, p) {
return invokeRecImmediate(s, p);
});
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
return this.scheduleRecursiveWithRelativeAndState(action, dueTime, function (_action, self) {
_action(function (dt) {
self(_action, dt);
});
});
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
});
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, function (_action, self) {
_action(function (dt) {
self(_action, dt);
});
});
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
});
};
/** Gets the current time according to the local machine's system clock. */
Scheduler.now = defaultNow;
/**
* Normalizes the specified TimeSpan value to a positive value.
* @param {Number} timeSpan The time span value to normalize.
* @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
*/
Scheduler.normalize = function (timeSpan) {
if (timeSpan < 0) {
timeSpan = 0;
}
return timeSpan;
};
return Scheduler;
}());
var normalizeTime = Scheduler.normalize;
/**
* Gets a scheduler that schedules work immediately on the current thread.
*/
var immediateScheduler = Scheduler.immediate = (function () {
function scheduleNow(state, action) { return action(this, state); }
function scheduleRelative(state, dueTime, action) {
var dt = normalizeTime(dt);
while (dt - this.now() > 0) { }
return action(this, state);
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
}());
/**
* Gets a scheduler that schedules work as soon as possible on the current thread.
*/
var currentThreadScheduler = Scheduler.currentThread = (function () {
var queue;
function runTrampoline (q) {
var item;
while (q.length > 0) {
item = q.dequeue();
if (!item.isCancelled()) {
// Note, do not schedule blocking work!
while (item.dueTime - Scheduler.now() > 0) {
}
if (!item.isCancelled()) {
item.invoke();
}
}
}
}
function scheduleNow(state, action) {
return this.scheduleWithRelativeAndState(state, 0, action);
}
function scheduleRelative(state, dueTime, action) {
var dt = this.now() + Scheduler.normalize(dueTime),
si = new ScheduledItem(this, state, action, dt),
t;
if (!queue) {
queue = new PriorityQueue(4);
queue.enqueue(si);
try {
runTrampoline(queue);
} catch (e) {
throw e;
} finally {
queue = null;
}
} else {
queue.enqueue(si);
}
return si.disposable;
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
currentScheduler.scheduleRequired = function () { return queue === null; };
currentScheduler.ensureTrampoline = function (action) {
if (queue === null) {
return this.schedule(action);
} else {
return action();
}
};
return currentScheduler;
}());
var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
function tick(command, recurse) {
recurse(0, this._period);
try {
this._state = this._action(this._state);
} catch (e) {
this._cancel.dispose();
throw e;
}
}
function SchedulePeriodicRecursive(scheduler, state, period, action) {
this._scheduler = scheduler;
this._state = state;
this._period = period;
this._action = action;
}
SchedulePeriodicRecursive.prototype.start = function () {
var d = new SingleAssignmentDisposable();
this._cancel = d;
d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
return d;
};
return SchedulePeriodicRecursive;
}());
var scheduleMethod, clearMethod = noop;
(function () {
var reNative = RegExp('^' +
String(toString)
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
.replace(/toString| for [^\]]+/g, '.*?') + '$'
);
var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
!reNative.test(setImmediate) && setImmediate,
clearImmediate = typeof (clearImmediate = freeGlobal && moduleExports && freeGlobal.clearImmediate) == 'function' &&
!reNative.test(clearImmediate) && clearImmediate;
function postMessageSupported () {
// Ensure not in a worker
if (!root.postMessage || root.importScripts) { return false; }
var isAsync = false,
oldHandler = root.onmessage;
// Test for async
root.onmessage = function () { isAsync = true; };
root.postMessage('','*');
root.onmessage = oldHandler;
return isAsync;
}
// Use in order, nextTick, setImmediate, postMessage, MessageChannel, script readystatechanged, setTimeout
if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
scheduleMethod = process.nextTick;
} else if (typeof setImmediate === 'function') {
scheduleMethod = setImmediate;
clearMethod = clearImmediate;
} else if (postMessageSupported()) {
var MSG_PREFIX = 'ms.rx.schedule' + Math.random(),
tasks = {},
taskId = 0;
function onGlobalPostMessage(event) {
// Only if we're a match to avoid any other global events
if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
var handleId = event.data.substring(MSG_PREFIX.length),
action = tasks[handleId];
action();
delete tasks[handleId];
}
}
if (root.addEventListener) {
root.addEventListener('message', onGlobalPostMessage, false);
} else {
root.attachEvent('onmessage', onGlobalPostMessage, false);
}
scheduleMethod = function (action) {
var currentId = taskId++;
tasks[currentId] = action;
root.postMessage(MSG_PREFIX + currentId, '*');
};
} else if (!!root.MessageChannel) {
var channel = new root.MessageChannel(),
channelTasks = {},
channelTaskId = 0;
channel.port1.onmessage = function (event) {
var id = event.data,
action = channelTasks[id];
action();
delete channelTasks[id];
};
scheduleMethod = function (action) {
var id = channelTaskId++;
channelTasks[id] = action;
channel.port2.postMessage(id);
};
} else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
scheduleMethod = function (action) {
var scriptElement = root.document.createElement('script');
scriptElement.onreadystatechange = function () {
action();
scriptElement.onreadystatechange = null;
scriptElement.parentNode.removeChild(scriptElement);
scriptElement = null;
};
root.document.documentElement.appendChild(scriptElement);
};
} else {
scheduleMethod = function (action) { return setTimeout(action, 0); };
clearMethod = clearTimeout;
}
}());
/**
* Gets a scheduler that schedules work via a timed callback based upon platform.
*/
var timeoutScheduler = Scheduler.timeout = (function () {
function scheduleNow(state, action) {
var scheduler = this,
disposable = new SingleAssignmentDisposable();
var id = scheduleMethod(function () {
if (!disposable.isDisposed) {
disposable.setDisposable(action(scheduler, state));
}
});
return new CompositeDisposable(disposable, disposableCreate(function () {
clearMethod(id);
}));
}
function scheduleRelative(state, dueTime, action) {
var scheduler = this,
dt = Scheduler.normalize(dueTime);
if (dt === 0) {
return scheduler.scheduleWithState(state, action);
}
var disposable = new SingleAssignmentDisposable();
var id = setTimeout(function () {
if (!disposable.isDisposed) {
disposable.setDisposable(action(scheduler, state));
}
}, dt);
return new CompositeDisposable(disposable, disposableCreate(function () {
clearTimeout(id);
}));
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
})();
/**
* Represents a notification to an observer.
*/
var Notification = Rx.Notification = (function () {
function Notification(kind, hasValue) {
this.hasValue = hasValue == null ? false : hasValue;
this.kind = kind;
}
var NotificationPrototype = Notification.prototype;
/**
* Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
*
* @memberOf Notification
* @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
* @param {Function} onError Delegate to invoke for an OnError notification.
* @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
* @returns {Any} Result produced by the observation.
*/
NotificationPrototype.accept = function (observerOrOnNext, onError, onCompleted) {
if (arguments.length === 1 && typeof observerOrOnNext === 'object') {
return this._acceptObservable(observerOrOnNext);
}
return this._accept(observerOrOnNext, onError, onCompleted);
};
/**
* Returns an observable sequence with a single notification.
*
* @memberOf Notification
* @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
* @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
*/
NotificationPrototype.toObservable = function (scheduler) {
var notification = this;
scheduler || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
notification._acceptObservable(observer);
if (notification.kind === 'N') {
observer.onCompleted();
}
});
});
};
return Notification;
})();
/**
* Creates an object that represents an OnNext notification to an observer.
* @param {Any} value The value contained in the notification.
* @returns {Notification} The OnNext notification containing the value.
*/
var notificationCreateOnNext = Notification.createOnNext = (function () {
function _accept (onNext) {
return onNext(this.value);
}
function _acceptObservable(observer) {
return observer.onNext(this.value);
}
function toString () {
return 'OnNext(' + this.value + ')';
}
return function (value) {
var notification = new Notification('N', true);
notification.value = value;
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());
/**
* Creates an object that represents an OnError notification to an observer.
* @param {Any} error The exception contained in the notification.
* @returns {Notification} The OnError notification containing the exception.
*/
var notificationCreateOnError = Notification.createOnError = (function () {
function _accept (onNext, onError) {
return onError(this.exception);
}
function _acceptObservable(observer) {
return observer.onError(this.exception);
}
function toString () {
return 'OnError(' + this.exception + ')';
}
return function (exception) {
var notification = new Notification('E');
notification.exception = exception;
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());
/**
* Creates an object that represents an OnCompleted notification to an observer.
* @returns {Notification} The OnCompleted notification.
*/
var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
function _accept (onNext, onError, onCompleted) {
return onCompleted();
}
function _acceptObservable(observer) {
return observer.onCompleted();
}
function toString () {
return 'OnCompleted()';
}
return function () {
var notification = new Notification('C');
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());
var Enumerator = Rx.internals.Enumerator = function (next) {
this._next = next;
};
Enumerator.prototype.next = function () {
return this._next();
};
Enumerator.prototype[$iterator$] = function () { return this; }
var Enumerable = Rx.internals.Enumerable = function (iterator) {
this._iterator = iterator;
};
Enumerable.prototype[$iterator$] = function () {
return this._iterator();
};
Enumerable.prototype.concat = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var e;
try {
e = sources[$iterator$]();
} catch(err) {
observer.onError();
return;
}
var isDisposed,
subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
var currentItem;
if (isDisposed) { return; }
try {
currentItem = e.next();
} catch (ex) {
observer.onError(ex);
return;
}
if (currentItem.done) {
observer.onCompleted();
return;
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(
observer.onNext.bind(observer),
observer.onError.bind(observer),
function () { self(); })
);
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
});
};
Enumerable.prototype.catchException = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var e;
try {
e = sources[$iterator$]();
} catch(err) {
observer.onError();
return;
}
var isDisposed,
lastException,
subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
if (isDisposed) { return; }
var currentItem;
try {
currentItem = e.next();
} catch (ex) {
observer.onError(ex);
return;
}
if (currentItem.done) {
if (lastException) {
observer.onError(lastException);
} else {
observer.onCompleted();
}
return;
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(
observer.onNext.bind(observer),
function (exn) {
lastException = exn;
self();
},
observer.onCompleted.bind(observer)));
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
});
};
var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
if (repeatCount == null) { repeatCount = -1; }
return new Enumerable(function () {
var left = repeatCount;
return new Enumerator(function () {
if (left === 0) { return doneEnumerator; }
if (left > 0) { left--; }
return { done: false, value: value };
});
});
};
var enumerableFor = Enumerable.forEach = function (source, selector, thisArg) {
selector || (selector = identity);
return new Enumerable(function () {
var index = -1;
return new Enumerator(
function () {
return ++index < source.length ?
{ done: false, value: selector.call(thisArg, source[index], index, source) } :
doneEnumerator;
});
});
};
/**
* Supports push-style iteration over an observable sequence.
*/
var Observer = Rx.Observer = function () { };
/**
* Creates a notification callback from an observer.
*
* @param observer Observer object.
* @returns The action that forwards its input notification to the underlying observer.
*/
Observer.prototype.toNotifier = function () {
var observer = this;
return function (n) {
return n.accept(observer);
};
};
/**
* Hides the identity of an observer.
* @returns An observer that hides the identity of the specified observer.
*/
Observer.prototype.asObserver = function () {
return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this));
};
/**
* Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
*
* @static
* @memberOf Observer
* @param {Function} [onNext] Observer's OnNext action implementation.
* @param {Function} [onError] Observer's OnError action implementation.
* @param {Function} [onCompleted] Observer's OnCompleted action implementation.
* @returns {Observer} The observer object implemented using the given actions.
*/
var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
onNext || (onNext = noop);
onError || (onError = defaultError);
onCompleted || (onCompleted = noop);
return new AnonymousObserver(onNext, onError, onCompleted);
};
/**
* Creates an observer from a notification callback.
*
* @static
* @memberOf Observer
* @param {Function} handler Action that handles a notification.
* @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
*/
Observer.fromNotifier = function (handler) {
return new AnonymousObserver(function (x) {
return handler(notificationCreateOnNext(x));
}, function (exception) {
return handler(notificationCreateOnError(exception));
}, function () {
return handler(notificationCreateOnCompleted());
});
};
/**
* Abstract base class for implementations of the Observer class.
* This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
*/
var AbstractObserver = Rx.internals.AbstractObserver = (function (_super) {
inherits(AbstractObserver, _super);
/**
* Creates a new observer in a non-stopped state.
*
* @constructor
*/
function AbstractObserver() {
this.isStopped = false;
_super.call(this);
}
/**
* Notifies the observer of a new element in the sequence.
*
* @memberOf AbstractObserver
* @param {Any} value Next element in the sequence.
*/
AbstractObserver.prototype.onNext = function (value) {
if (!this.isStopped) {
this.next(value);
}
};
/**
* Notifies the observer that an exception has occurred.
*
* @memberOf AbstractObserver
* @param {Any} error The error that has occurred.
*/
AbstractObserver.prototype.onError = function (error) {
if (!this.isStopped) {
this.isStopped = true;
this.error(error);
}
};
/**
* Notifies the observer of the end of the sequence.
*/
AbstractObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.completed();
}
};
/**
* Disposes the observer, causing it to transition to the stopped state.
*/
AbstractObserver.prototype.dispose = function () {
this.isStopped = true;
};
AbstractObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.error(e);
return true;
}
return false;
};
return AbstractObserver;
}(Observer));
/**
* Class to create an Observer instance from delegate-based implementations of the on* methods.
*/
var AnonymousObserver = Rx.AnonymousObserver = (function (_super) {
inherits(AnonymousObserver, _super);
/**
* Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
* @param {Any} onNext Observer's OnNext action implementation.
* @param {Any} onError Observer's OnError action implementation.
* @param {Any} onCompleted Observer's OnCompleted action implementation.
*/
function AnonymousObserver(onNext, onError, onCompleted) {
_super.call(this);
this._onNext = onNext;
this._onError = onError;
this._onCompleted = onCompleted;
}
/**
* Calls the onNext action.
* @param {Any} value Next element in the sequence.
*/
AnonymousObserver.prototype.next = function (value) {
this._onNext(value);
};
/**
* Calls the onError action.
* @param {Any} error The error that has occurred.
*/
AnonymousObserver.prototype.error = function (exception) {
this._onError(exception);
};
/**
* Calls the onCompleted action.
*/
AnonymousObserver.prototype.completed = function () {
this._onCompleted();
};
return AnonymousObserver;
}(AbstractObserver));
var observableProto;
/**
* Represents a push-style collection.
*/
var Observable = Rx.Observable = (function () {
function Observable(subscribe) {
this._subscribe = subscribe;
}
observableProto = Observable.prototype;
/**
* Subscribes an observer to the observable sequence.
*
* @example
* 1 - source.subscribe();
* 2 - source.subscribe(observer);
* 3 - source.subscribe(function (x) { console.log(x); });
* 4 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); });
* 5 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }, function () { console.log('done'); });
* @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
* @returns {Diposable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
*/
observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
var subscriber = typeof observerOrOnNext === 'object' ?
observerOrOnNext :
observerCreate(observerOrOnNext, onError, onCompleted);
return this._subscribe(subscriber);
};
return Observable;
})();
var ScheduledObserver = Rx.internals.ScheduledObserver = (function (_super) {
inherits(ScheduledObserver, _super);
function ScheduledObserver(scheduler, observer) {
_super.call(this);
this.scheduler = scheduler;
this.observer = observer;
this.isAcquired = false;
this.hasFaulted = false;
this.queue = [];
this.disposable = new SerialDisposable();
}
ScheduledObserver.prototype.next = function (value) {
var self = this;
this.queue.push(function () {
self.observer.onNext(value);
});
};
ScheduledObserver.prototype.error = function (exception) {
var self = this;
this.queue.push(function () {
self.observer.onError(exception);
});
};
ScheduledObserver.prototype.completed = function () {
var self = this;
this.queue.push(function () {
self.observer.onCompleted();
});
};
ScheduledObserver.prototype.ensureActive = function () {
var isOwner = false, parent = this;
if (!this.hasFaulted && this.queue.length > 0) {
isOwner = !this.isAcquired;
this.isAcquired = true;
}
if (isOwner) {
this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
var work;
if (parent.queue.length > 0) {
work = parent.queue.shift();
} else {
parent.isAcquired = false;
return;
}
try {
work();
} catch (ex) {
parent.queue = [];
parent.hasFaulted = true;
throw ex;
}
self();
}));
}
};
ScheduledObserver.prototype.dispose = function () {
_super.prototype.dispose.call(this);
this.disposable.dispose();
};
return ScheduledObserver;
}(AbstractObserver));
/**
* Creates a list from an observable sequence.
* @returns An observable sequence containing a single element with a list containing all the elements of the source sequence.
*/
observableProto.toArray = function () {
var self = this;
return new AnonymousObservable(function(observer) {
var arr = [];
return self.subscribe(
arr.push.bind(arr),
observer.onError.bind(observer),
function () {
observer.onNext(arr);
observer.onCompleted();
});
});
};
/**
* Creates an observable sequence from a specified subscribe method implementation.
*
* @example
* var res = Rx.Observable.create(function (observer) { return function () { } );
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
* var res = Rx.Observable.create(function (observer) { } );
*
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
*/
Observable.create = Observable.createWithDisposable = function (subscribe) {
return new AnonymousObservable(subscribe);
};
/**
* Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
*
* @example
* var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
* @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
* @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
*/
var observableDefer = Observable.defer = function (observableFactory) {
return new AnonymousObservable(function (observer) {
var result;
try {
result = observableFactory();
} catch (e) {
return observableThrow(e).subscribe(observer);
}
isPromise(result) && (result = observableFromPromise(result));
return result.subscribe(observer);
});
};
/**
* Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
*
* @example
* var res = Rx.Observable.empty();
* var res = Rx.Observable.empty(Rx.Scheduler.timeout);
* @param {Scheduler} [scheduler] Scheduler to send the termination call on.
* @returns {Observable} An observable sequence with no elements.
*/
var observableEmpty = Observable.empty = function (scheduler) {
scheduler || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onCompleted();
});
});
};
/**
* Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
*
* @example
* var res = Rx.Observable.fromArray([1,2,3]);
* var res = Rx.Observable.fromArray([1,2,3], Rx.Scheduler.timeout);
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
* @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
*/
var observableFromArray = Observable.fromArray = function (array, scheduler) {
scheduler || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (observer) {
var count = 0, len = array.length;
return scheduler.scheduleRecursive(function (self) {
if (count < len) {
observer.onNext(array[count++]);
self();
} else {
observer.onCompleted();
}
});
});
};
/**
* Converts an iterable into an Observable sequence
*
* @example
* var res = Rx.Observable.fromIterable(new Map());
* var res = Rx.Observable.fromIterable(new Set(), Rx.Scheduler.timeout);
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
* @returns {Observable} The observable sequence whose elements are pulled from the given generator sequence.
*/
Observable.fromIterable = function (iterable, scheduler) {
scheduler || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (observer) {
var iterator;
try {
iterator = iterable[$iterator$]();
} catch (e) {
observer.onError(e);
return;
}
return scheduler.scheduleRecursive(function (self) {
var next;
try {
next = iterator.next();
} catch (err) {
observer.onError(err);
return;
}
if (next.done) {
observer.onCompleted();
} else {
observer.onNext(next.value);
self();
}
});
});
};
/**
* Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
* @param {Mixed} initialState Initial state.
* @param {Function} condition Condition to terminate generation (upon returning false).
* @param {Function} iterate Iteration step function.
* @param {Function} resultSelector Selector function for results produced in the sequence.
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
* @returns {Observable} The generated sequence.
*/
Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
scheduler || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (observer) {
var first = true, state = initialState;
return scheduler.scheduleRecursive(function (self) {
var hasResult, result;
try {
if (first) {
first = false;
} else {
state = iterate(state);
}
hasResult = condition(state);
if (hasResult) {
result = resultSelector(state);
}
} catch (exception) {
observer.onError(exception);
return;
}
if (hasResult) {
observer.onNext(result);
self();
} else {
observer.onCompleted();
}
});
});
};
/**
* Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
* @returns {Observable} An observable sequence whose observers will never get called.
*/
var observableNever = Observable.never = function () {
return new AnonymousObservable(function () {
return disposableEmpty;
});
};
/**
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
* @example
* var res = Rx.Observable.of(1,2,3);
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
*/
Observable.of = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return observableFromArray(args);
};
/**
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
* @example
* var res = Rx.Observable.of(1,2,3);
* @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
*/
var observableOf = Observable.ofWithScheduler = function (scheduler) {
var len = arguments.length - 1, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i + 1]; }
return observableFromArray(args, scheduler);
};
/**
* Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.range(0, 10);
* var res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout);
* @param {Number} start The value of the first integer in the sequence.
* @param {Number} count The number of sequential integers to generate.
* @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
* @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
*/
Observable.range = function (start, count, scheduler) {
scheduler || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.scheduleRecursiveWithState(0, function (i, self) {
if (i < count) {
observer.onNext(start + i);
self(i + 1);
} else {
observer.onCompleted();
}
});
});
};
/**
* Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.repeat(42);
* var res = Rx.Observable.repeat(42, 4);
* 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout);
* 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout);
* @param {Mixed} value Element to repeat.
* @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
* @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence that repeats the given element the specified number of times.
*/
Observable.repeat = function (value, repeatCount, scheduler) {
scheduler || (scheduler = currentThreadScheduler);
if (repeatCount == null) {
repeatCount = -1;
}
return observableReturn(value, scheduler).repeat(repeatCount);
};
/**
* Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
* There is an alias called 'just', and 'returnValue' for browsers <IE9.
*
* @example
* var res = Rx.Observable.return(42);
* var res = Rx.Observable.return(42, Rx.Scheduler.timeout);
* @param {Mixed} value Single element in the resulting observable sequence.
* @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence containing the single specified element.
*/
var observableReturn = Observable['return'] = Observable.returnValue = Observable.just = function (value, scheduler) {
scheduler || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onNext(value);
observer.onCompleted();
});
});
};
/**
* Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
* There is an alias to this method called 'throwException' for browsers <IE9.
*
* @example
* var res = Rx.Observable.throwException(new Error('Error'));
* var res = Rx.Observable.throwException(new Error('Error'), Rx.Scheduler.timeout);
* @param {Mixed} exception An object used for the sequence's termination.
* @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
*/
var observableThrow = Observable['throw'] = Observable.throwException = function (exception, scheduler) {
scheduler || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onError(exception);
});
});
};
function observableCatchHandler(source, handler) {
return new AnonymousObservable(function (observer) {
var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
subscription.setDisposable(d1);
d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) {
var d, result;
try {
result = handler(exception);
} catch (ex) {
observer.onError(ex);
return;
}
isPromise(result) && (result = observableFromPromise(result));
d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(result.subscribe(observer));
}, observer.onCompleted.bind(observer)));
return subscription;
});
}
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
* @example
* 1 - xs.catchException(ys)
* 2 - xs.catchException(function (ex) { return ys(ex); })
* @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
* @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
*/
observableProto['catch'] = observableProto.catchException = function (handlerOrSecond) {
return typeof handlerOrSecond === 'function' ?
observableCatchHandler(this, handlerOrSecond) :
observableCatch([this, handlerOrSecond]);
};
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
*
* @example
* 1 - res = Rx.Observable.catchException(xs, ys, zs);
* 2 - res = Rx.Observable.catchException([xs, ys, zs]);
* @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
*/
var observableCatch = Observable.catchException = Observable['catch'] = function () {
var items = argsOrArray(arguments, 0);
return enumerableFor(items).catchException();
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
* This can be in the form of an argument list of observables or an array.
*
* @example
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.combineLatest = function () {
var args = slice.call(arguments);
if (Array.isArray(args[0])) {
args[0].unshift(this);
} else {
args.unshift(this);
}
return combineLatest.apply(this, args);
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
*
* @example
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
var combineLatest = Observable.combineLatest = function () {
var args = slice.call(arguments), resultSelector = args.pop();
if (Array.isArray(args[0])) {
args = args[0];
}
return new AnonymousObservable(function (observer) {
var falseFactory = function () { return false; },
n = args.length,
hasValue = arrayInitialize(n, falseFactory),
hasValueAll = false,
isDone = arrayInitialize(n, falseFactory),
values = new Array(n);
function next(i) {
var res;
hasValue[i] = true;
if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
try {
res = resultSelector.apply(null, values);
} catch (ex) {
observer.onError(ex);
return;
}
observer.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
observer.onCompleted();
}
}
function done (i) {
isDone[i] = true;
if (isDone.every(identity)) {
observer.onCompleted();
}
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var source = args[i], sad = new SingleAssignmentDisposable();
isPromise(source) && (source = observableFromPromise(source));
sad.setDisposable(source.subscribe(function (x) {
values[i] = x;
next(i);
}, observer.onError.bind(observer), function () {
done(i);
}));
subscriptions[i] = sad;
}(idx));
}
return new CompositeDisposable(subscriptions);
});
};
/**
* Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
*
* @example
* 1 - concatenated = xs.concat(ys, zs);
* 2 - concatenated = xs.concat([ys, zs]);
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
observableProto.concat = function () {
var items = slice.call(arguments, 0);
items.unshift(this);
return observableConcat.apply(this, items);
};
/**
* Concatenates all the observable sequences.
*
* @example
* 1 - res = Rx.Observable.concat(xs, ys, zs);
* 2 - res = Rx.Observable.concat([xs, ys, zs]);
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
var observableConcat = Observable.concat = function () {
var sources = argsOrArray(arguments, 0);
return enumerableFor(sources).concat();
};
/**
* Concatenates an observable sequence of observable sequences.
* @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
*/
observableProto.concatObservable = observableProto.concatAll =function () {
return this.merge(1);
};
/**
* Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
* Or merges two observable sequences into a single observable sequence.
*
* @example
* 1 - merged = sources.merge(1);
* 2 - merged = source.merge(otherSource);
* @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.merge = function (maxConcurrentOrOther) {
if (typeof maxConcurrentOrOther !== 'number') {
return observableMerge(this, maxConcurrentOrOther);
}
var sources = this;
return new AnonymousObservable(function (observer) {
var activeCount = 0,
group = new CompositeDisposable(),
isStopped = false,
q = [],
subscribe = function (xs) {
var subscription = new SingleAssignmentDisposable();
group.add(subscription);
// Check for promises support
if (isPromise(xs)) { xs = observableFromPromise(xs); }
subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () {
var s;
group.remove(subscription);
if (q.length > 0) {
s = q.shift();
subscribe(s);
} else {
activeCount--;
if (isStopped && activeCount === 0) {
observer.onCompleted();
}
}
}));
};
group.add(sources.subscribe(function (innerSource) {
if (activeCount < maxConcurrentOrOther) {
activeCount++;
subscribe(innerSource);
} else {
q.push(innerSource);
}
}, observer.onError.bind(observer), function () {
isStopped = true;
if (activeCount === 0) {
observer.onCompleted();
}
}));
return group;
});
};
/**
* Merges all the observable sequences into a single observable sequence.
* The scheduler is optional and if not specified, the immediate scheduler is used.
*
* @example
* 1 - merged = Rx.Observable.merge(xs, ys, zs);
* 2 - merged = Rx.Observable.merge([xs, ys, zs]);
* 3 - merged = Rx.Observable.merge(scheduler, xs, ys, zs);
* 4 - merged = Rx.Observable.merge(scheduler, [xs, ys, zs]);
* @returns {Observable} The observable sequence that merges the elements of the observable sequences.
*/
var observableMerge = Observable.merge = function () {
var scheduler, sources;
if (!arguments[0]) {
scheduler = immediateScheduler;
sources = slice.call(arguments, 1);
} else if (arguments[0].now) {
scheduler = arguments[0];
sources = slice.call(arguments, 1);
} else {
scheduler = immediateScheduler;
sources = slice.call(arguments, 0);
}
if (Array.isArray(sources[0])) {
sources = sources[0];
}
return observableFromArray(sources, scheduler).mergeObservable();
};
/**
* Merges an observable sequence of observable sequences into an observable sequence.
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.mergeObservable = observableProto.mergeAll =function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var group = new CompositeDisposable(),
isStopped = false,
m = new SingleAssignmentDisposable();
group.add(m);
m.setDisposable(sources.subscribe(function (innerSource) {
var innerSubscription = new SingleAssignmentDisposable();
group.add(innerSubscription);
// Check if Promise or Observable
if (isPromise(innerSource)) {
innerSource = observableFromPromise(innerSource);
}
innerSubscription.setDisposable(innerSource.subscribe(function (x) {
observer.onNext(x);
}, observer.onError.bind(observer), function () {
group.remove(innerSubscription);
if (isStopped && group.length === 1) { observer.onCompleted(); }
}));
}, observer.onError.bind(observer), function () {
isStopped = true;
if (group.length === 1) { observer.onCompleted(); }
}));
return group;
});
};
/**
* Returns the values from the source observable sequence only after the other observable sequence produces a value.
* @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
*/
observableProto.skipUntil = function (other) {
var source = this;
return new AnonymousObservable(function (observer) {
var isOpen = false;
var disposables = new CompositeDisposable(source.subscribe(function (left) {
isOpen && observer.onNext(left);
}, observer.onError.bind(observer), function () {
isOpen && observer.onCompleted();
}));
isPromise(other) && (other = observableFromPromise(other));
var rightSubscription = new SingleAssignmentDisposable();
disposables.add(rightSubscription);
rightSubscription.setDisposable(other.subscribe(function () {
isOpen = true;
rightSubscription.dispose();
}, observer.onError.bind(observer), function () {
rightSubscription.dispose();
}));
return disposables;
});
};
/**
* Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
* @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto['switch'] = observableProto.switchLatest = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var hasLatest = false,
innerSubscription = new SerialDisposable(),
isStopped = false,
latest = 0,
subscription = sources.subscribe(function (innerSource) {
var d = new SingleAssignmentDisposable(), id = ++latest;
hasLatest = true;
innerSubscription.setDisposable(d);
// Check if Promise or Observable
if (isPromise(innerSource)) {
innerSource = observableFromPromise(innerSource);
}
d.setDisposable(innerSource.subscribe(function (x) {
if (latest === id) {
observer.onNext(x);
}
}, function (e) {
if (latest === id) {
observer.onError(e);
}
}, function () {
if (latest === id) {
hasLatest = false;
if (isStopped) {
observer.onCompleted();
}
}
}));
}, observer.onError.bind(observer), function () {
isStopped = true;
if (!hasLatest) {
observer.onCompleted();
}
});
return new CompositeDisposable(subscription, innerSubscription);
});
};
/**
* Returns the values from the source observable sequence until the other observable sequence produces a value.
* @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
*/
observableProto.takeUntil = function (other) {
var source = this;
return new AnonymousObservable(function (observer) {
isPromise(other) && (other = observableFromPromise(other));
return new CompositeDisposable(
source.subscribe(observer),
other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop)
);
});
};
function zipArray(second, resultSelector) {
var first = this;
return new AnonymousObservable(function (observer) {
var index = 0, len = second.length;
return first.subscribe(function (left) {
if (index < len) {
var right = second[index++], result;
try {
result = resultSelector(left, right);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
} else {
observer.onCompleted();
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
}
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
* The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources.
*
* @example
* 1 - res = obs1.zip(obs2, fn);
* 1 - res = x1.zip([1,2,3], fn);
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.zip = function () {
if (Array.isArray(arguments[0])) {
return zipArray.apply(this, arguments);
}
var parent = this, sources = slice.call(arguments), resultSelector = sources.pop();
sources.unshift(parent);
return new AnonymousObservable(function (observer) {
var n = sources.length,
queues = arrayInitialize(n, function () { return []; }),
isDone = arrayInitialize(n, function () { return false; });
function next(i) {
var res, queuedValues;
if (queues.every(function (x) { return x.length > 0; })) {
try {
queuedValues = queues.map(function (x) { return x.shift(); });
res = resultSelector.apply(parent, queuedValues);
} catch (ex) {
observer.onError(ex);
return;
}
observer.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
observer.onCompleted();
}
};
function done(i) {
isDone[i] = true;
if (isDone.every(function (x) { return x; })) {
observer.onCompleted();
}
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var source = sources[i], sad = new SingleAssignmentDisposable();
isPromise(source) && (source = observableFromPromise(source));
sad.setDisposable(source.subscribe(function (x) {
queues[i].push(x);
next(i);
}, observer.onError.bind(observer), function () {
done(i);
}));
subscriptions[i] = sad;
})(idx);
}
return new CompositeDisposable(subscriptions);
});
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
* @param arguments Observable sources.
* @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
Observable.zip = function () {
var args = slice.call(arguments, 0),
first = args.shift();
return first.zip.apply(first, args);
};
/**
* Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
* @param arguments Observable sources.
* @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
*/
Observable.zipArray = function () {
var sources = argsOrArray(arguments, 0);
return new AnonymousObservable(function (observer) {
var n = sources.length,
queues = arrayInitialize(n, function () { return []; }),
isDone = arrayInitialize(n, function () { return false; });
function next(i) {
if (queues.every(function (x) { return x.length > 0; })) {
var res = queues.map(function (x) { return x.shift(); });
observer.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
observer.onCompleted();
return;
}
};
function done(i) {
isDone[i] = true;
if (isDone.every(identity)) {
observer.onCompleted();
return;
}
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
subscriptions[i] = new SingleAssignmentDisposable();
subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
queues[i].push(x);
next(i);
}, observer.onError.bind(observer), function () {
done(i);
}));
})(idx);
}
var compositeDisposable = new CompositeDisposable(subscriptions);
compositeDisposable.add(disposableCreate(function () {
for (var qIdx = 0, qLen = queues.length; qIdx < qLen; qIdx++) {
queues[qIdx] = [];
}
}));
return compositeDisposable;
});
};
/**
* Hides the identity of an observable sequence.
* @returns {Observable} An observable sequence that hides the identity of the source sequence.
*/
observableProto.asObservable = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(observer);
});
};
/**
* Dematerializes the explicit notification values of an observable sequence as implicit notifications.
* @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
*/
observableProto.dematerialize = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(function (x) {
return x.accept(observer);
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
*
* var obs = observable.distinctUntilChanged();
* var obs = observable.distinctUntilChanged(function (x) { return x.id; });
* var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
*
* @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
* @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
* @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
*/
observableProto.distinctUntilChanged = function (keySelector, comparer) {
var source = this;
keySelector || (keySelector = identity);
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (observer) {
var hasCurrentKey = false, currentKey;
return source.subscribe(function (value) {
var comparerEquals = false, key;
try {
key = keySelector(value);
} catch (exception) {
observer.onError(exception);
return;
}
if (hasCurrentKey) {
try {
comparerEquals = comparer(currentKey, key);
} catch (exception) {
observer.onError(exception);
return;
}
}
if (!hasCurrentKey || !comparerEquals) {
hasCurrentKey = true;
currentKey = key;
observer.onNext(value);
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
*
* @example
* var res = observable.doAction(observer);
* var res = observable.doAction(onNext);
* var res = observable.doAction(onNext, onError);
* var res = observable.doAction(onNext, onError, onCompleted);
* @param {Mixed} observerOrOnNext Action to invoke for each element in the observable sequence or an observer.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto['do'] = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
var source = this, onNextFunc;
if (typeof observerOrOnNext === 'function') {
onNextFunc = observerOrOnNext;
} else {
onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext);
onError = observerOrOnNext.onError.bind(observerOrOnNext);
onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext);
}
return new AnonymousObservable(function (observer) {
return source.subscribe(function (x) {
try {
onNextFunc(x);
} catch (e) {
observer.onError(e);
}
observer.onNext(x);
}, function (exception) {
if (!onError) {
observer.onError(exception);
} else {
try {
onError(exception);
} catch (e) {
observer.onError(e);
}
observer.onError(exception);
}
}, function () {
if (!onCompleted) {
observer.onCompleted();
} else {
try {
onCompleted();
} catch (e) {
observer.onError(e);
}
observer.onCompleted();
}
});
});
};
/**
* Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
*
* @example
* var res = observable.finallyAction(function () { console.log('sequence ended'; });
* @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
* @returns {Observable} Source sequence with the action-invoking termination behavior applied.
*/
observableProto['finally'] = observableProto.finallyAction = function (action) {
var source = this;
return new AnonymousObservable(function (observer) {
var subscription;
try {
subscription = source.subscribe(observer);
} catch (e) {
action();
throw e;
}
return disposableCreate(function () {
try {
subscription.dispose();
} catch (e) {
throw e;
} finally {
action();
}
});
});
};
/**
* Ignores all elements in an observable sequence leaving only the termination messages.
* @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
*/
observableProto.ignoreElements = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Materializes the implicit notifications of an observable sequence as explicit notification values.
* @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
*/
observableProto.materialize = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(function (value) {
observer.onNext(notificationCreateOnNext(value));
}, function (e) {
observer.onNext(notificationCreateOnError(e));
observer.onCompleted();
}, function () {
observer.onNext(notificationCreateOnCompleted());
observer.onCompleted();
});
});
};
/**
* Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
*
* @example
* var res = repeated = source.repeat();
* var res = repeated = source.repeat(42);
* @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
* @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
*/
observableProto.repeat = function (repeatCount) {
return enumerableRepeat(this, repeatCount).concat();
};
/**
* Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
*
* @example
* var res = retried = retry.repeat();
* var res = retried = retry.repeat(42);
* @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
* @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
*/
observableProto.retry = function (retryCount) {
return enumerableRepeat(this, retryCount).catchException();
};
/**
* Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
* For aggregation behavior with no intermediate results, see Observable.aggregate.
* @example
* var res = source.scan(function (acc, x) { return acc + x; });
* var res = source.scan(0, function (acc, x) { return acc + x; });
* @param {Mixed} [seed] The initial accumulator value.
* @param {Function} accumulator An accumulator function to be invoked on each element.
* @returns {Observable} An observable sequence containing the accumulated values.
*/
observableProto.scan = function () {
var hasSeed = false, seed, accumulator, source = this;
if (arguments.length === 2) {
hasSeed = true;
seed = arguments[0];
accumulator = arguments[1];
} else {
accumulator = arguments[0];
}
return new AnonymousObservable(function (observer) {
var hasAccumulation, accumulation, hasValue;
return source.subscribe (
function (x) {
try {
if (!hasValue) {
hasValue = true;
}
if (hasAccumulation) {
accumulation = accumulator(accumulation, x);
} else {
accumulation = hasSeed ? accumulator(seed, x) : x;
hasAccumulation = true;
}
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(accumulation);
},
observer.onError.bind(observer),
function () {
if (!hasValue && hasSeed) {
observer.onNext(seed);
}
observer.onCompleted();
}
);
});
};
/**
* Bypasses a specified number of elements at the end of an observable sequence.
* @description
* This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
* received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
* @param count Number of elements to bypass at the end of the source sequence.
* @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
*/
observableProto.skipLast = function (count) {
var source = this;
return new AnonymousObservable(function (observer) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
if (q.length > count) {
observer.onNext(q.shift());
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
*
* var res = source.startWith(1, 2, 3);
* var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
*
* @memberOf Observable#
* @returns {Observable} The source sequence prepended with the specified values.
*/
observableProto.startWith = function () {
var values, scheduler, start = 0;
if (!!arguments.length && 'now' in Object(arguments[0])) {
scheduler = arguments[0];
start = 1;
} else {
scheduler = immediateScheduler;
}
values = slice.call(arguments, start);
return enumerableFor([observableFromArray(values, scheduler), this]).concat();
};
/**
* Returns a specified number of contiguous elements from the end of an observable sequence, using an optional scheduler to drain the queue.
*
* @example
* var res = source.takeLast(5);
* var res = source.takeLast(5, Rx.Scheduler.timeout);
*
* @description
* This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
* the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
* @param {Number} count Number of elements to take from the end of the source sequence.
* @param {Scheduler} [scheduler] Scheduler used to drain the queue upon completion of the source sequence.
* @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
*/
observableProto.takeLast = function (count, scheduler) {
return this.takeLastBuffer(count).selectMany(function (xs) { return observableFromArray(xs, scheduler); });
};
/**
* Returns an array with the specified number of contiguous elements from the end of an observable sequence.
*
* @description
* This operator accumulates a buffer with a length enough to store count elements. Upon completion of the
* source sequence, this buffer is produced on the result sequence.
* @param {Number} count Number of elements to take from the end of the source sequence.
* @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence.
*/
observableProto.takeLastBuffer = function (count) {
var source = this;
return new AnonymousObservable(function (observer) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
if (q.length > count) {
q.shift();
}
}, observer.onError.bind(observer), function () {
observer.onNext(q);
observer.onCompleted();
});
});
};
function concatMap(selector) {
return this.map(function (x, i) {
var result = selector(x, i);
return isPromise(result) ? observableFromPromise(result) : result;
}).concatAll();
}
function concatMapObserver(onNext, onError, onCompleted) {
var source = this;
return new AnonymousObservable(function (observer) {
var index = 0;
return source.subscribe(
function (x) {
observer.onNext(onNext(x, index++));
},
function (err) {
observer.onNext(onError(err));
observer.completed();
},
function () {
observer.onNext(onCompleted());
observer.onCompleted();
});
}).concatAll();
}
/**
* One of the Following:
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
*
* @example
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
* Or:
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
*
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
* Or:
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
*
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
* source sequence onto which could be either an observable or Promise.
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector) {
if (resultSelector) {
return this.concatMap(function (x, i) {
var selectorResult = selector(x, i),
result = isPromise(selectorResult) ? observableFromPromise(selectorResult) : selectorResult;
return result.map(function (y) {
return resultSelector(x, y, i);
});
});
}
if (typeof selector === 'function') {
return concatMap.call(this, selector);
}
return concatMap.call(this, function () {
return selector;
});
};
/**
* Projects each element of an observable sequence into a new form by incorporating the element's index.
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
*/
observableProto.select = observableProto.map = function (selector, thisArg) {
var parent = this;
return new AnonymousObservable(function (observer) {
var count = 0;
return parent.subscribe(function (value) {
var result;
try {
result = selector.call(thisArg, value, count++, parent);
} catch (exception) {
observer.onError(exception);
return;
}
observer.onNext(result);
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Retrieves the value of a specified property from all elements in the Observable sequence.
* @param {String} property The property to pluck.
* @returns {Observable} Returns a new Observable sequence of property values.
*/
observableProto.pluck = function (property) {
return this.select(function (x) { return x[property]; });
};
function selectMany(selector) {
return this.select(function (x, i) {
var result = selector(x, i);
return isPromise(result) ? observableFromPromise(result) : result;
}).mergeObservable();
}
function selectManyObserver(onNext, onError, onCompleted) {
var source = this;
return new AnonymousObservable(function (observer) {
var index = 0;
return source.subscribe(
function (x) {
observer.onNext(onNext(x, index++));
},
function (err) {
observer.onNext(onError(err));
observer.completed();
},
function () {
observer.onNext(onCompleted());
observer.onCompleted();
});
}).mergeAll();
}
/**
* One of the Following:
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
*
* @example
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
* Or:
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
*
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
* Or:
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
*
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
* source sequence onto which could be either an observable or Promise.
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector) {
if (resultSelector) {
return this.selectMany(function (x, i) {
var selectorResult = selector(x, i),
result = isPromise(selectorResult) ? observableFromPromise(selectorResult) : selectorResult;
return result.select(function (y) {
return resultSelector(x, y, i);
});
});
}
if (typeof selector === 'function') {
return selectMany.call(this, selector);
}
return selectMany.call(this, function () {
return selector;
});
};
/**
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) {
return this.select(selector, thisArg).switchLatest();
};
/**
* Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
* @param {Number} count The number of elements to skip before returning the remaining elements.
* @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
*/
observableProto.skip = function (count) {
if (count < 0) {
throw new Error(argumentOutOfRange);
}
var observable = this;
return new AnonymousObservable(function (observer) {
var remaining = count;
return observable.subscribe(function (x) {
if (remaining <= 0) {
observer.onNext(x);
} else {
remaining--;
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
* The element's index is used in the logic of the predicate function.
*
* var res = source.skipWhile(function (value) { return value < 10; });
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
*/
observableProto.skipWhile = function (predicate, thisArg) {
var source = this;
return new AnonymousObservable(function (observer) {
var i = 0, running = false;
return source.subscribe(function (x) {
if (!running) {
try {
running = !predicate.call(thisArg, x, i++, source);
} catch (e) {
observer.onError(e);
return;
}
}
if (running) {
observer.onNext(x);
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
*
* var res = source.take(5);
* var res = source.take(0, Rx.Scheduler.timeout);
* @param {Number} count The number of elements to return.
* @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
* @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
*/
observableProto.take = function (count, scheduler) {
if (count < 0) {
throw new Error(argumentOutOfRange);
}
if (count === 0) {
return observableEmpty(scheduler);
}
var observable = this;
return new AnonymousObservable(function (observer) {
var remaining = count;
return observable.subscribe(function (x) {
if (remaining > 0) {
remaining--;
observer.onNext(x);
if (remaining === 0) {
observer.onCompleted();
}
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Returns elements from an observable sequence as long as a specified condition is true.
* The element's index is used in the logic of the predicate function.
*
* @example
* var res = source.takeWhile(function (value) { return value < 10; });
* var res = source.takeWhile(function (value, index) { return value < 10 || index < 10; });
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
*/
observableProto.takeWhile = function (predicate, thisArg) {
var observable = this;
return new AnonymousObservable(function (observer) {
var i = 0, running = true;
return observable.subscribe(function (x) {
if (running) {
try {
running = predicate.call(thisArg, x, i++, observable);
} catch (e) {
observer.onError(e);
return;
}
if (running) {
observer.onNext(x);
} else {
observer.onCompleted();
}
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
*
* @example
* var res = source.where(function (value) { return value < 10; });
* var res = source.where(function (value, index) { return value < 10 || index < 10; });
* @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
*/
observableProto.where = observableProto.filter = function (predicate, thisArg) {
var parent = this;
return new AnonymousObservable(function (observer) {
var count = 0;
return parent.subscribe(function (value) {
var shouldRun;
try {
shouldRun = predicate.call(thisArg, value, count++, parent);
} catch (exception) {
observer.onError(exception);
return;
}
if (shouldRun) {
observer.onNext(value);
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Converts a callback function to an observable sequence.
*
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
*/
Observable.fromCallback = function (func, scheduler, context, selector) {
scheduler || (scheduler = immediateScheduler);
return function () {
var args = slice.call(arguments, 0);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
function handler(e) {
var results = e;
if (selector) {
try {
results = selector(arguments);
} catch (err) {
observer.onError(err);
return;
}
} else {
if (results.length === 1) {
results = results[0];
}
}
observer.onNext(results);
observer.onCompleted();
}
args.push(handler);
func.apply(context, args);
});
});
};
};
/**
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
* @param {Function} func The function to call
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
*/
Observable.fromNodeCallback = function (func, scheduler, context, selector) {
scheduler || (scheduler = immediateScheduler);
return function () {
var args = slice.call(arguments, 0);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
function handler(err) {
if (err) {
observer.onError(err);
return;
}
var results = slice.call(arguments, 1);
if (selector) {
try {
results = selector(results);
} catch (e) {
observer.onError(e);
return;
}
} else {
if (results.length === 1) {
results = results[0];
}
}
observer.onNext(results);
observer.onCompleted();
}
args.push(handler);
func.apply(context, args);
});
});
};
};
function createListener (element, name, handler) {
// Node.js specific
if (element.addListener) {
element.addListener(name, handler);
return disposableCreate(function () {
element.removeListener(name, handler);
});
}
if (element.addEventListener) {
element.addEventListener(name, handler, false);
return disposableCreate(function () {
element.removeEventListener(name, handler, false);
});
}
throw new Error('No listener found');
}
function createEventListener (el, eventName, handler) {
var disposables = new CompositeDisposable();
// Asume NodeList
if (typeof el.item === 'function' && typeof el.length === 'number') {
for (var i = 0, len = el.length; i < len; i++) {
disposables.add(createEventListener(el.item(i), eventName, handler));
}
} else if (el) {
disposables.add(createListener(el, eventName, handler));
}
return disposables;
}
// Check for Angular/jQuery/Zepto support
var jq =
!!root.angular && !!angular.element ? angular.element :
(!!root.jQuery ? root.jQuery : (
!!root.Zepto ? root.Zepto : null));
// Check for ember
var ember = !!root.Ember && typeof root.Ember.addListener === 'function';
/**
* Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
*
* @example
* var source = Rx.Observable.fromEvent(element, 'mouseup');
*
* @param {Object} element The DOMElement or NodeList to attach a listener.
* @param {String} eventName The event name to attach the observable sequence.
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @returns {Observable} An observable sequence of events from the specified element and the specified event.
*/
Observable.fromEvent = function (element, eventName, selector) {
if (ember) {
return fromEventPattern(
function (h) { Ember.addListener(element, eventName, h); },
function (h) { Ember.removeListener(element, eventName, h); },
selector);
}
if (jq) {
var $elem = jq(element);
return fromEventPattern(
function (h) { $elem.on(eventName, h); },
function (h) { $elem.off(eventName, h); },
selector);
}
return new AnonymousObservable(function (observer) {
return createEventListener(
element,
eventName,
function handler (e) {
var results = e;
if (selector) {
try {
results = selector(arguments);
} catch (err) {
observer.onError(err);
return
}
}
observer.onNext(results);
});
}).publish().refCount();
};
/**
* Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.
* @param {Function} addHandler The function to add a handler to the emitter.
* @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @returns {Observable} An observable sequence which wraps an event from an event emitter
*/
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
return new AnonymousObservable(function (observer) {
function innerHandler (e) {
var result = e;
if (selector) {
try {
result = selector(arguments);
} catch (err) {
observer.onError(err);
return;
}
}
observer.onNext(result);
}
var returnValue = addHandler(innerHandler);
return disposableCreate(function () {
if (removeHandler) {
removeHandler(innerHandler, returnValue);
}
});
}).publish().refCount();
};
/**
* Converts a Promise to an Observable sequence
* @param {Promise} An ES6 Compliant promise.
* @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
*/
var observableFromPromise = Observable.fromPromise = function (promise) {
return new AnonymousObservable(function (observer) {
promise.then(
function (value) {
observer.onNext(value);
observer.onCompleted();
},
function (reason) {
observer.onError(reason);
});
return function () {
if (promise && promise.abort) {
promise.abort();
}
}
});
};
/*
* Converts an existing observable sequence to an ES6 Compatible Promise
* @example
* var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
*
* // With config
* Rx.config.Promise = RSVP.Promise;
* var promise = Rx.Observable.return(42).toPromise();
* @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
* @returns {Promise} An ES6 compatible promise with the last value from the observable sequence.
*/
observableProto.toPromise = function (promiseCtor) {
promiseCtor || (promiseCtor = Rx.config.Promise);
if (!promiseCtor) {
throw new Error('Promise type not provided nor in Rx.config.Promise');
}
var source = this;
return new promiseCtor(function (resolve, reject) {
// No cancellation can be done
var value, hasValue = false;
source.subscribe(function (v) {
value = v;
hasValue = true;
}, function (err) {
reject(err);
}, function () {
if (hasValue) {
resolve(value);
}
});
});
};
/**
* Invokes the asynchronous function, surfacing the result through an observable sequence.
* @param {Function} functionAsync Asynchronous function which returns a Promise to run.
* @returns {Observable} An observable sequence exposing the function's result value, or an exception.
*/
Observable.startAsync = function (functionAsync) {
var promise;
try {
promise = functionAsync();
} catch (e) {
return observableThrow(e);
}
return observableFromPromise(promise);
}
/**
* Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
* subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
* invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
*
* @example
* 1 - res = source.multicast(observable);
* 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; });
*
* @param {Function|Subject} subjectOrSubjectSelector
* Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function.
* Or:
* Subject to push source elements into.
*
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.multicast = function (subjectOrSubjectSelector, selector) {
var source = this;
return typeof subjectOrSubjectSelector === 'function' ?
new AnonymousObservable(function (observer) {
var connectable = source.multicast(subjectOrSubjectSelector());
return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect());
}) :
new ConnectableObservable(source, subjectOrSubjectSelector);
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
* This operator is a specialization of Multicast using a regular Subject.
*
* @example
* var resres = source.publish();
* var res = source.publish(function (x) { return x; });
*
* @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publish = function (selector) {
return !selector ?
this.multicast(new Subject()) :
this.multicast(function () {
return new Subject();
}, selector);
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence.
* This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
*
* @example
* var res = source.share();
*
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.share = function () {
return this.publish(null).refCount();
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification.
* This operator is a specialization of Multicast using a AsyncSubject.
*
* @example
* var res = source.publishLast();
* var res = source.publishLast(function (x) { return x; });
*
* @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publishLast = function (selector) {
return !selector ?
this.multicast(new AsyncSubject()) :
this.multicast(function () {
return new AsyncSubject();
}, selector);
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
* This operator is a specialization of Multicast using a BehaviorSubject.
*
* @example
* var res = source.publishValue(42);
* var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42);
*
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
* @param {Mixed} initialValue Initial value received by observers upon subscription.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publishValue = function (initialValueOrSelector, initialValue) {
return arguments.length === 2 ?
this.multicast(function () {
return new BehaviorSubject(initialValue);
}, initialValueOrSelector) :
this.multicast(new BehaviorSubject(initialValueOrSelector));
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue.
* This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
*
* @example
* var res = source.shareValue(42);
*
* @param {Mixed} initialValue Initial value received by observers upon subscription.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.shareValue = function (initialValue) {
return this.publishValue(initialValue).
refCount();
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
* This operator is a specialization of Multicast using a ReplaySubject.
*
* @example
* var res = source.replay(null, 3);
* var res = source.replay(null, 3, 500);
* var res = source.replay(null, 3, 500, scheduler);
* var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler);
*
* @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy.
* @param bufferSize [Optional] Maximum element count of the replay buffer.
* @param window [Optional] Maximum time length of the replay buffer.
* @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.replay = function (selector, bufferSize, window, scheduler) {
return !selector ?
this.multicast(new ReplaySubject(bufferSize, window, scheduler)) :
this.multicast(function () {
return new ReplaySubject(bufferSize, window, scheduler);
}, selector);
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
* This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
*
* @example
* var res = source.shareReplay(3);
* var res = source.shareReplay(3, 500);
* var res = source.shareReplay(3, 500, scheduler);
*
* @param bufferSize [Optional] Maximum element count of the replay buffer.
* @param window [Optional] Maximum time length of the replay buffer.
* @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.shareReplay = function (bufferSize, window, scheduler) {
return this.replay(null, bufferSize, window, scheduler).refCount();
};
/** @private */
var ConnectableObservable = Rx.ConnectableObservable = (function (_super) {
inherits(ConnectableObservable, _super);
/**
* @constructor
* @private
*/
function ConnectableObservable(source, subject) {
var state = {
subject: subject,
source: source.asObservable(),
hasSubscription: false,
subscription: null
};
this.connect = function () {
if (!state.hasSubscription) {
state.hasSubscription = true;
state.subscription = new CompositeDisposable(state.source.subscribe(state.subject), disposableCreate(function () {
state.hasSubscription = false;
}));
}
return state.subscription;
};
function subscribe(observer) {
return state.subject.subscribe(observer);
}
_super.call(this, subscribe);
}
/**
* @private
* @memberOf ConnectableObservable
*/
ConnectableObservable.prototype.connect = function () { return this.connect(); };
/**
* @private
* @memberOf ConnectableObservable
*/
ConnectableObservable.prototype.refCount = function () {
var connectableSubscription = null, count = 0, source = this;
return new AnonymousObservable(function (observer) {
var shouldConnect, subscription;
count++;
shouldConnect = count === 1;
subscription = source.subscribe(observer);
if (shouldConnect) {
connectableSubscription = source.connect();
}
return disposableCreate(function () {
subscription.dispose();
count--;
if (count === 0) {
connectableSubscription.dispose();
}
});
});
};
return ConnectableObservable;
}(Observable));
function observableTimerTimeSpan(dueTime, scheduler) {
var d = normalizeTime(dueTime);
return new AnonymousObservable(function (observer) {
return scheduler.scheduleWithRelative(d, function () {
observer.onNext(0);
observer.onCompleted();
});
});
}
function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) {
if (dueTime === period) {
return new AnonymousObservable(function (observer) {
return scheduler.schedulePeriodicWithState(0, period, function (count) {
observer.onNext(count);
return count + 1;
});
});
}
return observableDefer(function () {
return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler);
});
}
function observableTimerDateAndPeriod(dueTime, period, scheduler) {
var p = normalizeTime(period);
return new AnonymousObservable(function (observer) {
var count = 0, d = dueTime;
return scheduler.scheduleRecursiveWithAbsolute(d, function (self) {
var now;
if (p > 0) {
now = scheduler.now();
d = d + p;
if (d <= now) {
d = now + p;
}
}
observer.onNext(count++);
self(d);
});
});
}
/**
* Returns an observable sequence that produces a value after each period.
*
* @example
* 1 - res = Rx.Observable.interval(1000);
* 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout);
*
* @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.
* @returns {Observable} An observable sequence that produces a value after each period.
*/
var observableinterval = Observable.interval = function (period, scheduler) {
scheduler || (scheduler = timeoutScheduler);
return observableTimerTimeSpanAndPeriod(period, period, scheduler);
};
/**
* Returns an observable sequence that produces a value after dueTime has elapsed and then after each period.
*
* @example
* var res = Rx.Observable.timer(5000);
* var res = Rx.Observable.timer(5000, 1000);
* var res = Rx.Observable.timer(5000, Rx.Scheduler.timeout);
* var res = Rx.Observable.timer(5000, 1000, Rx.Scheduler.timeout);
*
* @param {Number} dueTime Relative time (specified as an integer denoting milliseconds) at which to produce the first value.
* @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period.
*/
var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) {
var period;
scheduler || (scheduler = timeoutScheduler);
if (typeof periodOrScheduler === 'number') {
period = periodOrScheduler;
} else if (typeof periodOrScheduler === 'object' && 'now' in periodOrScheduler) {
scheduler = periodOrScheduler;
}
return period === undefined ?
observableTimerTimeSpan(dueTime, scheduler) :
observableTimerTimeSpanAndPeriod(dueTime, period, scheduler);
};
/**
* Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved.
*
* @example
* var res = Rx.Observable.delay(5000);
* var res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout);
* @memberOf Observable#
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence.
* @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delay = function (dueTime, scheduler) {
scheduler || (scheduler = timeoutScheduler);
var source = this;
return new AnonymousObservable(function (observer) {
var active = false,
cancelable = new SerialDisposable(),
exception = null,
q = [],
running = false,
subscription;
subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) {
var d, shouldRun;
if (notification.value.kind === 'E') {
q = [];
q.push(notification);
exception = notification.value.exception;
shouldRun = !running;
} else {
q.push({ value: notification.value, timestamp: notification.timestamp + dueTime });
shouldRun = !active;
active = true;
}
if (shouldRun) {
if (exception !== null) {
observer.onError(exception);
} else {
d = new SingleAssignmentDisposable();
cancelable.setDisposable(d);
d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) {
var e, recurseDueTime, result, shouldRecurse;
if (exception !== null) {
return;
}
running = true;
do {
result = null;
if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) {
result = q.shift().value;
}
if (result !== null) {
result.accept(observer);
}
} while (result !== null);
shouldRecurse = false;
recurseDueTime = 0;
if (q.length > 0) {
shouldRecurse = true;
recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now());
} else {
active = false;
}
e = exception;
running = false;
if (e !== null) {
observer.onError(e);
} else if (shouldRecurse) {
self(recurseDueTime);
}
}));
}
}
});
return new CompositeDisposable(subscription, cancelable);
});
};
/**
* Ignores values from an observable sequence which are followed by another value before dueTime.
*
* @example
* 1 - res = source.throttle(5000); // 5 seconds
* 2 - res = source.throttle(5000, scheduler);
*
* @param {Number} dueTime Duration of the throttle period for each value (specified as an integer denoting milliseconds).
* @param {Scheduler} [scheduler] Scheduler to run the throttle timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} The throttled sequence.
*/
observableProto.throttle = function (dueTime, scheduler) {
scheduler || (scheduler = timeoutScheduler);
var source = this;
return this.throttleWithSelector(function () { return observableTimer(dueTime, scheduler); })
};
/**
* Records the time interval between consecutive values in an observable sequence.
*
* @example
* 1 - res = source.timeInterval();
* 2 - res = source.timeInterval(Rx.Scheduler.timeout);
*
* @param [scheduler] Scheduler used to compute time intervals. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence with time interval information on values.
*/
observableProto.timeInterval = function (scheduler) {
var source = this;
scheduler || (scheduler = timeoutScheduler);
return observableDefer(function () {
var last = scheduler.now();
return source.select(function (x) {
var now = scheduler.now(), span = now - last;
last = now;
return {
value: x,
interval: span
};
});
});
};
/**
* Records the timestamp for each value in an observable sequence.
*
* @example
* 1 - res = source.timestamp(); // produces { value: x, timestamp: ts }
* 2 - res = source.timestamp(Rx.Scheduler.timeout);
*
* @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence with timestamp information on values.
*/
observableProto.timestamp = function (scheduler) {
scheduler || (scheduler = timeoutScheduler);
return this.select(function (x) {
return {
value: x,
timestamp: scheduler.now()
};
});
};
function sampleObservable(source, sampler) {
return new AnonymousObservable(function (observer) {
var atEnd, value, hasValue;
function sampleSubscribe() {
if (hasValue) {
hasValue = false;
observer.onNext(value);
}
if (atEnd) {
observer.onCompleted();
}
}
return new CompositeDisposable(
source.subscribe(function (newValue) {
hasValue = true;
value = newValue;
}, observer.onError.bind(observer), function () {
atEnd = true;
}),
sampler.subscribe(sampleSubscribe, observer.onError.bind(observer), sampleSubscribe)
);
});
}
/**
* Samples the observable sequence at each interval.
*
* @example
* 1 - res = source.sample(sampleObservable); // Sampler tick sequence
* 2 - res = source.sample(5000); // 5 seconds
* 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds
*
* @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable.
* @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} Sampled observable sequence.
*/
observableProto.sample = function (intervalOrSampler, scheduler) {
scheduler || (scheduler = timeoutScheduler);
if (typeof intervalOrSampler === 'number') {
return sampleObservable(this, observableinterval(intervalOrSampler, scheduler));
}
return sampleObservable(this, intervalOrSampler);
};
/**
* Returns the source observable sequence or the other observable sequence if dueTime elapses.
*
* @example
* 1 - res = source.timeout(new Date()); // As a date
* 2 - res = source.timeout(5000); // 5 seconds
* 3 - res = source.timeout(new Date(), Rx.Observable.returnValue(42)); // As a date and timeout observable
* 4 - res = source.timeout(5000, Rx.Observable.returnValue(42)); // 5 seconds and timeout observable
* 5 - res = source.timeout(new Date(), Rx.Observable.returnValue(42), Rx.Scheduler.timeout); // As a date and timeout observable
* 6 - res = source.timeout(5000, Rx.Observable.returnValue(42), Rx.Scheduler.timeout); // 5 seconds and timeout observable
*
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs.
* @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used.
* @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
*/
observableProto.timeout = function (dueTime, other, scheduler) {
other || (other = observableThrow(new Error('Timeout')));
scheduler || (scheduler = timeoutScheduler);
var source = this, schedulerMethod = dueTime instanceof Date ?
'scheduleWithAbsolute' :
'scheduleWithRelative';
return new AnonymousObservable(function (observer) {
var id = 0,
original = new SingleAssignmentDisposable(),
subscription = new SerialDisposable(),
switched = false,
timer = new SerialDisposable();
subscription.setDisposable(original);
var createTimer = function () {
var myId = id;
timer.setDisposable(scheduler[schedulerMethod](dueTime, function () {
if (id === myId) {
isPromise(other) && (other = observableFromPromise(other));
subscription.setDisposable(other.subscribe(observer));
}
}));
};
createTimer();
original.setDisposable(source.subscribe(function (x) {
if (!switched) {
id++;
observer.onNext(x);
createTimer();
}
}, function (e) {
if (!switched) {
id++;
observer.onError(e);
}
}, function () {
if (!switched) {
id++;
observer.onCompleted();
}
}));
return new CompositeDisposable(subscription, timer);
});
};
/**
* Generates an observable sequence by iterating a state from an initial state until the condition fails.
*
* @example
* res = source.generateWithRelativeTime(0,
* function (x) { return return true; },
* function (x) { return x + 1; },
* function (x) { return x; },
* function (x) { return 500; }
* );
*
* @param {Mixed} initialState Initial state.
* @param {Function} condition Condition to terminate generation (upon returning false).
* @param {Function} iterate Iteration step function.
* @param {Function} resultSelector Selector function for results produced in the sequence.
* @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds.
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
* @returns {Observable} The generated sequence.
*/
Observable.generateWithRelativeTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) {
scheduler || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var first = true,
hasResult = false,
result,
state = initialState,
time;
return scheduler.scheduleRecursiveWithRelative(0, function (self) {
if (hasResult) {
observer.onNext(result);
}
try {
if (first) {
first = false;
} else {
state = iterate(state);
}
hasResult = condition(state);
if (hasResult) {
result = resultSelector(state);
time = timeSelector(state);
}
} catch (e) {
observer.onError(e);
return;
}
if (hasResult) {
self(time);
} else {
observer.onCompleted();
}
});
});
};
/**
* Time shifts the observable sequence by delaying the subscription.
*
* @example
* 1 - res = source.delaySubscription(5000); // 5s
* 2 - res = source.delaySubscription(5000, Rx.Scheduler.timeout); // 5 seconds
*
* @param {Number} dueTime Absolute or relative time to perform the subscription at.
* @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delaySubscription = function (dueTime, scheduler) {
scheduler || (scheduler = timeoutScheduler);
return this.delayWithSelector(observableTimer(dueTime, scheduler), function () { return observableEmpty(); });
};
/**
* Time shifts the observable sequence based on a subscription delay and a delay selector function for each element.
*
* @example
* 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only
* 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector
*
* @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source.
* @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) {
var source = this, subDelay, selector;
if (typeof subscriptionDelay === 'function') {
selector = subscriptionDelay;
} else {
subDelay = subscriptionDelay;
selector = delayDurationSelector;
}
return new AnonymousObservable(function (observer) {
var delays = new CompositeDisposable(), atEnd = false, done = function () {
if (atEnd && delays.length === 0) {
observer.onCompleted();
}
}, subscription = new SerialDisposable(), start = function () {
subscription.setDisposable(source.subscribe(function (x) {
var delay;
try {
delay = selector(x);
} catch (error) {
observer.onError(error);
return;
}
var d = new SingleAssignmentDisposable();
delays.add(d);
d.setDisposable(delay.subscribe(function () {
observer.onNext(x);
delays.remove(d);
done();
}, observer.onError.bind(observer), function () {
observer.onNext(x);
delays.remove(d);
done();
}));
}, observer.onError.bind(observer), function () {
atEnd = true;
subscription.dispose();
done();
}));
};
if (!subDelay) {
start();
} else {
subscription.setDisposable(subDelay.subscribe(function () {
start();
}, observer.onError.bind(observer), function () { start(); }));
}
return new CompositeDisposable(subscription, delays);
});
};
/**
* Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled.
*
* @example
* 1 - res = source.timeoutWithSelector(Rx.Observable.timer(500));
* 2 - res = source.timeoutWithSelector(Rx.Observable.timer(500), function (x) { return Rx.Observable.timer(200); });
* 3 - res = source.timeoutWithSelector(Rx.Observable.timer(500), function (x) { return Rx.Observable.timer(200); }, Rx.Observable.returnValue(42));
*
* @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never().
* @param {Function} [timeoutDurationSelector] Selector to retrieve an observable sequence that represents the timeout between the current element and the next element.
* @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException().
* @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
*/
observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) {
if (arguments.length === 1) {
timeoutdurationSelector = firstTimeout;
var firstTimeout = observableNever();
}
other || (other = observableThrow(new Error('Timeout')));
var source = this;
return new AnonymousObservable(function (observer) {
var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable();
subscription.setDisposable(original);
var id = 0, switched = false, setTimer = function (timeout) {
var myId = id, timerWins = function () {
return id === myId;
};
var d = new SingleAssignmentDisposable();
timer.setDisposable(d);
d.setDisposable(timeout.subscribe(function () {
if (timerWins()) {
subscription.setDisposable(other.subscribe(observer));
}
d.dispose();
}, function (e) {
if (timerWins()) {
observer.onError(e);
}
}, function () {
if (timerWins()) {
subscription.setDisposable(other.subscribe(observer));
}
}));
};
setTimer(firstTimeout);
var observerWins = function () {
var res = !switched;
if (res) {
id++;
}
return res;
};
original.setDisposable(source.subscribe(function (x) {
if (observerWins()) {
observer.onNext(x);
var timeout;
try {
timeout = timeoutdurationSelector(x);
} catch (e) {
observer.onError(e);
return;
}
setTimer(timeout);
}
}, function (e) {
if (observerWins()) {
observer.onError(e);
}
}, function () {
if (observerWins()) {
observer.onCompleted();
}
}));
return new CompositeDisposable(subscription, timer);
});
};
/**
* Ignores values from an observable sequence which are followed by another value within a computed throttle duration.
*
* @example
* 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(x + x); });
*
* @param {Function} throttleDurationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element.
* @returns {Observable} The throttled sequence.
*/
observableProto.throttleWithSelector = function (throttleDurationSelector) {
var source = this;
return new AnonymousObservable(function (observer) {
var value, hasValue = false, cancelable = new SerialDisposable(), id = 0, subscription = source.subscribe(function (x) {
var throttle;
try {
throttle = throttleDurationSelector(x);
} catch (e) {
observer.onError(e);
return;
}
hasValue = true;
value = x;
id++;
var currentid = id, d = new SingleAssignmentDisposable();
cancelable.setDisposable(d);
d.setDisposable(throttle.subscribe(function () {
if (hasValue && id === currentid) {
observer.onNext(value);
}
hasValue = false;
d.dispose();
}, observer.onError.bind(observer), function () {
if (hasValue && id === currentid) {
observer.onNext(value);
}
hasValue = false;
d.dispose();
}));
}, function (e) {
cancelable.dispose();
observer.onError(e);
hasValue = false;
id++;
}, function () {
cancelable.dispose();
if (hasValue) {
observer.onNext(value);
}
observer.onCompleted();
hasValue = false;
id++;
});
return new CompositeDisposable(subscription, cancelable);
});
};
/**
* Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
*
* 1 - res = source.skipLastWithTime(5000);
* 2 - res = source.skipLastWithTime(5000, scheduler);
*
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for skipping elements from the end of the sequence.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout
* @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence.
*/
observableProto.skipLastWithTime = function (duration, scheduler) {
scheduler || (scheduler = timeoutScheduler);
var source = this;
return new AnonymousObservable(function (observer) {
var q = [];
return source.subscribe(function (x) {
var now = scheduler.now();
q.push({ interval: now, value: x });
while (q.length > 0 && now - q[0].interval >= duration) {
observer.onNext(q.shift().value);
}
}, observer.onError.bind(observer), function () {
var now = scheduler.now();
while (q.length > 0 && now - q[0].interval >= duration) {
observer.onNext(q.shift().value);
}
observer.onCompleted();
});
});
};
/**
* Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements.
*
* @example
* 1 - res = source.takeLastWithTime(5000, [optional timer scheduler], [optional loop scheduler]);
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for taking elements from the end of the sequence.
* @param {Scheduler} [timerScheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @param {Scheduler} [loopScheduler] Scheduler to drain the collected elements. If not specified, defaults to Rx.Scheduler.immediate.
* @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence.
*/
observableProto.takeLastWithTime = function (duration, timerScheduler, loopScheduler) {
return this.takeLastBufferWithTime(duration, timerScheduler).selectMany(function (xs) { return observableFromArray(xs, loopScheduler); });
};
/**
* Returns an array with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.takeLastBufferWithTime(5000, [optional scheduler]);
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for taking elements from the end of the sequence.
* @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence containing a single array with the elements taken during the specified duration from the end of the source sequence.
*/
observableProto.takeLastBufferWithTime = function (duration, scheduler) {
var source = this;
scheduler || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var q = [];
return source.subscribe(function (x) {
var now = scheduler.now();
q.push({ interval: now, value: x });
while (q.length > 0 && now - q[0].interval >= duration) {
q.shift();
}
}, observer.onError.bind(observer), function () {
var now = scheduler.now(), res = [];
while (q.length > 0) {
var next = q.shift();
if (now - next.interval <= duration) {
res.push(next.value);
}
}
observer.onNext(res);
observer.onCompleted();
});
});
};
/**
* Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.takeWithTime(5000, [optional scheduler]);
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for taking elements from the start of the sequence.
* @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence.
*/
observableProto.takeWithTime = function (duration, scheduler) {
var source = this;
scheduler || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var t = scheduler.scheduleWithRelative(duration, function () {
observer.onCompleted();
});
return new CompositeDisposable(t, source.subscribe(observer));
});
};
/**
* Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.skipWithTime(5000, [optional scheduler]);
*
* @description
* Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence.
* This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded
* may not execute immediately, despite the zero due time.
*
* Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration.
* @param {Number} duration Duration for skipping elements from the start of the sequence.
* @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence.
*/
observableProto.skipWithTime = function (duration, scheduler) {
var source = this;
scheduler || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var open = false,
t = scheduler.scheduleWithRelative(duration, function () { open = true; }),
d = source.subscribe(function (x) {
if (open) {
observer.onNext(x);
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
return new CompositeDisposable(t, d);
});
};
/**
* Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers.
* Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the start time.
*
* @examples
* 1 - res = source.skipUntilWithTime(new Date(), [optional scheduler]);
* 2 - res = source.skipUntilWithTime(5000, [optional scheduler]);
* @param startTime Time to start taking elements from the source sequence. If this value is less than or equal to Date(), no elements will be skipped.
* @param scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements skipped until the specified start time.
*/
observableProto.skipUntilWithTime = function (startTime, scheduler) {
scheduler || (scheduler = timeoutScheduler);
var source = this, schedulerMethod = startTime instanceof Date ?
'scheduleWithAbsolute' :
'scheduleWithRelative';
return new AnonymousObservable(function (observer) {
var open = false;
return new CompositeDisposable(
scheduler[schedulerMethod](startTime, function () { open = true; }),
source.subscribe(
function (x) { open && observer.onNext(x); },
observer.onError.bind(observer),
observer.onCompleted.bind(observer)));
});
};
/**
* Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.takeUntilWithTime(new Date(), [optional scheduler]);
* 2 - res = source.takeUntilWithTime(5000, [optional scheduler]);
* @param {Number | Date} endTime Time to stop taking elements from the source sequence. If this value is less than or equal to new Date(), the result stream will complete immediately.
* @param {Scheduler} scheduler Scheduler to run the timer on.
* @returns {Observable} An observable sequence with the elements taken until the specified end time.
*/
observableProto.takeUntilWithTime = function (endTime, scheduler) {
scheduler || (scheduler = timeoutScheduler);
var source = this, schedulerMethod = endTime instanceof Date ?
'scheduleWithAbsolute' :
'scheduleWithRelative';
return new AnonymousObservable(function (observer) {
return new CompositeDisposable(scheduler[schedulerMethod](endTime, function () {
observer.onCompleted();
}), source.subscribe(observer));
});
};
var PausableObservable = (function (_super) {
inherits(PausableObservable, _super);
function subscribe(observer) {
var conn = this.source.publish(),
subscription = conn.subscribe(observer),
connection = disposableEmpty;
var pausable = this.subject.distinctUntilChanged().subscribe(function (b) {
if (b) {
connection = conn.connect();
} else {
connection.dispose();
connection = disposableEmpty;
}
});
return new CompositeDisposable(subscription, connection, pausable);
}
function PausableObservable(source, subject) {
this.source = source;
this.subject = subject || new Subject();
this.isPaused = true;
_super.call(this, subscribe);
}
PausableObservable.prototype.pause = function () {
if (this.isPaused === true){
return;
}
this.isPaused = true;
this.subject.onNext(false);
};
PausableObservable.prototype.resume = function () {
if (this.isPaused === false){
return;
}
this.isPaused = false;
this.subject.onNext(true);
};
return PausableObservable;
}(Observable));
/**
* Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
* @example
* var pauser = new Rx.Subject();
* var source = Rx.Observable.interval(100).pausable(pauser);
* @param {Observable} pauser The observable sequence used to pause the underlying sequence.
* @returns {Observable} The observable sequence which is paused based upon the pauser.
*/
observableProto.pausable = function (pauser) {
return new PausableObservable(this, pauser);
};
function combineLatestSource(source, subject, resultSelector) {
return new AnonymousObservable(function (observer) {
var n = 2,
hasValue = [false, false],
hasValueAll = false,
isDone = false,
values = new Array(n);
function next(x, i) {
values[i] = x
var res;
hasValue[i] = true;
if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
try {
res = resultSelector.apply(null, values);
} catch (ex) {
observer.onError(ex);
return;
}
observer.onNext(res);
} else if (isDone) {
observer.onCompleted();
}
}
return new CompositeDisposable(
source.subscribe(
function (x) {
next(x, 0);
},
observer.onError.bind(observer),
function () {
isDone = true;
observer.onCompleted();
}),
subject.subscribe(
function (x) {
next(x, 1);
},
observer.onError.bind(observer))
);
});
}
var PausableBufferedObservable = (function (_super) {
inherits(PausableBufferedObservable, _super);
function subscribe(observer) {
var q = [], previous = true;
var subscription =
combineLatestSource(
this.source,
this.subject.distinctUntilChanged(),
function (data, shouldFire) {
return { data: data, shouldFire: shouldFire };
})
.subscribe(
function (results) {
if (results.shouldFire && previous) {
observer.onNext(results.data);
}
if (results.shouldFire && !previous) {
while (q.length > 0) {
observer.onNext(q.shift());
}
previous = true;
} else if (!results.shouldFire && !previous) {
q.push(results.data);
} else if (!results.shouldFire && previous) {
previous = false;
}
},
function (err) {
// Empty buffer before sending error
while (q.length > 0) {
observer.onNext(q.shift());
}
observer.onError(err);
},
function () {
// Empty buffer before sending completion
while (q.length > 0) {
observer.onNext(q.shift());
}
observer.onCompleted();
}
);
this.subject.onNext(false);
return subscription;
}
function PausableBufferedObservable(source, subject) {
this.source = source;
this.subject = subject || new Subject();
this.isPaused = true;
_super.call(this, subscribe);
}
PausableBufferedObservable.prototype.pause = function () {
if (this.isPaused === true){
return;
}
this.isPaused = true;
this.subject.onNext(false);
};
PausableBufferedObservable.prototype.resume = function () {
if (this.isPaused === false){
return;
}
this.isPaused = false;
this.subject.onNext(true);
};
return PausableBufferedObservable;
}(Observable));
/**
* Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
* and yields the values that were buffered while paused.
* @example
* var pauser = new Rx.Subject();
* var source = Rx.Observable.interval(100).pausableBuffered(pauser);
* @param {Observable} pauser The observable sequence used to pause the underlying sequence.
* @returns {Observable} The observable sequence which is paused based upon the pauser.
*/
observableProto.pausableBuffered = function (subject) {
return new PausableBufferedObservable(this, subject);
};
/**
* Attaches a controller to the observable sequence with the ability to queue.
* @example
* var source = Rx.Observable.interval(100).controlled();
* source.request(3); // Reads 3 values
* @param {Observable} pauser The observable sequence used to pause the underlying sequence.
* @returns {Observable} The observable sequence which is paused based upon the pauser.
*/
observableProto.controlled = function (enableQueue) {
if (enableQueue == null) { enableQueue = true; }
return new ControlledObservable(this, enableQueue);
};
var ControlledObservable = (function (_super) {
inherits(ControlledObservable, _super);
function subscribe (observer) {
return this.source.subscribe(observer);
}
function ControlledObservable (source, enableQueue) {
_super.call(this, subscribe);
this.subject = new ControlledSubject(enableQueue);
this.source = source.multicast(this.subject).refCount();
}
ControlledObservable.prototype.request = function (numberOfItems) {
if (numberOfItems == null) { numberOfItems = -1; }
return this.subject.request(numberOfItems);
};
return ControlledObservable;
}(Observable));
var ControlledSubject = Rx.ControlledSubject = (function (_super) {
function subscribe (observer) {
return this.subject.subscribe(observer);
}
inherits(ControlledSubject, _super);
function ControlledSubject(enableQueue) {
if (enableQueue == null) {
enableQueue = true;
}
_super.call(this, subscribe);
this.subject = new Subject();
this.enableQueue = enableQueue;
this.queue = enableQueue ? [] : null;
this.requestedCount = 0;
this.requestedDisposable = disposableEmpty;
this.error = null;
this.hasFailed = false;
this.hasCompleted = false;
this.controlledDisposable = disposableEmpty;
}
addProperties(ControlledSubject.prototype, Observer, {
onCompleted: function () {
checkDisposed.call(this);
this.hasCompleted = true;
if (!this.enableQueue || this.queue.length === 0) {
this.subject.onCompleted();
}
},
onError: function (error) {
checkDisposed.call(this);
this.hasFailed = true;
this.error = error;
if (!this.enableQueue || this.queue.length === 0) {
this.subject.onError(error);
}
},
onNext: function (value) {
checkDisposed.call(this);
var hasRequested = false;
if (this.requestedCount === 0) {
if (this.enableQueue) {
this.queue.push(value);
}
} else {
if (this.requestedCount !== -1) {
if (this.requestedCount-- === 0) {
this.disposeCurrentRequest();
}
}
hasRequested = true;
}
if (hasRequested) {
this.subject.onNext(value);
}
},
_processRequest: function (numberOfItems) {
if (this.enableQueue) {
//console.log('queue length', this.queue.length);
while (this.queue.length >= numberOfItems && numberOfItems > 0) {
//console.log('number of items', numberOfItems);
this.subject.onNext(this.queue.shift());
numberOfItems--;
}
if (this.queue.length !== 0) {
return { numberOfItems: numberOfItems, returnValue: true };
} else {
return { numberOfItems: numberOfItems, returnValue: false };
}
}
if (this.hasFailed) {
this.subject.onError(this.error);
this.controlledDisposable.dispose();
this.controlledDisposable = disposableEmpty;
} else if (this.hasCompleted) {
this.subject.onCompleted();
this.controlledDisposable.dispose();
this.controlledDisposable = disposableEmpty;
}
return { numberOfItems: numberOfItems, returnValue: false };
},
request: function (number) {
checkDisposed.call(this);
this.disposeCurrentRequest();
var self = this,
r = this._processRequest(number);
number = r.numberOfItems;
if (!r.returnValue) {
this.requestedCount = number;
this.requestedDisposable = disposableCreate(function () {
self.requestedCount = 0;
});
return this.requestedDisposable
} else {
return disposableEmpty;
}
},
disposeCurrentRequest: function () {
this.requestedDisposable.dispose();
this.requestedDisposable = disposableEmpty;
},
dispose: function () {
this.isDisposed = true;
this.error = null;
this.subject.dispose();
this.requestedDisposable.dispose();
}
});
return ControlledSubject;
}(Observable));
/**
* Returns a new observable that triggers on the second and subsequent triggerings of the input observable.
* The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair.
* The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs.
* @returns {Observable} An observable that triggers on successive pairs of observations from the input observable as an array.
*/
observableProto.pairwise = function () {
var source = this;
return new AnonymousObservable(function (observer) {
var previous, hasPrevious = false;
return source.subscribe(
function (x) {
if (hasPrevious) {
observer.onNext([previous, x]);
} else {
hasPrevious = true;
}
previous = x;
},
observer.onError.bind(observer),
observer.onCompleted.bind(observer));
});
};
/**
* Returns two observables which partition the observations of the source by the given function.
* The first will trigger observations for those values for which the predicate returns true.
* The second will trigger observations for those values where the predicate returns false.
* The predicate is executed once for each subscribed observer.
* Both also propagate all error observations arising from the source and each completes
* when the source completes.
* @param {Function} predicate
* The function to determine which output Observable will trigger a particular observation.
* @returns {Array}
* An array of observables. The first triggers when the predicate returns true,
* and the second triggers when the predicate returns false.
*/
observableProto.partition = function(predicate, thisArg) {
var published = this.publish().refCount();
return [
published.filter(predicate, thisArg),
published.filter(function (x, i, o) { return !predicate.call(thisArg, x, i, o); })
];
};
/*
* Performs a exclusive waiting for the first to finish before subscribing to another observable.
* Observables that come in between subscriptions will be dropped on the floor.
* @returns {Observable} A exclusive observable with only the results that happen when subscribed.
*/
observableProto.exclusive = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var hasCurrent = false,
isStopped = false,
m = new SingleAssignmentDisposable(),
g = new CompositeDisposable();
g.add(m);
m.setDisposable(sources.subscribe(
function (innerSource) {
if (!hasCurrent) {
hasCurrent = true;
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
var innerSubscription = new SingleAssignmentDisposable();
g.add(innerSubscription);
innerSubscription.setDisposable(innerSource.subscribe(
observer.onNext.bind(observer),
observer.onError.bind(observer),
function () {
g.remove(innerSubscription);
hasCurrent = false;
if (isStopped && g.length === 1) {
observer.onCompleted();
}
}));
}
},
observer.onError.bind(observer),
function () {
isStopped = true;
if (!hasCurrent && g.length === 1) {
observer.onCompleted();
}
}));
return g;
});
};
/*
* Performs a exclusive map waiting for the first to finish before subscribing to another observable.
* Observables that come in between subscriptions will be dropped on the floor.
* @param {Function} selector Selector to invoke for every item in the current subscription.
* @param {Any} [thisArg] An optional context to invoke with the selector parameter.
* @returns {Observable} An exclusive observable with only the results that happen when subscribed.
*/
observableProto.exclusiveMap = function (selector, thisArg) {
var sources = this;
return new AnonymousObservable(function (observer) {
var index = 0,
hasCurrent = false,
isStopped = true,
m = new SingleAssignmentDisposable(),
g = new CompositeDisposable();
g.add(m);
m.setDisposable(sources.subscribe(
function (innerSource) {
if (!hasCurrent) {
hasCurrent = true;
innerSubscription = new SingleAssignmentDisposable();
g.add(innerSubscription);
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
innerSubscription.setDisposable(innerSource.subscribe(
function (x) {
var result;
try {
result = selector.call(thisArg, x, index++, innerSource);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
},
observer.onError.bind(observer),
function () {
g.remove(innerSubscription);
hasCurrent = false;
if (isStopped && g.length === 1) {
observer.onCompleted();
}
}));
}
},
observer.onError.bind(observer),
function () {
isStopped = true;
if (g.length === 1 && !hasCurrent) {
observer.onCompleted();
}
}));
return g;
});
};
var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
inherits(AnonymousObservable, __super__);
// Fix subscriber to check for undefined or function returned to decorate as Disposable
function fixSubscriber(subscriber) {
if (typeof subscriber === 'undefined') {
subscriber = disposableEmpty;
} else if (typeof subscriber === 'function') {
subscriber = disposableCreate(subscriber);
}
return subscriber;
}
function AnonymousObservable(subscribe) {
if (!(this instanceof AnonymousObservable)) {
return new AnonymousObservable(subscribe);
}
function s(observer) {
var setDisposable = function () {
try {
autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver)));
} catch (e) {
if (!autoDetachObserver.fail(e)) {
throw e;
}
}
};
var autoDetachObserver = new AutoDetachObserver(observer);
if (currentThreadScheduler.scheduleRequired()) {
currentThreadScheduler.schedule(setDisposable);
} else {
setDisposable();
}
return autoDetachObserver;
}
__super__.call(this, s);
}
return AnonymousObservable;
}(Observable));
/** @private */
var AutoDetachObserver = (function (_super) {
inherits(AutoDetachObserver, _super);
function AutoDetachObserver(observer) {
_super.call(this);
this.observer = observer;
this.m = new SingleAssignmentDisposable();
}
var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
AutoDetachObserverPrototype.next = function (value) {
var noError = false;
try {
this.observer.onNext(value);
noError = true;
} catch (e) {
throw e;
} finally {
if (!noError) {
this.dispose();
}
}
};
AutoDetachObserverPrototype.error = function (exn) {
try {
this.observer.onError(exn);
} catch (e) {
throw e;
} finally {
this.dispose();
}
};
AutoDetachObserverPrototype.completed = function () {
try {
this.observer.onCompleted();
} catch (e) {
throw e;
} finally {
this.dispose();
}
};
AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); };
/* @private */
AutoDetachObserverPrototype.disposable = function (value) {
return arguments.length ? this.getDisposable() : setDisposable(value);
};
AutoDetachObserverPrototype.dispose = function () {
_super.prototype.dispose.call(this);
this.m.dispose();
};
return AutoDetachObserver;
}(AbstractObserver));
/** @private */
var InnerSubscription = function (subject, observer) {
this.subject = subject;
this.observer = observer;
};
/**
* @private
* @memberOf InnerSubscription
*/
InnerSubscription.prototype.dispose = function () {
if (!this.subject.isDisposed && this.observer !== null) {
var idx = this.subject.observers.indexOf(this.observer);
this.subject.observers.splice(idx, 1);
this.observer = null;
}
};
/**
* Represents an object that is both an observable sequence as well as an observer.
* Each notification is broadcasted to all subscribed observers.
*/
var Subject = Rx.Subject = (function (_super) {
function subscribe(observer) {
checkDisposed.call(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
if (this.exception) {
observer.onError(this.exception);
return disposableEmpty;
}
observer.onCompleted();
return disposableEmpty;
}
inherits(Subject, _super);
/**
* Creates a subject.
* @constructor
*/
function Subject() {
_super.call(this, subscribe);
this.isDisposed = false,
this.isStopped = false,
this.observers = [];
}
addProperties(Subject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
return this.observers.length > 0;
},
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onCompleted();
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (exception) {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
this.exception = exception;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onError(exception);
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
for (var i = 0, len = os.length; i < len; i++) {
os[i].onNext(value);
}
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
}
});
/**
* Creates a subject from the specified observer and observable.
* @param {Observer} observer The observer used to send messages to the subject.
* @param {Observable} observable The observable used to subscribe to messages sent from the subject.
* @returns {Subject} Subject implemented using the given observer and observable.
*/
Subject.create = function (observer, observable) {
return new AnonymousSubject(observer, observable);
};
return Subject;
}(Observable));
/**
* Represents the result of an asynchronous operation.
* The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
*/
var AsyncSubject = Rx.AsyncSubject = (function (_super) {
function subscribe(observer) {
checkDisposed.call(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
var ex = this.exception,
hv = this.hasValue,
v = this.value;
if (ex) {
observer.onError(ex);
} else if (hv) {
observer.onNext(v);
observer.onCompleted();
} else {
observer.onCompleted();
}
return disposableEmpty;
}
inherits(AsyncSubject, _super);
/**
* Creates a subject that can only receive one value and that value is cached for all future observations.
* @constructor
*/
function AsyncSubject() {
_super.call(this, subscribe);
this.isDisposed = false;
this.isStopped = false;
this.value = null;
this.hasValue = false;
this.observers = [];
this.exception = null;
}
addProperties(AsyncSubject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
checkDisposed.call(this);
return this.observers.length > 0;
},
/**
* Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
*/
onCompleted: function () {
var o, i, len;
checkDisposed.call(this);
if (!this.isStopped) {
this.isStopped = true;
var os = this.observers.slice(0),
v = this.value,
hv = this.hasValue;
if (hv) {
for (i = 0, len = os.length; i < len; i++) {
o = os[i];
o.onNext(v);
o.onCompleted();
}
} else {
for (i = 0, len = os.length; i < len; i++) {
os[i].onCompleted();
}
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (exception) {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
this.exception = exception;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onError(exception);
}
this.observers = [];
}
},
/**
* Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
* @param {Mixed} value The value to store in the subject.
*/
onNext: function (value) {
checkDisposed.call(this);
if (!this.isStopped) {
this.value = value;
this.hasValue = true;
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
this.exception = null;
this.value = null;
}
});
return AsyncSubject;
}(Observable));
/** @private */
var AnonymousSubject = (function (_super) {
inherits(AnonymousSubject, _super);
function subscribe(observer) {
return this.observable.subscribe(observer);
}
/**
* @private
* @constructor
*/
function AnonymousSubject(observer, observable) {
_super.call(this, subscribe);
this.observer = observer;
this.observable = observable;
}
addProperties(AnonymousSubject.prototype, Observer, {
/**
* @private
* @memberOf AnonymousSubject#
*/
onCompleted: function () {
this.observer.onCompleted();
},
/**
* @private
* @memberOf AnonymousSubject#
*/
onError: function (exception) {
this.observer.onError(exception);
},
/**
* @private
* @memberOf AnonymousSubject#
*/
onNext: function (value) {
this.observer.onNext(value);
}
});
return AnonymousSubject;
}(Observable));
/**
* Represents a value that changes over time.
* Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
*/
var BehaviorSubject = Rx.BehaviorSubject = (function (_super) {
function subscribe(observer) {
checkDisposed.call(this);
if (!this.isStopped) {
this.observers.push(observer);
observer.onNext(this.value);
return new InnerSubscription(this, observer);
}
var ex = this.exception;
if (ex) {
observer.onError(ex);
} else {
observer.onCompleted();
}
return disposableEmpty;
}
inherits(BehaviorSubject, _super);
/**
* @constructor
* Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value.
* @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet.
*/
function BehaviorSubject(value) {
_super.call(this, subscribe);
this.value = value,
this.observers = [],
this.isDisposed = false,
this.isStopped = false,
this.exception = null;
}
addProperties(BehaviorSubject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
return this.observers.length > 0;
},
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onCompleted();
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (error) {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
this.exception = error;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onError(error);
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed.call(this);
if (!this.isStopped) {
this.value = value;
var os = this.observers.slice(0);
for (var i = 0, len = os.length; i < len; i++) {
os[i].onNext(value);
}
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
this.value = null;
this.exception = null;
}
});
return BehaviorSubject;
}(Observable));
/**
* Represents an object that is both an observable sequence as well as an observer.
* Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
*/
var ReplaySubject = Rx.ReplaySubject = (function (_super) {
function RemovableDisposable (subject, observer) {
this.subject = subject;
this.observer = observer;
};
RemovableDisposable.prototype.dispose = function () {
this.observer.dispose();
if (!this.subject.isDisposed) {
var idx = this.subject.observers.indexOf(this.observer);
this.subject.observers.splice(idx, 1);
}
};
function subscribe(observer) {
var so = new ScheduledObserver(this.scheduler, observer),
subscription = new RemovableDisposable(this, so);
checkDisposed.call(this);
this._trim(this.scheduler.now());
this.observers.push(so);
var n = this.q.length;
for (var i = 0, len = this.q.length; i < len; i++) {
so.onNext(this.q[i].value);
}
if (this.hasError) {
n++;
so.onError(this.error);
} else if (this.isStopped) {
n++;
so.onCompleted();
}
so.ensureActive(n);
return subscription;
}
inherits(ReplaySubject, _super);
/**
* Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler.
* @param {Number} [bufferSize] Maximum element count of the replay buffer.
* @param {Number} [windowSize] Maximum time length of the replay buffer.
* @param {Scheduler} [scheduler] Scheduler the observers are invoked on.
*/
function ReplaySubject(bufferSize, windowSize, scheduler) {
this.bufferSize = bufferSize == null ? Number.MAX_VALUE : bufferSize;
this.windowSize = windowSize == null ? Number.MAX_VALUE : windowSize;
this.scheduler = scheduler || currentThreadScheduler;
this.q = [];
this.observers = [];
this.isStopped = false;
this.isDisposed = false;
this.hasError = false;
this.error = null;
_super.call(this, subscribe);
}
addProperties(ReplaySubject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
return this.observers.length > 0;
},
/* @private */
_trim: function (now) {
while (this.q.length > this.bufferSize) {
this.q.shift();
}
while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) {
this.q.shift();
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
var observer;
checkDisposed.call(this);
if (!this.isStopped) {
var now = this.scheduler.now();
this.q.push({ interval: now, value: value });
this._trim(now);
var o = this.observers.slice(0);
for (var i = 0, len = o.length; i < len; i++) {
observer = o[i];
observer.onNext(value);
observer.ensureActive();
}
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (error) {
var observer;
checkDisposed.call(this);
if (!this.isStopped) {
this.isStopped = true;
this.error = error;
this.hasError = true;
var now = this.scheduler.now();
this._trim(now);
var o = this.observers.slice(0);
for (var i = 0, len = o.length; i < len; i++) {
observer = o[i];
observer.onError(error);
observer.ensureActive();
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
var observer;
checkDisposed.call(this);
if (!this.isStopped) {
this.isStopped = true;
var now = this.scheduler.now();
this._trim(now);
var o = this.observers.slice(0);
for (var i = 0, len = o.length; i < len; i++) {
observer = o[i];
observer.onCompleted();
observer.ensureActive();
}
this.observers = [];
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
}
});
return ReplaySubject;
}(Observable));
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
root.Rx = Rx;
define(function() {
return Rx;
});
} else if (freeExports && freeModule) {
// in Node.js or RingoJS
if (moduleExports) {
(freeModule.exports = Rx).Rx = Rx;
} else {
freeExports.Rx = Rx;
}
} else {
// in a browser or Rhino
root.Rx = Rx;
}
}.call(this)); |
src/svg-icons/communication/screen-share.js | ichiohta/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let CommunicationScreenShare = (props) => (
<SvgIcon {...props}>
<path d="M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.11-.9-2-2-2H4c-1.11 0-2 .89-2 2v10c0 1.1.89 2 2 2H0v2h24v-2h-4zm-7-3.53v-2.19c-2.78 0-4.61.85-6 2.72.56-2.67 2.11-5.33 6-5.87V7l4 3.73-4 3.74z"/>
</SvgIcon>
);
CommunicationScreenShare = pure(CommunicationScreenShare);
CommunicationScreenShare.displayName = 'CommunicationScreenShare';
CommunicationScreenShare.muiName = 'SvgIcon';
export default CommunicationScreenShare;
|
src/components/hello.js | jonny-improbable/react-tape | import React from 'react';
export default class Hello extends React.Component {
render() {
return (
<h1 className="cblue">Hello World</h1>
)
}
}
|
src/svg-icons/image/crop.js | nathanmarks/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageCrop = (props) => (
<SvgIcon {...props}>
<path d="M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"/>
</SvgIcon>
);
ImageCrop = pure(ImageCrop);
ImageCrop.displayName = 'ImageCrop';
ImageCrop.muiName = 'SvgIcon';
export default ImageCrop;
|
ajax/libs/forerunnerdb/1.3.5/fdb-all.min.js | sreym/cdnjs | !function(C){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=C();else if("function"==typeof define&&define.amd)define([],C);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self);f.ForerunnerDB=C()}}(function(){return function f(l,g,c){function b(a,n){if(!g[a]){if(!l[a]){var d="function"==typeof require&&require;if(!n&&d)return d(a,!0);if(h)return h(a,!0);d=Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",
d;}d=g[a]={exports:{}};l[a][0].call(d.exports,function(k){var d=l[a][1][k];return b(d?d:k)},d,d.exports,f,l,g,c)}return g[a].exports}for(var h="function"==typeof require&&require,a=0;a<c.length;a++)b(c[a]);return b}({1:[function(f,l,g){g=f("../lib/Core");f("../lib/CollectionGroup");f("../lib/View");f("../lib/Highchart");f("../lib/Persist");f("../lib/Document");f("../lib/Overview");f("../lib/Grid");l.exports=g},{"../lib/CollectionGroup":4,"../lib/Core":5,"../lib/Document":7,"../lib/Grid":8,"../lib/Highchart":9,
"../lib/Overview":24,"../lib/Persist":26,"../lib/View":29}],2:[function(f,l,g){g=f("./Shared");f("./Path");f=function(c){var b;this._primaryKey="_id";this._keyArr=[];this._data=[];this._objLookup={};this._count=0;for(b in c)c.hasOwnProperty(b)&&this._keyArr.push({key:b,dir:c[b]})};g.addModule("ActiveBucket",f);g.synthesize(f.prototype,"primaryKey");g.mixin(f.prototype,"Mixin.Sorting");f.prototype.qs=function(c,b,h,a){if(!b.length)return 0;for(var e=-1,n,d,k=0,x=b.length-1;x>=k;){n=Math.floor((k+x)/
2);if(e===n)break;e=b[n];void 0!==e&&(d=a(this,c,h,e),0<d&&(k=n+1),0>d&&(x=n-1));e=n}return 0<d?n+1:n};f.prototype._sortFunc=function(c,b,h,a){h=h.split(".:.");a=a.split(".:.");var e=c._keyArr,n=e.length,d,k,x;for(d=0;d<n;d++)if(k=e[d],x=typeof b[k.key],"number"===x&&(h[d]=Number(h[d]),a[d]=Number(a[d])),h[d]!==a[d]){if(1===k.dir)return c.sortAsc(h[d],a[d]);if(-1===k.dir)return c.sortDesc(h[d],a[d])}};f.prototype.insert=function(c){var b,h;b=this.documentKey(c);h=this._data.indexOf(b);-1===h&&(h=
this.qs(c,this._data,b,this._sortFunc));this._data.splice(h,0,b);this._objLookup[c[this._primaryKey]]=b;this._count++;return h};f.prototype.remove=function(c){var b;if(b=this._objLookup[c[this._primaryKey]])if(b=this._data.indexOf(b),-1<b)return this._data.splice(b,1),delete this._objLookup[c[this._primaryKey]],this._count--,!0;return!1};f.prototype.index=function(c){var b,h;b=this.documentKey(c);h=this._data.indexOf(b);-1===h&&(h=this.qs(c,this._data,b,this._sortFunc));return h};f.prototype.documentKey=
function(c){var b="",h=this._keyArr,a=h.length,e,n;for(e=0;e<a;e++)n=h[e],b&&(b+=".:."),b+=c[n.key];return b+=".:."+c[this._primaryKey]};f.prototype.count=function(){return this._count};g.finishModule("ActiveBucket");l.exports=f},{"./Path":25,"./Shared":28}],3:[function(f,l,g){var c,b,h,a,e,n;g=f("./Shared");var d=function(k){this.init.apply(this,arguments)};d.prototype.init=function(k){this._primaryKey="_id";this._primaryIndex=new b("primary");this._primaryCrc=new b("primaryCrc");this._crcLookup=
new b("crcLookup");this._name=k;this._data=[];this._groups=[];this._metrics=new c;this._deferQueue={insert:[],update:[],remove:[],upsert:[]};this._deferThreshold={insert:100,update:100,remove:100,upsert:100};this._deferTime={insert:1,update:1,remove:1,upsert:1};this._subsetOf(this)};g.addModule("Collection",d);g.mixin(d.prototype,"Mixin.Common");g.mixin(d.prototype,"Mixin.Events");g.mixin(d.prototype,"Mixin.ChainReactor");g.mixin(d.prototype,"Mixin.CRUD");g.mixin(d.prototype,"Mixin.Constants");g.mixin(d.prototype,
"Mixin.Triggers");g.mixin(d.prototype,"Mixin.Sorting");g.mixin(d.prototype,"Mixin.Matching");c=f("./Metrics");b=f("./KeyValueStore");h=f("./Path");a=f("./IndexHashMap");e=f("./IndexBinaryTree");n=f("./Crc");f=g.modules.Core;d.prototype.crc=n;g.synthesize(d.prototype,"state");g.synthesize(d.prototype,"name");d.prototype.data=function(){return this._data};d.prototype.drop=function(){if("dropped"!==this._state){if(this._db&&this._db._collection&&this._name){this.debug()&&console.log("Dropping collection "+
this._name);this._state="dropped";this.emit("drop",this);delete this._db._collection[this._name];if(this._groups&&this._groups.length){var k=[],a;for(a=0;a<this._groups.length;a++)k.push(this._groups[a]);for(a=0;a<k.length;a++)this._groups[a].removeCollection(this)}delete this._primaryKey;delete this._primaryIndex;delete this._primaryCrc;delete this._crcLookup;delete this._name;delete this._data;delete this._groups;delete this._metrics;return!0}}else return!0;return!1};d.prototype.primaryKey=function(k){return void 0!==
k?(this._primaryKey!==k&&(this._primaryKey=k,this._primaryIndex.primaryKey(k),this.rebuildPrimaryKeyIndex()),this):this._primaryKey};d.prototype._onInsert=function(k,a){this.emit("insert",k,a)};d.prototype._onUpdate=function(k){this.emit("update",k)};d.prototype._onRemove=function(k){this.emit("remove",k)};g.synthesize(d.prototype,"db");d.prototype.setData=function(k,a,e){if(k){var b=this._metrics.create("setData");b.start();a=this.options(a);this.preSetData(k,a,e);a.$decouple&&(k=this.decouple(k));
k instanceof Array||(k=[k]);b.time("transformIn");k=this.transformIn(k);b.time("transformIn");var d=[].concat(this._data);this._dataReplace(k);b.time("Rebuild Primary Key Index");this.rebuildPrimaryKeyIndex(a);b.time("Rebuild Primary Key Index");b.time("Rebuild All Other Indexes");this._rebuildIndexes();b.time("Rebuild All Other Indexes");b.time("Resolve chains");this.chainSend("setData",k,{oldData:d});b.time("Resolve chains");b.stop();this.emit("setData",this._data,d)}e&&e(!1);return this};d.prototype.rebuildPrimaryKeyIndex=
function(k){var a=k&&void 0!==k.$ensureKeys?k.$ensureKeys:!0;k=k&&void 0!==k.$violationCheck?k.$violationCheck:!0;var e,b,d,h=this._primaryIndex,c=this._primaryCrc,n=this._crcLookup,f=this._primaryKey,g;h.truncate();c.truncate();n.truncate();e=this._data;for(b=e.length;b--;){d=e[b];a&&this.ensurePrimaryKey(d);if(k){if(!h.uniqueSet(d[f],d))throw'ForerunnerDB.Collection "'+this.name()+'": Call to setData on collection failed because your data violates the primary key unique constraint. One or more documents are using the same primary key: '+
d[this._primaryKey];}else h.set(d[f],d);g=JSON.stringify(d);c.set(d[f],g);n.set(g,d)}};d.prototype.ensurePrimaryKey=function(k){void 0===k[this._primaryKey]&&(k[this._primaryKey]=this.objectId())};d.prototype.truncate=function(){this.emit("truncate",this._data);this._data.length=0;this._primaryIndex=new b("primary");this._primaryCrc=new b("primaryCrc");this._crcLookup=new b("crcLookup");this.deferEmit("change",{type:"truncate"});return this};d.prototype.upsert=function(k,a){if(k){var e=this._deferQueue.upsert,
b=this._deferThreshold.upsert,d={},h;if(k instanceof Array){if(k.length>b)return this._deferQueue.upsert=e.concat(k),this.processQueue("upsert",a),{};d=[];for(e=0;e<k.length;e++)d.push(this.upsert(k[e]));a&&a();return d}k[this._primaryKey]?(h={},h[this._primaryKey]=k[this._primaryKey],this._primaryIndex.lookup(h)[0]?d.op="update":d.op="insert"):d.op="insert";switch(d.op){case "insert":d.result=this.insert(k);break;case "update":d.result=this.update(h,k)}return d}a&&a();return{}};d.prototype.update=
function(k,a,e){a=this.decouple(a);a=this.transformIn(a);this.debug()&&console.log('Updating some collection data for collection "'+this.name()+'"');var d=this,b=this._metrics.create("update"),h,c,n=function(h){var c=d.decouple(h),n,f;if(d.willTrigger(d.TYPE_UPDATE,d.PHASE_BEFORE)||d.willTrigger(d.TYPE_UPDATE,d.PHASE_AFTER)){n={type:"update",query:d.decouple(k),update:d.decouple(a),options:d.decouple(e),op:b};if(!1===d.processTrigger(n,d.TYPE_UPDATE,d.PHASE_BEFORE,c)||d.willTrigger(d.TYPE_UPDATE,
d.PHASE_BEFORE)&&(f=d.updateObject(c,n.update,n.query,n.options,""))&&!1===d.processTrigger(n,d.TYPE_UPDATE,d.PHASE_AFTER,h,c))return!1;f=d.updateObject(h,n.update,n.query,n.options,"")}else f=d.updateObject(h,a,k,e,"");return f};b.start();b.time("Retrieve documents to update");h=this.find(k,{$decouple:!1});b.time("Retrieve documents to update");h.length&&(b.time("Update documents"),c=h.filter(n),b.time("Update documents"),c.length&&(b.time("Resolve chains"),this.chainSend("update",{query:k,update:a,
dataSet:h},e),b.time("Resolve chains"),this._onUpdate(c),this.deferEmit("change",{type:"update",data:c})));b.stop();return c||[]};d.prototype._replaceObj=function(k,a){var d;this._removeFromIndexes(k);for(d in k)k.hasOwnProperty(d)&&delete k[d];for(d in a)a.hasOwnProperty(d)&&(k[d]=a[d]);if(!this._insertIntoIndexes(k))throw'ForerunnerDB.Collection "'+this.name()+'": Primary key violation in update! Key violated: '+k[this._primaryKey];return!0};d.prototype.updateById=function(k,a){var d={};d[this._primaryKey]=
k;return this.update(d,a)};d.prototype.updateObject=function(k,a,d,e,b,c){a=this.decouple(a);b=b||"";"."===b.substr(0,1)&&(b=b.substr(1,b.length-1));this.decouple(k);var n=!1,f=!1,g,q,p,m;for(m in a)if(a.hasOwnProperty(m)){g=!1;if("$"===m.substr(0,1))switch(m){case "$key":case "$index":g=!0;break;default:g=!0,f=this.updateObject(k,a[m],d,e,b,m),n=n||f}if(this._isPositionalKey(m)&&(g=!0,m=m.substr(0,m.length-2),f=new h(b+"."+m),k[m]&&k[m]instanceof Array&&k[m].length)){q=[];for(p=0;p<k[m].length;p++)this._match(k[m][p],
f.value(d)[0])&&q.push(p);for(p=0;p<q.length;p++)f=this.updateObject(k[m][q[p]],a[m+".$"],d,e,b+"."+m,c),n=n||f}if(!g)if(c||"object"!==typeof a[m])switch(c){case "$inc":this._updateIncrement(k,m,a[m]);n=!0;break;case "$push":void 0===k[m]&&this._updateProperty(k,m,[]);if(k[m]instanceof Array){if(void 0!==a[m].$position&&a[m].$each instanceof Array)for(f=a[m].$position,g=a[m].$each.length,p=0;p<g;p++)this._updateSplicePush(k[m],f+p,a[m].$each[p]);else if(a[m].$each instanceof Array)for(g=a[m].$each.length,
p=0;p<g;p++)this._updatePush(k[m],a[m].$each[p]);else this._updatePush(k[m],a[m]);n=!0}else throw'ForerunnerDB.Collection "'+this.name()+'": Cannot push to a key that is not an array! ('+m+")";break;case "$pull":if(k[m]instanceof Array){q=[];for(p=0;p<k[m].length;p++)this._match(k[m][p],a[m])&&q.push(p);for(g=q.length;g--;)this._updatePull(k[m],q[g]),n=!0}break;case "$pullAll":if(k[m]instanceof Array)if(a[m]instanceof Array){if(q=k[m],g=q.length,0<g)for(;g--;){for(f=0;f<a[m].length;f++)q[g]===a[m][f]&&
(this._updatePull(k[m],g),g--,n=!0);if(0>g)break}}else throw'ForerunnerDB.Collection "'+this.name()+'": Cannot pullAll without being given an array of values to pull! ('+m+")";break;case "$addToSet":void 0===k[m]&&this._updateProperty(k,m,[]);if(k[m]instanceof Array){p=k[m];var l;q=p.length;var A;g=!0;l=e&&e.$addToSet;var z;a[m].$key?(f=!1,z=new h(a[m].$key),A=z.value(a[m])[0],delete a[m].$key):l&&l.key?(f=!1,z=new h(l.key),A=z.value(a[m])[0]):(A=JSON.stringify(a[m]),f=!0);for(l=0;l<q;l++)if(f){if(JSON.stringify(p[l])===
A){g=!1;break}}else if(A===z.value(p[l])[0]){g=!1;break}g&&(this._updatePush(k[m],a[m]),n=!0)}else throw'ForerunnerDB.Collection "'+this.name()+'": Cannot addToSet on a key that is not an array! (undefined)';break;case "$splicePush":void 0===k[m]&&this._updateProperty(k,m,[]);if(k[m]instanceof Array)if(f=a.$index,void 0!==f)delete a.$index,f>k[m].length&&(f=k[m].length),this._updateSplicePush(k[m],f,a[m]),n=!0;else throw'ForerunnerDB.Collection "'+this.name()+'": Cannot splicePush without a $index integer value!';
else throw'ForerunnerDB.Collection "'+this.name()+'": Cannot splicePush with a key that is not an array! ('+m+")";break;case "$move":if(k[m]instanceof Array)for(p=0;p<k[m].length;p++){if(this._match(k[m][p],a[m])){n=a.$index;if(void 0!==n)delete a.$index,this._updateSpliceMove(k[m],p,n),n=!0;else throw'ForerunnerDB.Collection "'+this.name()+'": Cannot move without a $index integer value!';break}}else throw'ForerunnerDB.Collection "'+this.name()+'": Cannot move on a key that is not an array! ('+m+
")";break;case "$mul":this._updateMultiply(k,m,a[m]);n=!0;break;case "$rename":this._updateRename(k,m,a[m]);n=!0;break;case "$unset":this._updateUnset(k,m);n=!0;break;case "$pop":if(k[m]instanceof Array)this._updatePop(k[m],a[m])&&(n=!0);else throw'ForerunnerDB.Collection "'+this.name()+'": Cannot pop from a key that is not an array! ('+m+")";break;default:k[m]!==a[m]&&(this._updateProperty(k,m,a[m]),n=!0)}else if(null!==k[m]&&"object"===typeof k[m])if(p=k[m]instanceof Array,q=a[m]instanceof Array,
p||q)if(!q&&p)for(p=0;p<k[m].length;p++)f=this.updateObject(k[m][p],a[m],d,e,b+"."+m,c),n=n||f;else k[m]!==a[m]&&(this._updateProperty(k,m,a[m]),n=!0);else f=this.updateObject(k[m],a[m],d,e,b+"."+m,c),n=n||f;else k[m]!==a[m]&&(this._updateProperty(k,m,a[m]),n=!0)}return n};d.prototype._isPositionalKey=function(a){return".$"===a.substr(a.length-2,2)};d.prototype._updateProperty=function(a,d,e){a[d]=e;this.debug()&&console.log('ForerunnerDB.Collection: Setting non-data-bound document property "'+d+
'" for collection "'+this.name()+'"')};d.prototype._updateIncrement=function(a,d,e){a[d]+=e};d.prototype._updateSpliceMove=function(a,d,e){a.splice(e,0,a.splice(d,1)[0]);this.debug()&&console.log('ForerunnerDB.Collection: Moving non-data-bound document array index from "'+d+'" to "'+e+'" for collection "'+this.name()+'"')};d.prototype._updateSplicePush=function(a,d,e){a.length>d?a.splice(d,0,e):a.push(e)};d.prototype._updatePush=function(a,d){a.push(d)};d.prototype._updatePull=function(a,d){a.splice(d,
1)};d.prototype._updateMultiply=function(a,d,e){a[d]*=e};d.prototype._updateRename=function(a,d,e){a[e]=a[d];delete a[d]};d.prototype._updateUnset=function(a,d){delete a[d]};d.prototype._updatePop=function(a,d){var e=!1;0<a.length&&(1===d?(a.pop(),e=!0):-1===d&&(a.shift(),e=!0));return e};d.prototype.remove=function(a,d,e){var b,h;if(a instanceof Array){b=[];for(e=0;e<a.length;e++)b.push(this.remove(a[e],{noEmit:!0}));(!d||d&&!d.noEmit)&&this._onRemove(b);return b}e=this.find(a,{$decouple:!1});if(e.length){for(var c=
0;c<e.length;c++)h=e[c],this._removeFromIndexes(h),b=this._data.indexOf(h),this._dataRemoveAtIndex(b),this.processTrigger(this.TYPE_REMOVE,this.PHASE_AFTER,h,{});this.chainSend("remove",{query:a,dataSet:e},d);(!d||d&&!d.noEmit)&&this._onRemove(e);this.deferEmit("change",{type:"remove",data:e})}return e};d.prototype.removeById=function(a){var d={};d[this._primaryKey]=a;return this.remove(d)};d.prototype.deferEmit=function(){var a=this,d;this._noEmitDefer||this._db&&(!this._db||this._db._noEmitDefer)?
this.emit.apply(this,arguments):(d=arguments,this._changeTimeout&&clearTimeout(this._changeTimeout),this._changeTimeout=setTimeout(function(){a.debug()&&console.log("ForerunnerDB.Collection: Emitting "+d[0]);a.emit.apply(a,d)},100))};d.prototype.processQueue=function(a,d){var e=this._deferQueue[a],b=this._deferThreshold[a],h=this._deferTime[a];if(e.length){var c=this;e.length&&(e=e.length>b?e.splice(0,b):e.splice(0,e.length),this[a](e));setTimeout(function(){c.processQueue(a,d)},h)}else d&&d()};d.prototype.insert=
function(a,d,e){"function"===typeof d?(e=d,d=this._data.length):void 0===d&&(d=this._data.length);a=this.transformIn(a);return this._insertHandle(a,d,e)};d.prototype._insertHandle=function(a,d,e){var b=this._deferQueue.insert,h=this._deferThreshold.insert,c=[],n=[];if(a instanceof Array){if(a.length>h){this._deferQueue.insert=b.concat(a);this.processQueue("insert",e);return}for(h=0;h<a.length;h++)b=this._insert(a[h],d+h),!0===b?c.push(a[h]):n.push({doc:a[h],reason:b})}else b=this._insert(a,d),!0===
b?c.push(a):n.push({doc:a,reason:b});this.chainSend("insert",a,{index:d});this._onInsert(c,n);e&&e();this.deferEmit("change",{type:"insert",data:c});return{inserted:c,failed:n}};d.prototype._insert=function(a,d){if(a){var e;this.ensurePrimaryKey(a);if(e=this.insertIndexViolation(a))return"Index violation in index: "+e;this._insertIntoIndexes(a);d>this._data.length&&(d=this._data.length);this._dataInsertAtIndex(d,a);this.processTrigger(this.TYPE_INSERT,this.PHASE_AFTER,{},a);return!0}return"No document passed to insert"};
d.prototype._dataInsertAtIndex=function(a,d){this._data.splice(a,0,d)};d.prototype._dataRemoveAtIndex=function(a){this._data.splice(a,1)};d.prototype._dataReplace=function(a){for(;this._data.length;)this._data.pop();this._data=this._data.concat(a)};d.prototype._insertIntoIndexes=function(a){var d=this._indexByName,e,b,h=JSON.stringify(a);b=this._primaryIndex.uniqueSet(a[this._primaryKey],a);this._primaryCrc.uniqueSet(a[this._primaryKey],h);this._crcLookup.uniqueSet(h,a);for(e in d)d.hasOwnProperty(e)&&
d[e].insert(a);return b};d.prototype._removeFromIndexes=function(a){var d=this._indexByName,e,b=JSON.stringify(a);this._primaryIndex.unSet(a[this._primaryKey]);this._primaryCrc.unSet(a[this._primaryKey]);this._crcLookup.unSet(b);for(e in d)d.hasOwnProperty(e)&&d[e].remove(a)};d.prototype._rebuildIndexes=function(){var a=this._indexByName,d;for(d in a)a.hasOwnProperty(d)&&a[d].rebuild()};d.prototype.indexOfDocById=function(a){return this._data.indexOf(this._primaryIndex.get(a[this._primaryKey]))};
d.prototype.subset=function(a,e){var b=this.find(a,e);return(new d)._subsetOf(this).primaryKey(this._primaryKey).setData(b)};d.prototype.subsetOf=function(){return this.__subsetOf};d.prototype._subsetOf=function(a){this.__subsetOf=a;return this};d.prototype.distinct=function(a,d,e){d=this.find(d,e);a=new h(a);e={};var b=[],c,n;for(n=0;n<d.length;n++)(c=a.value(d[n])[0])&&!e[c]&&(e[c]=!0,b.push(c));return b};d.prototype.findById=function(a,d){var e={};e[this._primaryKey]=a;return this.find(e,d)[0]};
d.prototype.peek=function(a,e){var b=this._data,h=b.length,c,n,f=new d;if("string"===typeof a){for(c=0;c<h;c++)n=JSON.stringify(b[c]),-1<n.indexOf(a)&&f.insert(b[c]);return f.find({},e)}return this.find(a,e)};d.prototype.explain=function(a,d){return this.find(a,d).__fdbOp._data};d.prototype.options=function(a){a=a||{};a.$decouple=void 0!==a.$decouple?a.$decouple:!0;a.$explain=void 0!==a.$explain?a.$explain:!1;return a};d.prototype.find=function(a,d){a=a||{};d=this.options(d);var e=this._metrics.create("find"),
b=this,c,n=!0,f,g,t,q,p,m,l,A,z,B=[];g=function(d){return b._match(d,a,"and")};e.start();if(a){e.time("analyseQuery");c=this._analyseQuery(a,d,e);e.time("analyseQuery");e.data("analysis",c);if(c.hasJoin&&c.queriesJoin){e.time("joinReferences");for(t=0;t<c.joinsOn.length;t++)p=c.joinsOn[t],q=new h(c.joinQueries[p]),q=q.value(a)[0],this._db.collection(c.joinsOn[t]).subset(q);e.time("joinReferences")}c.indexMatch.length&&(!d||d&&!d.$skipIndex)?(e.data("index.potential",c.indexMatch),e.data("index.used",
c.indexMatch[0].index),e.time("indexLookup"),f=c.indexMatch[0].lookup,e.time("indexLookup"),c.indexMatch[0].keyData.totalKeyCount===c.indexMatch[0].keyData.score&&(n=!1)):e.flag("usedIndex",!1);n&&(f&&f.length?(c=f.length,e.time("tableScan: "+c),f=f.filter(g)):(c=this._data.length,e.time("tableScan: "+c),f=this._data.filter(g)),d.$orderBy&&(e.time("sort"),f=this.sort(d.$orderBy,f),e.time("sort")),e.time("tableScan: "+c));d.limit&&f&&f.length>d.limit&&(f.length=d.limit,e.data("limit",d.limit));d.$decouple&&
(e.time("decouple"),f=this.decouple(f),e.time("decouple"),e.data("flag.decouple",!0));if(d.join){for(g=0;g<d.join.length;g++)for(p in d.join[g])if(d.join[g].hasOwnProperty(p))for(A=p,c=this._db.collection(p),n=d.join[g][p],z=0;z<f.length;z++){l={};q=t=!1;for(m in n)if(n.hasOwnProperty(m))if("$"===m.substr(0,1))switch(m){case "$as":A=n[m];break;case "$multi":t=n[m];break;case "$require":q=n[m];break;default:m.substr(0,3)}else l[m]=(new h(n[m])).value(f[z])[0];l=c.find(l);!q||q&&l[0]?f[z][A]=!1===t?
l[0]:l:B.push(f[z])}e.data("flag.join",!0)}if(B.length){e.time("removalQueue");for(m=0;m<B.length;m++)p=f.indexOf(B[m]),-1<p&&f.splice(p,1);e.time("removalQueue")}if(d.transform){e.time("transform");for(m=0;m<f.length;m++)f.splice(m,1,d.transform(f[m]));e.time("transform");e.data("flag.transform",!0)}this._transformEnabled&&this._transformOut&&(e.time("transformOut"),f=this.transformOut(f),e.time("transformOut"));e.data("results",f.length);e.stop()}else e.stop(),f=[];f.__fdbOp=e;return f};d.prototype.indexOf=
function(a){if(a=this.find(a,{$decouple:!1})[0])return this._data.indexOf(a)};d.prototype.transform=function(a){return void 0!==a?("object"===typeof a?(void 0!==a.enabled&&(this._transformEnabled=a.enabled),void 0!==a.dataIn&&(this._transformIn=a.dataIn),void 0!==a.dataOut&&(this._transformOut=a.dataOut)):this._transformEnabled=!1!==a,this):{enabled:this._transformEnabled,dataIn:this._transformIn,dataOut:this._transformOut}};d.prototype.transformIn=function(a){if(this._transformEnabled&&this._transformIn){if(a instanceof
Array){var d=[],e;for(e=0;e<a.length;e++)d[e]=this._transformIn(a[e]);return d}return this._transformIn(a)}return a};d.prototype.transformOut=function(a){if(this._transformEnabled&&this._transformOut){if(a instanceof Array){var d=[],e;for(e=0;e<a.length;e++)d[e]=this._transformOut(a[e]);return d}return this._transformOut(a)}return a};d.prototype.sort=function(a,d){d=d||[];var e=[],b,c;for(b in a)a.hasOwnProperty(b)&&(c={},c[b]=a[b],c.___fdbKey=b,e.push(c));return 2>e.length?this._sort(a,d):this._bucketSort(e,
d)};d.prototype._bucketSort=function(a,d){var e=a.shift(),b,c,h=[];if(0<a.length){d=this._sort(e,d);b=this.bucket(e.___fdbKey,d);for(c in b)b.hasOwnProperty(c)&&(e=[].concat(a),h=h.concat(this._bucketSort(e,b[c])));return h}return this._sort(e,d)};d.prototype._sort=function(a,d){var e=this,b,c=new h;b=c.parse(a,!0)[0];c.path(b.path);if(1===b.value)b=function(a,d){var b=c.value(a)[0],k=c.value(d)[0];return e.sortAsc(b,k)};else if(-1===b.value)b=function(a,d){var b=c.value(a)[0],k=c.value(d)[0];return e.sortDesc(b,
k)};else throw'ForerunnerDB.Collection "'+this.name()+'": $orderBy clause has invalid direction: '+b.value+", accepted values are 1 or -1 for ascending or descending!";return d.sort(b)};d.prototype.bucket=function(a,d){var e,b={};for(e=0;e<d.length;e++)b[d[e][a]]=b[d[e][a]]||[],b[d[e][a]].push(d[e]);return b};d.prototype._analyseQuery=function(a,d,e){var b={queriesOn:[this._name],indexMatch:[],hasJoin:!1,queriesJoin:!1,joinQueries:{},query:a,options:d},c,n=[],f=[],g,t,q,p,m,l;e.time("checkIndexes");
if(m=(new h).countKeys(a)){void 0!==a[this._primaryKey]&&(e.time("checkIndexMatch: Primary Key"),b.indexMatch.push({lookup:this._primaryIndex.lookup(a,d),keyData:{matchedKeys:[this._primaryKey],totalKeyCount:m,score:1},index:this._primaryIndex}),e.time("checkIndexMatch: Primary Key"));for(l in this._indexById)if(this._indexById.hasOwnProperty(l)&&(t=this._indexById[l],q=t.name(),e.time("checkIndexMatch: "+q),g=t.match(a,d),0<g.score&&(p=t.lookup(a,d),b.indexMatch.push({lookup:p,keyData:g,index:t})),
e.time("checkIndexMatch: "+q),g.score===m))break;e.time("checkIndexes");1<b.indexMatch.length&&(e.time("findOptimalIndex"),b.indexMatch.sort(function(a,d){if(a.keyData.score>d.keyData.score)return-1;if(a.keyData.score<d.keyData.score)return 1;if(a.keyData.score===d.keyData.score)return a.lookup.length-d.lookup.length}),e.time("findOptimalIndex"))}if(d.join){b.hasJoin=!0;for(e=0;e<d.join.length;e++)for(c in d.join[e])d.join[e].hasOwnProperty(c)&&(n.push(c),"$as"in d.join[e][c]?f.push(d.join[e][c].$as):
f.push(c));for(c=0;c<f.length;c++)if(d=this._queryReferencesCollection(a,f[c],""))b.joinQueries[n[c]]=d,b.queriesJoin=!0;b.joinsOn=n;b.queriesOn=b.queriesOn.concat(n)}return b};d.prototype._queryReferencesCollection=function(a,d,e){for(var b in a)if(a.hasOwnProperty(b)){if(b===d)return e&&(e+="."),e+b;if("object"===typeof a[b])return e&&(e+="."),e+=b,this._queryReferencesCollection(a[b],d,e)}return!1};d.prototype.count=function(a,d){return a?this.find(a,d).length:this._data.length};d.prototype.findSub=
function(a,d,e,b){var c=new h(d);a=this.find(a);var n=a.length,f,g,t=this._db.collection("__FDB_temp_"+this.objectId()),q={parents:n,subDocTotal:0,subDocs:[],pathFound:!1,err:""};for(f=0;f<n;f++)if(g=c.value(a[f])[0]){t.setData(g);g=t.find(e,b);if(b.returnFirst&&g.length)return g[0];q.subDocs.push(g);q.subDocTotal+=g.length;q.pathFound=!0}t.drop();if(b.noStats)return q.subDocs;q.pathFound||(q.err="No objects found in the parent documents with a matching path of: "+d);return q};d.prototype.insertIndexViolation=
function(a){var d,e=this._indexByName,b,c;if(this._primaryIndex.get(a[this._primaryKey]))d=this._primaryIndex;else for(b in e)if(e.hasOwnProperty(b)&&(c=e[b],c.unique()&&c.violation(a))){d=c;break}return d?d.name():!1};d.prototype.ensureIndex=function(d,b){this._indexByName=this._indexByName||{};this._indexById=this._indexById||{};var c,h={start:(new Date).getTime()};if(b)switch(b.type){case "hashed":c=new a(d,b,this);break;case "btree":c=new e(d,b,this);break;default:c=new a(d,b,this)}else c=new a(d,
b,this);if(this._indexByName[c.name()])return{err:"Index with that name already exists"};if(this._indexById[c.id()])return{err:"Index with those keys already exists"};c.rebuild();this._indexByName[c.name()]=c;this._indexById[c.id()]=c;h.end=(new Date).getTime();h.total=h.end-h.start;this._lastOp={type:"ensureIndex",stats:{time:h}};return{index:c,id:c.id(),name:c.name(),state:c.state()}};d.prototype.index=function(a){if(this._indexByName)return this._indexByName[a]};d.prototype.lastOp=function(){return this._metrics.list()};
d.prototype.diff=function(a){var d={insert:[],update:[],remove:[]},e=this.primaryKey(),b,c,h,n;if(e===a.primaryKey()){for(b=a._data;b&&!(b instanceof Array);)a=b,b=a._data;n=b.length;for(c=0;c<n;c++)h=b[c],this._primaryIndex.get(h[e])?this._primaryCrc.get(h[e])!==a._primaryCrc.get(h[e])&&d.update.push(h):d.insert.push(h);b=this._data;n=b.length;for(c=0;c<n;c++)h=b[c],a._primaryIndex.get(h[e])||d.remove.push(h)}else throw'ForerunnerDB.Collection "'+this.name()+'": Collection diffing requires that both collections have the same primary key!';
return d};f.prototype.collection=function(a,e){if(a)return this._collection[a]||this.debug()&&console.log("Creating collection "+a),this._collection[a]=this._collection[a]||(new d(a)).db(this),void 0!==e&&this._collection[a].primaryKey(e),this._collection[a];throw'ForerunnerDB.Core "'+this.name()+'": Cannot get collection with undefined name!';};f.prototype.collectionExists=function(a){return Boolean(this._collection[a])};f.prototype.collections=function(a){var d=[],e;a&&(a instanceof RegExp||(a=
RegExp(a)));for(e in this._collection)this._collection.hasOwnProperty(e)&&(a?a.exec(e)&&d.push({name:e,count:this._collection[e].count()}):d.push({name:e,count:this._collection[e].count()}));return d};g.finishModule("Collection");l.exports=d},{"./Crc":6,"./IndexBinaryTree":10,"./IndexHashMap":11,"./KeyValueStore":12,"./Metrics":13,"./Path":25,"./Shared":28}],4:[function(f,l,g){var c,b;g=f("./Shared");var h=function(){this.init.apply(this,arguments)};h.prototype.init=function(a){this._name=a;this._data=
new b("__FDB__cg_data_"+this._name);this._collections=[];this._view=[]};g.addModule("CollectionGroup",h);g.mixin(h.prototype,"Mixin.Common");g.mixin(h.prototype,"Mixin.ChainReactor");g.mixin(h.prototype,"Mixin.Constants");g.mixin(h.prototype,"Mixin.Triggers");b=f("./Collection");f=g.modules.Core;c=g.modules.Core.prototype.init;h.prototype.on=function(){this._data.on.apply(this._data,arguments)};h.prototype.off=function(){this._data.off.apply(this._data,arguments)};h.prototype.emit=function(){this._data.emit.apply(this._data,
arguments)};h.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey=a,this):this._primaryKey};g.synthesize(h.prototype,"state");g.synthesize(h.prototype,"db");h.prototype.addCollection=function(a){if(a&&-1===this._collections.indexOf(a)){if(this._collections.length){if(this._primaryKey!==a.primaryKey())throw'ForerunnerDB.CollectionGroup "'+this.name()+'": All collections in a collection group must have the same primary key!';}else this.primaryKey(a.primaryKey());this._collections.push(a);
a._groups.push(this);a.chain(this);this._data.insert(a.find())}return this};h.prototype.removeCollection=function(a){if(a){var e=this._collections.indexOf(a);-1!==e&&(a.unChain(this),this._collections.splice(e,1),e=a._groups.indexOf(this),-1!==e&&a._groups.splice(e,1));0===this._collections.length&&delete this._primaryKey}return this};h.prototype._chainHandler=function(a){switch(a.type){case "setData":a.data=this.decouple(a.data);this._data.remove(a.options.oldData);this._data.insert(a.data);break;
case "insert":a.data=this.decouple(a.data);this._data.insert(a.data);break;case "update":this._data.update(a.data.query,a.data.update,a.options);break;case "remove":this._data.remove(a.data.query,a.options)}};h.prototype.insert=function(){this._collectionsRun("insert",arguments)};h.prototype.update=function(){this._collectionsRun("update",arguments)};h.prototype.updateById=function(){this._collectionsRun("updateById",arguments)};h.prototype.remove=function(){this._collectionsRun("remove",arguments)};
h.prototype._collectionsRun=function(a,e){for(var b=0;b<this._collections.length;b++)this._collections[b][a].apply(this._collections[b],e)};h.prototype.find=function(a,e){return this._data.find(a,e)};h.prototype.removeById=function(a){for(var e=0;e<this._collections.length;e++)this._collections[e].removeById(a)};h.prototype.subset=function(a,e){var c=this.find(a,e);return(new b)._subsetOf(this).primaryKey(this._primaryKey).setData(c)};h.prototype.drop=function(){if("dropped"!==this._state){var a,
e;this._debug&&console.log("Dropping collection group "+this._name);this._state="dropped";if(this._collections&&this._collections.length)for(e=[].concat(this._collections),a=0;a<e.length;a++)this.removeCollection(e[a]);if(this._view&&this._view.length)for(e=[].concat(this._view),a=0;a<e.length;a++)this._removeView(e[a]);this.emit("drop",this)}return!0};f.prototype.init=function(){this._collectionGroup={};c.apply(this,arguments)};f.prototype.collectionGroup=function(a){return a?(this._collectionGroup[a]=
this._collectionGroup[a]||(new h(a)).db(this),this._collectionGroup[a]):this._collectionGroup};f.prototype.collectionGroups=function(){var a=[],e;for(e in this._collectionGroup)this._collectionGroup.hasOwnProperty(e)&&a.push({name:e});return a};l.exports=h},{"./Collection":3,"./Shared":28}],5:[function(f,l,g){var c,b,h;c=f("./Shared");h=f("./Overload");g=function(a){this.init.apply(this,arguments)};g.prototype.init=function(a){this._name=a;this._collection={};this._debug={}};g.prototype.moduleLoaded=
h({string:function(a){if(void 0!==a){a=a.replace(/ /g,"");a=a.split(",");var e;for(e=0;e<a.length;e++)if(!c.modules[a[e]])return!1;return!0}return!1},"string, function":function(a,e){if(void 0!==a){a=a.replace(/ /g,"");var b=a.split(","),d;for(d=0;d<b.length;d++)if(!c.modules[b[d]])return!1;e()}},"string, function, function":function(a,e,b){if(void 0!==a){a=a.replace(/ /g,"");a=a.split(",");var d;for(d=0;d<a.length;d++)if(!c.modules[a[d]])return b(),!1;e()}}});g.prototype.version=function(a,e){return void 0!==
a?0===c.version.indexOf(a)?(e&&e(),!0):!1:c.version};g.moduleLoaded=g.prototype.moduleLoaded;g.version=g.prototype.version;g.shared=c;g.prototype.shared=c;c.addModule("Core",g);c.mixin(g.prototype,"Mixin.Common");c.mixin(g.prototype,"Mixin.ChainReactor");c.mixin(g.prototype,"Mixin.Constants");b=f("./Collection.js");f("./Metrics.js");f=f("./Crc.js");g.prototype._isServer=!1;c.synthesize(g.prototype,"state");c.synthesize(g.prototype,"name");g.prototype.isClient=function(){return!this._isServer};g.prototype.isServer=
function(){return this._isServer};g.prototype.crc=f;g.prototype.isClient=function(){return!this._isServer};g.prototype.isServer=function(){return this._isServer};g.prototype.arrayToCollection=function(a){return(new b).setData(a)};g.prototype.on=function(a,e){this._listeners=this._listeners||{};this._listeners[a]=this._listeners[a]||[];this._listeners[a].push(e);return this};g.prototype.off=function(a,e){if(a in this._listeners){var b=this._listeners[a],d=b.indexOf(e);-1<d&&b.splice(d,1)}return this};
g.prototype.emit=function(a,e){this._listeners=this._listeners||{};if(a in this._listeners){var b=this._listeners[a],d=b.length,c;for(c=0;c<d;c++)b[c].apply(this,Array.prototype.slice.call(arguments,1))}return this};g.prototype.peek=function(a){var e,b,d=[],c=typeof a;for(e in this._collection)this._collection.hasOwnProperty(e)&&(b=this._collection[e],d="string"===c?d.concat(b.peek(a)):d.concat(b.find(a)));return d};g.prototype.peekCat=function(a){var e,b,d={},c,h=typeof a;for(e in this._collection)this._collection.hasOwnProperty(e)&&
(b=this._collection[e],(c="string"===h?b.peek(a):b.find(a))&&c.length&&(d[b.name()]=c));return d};g.prototype.drop=function(a){if("dropped"!==this._state){var e=this.collections(),b=e.length,d,c=0,h=function(){c++;c===b&&a&&a()};this._state="dropped";for(d=0;d<b;d++)this.collection(e[d].name).drop(h),delete this._collection[e[d].name];this.emit("drop",this)}return!0};l.exports=g},{"./Collection.js":3,"./Crc.js":6,"./Metrics.js":13,"./Overload":23,"./Shared":28}],6:[function(f,l,g){var c=function(){var b=
[],c,a,e;for(a=0;256>a;a++){c=a;for(e=0;8>e;e++)c=c&1?3988292384^c>>>1:c>>>1;b[a]=c}return b}();l.exports=function(b){var h=-1,a;for(a=0;a<b.length;a++)h=h>>>8^c[(h^b.charCodeAt(a))&255];return(h^-1)>>>0}},{}],7:[function(f,l,g){var c,b;g=f("./Shared");var h=function(){this.init.apply(this,arguments)};h.prototype.init=function(a){this._name=a;this._data={}};g.addModule("Document",h);g.mixin(h.prototype,"Mixin.Common");g.mixin(h.prototype,"Mixin.Events");g.mixin(h.prototype,"Mixin.ChainReactor");g.mixin(h.prototype,
"Mixin.Constants");g.mixin(h.prototype,"Mixin.Triggers");f=f("./Collection");c=g.modules.Core;b=g.modules.Core.prototype.init;g.synthesize(h.prototype,"state");g.synthesize(h.prototype,"db");g.synthesize(h.prototype,"name");h.prototype.setData=function(a){var e,b;if(a)if(a=this.decouple(a),this._linked){b={};for(e in this._data)"jQuery"!==e.substr(0,6)&&this._data.hasOwnProperty(e)&&void 0===a[e]&&(b[e]=1);a.$unset=b;this.updateObject(this._data,a,{})}else this._data=a;return this};h.prototype.update=
function(a,e,b){this.updateObject(this._data,e,a,b)};h.prototype.updateObject=f.prototype.updateObject;h.prototype._isPositionalKey=function(a){return".$"===a.substr(a.length-2,2)};h.prototype._updateProperty=function(a,e,b){this._linked?(jQuery.observable(a).setProperty(e,b),this.debug()&&console.log('ForerunnerDB.Document: Setting data-bound document property "'+e+'" for collection "'+this.name()+'"')):(a[e]=b,this.debug()&&console.log('ForerunnerDB.Document: Setting non-data-bound document property "'+
e+'" for collection "'+this.name()+'"'))};h.prototype._updateIncrement=function(a,e,b){this._linked?jQuery.observable(a).setProperty(e,a[e]+b):a[e]+=b};h.prototype._updateSpliceMove=function(a,e,b){this._linked?(jQuery.observable(a).move(e,b),this.debug()&&console.log('ForerunnerDB.Document: Moving data-bound document array index from "'+e+'" to "'+b+'" for collection "'+this.name()+'"')):(a.splice(b,0,a.splice(e,1)[0]),this.debug()&&console.log('ForerunnerDB.Document: Moving non-data-bound document array index from "'+
e+'" to "'+b+'" for collection "'+this.name()+'"'))};h.prototype._updateSplicePush=function(a,e,b){a.length>e?this._linked?jQuery.observable(a).insert(e,b):a.splice(e,0,b):this._linked?jQuery.observable(a).insert(b):a.push(b)};h.prototype._updatePush=function(a,e){this._linked?jQuery.observable(a).insert(e):a.push(e)};h.prototype._updatePull=function(a,e){this._linked?jQuery.observable(a).remove(e):a.splice(e,1)};h.prototype._updateMultiply=function(a,e,b){this._linked?jQuery.observable(a).setProperty(e,
a[e]*b):a[e]*=b};h.prototype._updateRename=function(a,e,b){var d=a[e];this._linked?(jQuery.observable(a).setProperty(b,d),jQuery.observable(a).removeProperty(e)):(a[b]=d,delete a[e])};h.prototype._updateUnset=function(a,e){this._linked?jQuery.observable(a).removeProperty(e):delete a[e]};h.prototype._updatePop=function(a,e){var b,d=!1;0<a.length&&(this._linked?(1===e?b=a.length-1:-1===e&&(b=0),-1<b&&(jQuery.observable(arr).remove(b),d=!0)):1===e?(a.pop(),d=!0):-1===e&&(a.shift(),d=!0));return d};h.prototype.drop=
function(){if("dropped"!==this._state){if(this._db&&this._name&&this._db&&this._db._document&&this._db._document[this._name])return this._state="dropped",delete this._db._document[this._name],delete this._data,this.emit("drop",this),!0}else return!0;return!1};c.prototype.init=function(){b.apply(this,arguments)};c.prototype.document=function(a){return a?(this._document=this._document||{},this._document[a]=this._document[a]||(new h(a)).db(this),this._document[a]):this._document};c.prototype.documents=
function(){var a=[],e;for(e in this._document)this._document.hasOwnProperty(e)&&a.push({name:e});return a};g.finishModule("Document");l.exports=h},{"./Collection":3,"./Shared":28}],8:[function(f,l,g){var c,b,h,a;g=f("./Shared");var e=function(a,d){this.init.apply(this,arguments)};e.prototype.init=function(a,d,e){var b=this;this._selector=a;this._template=d;this._options=e;this._debug={};this._collectionDroppedWrap=function(){b._collectionDropped.apply(b,arguments)}};g.addModule("Grid",e);g.mixin(e.prototype,
"Mixin.Common");g.mixin(e.prototype,"Mixin.ChainReactor");g.mixin(e.prototype,"Mixin.Constants");g.mixin(e.prototype,"Mixin.Triggers");g.mixin(e.prototype,"Mixin.Events");c=f("./Collection");b=f("./CollectionGroup");h=f("./View");f("./ReactorIO");f=g.modules.Core;a=f.prototype.init;g.synthesize(e.prototype,"state");g.synthesize(e.prototype,"name");e.prototype.insert=function(){this._from.insert.apply(this._from,arguments)};e.prototype.update=function(){this._from.update.apply(this._from,arguments)};
e.prototype.updateById=function(){this._from.updateById.apply(this._from,arguments)};e.prototype.remove=function(){this._from.remove.apply(this._from,arguments)};e.prototype.from=function(a){void 0!==a&&(this._from&&(this._from.off("drop",this._collectionDroppedWrap),this._from._removeGrid(this)),"string"===typeof a&&(a=this._db.collection(a)),this._from=a,this.refresh());return this};e.prototype.db=function(a){return void 0!==a?(this._db=a,this):this._db};e.prototype._collectionDropped=function(a){a&&
delete this._from};e.prototype.drop=function(){if("dropped"!==this._state){if(this._from)return this._from.unlink(this._selector,this.template()),this._from.off("drop",this._collectionDroppedWrap),this._from._removeGrid(this),(this.debug()||this._db&&this._db.debug())&&console.log("ForerunnerDB.Grid: Dropping grid "+this._selector),this._state="dropped",this._db&&this._selector&&delete this._db._grid[this._selector],this.emit("drop",this),delete this._selector,delete this._template,delete this._from,
delete this._db,!0}else return!0;return!1};e.prototype.template=function(a){return void 0!==a?(this._template=a,this):this._template};e.prototype._sortGridClick=function(a){a=($(a.currentTarget).attr("data-grid-sort")||"").split(",");var d={},e;for(e=0;e<a.length;e++)d[a]=1;this._from.orderBy(d)};e.prototype.refresh=function(){if(this._from)if(this._from.link){var a=this,d=$(this._selector),e=function(){a._sortGridClick.apply(a,arguments)};d.html("");this._from.orderBy&&d.off("click","[data-grid-sort]",
e);this._from.link(this._selector,this.template(),{wrap:"gridRow"});if(this._from.orderBy)d.on("click","[data-grid-sort]",e)}else throw"Grid requires the AutoBind module in order to operate!";return this};c.prototype.grid=h.prototype.grid=function(a,d,b){if(this._db&&this._db._grid){if(this._db._grid[a])throw'ForerunnerDB.Collection/View "'+this.name()+'": Cannot create a grid using this collection/view because a grid with this name already exists: '+name;a=(new e(a,d,b)).db(this._db).from(this);
this._grid=this._grid||[];this._grid.push(a);return a}};c.prototype._addGrid=b.prototype._addGrid=h.prototype._addGrid=function(a){void 0!==a&&(this._grid=this._grid||[],this._grid.push(a));return this};c.prototype._removeGrid=b.prototype._removeGrid=h.prototype._removeGrid=function(a){void 0!==a&&this._grid&&(a=this._grid.indexOf(a),-1<a&&this._grid.splice(a,1));return this};f.prototype.init=function(){this._grid={};a.apply(this,arguments)};f.prototype.grid=function(a,d,b){this._grid[a]||(this.debug()||
this._db&&this._db.debug())&&console.log("Core.Grid: Creating grid "+a);this._grid[a]=this._grid[a]||(new e(a,d,b)).db(this);return this._grid[a]};f.prototype.gridExists=function(a){return Boolean(this._grid[a])};f.prototype.grids=function(){var a=[],d;for(d in this._grid)this._grid.hasOwnProperty(d)&&a.push({name:d,count:this._grid[d].count()});return a};g.finishModule("Grid");l.exports=e},{"./Collection":3,"./CollectionGroup":4,"./ReactorIO":27,"./Shared":28,"./View":29}],9:[function(f,l,g){var c,
b;g=f("./Shared");b=f("./Overload");var h=function(a,e){this.init.apply(this,arguments)};h.prototype.init=function(a,e){this._options=e;this._selector=jQuery(this._options.selector);if(!this._selector[0])throw'ForerunnerDB.Highchart "'+a.name()+'": Chart target element does not exist via selector: '+this._options.selector;this._listeners={};this._collection=a;this._options.series=[];e.chartOptions=e.chartOptions||{};e.chartOptions.credits=!1;var b,d;switch(this._options.type){case "pie":this._selector.highcharts(this._options.chartOptions);
this._chart=this._selector.highcharts();b=this._collection.find();d={allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b>: {y} ({point.percentage:.0f}%)",style:{color:Highcharts.theme&&Highcharts.theme.contrastTextColor||"black"}}};b=this.pieDataFromCollectionData(b,this._options.keyField,this._options.valField);jQuery.extend(d,this._options.seriesOptions);jQuery.extend(d,{name:this._options.seriesName,data:b});this._chart.addSeries(d,!0,!0);break;case "line":case "area":case "column":case "bar":b=
this.seriesDataFromCollectionData(this._options.seriesField,this._options.keyField,this._options.valField,this._options.orderBy);this._options.chartOptions.xAxis=b.xAxis;this._options.chartOptions.series=b.series;this._selector.highcharts(this._options.chartOptions);this._chart=this._selector.highcharts();break;default:throw'ForerunnerDB.Highchart "'+a.name()+'": Chart type specified is not currently supported by ForerunnerDB: '+this._options.type;}this._hookEvents()};g.addModule("Highchart",h);f=
g.modules.Collection;c=f.prototype.init;g.mixin(h.prototype,"Mixin.Events");g.synthesize(h.prototype,"state");h.prototype.pieDataFromCollectionData=function(a,e,b){var d=[],c;for(c=0;c<a.length;c++)d.push([a[c][e],a[c][b]]);return d};h.prototype.seriesDataFromCollectionData=function(a,e,b,d){var c=this._collection.distinct(a),h=[],f={categories:[]},g,u,l,w,y;for(w=0;w<c.length;w++){g=c[w];u={};u[a]=g;l=[];u=this._collection.find(u,{orderBy:d});for(y=0;y<u.length;y++)f.categories.push(u[y][e]),l.push(u[y][b]);
h.push({name:g,data:l})}return{xAxis:f,series:h}};h.prototype._hookEvents=function(){var a=this;a._collection.on("change",function(){a._changeListener.apply(a,arguments)});a._collection.on("drop",function(){a.drop.apply(a,arguments)})};h.prototype._changeListener=function(){if("undefined"!==typeof this._collection&&this._chart){var a=this._collection.find();switch(this._options.type){case "pie":this._chart.series[0].setData(this.pieDataFromCollectionData(a,this._options.keyField,this._options.valField),
!0,!0);break;case "bar":case "line":case "area":case "column":var e=this.seriesDataFromCollectionData(this._options.seriesField,this._options.keyField,this._options.valField,this._options.orderBy);this._chart.xAxis[0].setCategories(e.xAxis.categories);for(a=0;a<e.series.length;a++)this._chart.series[a]?this._chart.series[a].setData(e.series[a].data,!0,!0):this._chart.addSeries(e.series[a],!0,!0)}}};h.prototype.drop=function(){"dropped"!==this._state&&(this._state="dropped",this._chart&&this._chart.destroy(),
this._collection&&(this._collection.off("change",this._changeListener),this._collection.off("drop",this.drop),this._collection._highcharts&&delete this._collection._highcharts[this._options.selector]),delete this._chart,delete this._options,delete this._collection,this.emit("drop",this));return!0};f.prototype.init=function(){this._highcharts={};c.apply(this,arguments)};f.prototype.pieChart=new b({object:function(a){a.type="pie";a.chartOptions=a.chartOptions||{};a.chartOptions.chart=a.chartOptions.chart||
{};a.chartOptions.chart.type="pie";this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a));return this._highcharts[a.selector]},"*, string, string, string, ...":function(a,e,b,d,c){c=c||{};c.selector=a;c.keyField=e;c.valField=b;c.seriesName=d;this.pieChart(c)}});f.prototype.lineChart=new b({object:function(a){a.type="line";a.chartOptions=a.chartOptions||{};a.chartOptions.chart=a.chartOptions.chart||{};a.chartOptions.chart.type="line";this._highcharts[a.selector]||(this._highcharts[a.selector]=
new h(this,a));return this._highcharts[a.selector]},"*, string, string, string, ...":function(a,e,b,d,c){c=c||{};c.seriesField=e;c.selector=a;c.keyField=b;c.valField=d;this.lineChart(c)}});f.prototype.areaChart=new b({object:function(a){a.type="area";a.chartOptions=a.chartOptions||{};a.chartOptions.chart=a.chartOptions.chart||{};a.chartOptions.chart.type="area";this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a));return this._highcharts[a.selector]},"*, string, string, string, ...":function(a,
e,b,d,c){c=c||{};c.seriesField=e;c.selector=a;c.keyField=b;c.valField=d;this.areaChart(c)}});f.prototype.columnChart=new b({object:function(a){a.type="column";a.chartOptions=a.chartOptions||{};a.chartOptions.chart=a.chartOptions.chart||{};a.chartOptions.chart.type="column";this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a));return this._highcharts[a.selector]},"*, string, string, string, ...":function(a,e,b,d,c){c=c||{};c.seriesField=e;c.selector=a;c.keyField=b;c.valField=d;
this.columnChart(c)}});f.prototype.barChart=new b({object:function(a){a.type="bar";a.chartOptions=a.chartOptions||{};a.chartOptions.chart=a.chartOptions.chart||{};a.chartOptions.chart.type="bar";this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a));return this._highcharts[a.selector]},"*, string, string, string, ...":function(a,e,b,d,c){c=c||{};c.seriesField=e;c.selector=a;c.keyField=b;c.valField=d;this.barChart(c)}});f.prototype.stackedBarChart=new b({object:function(a){a.type=
"bar";a.chartOptions=a.chartOptions||{};a.chartOptions.chart=a.chartOptions.chart||{};a.chartOptions.chart.type="bar";a.plotOptions=a.plotOptions||{};a.plotOptions.series=a.plotOptions.series||{};a.plotOptions.series.stacking=a.plotOptions.series.stacking||"normal";this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a));return this._highcharts[a.selector]},"*, string, string, string, ...":function(a,e,b,d,c){c=c||{};c.seriesField=e;c.selector=a;c.keyField=b;c.valField=d;this.stackedBarChart(c)}});
f.prototype.dropChart=function(a){this._highcharts&&this._highcharts[a]&&this._highcharts[a].drop()};g.finishModule("Highchart");l.exports=h},{"./Overload":23,"./Shared":28}],10:[function(f,l,g){g=f("./Shared");var c=f("./Path"),b=function(){};f=function(){this.init.apply(this,arguments)};f.prototype.init=function(c,a,e){this._btree=new (b.create(2,this.sortAsc));this._size=0;this._id=this._itemKeyHash(c,c);this.unique(a&&a.unique?a.unique:!1);void 0!==c&&this.keys(c);void 0!==e&&this.collection(e);
this.name(a&&a.name?a.name:this._id)};g.addModule("IndexBinaryTree",f);g.mixin(f.prototype,"Mixin.ChainReactor");g.mixin(f.prototype,"Mixin.Sorting");f.prototype.id=function(){return this._id};f.prototype.state=function(){return this._state};f.prototype.size=function(){return this._size};g.synthesize(f.prototype,"data");g.synthesize(f.prototype,"name");g.synthesize(f.prototype,"collection");g.synthesize(f.prototype,"type");g.synthesize(f.prototype,"unique");f.prototype.keys=function(b){return void 0!==
b?(this._keys=b,this._keyCount=(new c).parse(this._keys).length,this):this._keys};f.prototype.rebuild=function(){if(this._collection){var c=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}).find(),a,e=c.length;this._btree=new (b.create(2,this.sortAsc));this._unique&&(this._uniqueLookup={});for(a=0;a<e;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}};f.prototype.insert=function(b,a){var e=this._unique,c=this._itemKeyHash(b,
this._keys);e&&(e=this._itemHash(b,this._keys),this._uniqueLookup[e]=b);e=this._btree.get(c);void 0===e&&(e=[],this._btree.put(c,e));e.push(b);this._size++};f.prototype.remove=function(b,a){var e=this._unique,c=this._itemKeyHash(b,this._keys),d;e&&(e=this._itemHash(b,this._keys),delete this._uniqueLookup[e]);e=this._btree.get(c);void 0!==e&&(d=e.indexOf(b),-1<d&&(1===e.length?this._btree.del(c):e.splice(d,1),this._size--))};f.prototype.violation=function(b){b=this._itemHash(b,this._keys);return Boolean(this._uniqueLookup[b])};
f.prototype.hashViolation=function(b){return Boolean(this._uniqueLookup[b])};f.prototype.lookup=function(b){return this._data[this._itemHash(b,this._keys)]||[]};f.prototype.match=function(b,a){var e=new c,f=e.parseArr(this._keys),e=e.parseArr(b),d=[],k=0,g;for(g=0;g<f.length;g++)if(e[g]===f[g])k++,d.push(e[g]);else return{matchedKeys:[],totalKeyCount:e.length,score:0};return{matchedKeys:d,totalKeyCount:e.length,score:k}};f.prototype._itemHash=function(b,a){var e=new c,f,d="",k;f=e.parse(a);for(k=
0;k<f.length;k++)d&&(d+="_"),d+=e.value(b,f[k].path).join(":");return d};f.prototype._itemKeyHash=function(b,a){var e=new c,f,d="",k;f=e.parse(a);for(k=0;k<f.length;k++)d&&(d+="_"),d+=e.keyValue(b,f[k].path);return d};f.prototype._itemHashArr=function(b,a){var e=new c,f,d=[],k,g,r,s;f=e.parse(a);for(r=0;r<f.length;r++)for(k=e.value(b,f[r].path),g=0;g<k.length;g++)if(0===r)d.push(k[g]);else for(s=0;s<d.length;s++)d[s]=d[s]+"_"+k[g];return d};g.finishModule("IndexBinaryTree");l.exports=f},{"./Path":25,
"./Shared":28}],11:[function(f,l,g){g=f("./Shared");var c=f("./Path");f=function(){this.init.apply(this,arguments)};f.prototype.init=function(b,c,a){this._crossRef={};this._size=0;this._id=this._itemKeyHash(b,b);this.data({});this.unique(c&&c.unique?c.unique:!1);void 0!==b&&this.keys(b);void 0!==a&&this.collection(a);this.name(c&&c.name?c.name:this._id)};g.addModule("IndexHashMap",f);g.mixin(f.prototype,"Mixin.ChainReactor");f.prototype.id=function(){return this._id};f.prototype.state=function(){return this._state};
f.prototype.size=function(){return this._size};g.synthesize(f.prototype,"data");g.synthesize(f.prototype,"name");g.synthesize(f.prototype,"collection");g.synthesize(f.prototype,"type");g.synthesize(f.prototype,"unique");f.prototype.keys=function(b){return void 0!==b?(this._keys=b,this._keyCount=(new c).parse(this._keys).length,this):this._keys};f.prototype.rebuild=function(){if(this._collection){var b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}).find(),c,a=b.length;this._data={};
this._unique&&(this._uniqueLookup={});for(c=0;c<a;c++)this.insert(b[c])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}};f.prototype.insert=function(b,c){var a,e;this._unique&&(a=this._itemHash(b,this._keys),this._uniqueLookup[a]=b);a=this._itemHashArr(b,this._keys);for(e=0;e<a.length;e++)this.pushToPathValue(a[e],b)};f.prototype.remove=function(b,c){var a,e;this._unique&&(a=this._itemHash(b,this._keys),delete this._uniqueLookup[a]);a=this._itemHashArr(b,
this._keys);for(e=0;e<a.length;e++)this.pullFromPathValue(a[e],b)};f.prototype.violation=function(b){b=this._itemHash(b,this._keys);return Boolean(this._uniqueLookup[b])};f.prototype.hashViolation=function(b){return Boolean(this._uniqueLookup[b])};f.prototype.pushToPathValue=function(b,c){var a=this._data[b]=this._data[b]||[];-1===a.indexOf(c)&&(a.push(c),this._size++,this.pushToCrossRef(c,a))};f.prototype.pullFromPathValue=function(b,c){var a=this._data[b],e;e=a.indexOf(c);-1<e&&(a.splice(e,1),this._size--,
this.pullFromCrossRef(c,a));a.length||delete this._data[b]};f.prototype.pull=function(b){var c=b[this._collection.primaryKey()],a=this._crossRef[c],e,f=a.length,d;for(e=0;e<f;e++)d=a[e],this._pullFromArray(d,b);this._size--;delete this._crossRef[c]};f.prototype._pullFromArray=function(b,c){for(var a=b.length;a--;)b[a]===c&&b.splice(a,1)};f.prototype.pushToCrossRef=function(b,c){var a=b[this._collection.primaryKey()];this._crossRef[a]=this._crossRef[a]||[];a=this._crossRef[a];-1===a.indexOf(c)&&a.push(c)};
f.prototype.pullFromCrossRef=function(b,c){var a=b[this._collection.primaryKey()];delete this._crossRef[a]};f.prototype.lookup=function(b){return this._data[this._itemHash(b,this._keys)]||[]};f.prototype.match=function(b,h){var a=new c,e=a.parseArr(this._keys),a=a.parseArr(b),f=[],d=0,k;for(k=0;k<e.length;k++)if(a[k]===e[k])d++,f.push(a[k]);else return{matchedKeys:[],totalKeyCount:a.length,score:0};return{matchedKeys:f,totalKeyCount:a.length,score:d}};f.prototype._itemHash=function(b,h){var a=new c,
e,f="",d;e=a.parse(h);for(d=0;d<e.length;d++)f&&(f+="_"),f+=a.value(b,e[d].path).join(":");return f};f.prototype._itemKeyHash=function(b,h){var a=new c,e,f="",d;e=a.parse(h);for(d=0;d<e.length;d++)f&&(f+="_"),f+=a.keyValue(b,e[d].path);return f};f.prototype._itemHashArr=function(b,h){var a=new c,e,f=[],d,k,g,r;e=a.parse(h);for(g=0;g<e.length;g++)for(d=a.value(b,e[g].path),k=0;k<d.length;k++)if(0===g)f.push(d[k]);else for(r=0;r<f.length;r++)f[r]=f[r]+"_"+d[k];return f};g.finishModule("IndexHashMap");
l.exports=f},{"./Path":25,"./Shared":28}],12:[function(f,l,g){f=f("./Shared");g=function(c){this.init.apply(this,arguments)};g.prototype.init=function(c){this._name=c;this._data={};this._primaryKey="_id"};f.addModule("KeyValueStore",g);f.mixin(g.prototype,"Mixin.ChainReactor");f.synthesize(g.prototype,"name");g.prototype.primaryKey=function(c){return void 0!==c?(this._primaryKey=c,this):this._primaryKey};g.prototype.truncate=function(){this._data={};return this};g.prototype.set=function(c,b){this._data[c]=
b?b:!0;return this};g.prototype.get=function(c){return this._data[c]};g.prototype.lookup=function(c){c=c[this._primaryKey];var b,h,a,e;if(c instanceof Array){h=c.length;e=[];for(b=0;b<h;b++)(a=this._data[c[b]])&&e.push(a);return e}if(c instanceof RegExp){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&c.test(b)&&e.push(this._data[b]);return e}if("object"===typeof c){if(c.$ne){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&b!==c.$ne&&e.push(this._data[b]);return e}if(c.$in&&c.$in instanceof
Array){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&-1<c.$in.indexOf(b)&&e.push(this._data[b]);return e}if(c.$nin&&c.$nin instanceof Array){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&-1===c.$nin.indexOf(b)&&e.push(this._data[b]);return e}if(c.$or&&c.$or instanceof Array){e=[];for(b=0;b<c.$or.length;b++)e=e.concat(this.lookup(c.$or[b]));return e}}else return a=this._data[c],void 0!==a?[a]:[]};g.prototype.unSet=function(c){delete this._data[c];return this};g.prototype.uniqueSet=
function(c,b){return void 0===this._data[c]?(this._data[c]=b,!0):!1};f.finishModule("KeyValueStore");l.exports=g},{"./Shared":28}],13:[function(f,l,g){g=f("./Shared");var c=f("./Operation");f=function(){this.init.apply(this,arguments)};f.prototype.init=function(){this._data=[]};g.addModule("Metrics",f);g.mixin(f.prototype,"Mixin.ChainReactor");f.prototype.create=function(b){b=new c(b);this._enabled&&this._data.push(b);return b};f.prototype.start=function(){this._enabled=!0;return this};f.prototype.stop=
function(){this._enabled=!1;return this};f.prototype.clear=function(){this._data=[];return this};f.prototype.list=function(){return this._data};g.finishModule("Metrics");l.exports=f},{"./Operation":22,"./Shared":28}],14:[function(f,l,g){l.exports={preSetData:function(){},postSetData:function(){}}},{}],15:[function(f,l,g){l.exports={chain:function(c){this._chain=this._chain||[];-1===this._chain.indexOf(c)&&this._chain.push(c)},unChain:function(c){this._chain&&(c=this._chain.indexOf(c),-1<c&&this._chain.splice(c,
1))},chainSend:function(c,b,h){if(this._chain){var a=this._chain,e=a.length,f;for(f=0;f<e;f++)a[f].chainReceive(this,c,b,h)}},chainReceive:function(c,b,h,a){c={sender:c,type:b,data:h,options:a};(!this._chainHandler||this._chainHandler&&!this._chainHandler(c))&&this.chainSend(c.type,c.data,c.options)}}},{}],16:[function(f,l,g){var c=0;f={decouple:function(b,c){if(void 0!==b){if(c){var a,e=JSON.stringify(b),f=[];for(a=0;a<c;a++)f.push(JSON.parse(e));return f}return JSON.parse(JSON.stringify(b))}},objectId:function(b){var h=
Math.pow(10,17);if(b){var a=0,e=b.length,f;for(f=0;f<e;f++)a+=b.charCodeAt(f)*h;b=a.toString(16)}else c++,b=(c+(Math.random()*h+Math.random()*h+Math.random()*h+Math.random()*h)).toString(16);return b},debug:f("./Overload")([function(){return this._debug&&this._debug.all},function(b){return void 0!==b?"boolean"===typeof b?(this._debug=this._debug||{},this._debug.all=b,this.chainSend("debug",this._debug),this):this._debug&&this._debug[b]||this._db&&this._db._debug&&this._db._debug[b]||this._debug&&
this._debug.all:this._debug&&this._debug.all},function(b,c){return void 0!==b?void 0!==c?(this._debug=this._debug||{},this._debug[b]=c,this.chainSend("debug",this._debug),this):this._debug&&this._debug[c]||this._db&&this._db._debug&&this._db._debug[b]:this._debug&&this._debug.all}])};l.exports=f},{"./Overload":23}],17:[function(f,l,g){l.exports={TYPE_INSERT:0,TYPE_UPDATE:1,TYPE_REMOVE:2,PHASE_BEFORE:0,PHASE_AFTER:1}},{}],18:[function(f,l,g){f=f("./Overload");f={on:new f({"string, function":function(c,
b){this._listeners=this._listeners||{};this._listeners[c]=this._listeners[c]||{};this._listeners[c]["*"]=this._listeners[c]["*"]||[];this._listeners[c]["*"].push(b);return this},"string, *, function":function(c,b,f){this._listeners=this._listeners||{};this._listeners[c]=this._listeners[c]||{};this._listeners[c][b]=this._listeners[c][b]||[];this._listeners[c][b].push(f);return this}}),off:new f({string:function(c){this._listeners&&this._listeners[c]&&c in this._listeners&&delete this._listeners[c];
return this},"string, function":function(c,b){var f,a;"string"===typeof b?this._listeners&&this._listeners[c]&&this._listeners[c][b]&&delete this._listeners[c][b]:c in this._listeners&&(f=this._listeners[c]["*"],a=f.indexOf(b),-1<a&&f.splice(a,1));return this},"string, *, function":function(c,b,f){this._listeners&&c in this._listeners&&b in this.listeners[c]&&(c=this._listeners[c][b],f=c.indexOf(f),-1<f&&c.splice(f,1))},"string, *":function(c,b){this._listeners&&c in this._listeners&&b in this._listeners[c]&&
delete this._listeners[c][b]}}),emit:function(c,b){this._listeners=this._listeners||{};if(c in this._listeners){var f,a;if(this._listeners[c]["*"]){var e=this._listeners[c]["*"];a=e.length;for(f=0;f<a;f++)e[f].apply(this,Array.prototype.slice.call(arguments,1))}if(b instanceof Array&&b[0]&&b[0][this._primaryKey]){var e=this._listeners[c],g,d;a=b.length;for(f=0;f<a;f++)if(e[b[f][this._primaryKey]])for(g=e[b[f][this._primaryKey]].length,d=0;d<g;d++)e[b[f][this._primaryKey]][d].apply(this,Array.prototype.slice.call(arguments,
1))}}return this}};l.exports=f},{"./Overload":23}],19:[function(f,l,g){l.exports={_match:function(c,b,f){var a,e;a=typeof c;e=typeof b;var g=!0,d;if(!("string"!==a&&"number"!==a||"string"!==e&&"number"!==e))c!==b&&(g=!1);else for(d in b)if(b.hasOwnProperty(d)){a=!1;if("$"===d.substr(0,1)&&(e=this._matchOp(d,c,b[d]),-1<e)){if(e){if("or"===f)return!0}else g=e;a=!0}if(!a&&b[d]instanceof RegExp)if(a=!0,"object"===typeof c&&void 0!==c[d]&&b[d].test(c[d])){if("or"===f)return!0}else g=!1;if(!a)if("object"===
typeof b[d])if(void 0!==c[d]){if(c[d]instanceof Array&&!(b[d]instanceof Array))for(a=!1,e=0;e<c[d].length&&!(a=this._match(c[d][e],b[d],void 0));e++);else if(!(c[d]instanceof Array)&&b[d]instanceof Array)for(a=!1,e=0;e<b[d].length&&!(a=this._match(c[d],b[d][e],void 0));e++);else a="object"===typeof c?this._match(c[d],b[d],void 0):this._match(void 0,b[d],void 0);if(a){if("or"===f)return!0}else g=!1}else if(b[d]&&void 0!==b[d].$exists)if(a=this._match(void 0,b[d],void 0)){if("or"===f)return!0}else g=
!1;else g=!1;else if(c&&c[d]===b[d]){if("or"===f)return!0}else if(c&&c[d]&&c[d]instanceof Array&&b[d]&&"object"!==typeof b[d]){a=!1;for(e=0;e<c[d].length&&!(a=this._match(c[d][e],b[d],void 0));e++);if(a){if("or"===f)return!0}else g=!1}else g=!1;if("and"===f&&!g)return!1}return g},_matchOp:function(c,b,f){switch(c){case "$gt":return b>f;case "$gte":return b>=f;case "$lt":return b<f;case "$lte":return b<=f;case "$exists":return void 0===b!==f;case "$ne":return b!=f;case "$or":for(c=0;c<f.length;c++)if(this._match(b,
f[c],"and"))return!0;return!1;case "$and":for(c=0;c<f.length;c++)if(!this._match(b,f[c],"and"))return!1;return!0;case "$in":if(f instanceof Array){c=f.length;var a;for(a=0;a<c;a++)if(f[a]===b)return!0;return!1}throw'ForerunnerDB.Mixin.Matching "'+this.name()+'": Cannot use an $in operator on a non-array key: '+c;case "$nin":if(f instanceof Array){c=f.length;for(a=0;a<c;a++)if(f[a]===b)return!1;return!0}throw'ForerunnerDB.Mixin.Matching "'+this.name()+'": Cannot use a $nin operator on a non-array key: '+
c;}return-1}}},{}],20:[function(f,l,g){l.exports={sortAsc:function(c,b){return"string"===typeof c&&"string"===typeof b?c.localeCompare(b):c>b?1:c<b?-1:0},sortDesc:function(c,b){return"string"===typeof c&&"string"===typeof b?b.localeCompare(c):c>b?-1:c<b?1:0}}},{}],21:[function(f,l,g){l.exports={addTrigger:function(c,b,f,a){return-1===this._triggerIndex(c,b,f)?(this._trigger=this._trigger||{},this._trigger[b]=this._trigger[b]||{},this._trigger[b][f]=this._trigger[b][f]||[],this._trigger[b][f].push({id:c,
method:a}),!0):!1},removeTrigger:function(c,b,f){c=this._triggerIndex(c,b,f);-1<c&&this._trigger[b][f].splice(c,1);return!1},willTrigger:function(c,b){return this._trigger&&this._trigger[c]&&this._trigger[c][b]&&this._trigger[c][b].length},processTrigger:function(c,b,f,a,e){var g,d;if(this._trigger&&this._trigger[b]&&this._trigger[b][f]){b=this._trigger[b][f];g=b.length;for(f=0;f<g;f++){d=b[f];this.debug();d=d.method.call(this,c,a,e);if(!1===d)return!1;if(void 0!==d&&!0!==d&&!1!==d)throw"ForerunnerDB.Mixin.Triggers: Trigger error: "+
d;}return!0}},_triggerIndex:function(c,b,f){var a;if(this._trigger&&this._trigger[b]&&this._trigger[b][f])for(b=this._trigger[b][f],f=b.length,a=0;a<f;a++)if(b[a].id===c)return a;return-1}}},{}],22:[function(f,l,g){g=f("./Shared");var c=f("./Path");f=function(b){this.pathSolver=new c;this.counter=0;this.init.apply(this,arguments)};f.prototype.init=function(b){this._data={operation:b,index:{potential:[],used:!1},steps:[],time:{startMs:0,stopMs:0,totalMs:0,process:{}},flag:{},log:[]}};g.addModule("Operation",
f);g.mixin(f.prototype,"Mixin.ChainReactor");f.prototype.start=function(){this._data.time.startMs=(new Date).getTime()};f.prototype.log=function(b){if(b){var c=0<this._log.length?this._data.log[this._data.log.length-1].time:0;b={event:b,time:(new Date).getTime(),delta:0};this._data.log.push(b);c&&(b.delta=b.time-c);return this}return this._data.log};f.prototype.time=function(b){if(void 0!==b){var c=this._data.time.process,c=c[b]=c[b]||{};c.startMs?(c.stopMs=(new Date).getTime(),c.totalMs=c.stopMs-
c.startMs,c.stepObj.totalMs=c.totalMs,delete c.stepObj):(c.startMs=(new Date).getTime(),c.stepObj={name:b},this._data.steps.push(c.stepObj));return this}return this._data.time};f.prototype.flag=function(b,c){if(void 0!==b&&void 0!==c)this._data.flag[b]=c;else return void 0!==b?this._data.flag[b]:this._data.flag};f.prototype.data=function(b,c,a){return void 0!==c?(this.pathSolver.set(this._data,b,c),this):this.pathSolver.get(this._data,b)};f.prototype.pushData=function(b,c,a){this.pathSolver.push(this._data,
b,c)};f.prototype.stop=function(){this._data.time.stopMs=(new Date).getTime();this._data.time.totalMs=this._data.time.stopMs-this._data.time.startMs};g.finishModule("Operation");l.exports=f},{"./Path":25,"./Shared":28}],23:[function(f,l,g){Overload=function(c){if(c){var b,f,a,e,g;if(!(c instanceof Array)){a={};for(b in c)if(c.hasOwnProperty(b))if(e=b.replace(/ /g,""),-1===e.indexOf("*"))a[e]=c[b];else for(g=generateSignaturePermutations(e),e=0;e<g.length;e++)a[g[e]]||(a[g[e]]=c[b]);c=a}return function(){var a=
[],e;if(c instanceof Array)for(f=c.length,b=0;b<f;b++){if(c[b].length===arguments.length)return c[b].apply(this,arguments)}else{for(b=0;b<arguments.length;b++)e=typeof arguments[b],"object"===e&&arguments[b]instanceof Array&&(e="array"),a.push(e);e=a.join(",");if(c[e])return c[e].apply(this,arguments);for(b=a.length;0<=b;b--)if(e=a.slice(0,b).join(","),c[e+",..."])return c[e+",..."].apply(this,arguments)}throw'ForerunnerDB.Overload "'+this.name()+'": Overloaded method does not have a matching signature for the passed arguments: '+
JSON.stringify(a);}}return function(){}};generateSignaturePermutations=function(c){var b=[],f,a=["string","object","number","function","undefined"],e;if(-1<c.indexOf("*"))for(e=0;e<a.length;e++)f=c.replace("*",a[e]),b=b.concat(generateSignaturePermutations(f));else b.push(c);return b};l.exports=Overload},{}],24:[function(f,l,g){var c,b,h;g=f("./Shared");var a=function(){this.init.apply(this,arguments)};a.prototype.init=function(a){var c=this;this._name=a;this._data=new h("__FDB__dc_data_"+this._name);
this._collData=new b;this._collections=[];this._collectionDroppedWrap=function(){c._collectionDropped.apply(c,arguments)}};g.addModule("Overview",a);g.mixin(a.prototype,"Mixin.Common");g.mixin(a.prototype,"Mixin.ChainReactor");g.mixin(a.prototype,"Mixin.Constants");g.mixin(a.prototype,"Mixin.Triggers");g.mixin(a.prototype,"Mixin.Events");b=f("./Collection");h=f("./Document");f=g.modules.Core;c=g.modules.Core.prototype.init;g.synthesize(a.prototype,"state");g.synthesize(a.prototype,"db");g.synthesize(a.prototype,
"name");g.synthesize(a.prototype,"query",function(a){var b=this.$super(a);void 0!==a&&this._refresh();return b});g.synthesize(a.prototype,"queryOptions",function(a){var b=this.$super(a);void 0!==a&&this._refresh();return b});g.synthesize(a.prototype,"reduce",function(a){var b=this.$super(a);void 0!==a&&this._refresh();return b});a.prototype.from=function(a){return void 0!==a?("string"===typeof a&&(a=this._db.collection(a)),this._addCollection(a),this):this._collections};a.prototype.find=function(){return this._collData.find.apply(this._collData,
arguments)};a.prototype.count=function(){return this._collData.count.apply(this._collData,arguments)};a.prototype._addCollection=function(a){-1===this._collections.indexOf(a)&&(this._collections.push(a),a.chain(this),a.on("drop",this._collectionDroppedWrap),this._refresh());return this};a.prototype._removeCollection=function(a){-1<this._collections.indexOf(a)&&(this._collections.splice(a,1),a.unChain(this),a.off("drop",this._collectionDroppedWrap),this._refresh());return this};a.prototype._collectionDropped=
function(a){a&&this._removeCollection(a)};a.prototype._refresh=function(){if("dropped"!==this._state){if(this._collections&&this._collections[0]){this._collData.primaryKey(this._collections[0].primaryKey());var a=[],b;for(b=0;b<this._collections.length;b++)a=a.concat(this._collections[b].find(this._query,this._queryOptions));this._collData.setData(a)}this._reduce&&(a=this._reduce(),this._data.setData(a))}};a.prototype._chainHandler=function(a){switch(a.type){case "setData":case "insert":case "update":case "remove":this._refresh()}};
a.prototype.data=function(){return this._data};a.prototype.drop=function(){if("dropped"!==this._state){this._state="dropped";delete this._data;for(delete this._collData;this._collections.length;)this._removeCollection(this._collections[0]);delete this._collections;this._db&&this._name&&delete this._db._overview[this._name];delete this._name;this.emit("drop",this)}return!0};f.prototype.init=function(){this._overview={};c.apply(this,arguments)};f.prototype.overview=function(b){return b?(this._overview[b]=
this._overview[b]||(new a(b)).db(this),this._overview[b]):this._overview};g.finishModule("Overview");l.exports=a},{"./Collection":3,"./Document":7,"./Shared":28}],25:[function(f,l,g){f=f("./Shared");g=function(c){this.init.apply(this,arguments)};g.prototype.init=function(c){c&&this.path(c)};f.addModule("Path",g);f.mixin(g.prototype,"Mixin.ChainReactor");g.prototype.path=function(c){return void 0!==c?(this._path=this.clean(c),this._pathParts=this._path.split("."),this):this._path};g.prototype.hasObjectPaths=
function(c,b){var f=!0,a;for(a in c)if(c.hasOwnProperty(a)&&(void 0===b[a]||"object"===typeof c[a]&&(f=this.hasObjectPaths(c[a],b[a]),!f)))return!1;return f};g.prototype.countKeys=function(c){var b=0,f;for(f in c)c.hasOwnProperty(f)&&void 0!==c[f]&&("object"!==typeof c[f]?b++:b+=this.countKeys(c[f]));return b};g.prototype.countObjectPaths=function(c,b){var f,a={},e=0,g=0,d;for(d in b)b.hasOwnProperty(d)&&("object"===typeof b[d]?(f=this.countObjectPaths(c[d],b[d]),a[d]=f.matchedKeys,g+=f.totalKeyCount,
e+=f.matchedKeyCount):(g++,c&&c[d]&&"object"!==typeof c[d]?(a[d]=!0,e++):a[d]=!1));return{matchedKeys:a,matchedKeyCount:e,totalKeyCount:g}};g.prototype.parse=function(c,b){var f=[],a="",e,g,d;for(g in c)if(c.hasOwnProperty(g))if(a=g,"object"===typeof c[g])if(b)for(e=this.parse(c[g],b),d=0;d<e.length;d++)f.push({path:a+"."+e[d].path,value:e[d].value});else for(e=this.parse(c[g]),d=0;d<e.length;d++)f.push({path:a+"."+e[d].path});else b?f.push({path:a,value:c[g]}):f.push({path:a});return f};g.prototype.parseArr=
function(c,b){b=b||{};return this._parseArr(c,"",[],b)};g.prototype._parseArr=function(c,b,f,a){var e,g="";b=b||"";f=f||[];for(e in c)c.hasOwnProperty(e)&&(!a.ignore||a.ignore&&!a.ignore.test(e))&&(g=b?b+"."+e:e,"object"===typeof c[e]?this._parseArr(c[e],g,f,a):f.push(g));return f};g.prototype.value=function(c,b){if(void 0!==c&&"object"===typeof c){var f,a,e,g,d=[],k;void 0!==b&&(b=this.clean(b),f=b.split("."));f=f||this._pathParts;a=f.length;e=c;for(k=0;k<a;k++){e=e[f[k]];if(g instanceof Array){for(a=
0;a<g.length;a++)d=d.concat(this.value(g,a+"."+f[k]));return d}if(!e||"object"!==typeof e)break;g=e}return[e]}return[]};g.prototype.set=function(c,b,f){if(void 0!==c&&void 0!==b){var a;b=this.clean(b);b=b.split(".");a=b.shift();b.length?(c[a]=c[a]||{},this.set(c[a],b.join("."),f)):c[a]=f}return c};g.prototype.get=function(c,b){return this.value(c,b)[0]};g.prototype.push=function(c,b,f){if(void 0!==c&&void 0!==b){var a;b=this.clean(b);b=b.split(".");a=b.shift();if(b.length)c[a]=c[a]||{},this.set(c[a],
b.join("."),f);else if(c[a]=c[a]||[],c[a]instanceof Array)c[a].push(f);else throw"ForerunnerDB.Path: Cannot push to a path whose endpoint is not an array!";}return c};g.prototype.keyValue=function(c,b){var f,a,e,g,d;void 0!==b&&(b=this.clean(b),f=b.split("."));f=f||this._pathParts;a=f.length;e=c;for(d=0;d<a;d++)if(e=e[f[d]],!e||"object"!==typeof e){g=f[d]+":"+e;break}return g};g.prototype.clean=function(c){"."===c.substr(0,1)&&(c=c.substr(1,c.length-1));return c};f.finishModule("Path");l.exports=
g},{"./Shared":28}],26:[function(f,l,g){g=f("./Shared");var c=f("localforage"),b,h,a,e,n;n=function(){this.init.apply(this,arguments)};n.prototype.init=function(a){a.isClient()&&void 0!==Storage&&(this.mode("localforage"),c.config({driver:[c.INDEXEDDB,c.WEBSQL,c.LOCALSTORAGE],name:"ForerunnerDB",storeName:"FDB"}))};g.addModule("Persist",n);g.mixin(n.prototype,"Mixin.ChainReactor");b=g.modules.Core;h=f("./Collection");a=h.prototype.drop;f("./CollectionGroup");e=b.prototype.init;f=g.overload;n.prototype.mode=
function(a){return void 0!==a?(this._mode=a,this):this._mode};n.prototype.driver=function(a){if(void 0!==a){switch(a.toUpperCase()){case "LOCALSTORAGE":c.setDriver(c.LOCALSTORAGE);break;case "WEBSQL":c.setDriver(c.WEBSQL);break;case "INDEXEDDB":c.setDriver(c.INDEXEDDB);break;default:throw"ForerunnerDB.Persist: The persistence driver you have specified is not found. Please use either IndexedDB, WebSQL or LocalStorage!";}return this}return c.driver()};n.prototype.save=function(a,b,e){var f;f=function(a,
b){a="object"===typeof a?"json::fdb::"+JSON.stringify(a):"raw::fdb::"+a;b&&b(!1,a)};switch(this.mode()){case "localforage":f(b,function(b,f){c.setItem(a,f).then(function(a){e(!1,a)},function(a){e(a)})});break;default:e&&e("No data handler.")}};n.prototype.load=function(a,b){var e,f,g;g=function(a,b){if(a){e=a.split("::fdb::");switch(e[0]){case "json":f=JSON.parse(e[1]);break;case "raw":f=e[1]}b&&b(!1,f)}else b(!1,a)};switch(this.mode()){case "localforage":c.getItem(a).then(function(a){g(a,b)},function(a){b(a)});
break;default:b&&b("No data handler or unrecognised data type.")}};n.prototype.drop=function(a,b){switch(this.mode()){case "localforage":c.removeItem(a).then(function(){b(!1)},function(a){b(a)});break;default:b&&b("No data handler or unrecognised data type.")}};h.prototype.drop=new f({"":function(){"dropped"!==this._state&&this.drop(!0)},"function":function(a){"dropped"!==this._state&&this.drop(!0,a)},"boolean":function(b){if("dropped"!==this._state){if(b)if(this._name)if(this._db)this._db.persist.drop(this._name);
else throw"ForerunnerDB.Persist: Cannot drop a collection's persistent storage when the collection is not attached to a database!";else throw"ForerunnerDB.Persist: Cannot drop a collection's persistent storage when no name assigned to collection!";a.apply(this,arguments)}},"boolean, function":function(b,c){"dropped"!==this._state&&(b&&(this._name?this._db?this._db.persist.drop(this._name,c):c&&c("Cannot drop a collection's persistent storage when the collection is not attached to a database!"):c&&
c("Cannot drop a collection's persistent storage when no name assigned to collection!")),a.apply(this,arguments))}});h.prototype.save=function(a){this._name?this._db?this._db.persist.save(this._name,this._data,a):a&&a("Cannot save a collection that is not attached to a database!"):a&&a("Cannot save a collection with no assigned name!")};h.prototype.load=function(a){var b=this;this._name?this._db?this._db.persist.load(this._name,function(c,e){c?a&&a(c):(e&&b.setData(e),a&&a(!1))}):a&&a("Cannot load a collection that is not attached to a database!"):
a&&a("Cannot load a collection with no assigned name!")};b.prototype.init=function(){this.persist=new n(this);e.apply(this,arguments)};b.prototype.load=function(a){var b=this._collection,c=b.keys().length,e,f;e=function(b){b?a(b):(c--,0===c&&a(!1))};for(f in b)b.hasOwnProperty(f)&&b[f].load(e)};b.prototype.save=function(a){var b=this._collection,c=b.keys().length,e,f;e=function(b){b?a(b):(c--,0===c&&a(!1))};for(f in b)b.hasOwnProperty(f)&&b[f].save(e)};g.finishModule("Persist");l.exports=n},{"./Collection":3,
"./CollectionGroup":4,"./Shared":28,localforage:36}],27:[function(f,l,g){f=f("./Shared");g=function(c,b,f){if(c&&b&&f){this._reactorIn=c;this._reactorOut=b;this._chainHandler=f;if(!c.chain||!b.chainReceive)throw"ForerunnerDB.ReactorIO: ReactorIO requires passed in and out objects to implement the ChainReactor mixin!";c.chain(this);this.chain(b)}else throw"ForerunnerDB.ReactorIO: ReactorIO requires an in, out and process argument to instantiate!";};f.addModule("ReactorIO",g);g.prototype.drop=function(){"dropped"!==
this._state&&(this._state="dropped",this._reactorIn&&this._reactorIn.unChain(this),this._reactorOut&&this.unChain(this._reactorOut),delete this._reactorIn,delete this._reactorOut,delete this._chainHandler,this.emit("drop",this));return!0};f.synthesize(g.prototype,"state");f.mixin(g.prototype,"Mixin.ChainReactor");f.mixin(g.prototype,"Mixin.Events");f.finishModule("ReactorIO");l.exports=g},{"./Shared":28}],28:[function(f,l,g){f={version:"1.3.4",modules:{},_synth:{},addModule:function(c,b){this.modules[c]=
b;this.emit("moduleLoad",[c,b])},finishModule:function(c){if(this.modules[c])this.modules[c]._fdbFinished=!0,this.emit("moduleFinished",[c,this.modules[c]]);else throw"ForerunnerDB.Shared: finishModule called on a module that has not been registered with addModule(): "+c;},moduleFinished:function(c,b){if(this.modules[c]&&this.modules[c]._fdbFinished)b(c,this.modules[c]);else this.on("moduleFinished",b)},moduleExists:function(c){return Boolean(this.modules[c])},mixin:function(c,b){var f=this.mixins[b];
if(f)for(var a in f)f.hasOwnProperty(a)&&(c[a]=f[a]);else throw"ForerunnerDB.Shared: Cannot find mixin named: "+b;},synthesize:function(c,b,f){this._synth[b]=this._synth[b]||function(a){return void 0!==a?(this["_"+b]=a,this):this["_"+b]};if(f){var a=this;c[b]=function(){var c=this.$super,g;this.$super=a._synth[b];g=f.apply(this,arguments);this.$super=c;return g}}else c[b]=this._synth[b]},overload:f("./Overload"),mixins:{"Mixin.Common":f("./Mixin.Common"),"Mixin.Events":f("./Mixin.Events"),"Mixin.ChainReactor":f("./Mixin.ChainReactor"),
"Mixin.CRUD":f("./Mixin.CRUD"),"Mixin.Constants":f("./Mixin.Constants"),"Mixin.Triggers":f("./Mixin.Triggers"),"Mixin.Sorting":f("./Mixin.Sorting"),"Mixin.Matching":f("./Mixin.Matching")}};f.mixin(f,"Mixin.Events");l.exports=f},{"./Mixin.CRUD":14,"./Mixin.ChainReactor":15,"./Mixin.Common":16,"./Mixin.Constants":17,"./Mixin.Events":18,"./Mixin.Matching":19,"./Mixin.Sorting":20,"./Mixin.Triggers":21,"./Overload":23}],29:[function(f,l,g){var c,b,h,a,e,n;g=f("./Shared");var d=function(a,b,c){this.init.apply(this,
arguments)};d.prototype.init=function(a,b,e){var d=this;this._name=a;this._groups=[];this._listeners={};this._querySettings={};this._debug={};this.query(b,!1);this.queryOptions(e,!1);this._collectionDroppedWrap=function(){d._collectionDropped.apply(d,arguments)};this._privateData=new c("__FDB__view_privateData_"+this._name)};g.addModule("View",d);g.mixin(d.prototype,"Mixin.Common");g.mixin(d.prototype,"Mixin.ChainReactor");g.mixin(d.prototype,"Mixin.Constants");g.mixin(d.prototype,"Mixin.Triggers");
c=f("./Collection");b=f("./CollectionGroup");n=f("./ActiveBucket");e=f("./ReactorIO");h=c.prototype.init;f=g.modules.Core;a=f.prototype.init;g.synthesize(d.prototype,"state");g.synthesize(d.prototype,"name");d.prototype.insert=function(){this._from.insert.apply(this._from,arguments)};d.prototype.update=function(){this._from.update.apply(this._from,arguments)};d.prototype.updateById=function(){this._from.updateById.apply(this._from,arguments)};d.prototype.remove=function(){this._from.remove.apply(this._from,
arguments)};d.prototype.find=function(a,b){return this.publicData().find(a,b)};d.prototype.data=function(){return this._privateData};d.prototype.from=function(a){var b=this;if(void 0!==a){this._from&&(this._from.off("drop",this._collectionDroppedWrap),this._from._removeView(this));"string"===typeof a&&(a=this._db.collection(a));this._from=a;this._io=new e(a,this,function(a){var c,e,d;if(b._querySettings.query){if("insert"===a.type){c=a.data;if(c instanceof Array)for(e=[],a=0;a<c.length;a++)b._privateData._match(c[a],
b._querySettings.query,"and")&&(e.push(c[a]),d=!0);else b._privateData._match(c,b._querySettings.query,"and")&&(e=c,d=!0);d&&this.chainSend("insert",e);return!0}if("update"===a.type&&(e=b._privateData.diff(b._from.subset(b._querySettings.query,b._querySettings.options)),e.insert.length||e.remove.length)){e.insert.length&&this.chainSend("insert",e.insert);if(e.update.length)for(d=b._privateData.primaryKey(),a=0;a<e.update.length;a++)c={},c[d]=e.update[a][d],this.chainSend("update",{query:c,update:e.update[a]});
if(e.remove.length){d=b._privateData.primaryKey();c=[];var f={query:{$or:c}};for(a=0;a<e.remove.length;a++)c.push({_id:e.remove[a][d]});this.chainSend("remove",f)}return!0}}return!1});var c=a.find(this._querySettings.query,this._querySettings.options);this._transformPrimaryKey(a.primaryKey());this._transformSetData(c);this._privateData.primaryKey(a.primaryKey());this._privateData.setData(c);this._querySettings.options&&this._querySettings.options.$orderBy?this.rebuildActiveBucket(this._querySettings.options.$orderBy):
this.rebuildActiveBucket()}return this};d.prototype._collectionDropped=function(a){a&&delete this._from};d.prototype.ensureIndex=function(){return this._privateData.ensureIndex.apply(this._privateData,arguments)};d.prototype._chainHandler=function(a){var b,c,e,d;switch(a.type){case "setData":this.debug()&&console.log('ForerunnerDB.View: Setting data on view "'+this.name()+'" in underlying (internal) view collection "'+this._privateData.name()+'"');a=this._from.find(this._querySettings.query,this._querySettings.options);
this._transformSetData(a);this._privateData.setData(a);break;case "insert":this.debug()&&console.log('ForerunnerDB.View: Inserting some data on view "'+this.name()+'" in underlying (internal) view collection "'+this._privateData.name()+'"');a.data=this.decouple(a.data);a.data instanceof Array||(a.data=[a.data]);if(this._querySettings.options&&this._querySettings.options.$orderBy)for(b=a.data,c=b.length,e=0;e<c;e++)d=this._activeBucket.insert(b[e]),this._transformInsert(a.data,d),this._privateData._insertHandle(a.data,
d);else d=this._privateData._data.length,this._transformInsert(a.data,d),this._privateData._insertHandle(a.data,d);break;case "update":this.debug()&&console.log('ForerunnerDB.View: Updating some data on view "'+this.name()+'" in underlying (internal) view collection "'+this._privateData.name()+'"');this._privateData.primaryKey();a=this._privateData.update(a.data.query,a.data.update,a.data.options);if(this._querySettings.options&&this._querySettings.options.$orderBy)for(c=a.length,e=0;e<c;e++)d=a[e],
this._activeBucket.remove(d),b=this._privateData._data.indexOf(d),d=this._activeBucket.insert(d),b!==d&&this._privateData._updateSpliceMove(this._privateData._data,b,d);if(this._transformEnabled&&this._transformIn)for(c=this._publicData.primaryKey(),b=0;b<a.length;b++)e={},d=a[b],e[c]=d[c],this._transformUpdate(e,d);break;case "remove":this.debug()&&console.log('ForerunnerDB.View: Removing some data on view "'+this.name()+'" in underlying (internal) view collection "'+this._privateData.name()+'"'),
this._transformRemove(a.data.query,a.options),this._privateData.remove(a.data.query,a.options)}};d.prototype.on=function(){this._privateData.on.apply(this._privateData,arguments)};d.prototype.off=function(){this._privateData.off.apply(this._privateData,arguments)};d.prototype.emit=function(){this._privateData.emit.apply(this._privateData,arguments)};d.prototype.drop=function(){if("dropped"!==this._state){if(this._from)return this._from.off("drop",this._collectionDroppedWrap),this._from._removeView(this),
(this.debug()||this._db&&this._db.debug())&&console.log("ForerunnerDB.View: Dropping view "+this._name),this._state="dropped",this._io&&this._io.drop(),this._privateData&&this._privateData.drop(),this._db&&this._name&&delete this._db._view[this._name],this.emit("drop",this),delete this._chain,delete this._from,delete this._privateData,delete this._io,delete this._groups,delete this._listeners,delete this._querySettings,delete this._db,!0}else return!0;return!1};d.prototype.db=function(a){return void 0!==
a?(this._db=a,this.privateData().db(a),this.publicData().db(a),this):this._db};d.prototype.primaryKey=function(){return this._privateData.primaryKey()};d.prototype.queryData=function(a,b,c){void 0!==a&&(this._querySettings.query=a);void 0!==b&&(this._querySettings.options=b);return void 0!==a||void 0!==b?(void 0!==c&&!0!==c||this.refresh(),this):this._querySettings};d.prototype.queryAdd=function(a,b,c){var e=this._querySettings.query,d;if(void 0!==a)for(d in a)a.hasOwnProperty(d)&&(void 0===e[d]||
void 0!==e[d]&&b)&&(e[d]=a[d]);void 0!==c&&!0!==c||this.refresh()};d.prototype.queryRemove=function(a,b){var c=this._querySettings.query,e;if(void 0!==a)for(e in a)a.hasOwnProperty(e)&&delete c[e];void 0!==b&&!0!==b||this.refresh()};d.prototype.query=function(a,b){return void 0!==a?(this._querySettings.query=a,void 0!==b&&!0!==b||this.refresh(),this):this._querySettings.query};d.prototype.orderBy=function(a){if(void 0!==a){var b=this.queryOptions()||{};b.$orderBy=a;this.queryOptions(b);return this}return(this.queryOptions()||
{}).$orderBy};d.prototype.queryOptions=function(a,b){return void 0!==a?(this._querySettings.options=a,void 0===a.$decouple&&(a.$decouple=!0),void 0===b||!0===b?this.refresh():this.rebuildActiveBucket(a.$orderBy),this):this._querySettings.options};d.prototype.rebuildActiveBucket=function(a){if(a){var b=this._privateData._data,c=b.length;this._activeBucket=new n(a);this._activeBucket.primaryKey(this._privateData.primaryKey());for(a=0;a<c;a++)this._activeBucket.insert(b[a])}else delete this._activeBucket};
d.prototype.refresh=function(){if(this._from){var a=this.publicData();this._privateData.remove();a.remove();this._privateData.insert(this._from.find(this._querySettings.query,this._querySettings.options))}this._querySettings.options&&this._querySettings.options.$orderBy?this.rebuildActiveBucket(this._querySettings.options.$orderBy):this.rebuildActiveBucket();return this};d.prototype.count=function(){return this._privateData&&this._privateData._data?this._privateData._data.length:0};d.prototype.transform=
function(a){return void 0!==a?("object"===typeof a?(void 0!==a.enabled&&(this._transformEnabled=a.enabled),void 0!==a.dataIn&&(this._transformIn=a.dataIn),void 0!==a.dataOut&&(this._transformOut=a.dataOut)):this._transformEnabled=!1!==a,this._transformPrimaryKey(this.privateData().primaryKey()),this._transformSetData(this.privateData().find()),this):{enabled:this._transformEnabled,dataIn:this._transformIn,dataOut:this._transformOut}};d.prototype.privateData=function(){return this._privateData};d.prototype.publicData=
function(){return this._transformEnabled?this._publicData:this._privateData};d.prototype._transformSetData=function(a){this._transformEnabled&&(this._publicData=new c("__FDB__view_publicData_"+this._name),this._publicData.db(this._privateData._db),this._publicData.transform({enabled:!0,dataIn:this._transformIn,dataOut:this._transformOut}),this._publicData.setData(a))};d.prototype._transformInsert=function(a,b){this._transformEnabled&&this._publicData&&this._publicData.insert(a,b)};d.prototype._transformUpdate=
function(a,b,c){this._transformEnabled&&this._publicData&&this._publicData.update(a,b,c)};d.prototype._transformRemove=function(a,b){this._transformEnabled&&this._publicData&&this._publicData.remove(a,b)};d.prototype._transformPrimaryKey=function(a){this._transformEnabled&&this._publicData&&this._publicData.primaryKey(a)};c.prototype.init=function(){this._view=[];h.apply(this,arguments)};c.prototype.view=function(a,b,c){if(this._db&&this._db._view){if(this._db._view[a])throw'ForerunnerDB.Collection "'+
this.name()+'": Cannot create a view using this collection because a view with this name already exists: '+a;a=(new d(a,b,c)).db(this._db).from(this);this._view=this._view||[];this._view.push(a);return a}};c.prototype._addView=b.prototype._addView=function(a){void 0!==a&&this._view.push(a);return this};c.prototype._removeView=b.prototype._removeView=function(a){void 0!==a&&(a=this._view.indexOf(a),-1<a&&this._view.splice(a,1));return this};f.prototype.init=function(){this._view={};a.apply(this,arguments)};
f.prototype.view=function(a){this._view[a]||(this.debug()||this._db&&this._db.debug())&&console.log("Core.View: Creating view "+a);this._view[a]=this._view[a]||(new d(a)).db(this);return this._view[a]};f.prototype.viewExists=function(a){return Boolean(this._view[a])};f.prototype.views=function(){var a=[],b;for(b in this._view)this._view.hasOwnProperty(b)&&a.push({name:b,count:this._view[b].count()});return a};g.finishModule("View");l.exports=d},{"./ActiveBucket":2,"./Collection":3,"./CollectionGroup":4,
"./ReactorIO":27,"./Shared":28}],30:[function(f,l,g){function c(e){function f(b){null===r?u.push(b):a(function(){var a=r?b.onFulfilled:b.onRejected;if(null===a)(r?b.resolve:b.reject)(s);else{var c;try{c=a(s)}catch(e){b.reject(e);return}b.resolve(c)}})}function d(a){try{if(a===v)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"===typeof a||"function"===typeof a)){var b=a.then;if("function"===typeof b){h(b.bind(a),d,g);return}}r=!0;s=a;l()}catch(c){g(c)}}function g(a){r=
!1;s=a;l()}function l(){for(var a=0,b=u.length;a<b;a++)f(u[a]);u=null}if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof e)throw new TypeError("not a function");var r=null,s=null,u=[],v=this;this.then=function(a,e){return new c(function(c,d){f(new b(a,e,c,d))})};h(e,d,g)}function b(a,b,c,f){this.onFulfilled="function"===typeof a?a:null;this.onRejected="function"===typeof b?b:null;this.resolve=c;this.reject=f}function h(a,b,c){var f=!1;try{a(function(a){f||
(f=!0,b(a))},function(a){f||(f=!0,c(a))})}catch(g){f||(f=!0,c(g))}}var a=f("asap");l.exports=c},{asap:32}],31:[function(f,l,g){function c(a){this.then=function(c){return"function"!==typeof c?this:new b(function(b,e){h(function(){try{b(c(a))}catch(d){e(d)}})})}}var b=f("./core.js"),h=f("asap");l.exports=b;c.prototype=Object.create(b.prototype);var a=new c(!0),e=new c(!1),n=new c(null),d=new c(void 0),k=new c(0),x=new c("");b.resolve=function(f){if(f instanceof b)return f;if(null===f)return n;if(void 0===
f)return d;if(!0===f)return a;if(!1===f)return e;if(0===f)return k;if(""===f)return x;if("object"===typeof f||"function"===typeof f)try{var g=f.then;if("function"===typeof g)return new b(g.bind(f))}catch(h){return new b(function(a,b){b(h)})}return new c(f)};b.from=b.cast=function(a){var c=Error("Promise.from and Promise.cast are deprecated, use Promise.resolve instead");c.name="Warning";console.warn(c.stack);return b.resolve(a)};b.denodeify=function(a,c){c=c||Infinity;return function(){var e=this,
d=Array.prototype.slice.call(arguments);return new b(function(b,f){for(;d.length&&d.length>c;)d.pop();d.push(function(a,c){a?f(a):b(c)});a.apply(e,d)})}};b.nodeify=function(a){return function(){var c=Array.prototype.slice.call(arguments),e="function"===typeof c[c.length-1]?c.pop():null;try{return a.apply(this,arguments).nodeify(e)}catch(d){if(null===e||"undefined"==typeof e)return new b(function(a,b){b(d)});h(function(){e(d)})}}};b.all=function(){var a=1===arguments.length&&Array.isArray(arguments[0]),
c=Array.prototype.slice.call(a?arguments[0]:arguments);a||(a=Error("Promise.all should be called with a single array, calling it with multiple arguments is deprecated"),a.name="Warning",console.warn(a.stack));return new b(function(a,b){function e(f,g){try{if(g&&("object"===typeof g||"function"===typeof g)){var h=g.then;if("function"===typeof h){h.call(g,function(a){e(f,a)},b);return}}c[f]=g;0===--d&&a(c)}catch(k){b(k)}}if(0===c.length)return a([]);for(var d=c.length,f=0;f<c.length;f++)e(f,c[f])})};
b.reject=function(a){return new b(function(b,c){c(a)})};b.race=function(a){return new b(function(c,e){a.forEach(function(a){b.resolve(a).then(c,e)})})};b.prototype.done=function(a,b){(arguments.length?this.then.apply(this,arguments):this).then(null,function(a){h(function(){throw a;})})};b.prototype.nodeify=function(a){if("function"!=typeof a)return this;this.then(function(b){h(function(){a(null,b)})},function(b){h(function(){a(b)})})};b.prototype["catch"]=function(a){return this.then(null,a)}},{"./core.js":30,
asap:32}],32:[function(f,l,g){(function(c){function b(){for(;f.next;){f=f.next;var a=f.task;f.task=void 0;var c=f.domain;c&&(f.domain=void 0,c.enter());try{a()}catch(g){if(d)throw c&&c.exit(),setTimeout(b,0),c&&c.enter(),g;setTimeout(function(){throw g;},0)}c&&c.exit()}e=!1}var f={task:void 0,next:null},a=f,e=!1,g=void 0,d=!1;if("undefined"!==typeof c&&c.nextTick)d=!0,g=function(){c.nextTick(b)};else if("function"===typeof setImmediate)g="undefined"!==typeof window?setImmediate.bind(window,b):function(){setImmediate(b)};
else if("undefined"!==typeof MessageChannel){var k=new MessageChannel;k.port1.onmessage=b;g=function(){k.port2.postMessage(0)}}else g=function(){setTimeout(b,0)};l.exports=function(b){a=a.next={task:b,domain:d&&c.domain,next:null};e||(e=!0,g())}}).call(this,f("_process"))},{_process:38}],33:[function(f,l,g){(function(){function c(a){var b=this,c={db:null};if(a)for(var e in a)c[e]=a[e];return new v(function(a,e){var d=w.open(c.name,c.version);d.onerror=function(){e(d.error)};d.onupgradeneeded=function(){d.result.createObjectStore(c.storeName)};
d.onsuccess=function(){c.db=d.result;b._dbInfo=c;a()}})}function b(a,b){var c=this;"string"!==typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=new v(function(b,e){c.ready().then(function(){var d=c._dbInfo,f=d.db.transaction(d.storeName,"readonly").objectStore(d.storeName).get(a);f.onsuccess=function(){var a=f.result;void 0===a&&(a=null);b(a)};f.onerror=function(){e(f.error)}})["catch"](e)});s(e,b);return e}function g(a,b){var c=this,e=new v(function(b,
e){c.ready().then(function(){var d=c._dbInfo,f=d.db.transaction(d.storeName,"readonly").objectStore(d.storeName).openCursor(),g=1;f.onsuccess=function(){var c=f.result;if(c){var e=a(c.value,c.key,g++);void 0!==e?b(e):c["continue"]()}else b()};f.onerror=function(){e(f.error)}})["catch"](e)});s(e,b);return e}function a(a,b,c){var e=this;"string"!==typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new v(function(c,d){e.ready().then(function(){var f=e._dbInfo,
g=f.db.transaction(f.storeName,"readwrite"),f=g.objectStore(f.storeName);null===b&&(b=void 0);var h=f.put(b,a);g.oncomplete=function(){void 0===b&&(b=null);c(b)};g.onabort=g.onerror=function(){d(h.error)}})["catch"](d)});s(d,c);return d}function e(a,b){var c=this;"string"!==typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=new v(function(b,e){c.ready().then(function(){var d=c._dbInfo,f=d.db.transaction(d.storeName,"readwrite"),g=f.objectStore(d.storeName)["delete"](a);
f.oncomplete=function(){b()};f.onerror=function(){e(g.error)};f.onabort=function(a){a=a.target.error;"QuotaExceededError"===a&&e(a)}})["catch"](e)});s(e,b);return e}function n(a){var b=this,c=new v(function(a,c){b.ready().then(function(){var e=b._dbInfo,d=e.db.transaction(e.storeName,"readwrite"),f=d.objectStore(e.storeName).clear();d.oncomplete=function(){a()};d.onabort=d.onerror=function(){c(f.error)}})["catch"](c)});s(c,a);return c}function d(a){var b=this,c=new v(function(a,c){b.ready().then(function(){var e=
b._dbInfo,d=e.db.transaction(e.storeName,"readonly").objectStore(e.storeName).count();d.onsuccess=function(){a(d.result)};d.onerror=function(){c(d.error)}})["catch"](c)});r(c,a);return c}function k(a,b){var c=this,e=new v(function(b,e){0>a?b(null):c.ready().then(function(){var d=c._dbInfo,f=!1,g=d.db.transaction(d.storeName,"readonly").objectStore(d.storeName).openCursor();g.onsuccess=function(){var c=g.result;c?0===a?b(c.key):f?b(c.key):(f=!0,c.advance(a)):b(null)};g.onerror=function(){e(g.error)}})["catch"](e)});
r(e,b);return e}function x(a){var b=this,c=new v(function(a,c){b.ready().then(function(){var e=b._dbInfo,d=e.db.transaction(e.storeName,"readonly").objectStore(e.storeName).openCursor(),f=[];d.onsuccess=function(){var b=d.result;b?(f.push(b.key),b["continue"]()):a(f)};d.onerror=function(){c(d.error)}})["catch"](c)});r(c,a);return c}function r(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}function s(a,b){b&&a.then(function(a){u(b,a)},function(a){b(a)})}function u(a,b){if(a)return setTimeout(function(){return a(null,
b)},0)}var v="undefined"!==typeof l&&l.exports?f("promise"):this.Promise,w=w||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB;if(w){var y={_driver:"asyncStorage",_initStorage:c,iterate:g,getItem:b,setItem:a,removeItem:e,clear:n,length:d,key:k,keys:x};"undefined"!==typeof l&&l.exports?l.exports=y:this.asyncStorage=y}}).call(window)},{promise:31}],34:[function(f,l,g){(function(){function c(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}var b="undefined"!==
typeof l&&l.exports?f("promise"):this.Promise,g=this,a=null,e=null;try{if(!(this.localStorage&&"setItem"in this.localStorage))return;e=this.localStorage}catch(n){return}var d=3;"undefined"!==typeof l&&l.exports&&(d=2);var k={_driver:"localStorageWrapper",_initStorage:function(c){var e={};if(c)for(var k in c)e[k]=c[k];e.keyPrefix=e.name+"/";this._dbInfo=e;return(new b(function(a){1===d?f(["localforageSerializer"],a):2===d?a(f("./../utils/serializer")):a(g.localforageSerializer)})).then(function(c){a=
c;return b.resolve()})},iterate:function(b,d){var f=this,g=f.ready().then(function(){for(var c=f._dbInfo.keyPrefix.length,d=e.length,g=0;g<d;g++){var h=e.key(g),k=e.getItem(h);k&&(k=a.deserialize(k));k=b(k,h.substring(c),g+1);if(void 0!==k)return k}});c(g,d);return g},getItem:function(b,d){var f=this;"string"!==typeof b&&(window.console.warn(b+" used as a key, but it is not a string."),b=String(b));var g=f.ready().then(function(){var c=e.getItem(f._dbInfo.keyPrefix+b);c&&(c=a.deserialize(c));return c});
c(g,d);return g},setItem:function(d,f,g){var h=this;"string"!==typeof d&&(window.console.warn(d+" used as a key, but it is not a string."),d=String(d));var k=h.ready().then(function(){void 0===f&&(f=null);var c=f;return new b(function(b,g){a.serialize(f,function(a,f){if(f)g(f);else try{e.setItem(h._dbInfo.keyPrefix+d,a),b(c)}catch(k){"QuotaExceededError"!==k.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==k.name||g(k),g(k)}})})});c(k,g);return k},removeItem:function(a,b){var d=this;"string"!==typeof a&&(window.console.warn(a+
" used as a key, but it is not a string."),a=String(a));var f=d.ready().then(function(){e.removeItem(d._dbInfo.keyPrefix+a)});c(f,b);return f},clear:function(a){var b=this,d=b.ready().then(function(){for(var a=b._dbInfo.keyPrefix,c=e.length-1;0<=c;c--){var d=e.key(c);0===d.indexOf(a)&&e.removeItem(d)}});c(d,a);return d},length:function(a){var b=this.keys().then(function(a){return a.length});c(b,a);return b},key:function(a,b){var d=this,f=d.ready().then(function(){var b=d._dbInfo,c;try{c=e.key(a)}catch(f){c=
null}c&&(c=c.substring(b.keyPrefix.length));return c});c(f,b);return f},keys:function(a){var b=this,d=b.ready().then(function(){for(var a=b._dbInfo,c=e.length,d=[],f=0;f<c;f++)0===e.key(f).indexOf(a.keyPrefix)&&d.push(e.key(f).substring(a.keyPrefix.length));return d});c(d,a);return d}};2===d?l.exports=k:1===d?(void 0)("localStorageWrapper",function(){return k}):this.localStorageWrapper=k}).call(window)},{"./../utils/serializer":37,promise:31}],35:[function(f,l,g){(function(){function c(a){var b=this,
c={db:null};if(a)for(var e in a)c[e]="string"!==typeof a[e]?a[e].toString():a[e];e=new s(function(a){t===y.DEFINE?f(["localforageSerializer"],a):t===y.EXPORT?a(f("./../utils/serializer")):a(u.localforageSerializer)});var d=new s(function(e,d){try{c.db=w(c.name,String(c.version),c.description,c.size)}catch(f){return b.setDriver(b.LOCALSTORAGE).then(function(){return b._initStorage(a)}).then(e)["catch"](d)}c.db.transaction(function(a){a.executeSql("CREATE TABLE IF NOT EXISTS "+c.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",
[],function(){b._dbInfo=c;e()},function(a,b){d(b)})})});return e.then(function(a){v=a;return d})}function b(a,b){var c=this;"string"!==typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=new s(function(b,e){c.ready().then(function(){var d=c._dbInfo;d.db.transaction(function(c){c.executeSql("SELECT * FROM "+d.storeName+" WHERE key = ? LIMIT 1",[a],function(a,c){var e=c.rows.length?c.rows.item(0).value:null;e&&(e=v.deserialize(e));b(e)},function(a,b){e(b)})})})["catch"](e)});
r(e,b);return e}function g(a,b){var c=this,e=new s(function(b,e){c.ready().then(function(){var d=c._dbInfo;d.db.transaction(function(c){c.executeSql("SELECT * FROM "+d.storeName,[],function(c,e){for(var d=e.rows,f=d.length,g=0;g<f;g++){var h=d.item(g),k=h.value;k&&(k=v.deserialize(k));k=a(k,h.key,g+1);if(void 0!==k){b(k);return}}b()},function(a,b){e(b)})})})["catch"](e)});r(e,b);return e}function a(a,b,c){var e=this;"string"!==typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),
a=String(a));var d=new s(function(c,d){e.ready().then(function(){void 0===b&&(b=null);var f=b;v.serialize(b,function(b,g){if(g)d(g);else{var h=e._dbInfo;h.db.transaction(function(e){e.executeSql("INSERT OR REPLACE INTO "+h.storeName+" (key, value) VALUES (?, ?)",[a,b],function(){c(f)},function(a,b){d(b)})},function(a){a.code===a.QUOTA_ERR&&d(a)})}})})["catch"](d)});r(d,c);return d}function e(a,b){var c=this;"string"!==typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));
var e=new s(function(b,e){c.ready().then(function(){var d=c._dbInfo;d.db.transaction(function(c){c.executeSql("DELETE FROM "+d.storeName+" WHERE key = ?",[a],function(){b()},function(a,b){e(b)})})})["catch"](e)});r(e,b);return e}function n(a){var b=this,c=new s(function(a,c){b.ready().then(function(){var e=b._dbInfo;e.db.transaction(function(b){b.executeSql("DELETE FROM "+e.storeName,[],function(){a()},function(a,b){c(b)})})})["catch"](c)});r(c,a);return c}function d(a){var b=this,c=new s(function(a,
c){b.ready().then(function(){var e=b._dbInfo;e.db.transaction(function(b){b.executeSql("SELECT COUNT(key) as c FROM "+e.storeName,[],function(b,c){var e=c.rows.item(0).c;a(e)},function(a,b){c(b)})})})["catch"](c)});r(c,a);return c}function k(a,b){var c=this,e=new s(function(b,e){c.ready().then(function(){var d=c._dbInfo;d.db.transaction(function(c){c.executeSql("SELECT key FROM "+d.storeName+" WHERE id = ? LIMIT 1",[a+1],function(a,c){var e=c.rows.length?c.rows.item(0).key:null;b(e)},function(a,b){e(b)})})})["catch"](e)});
r(e,b);return e}function x(a){var b=this,c=new s(function(a,c){b.ready().then(function(){var e=b._dbInfo;e.db.transaction(function(b){b.executeSql("SELECT key FROM "+e.storeName,[],function(b,c){for(var e=[],d=0;d<c.rows.length;d++)e.push(c.rows.item(d).key);a(e)},function(a,b){c(b)})})})["catch"](c)});r(c,a);return c}function r(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}var s="undefined"!==typeof l&&l.exports?f("promise"):this.Promise,u=this,v=null,w=this.openDatabase;if(w){var y={DEFINE:1,
EXPORT:2,WINDOW:3},t=y.WINDOW;"undefined"!==typeof l&&l.exports&&(t=y.EXPORT);var q={_driver:"webSQLStorage",_initStorage:c,iterate:g,getItem:b,setItem:a,removeItem:e,clear:n,length:d,key:k,keys:x};t===y.DEFINE?(void 0)("webSQLStorage",function(){return q}):t===y.EXPORT?l.exports=q:this.webSQLStorage=q}}).call(window)},{"./../utils/serializer":37,promise:31}],36:[function(f,l,g){(function(){function c(a,b){a[b]=function(){var c=arguments;return a.ready().then(function(){return a[b].apply(a,c)})}}
function b(){for(var a=1;a<arguments.length;a++){var b=arguments[a];if(b)for(var c in b)b.hasOwnProperty(c)&&(u(b[c])?arguments[0][c]=b[c].slice():arguments[0][c]=b[c])}return arguments[0]}function g(a){for(var b in d)if(d.hasOwnProperty(b)&&d[b]===a)return!0;return!1}function a(a){this._config=b({},x,a);this._driverSet=null;this._ready=!1;this._dbInfo=null;for(a=0;a<k.length;a++)c(this,k[a]);this.setDriver(this._config.driver)}var e="undefined"!==typeof l&&l.exports?f("promise"):this.Promise,n={},
d={INDEXEDDB:"asyncStorage",LOCALSTORAGE:"localStorageWrapper",WEBSQL:"webSQLStorage"},k="clear getItem iterate key keys length removeItem setItem".split(" "),x={description:"",driver:[d.INDEXEDDB,d.WEBSQL,d.LOCALSTORAGE].slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},r=3;"undefined"!==typeof l&&l.exports&&(r=2);var s=function(a){var b=b||a.indexedDB||a.webkitIndexedDB||a.mozIndexedDB||a.OIndexedDB||a.msIndexedDB,c={};c[d.WEBSQL]=!!a.openDatabase;c[d.INDEXEDDB]=!!function(){if("undefined"!==
typeof a.openDatabase&&a.navigator&&a.navigator.userAgent&&/Safari/.test(a.navigator.userAgent)&&!/Chrome/.test(a.navigator.userAgent))return!1;try{return b&&"function"===typeof b.open&&"undefined"!==typeof a.IDBKeyRange}catch(c){return!1}}();var e=d.LOCALSTORAGE,f;try{f=a.localStorage&&"setItem"in a.localStorage&&a.localStorage.setItem}catch(g){f=!1}c[e]=!!f;return c}(this),u=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},v=this;a.prototype.INDEXEDDB=d.INDEXEDDB;
a.prototype.LOCALSTORAGE=d.LOCALSTORAGE;a.prototype.WEBSQL=d.WEBSQL;a.prototype.config=function(a){if("object"===typeof a){if(this._ready)return Error("Can't call config() after localforage has been used.");for(var b in a)"storeName"===b&&(a[b]=a[b].replace(/\W/g,"_")),this._config[b]=a[b];"driver"in a&&a.driver&&this.setDriver(this._config.driver);return!0}return"string"===typeof a?this._config[a]:this._config};a.prototype.defineDriver=function(a,b,c){var d=new e(function(b,c){try{var d=a._driver,
f=Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver"),l=Error("Custom driver name already in use: "+a._driver);if(a._driver)if(g(a._driver))c(l);else{for(var p=k.concat("_initStorage"),l=0;l<p.length;l++){var q=p[l];if(!q||!a[q]||"function"!==typeof a[q]){c(f);return}}var r=e.resolve(!0);"_support"in a&&(r=a._support&&"function"===typeof a._support?a._support():e.resolve(!!a._support));r.then(function(c){s[d]=c;n[d]=a;b()},c)}else c(f)}catch(x){c(x)}});d.then(b,
c);return d};a.prototype.driver=function(){return this._driver||null};a.prototype.ready=function(a){var b=this,c=new e(function(a,c){b._driverSet.then(function(){null===b._ready&&(b._ready=b._initStorage(b._config));b._ready.then(a,c)})["catch"](c)});c.then(a,a);return c};a.prototype.setDriver=function(a,b,c){function d(){k._config.driver=k.driver()}var k=this;"string"===typeof a&&(a=[a]);this._driverSet=new e(function(b,c){var d=k._getFirstSupportedDriver(a),l=Error("No available storage method found.");
if(d){k._dbInfo=null;k._ready=null;if(g(d)){if(1===r){f([d],function(a){k._extend(a);b()});return}if(2===r){var p;switch(d){case k.INDEXEDDB:p=f("./drivers/indexeddb");break;case k.LOCALSTORAGE:p=f("./drivers/localstorage");break;case k.WEBSQL:p=f("./drivers/websql")}k._extend(p)}else k._extend(v[d])}else if(n[d])k._extend(n[d]);else{k._driverSet=e.reject(l);c(l);return}b()}else k._driverSet=e.reject(l),c(l)});this._driverSet.then(d,d);this._driverSet.then(b,c);return this._driverSet};a.prototype.supports=
function(a){return!!s[a]};a.prototype._extend=function(a){b(this,a)};a.prototype._getFirstSupportedDriver=function(a){if(a&&u(a))for(var b=0;b<a.length;b++){var c=a[b];if(this.supports(c))return c}return null};a.prototype.createInstance=function(b){return new a(b)};var w=new a;1===r?(void 0)("localforage",function(){return w}):2===r?l.exports=w:this.localforage=w}).call(window)},{"./drivers/indexeddb":33,"./drivers/localstorage":34,"./drivers/websql":35,promise:31}],37:[function(f,l,g){(function(){function c(a){var b=
0.75*a.length,c=a.length,g=0,l,r,s,u;"="===a[a.length-1]&&(b--,"="===a[a.length-2]&&b--);for(var v=new ArrayBuffer(b),w=new Uint8Array(v),b=0;b<c;b+=4)l=f.indexOf(a[b]),r=f.indexOf(a[b+1]),s=f.indexOf(a[b+2]),u=f.indexOf(a[b+3]),w[g++]=l<<2|r>>4,w[g++]=(r&15)<<4|s>>2,w[g++]=(s&3)<<6|u&63;return v}function b(a){a=new Uint8Array(a);var b="",c;for(c=0;c<a.length;c+=3)b+=f[a[c]>>2],b+=f[(a[c]&3)<<4|a[c+1]>>4],b+=f[(a[c+1]&15)<<2|a[c+2]>>6],b+=f[a[c+2]&63];2===a.length%3?b=b.substring(0,b.length-1)+"=":
1===a.length%3&&(b=b.substring(0,b.length-2)+"==");return b}var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a={serialize:function(a,c){var d="";a&&(d=a.toString());if(a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var f,g="__lfsc__:";a instanceof ArrayBuffer?(f=a,g+="arbf"):(f=a.buffer,"[object Int8Array]"===d?g+="si08":"[object Uint8Array]"===d?g+="ui08":"[object Uint8ClampedArray]"===d?g+="uic8":"[object Int16Array]"===
d?g+="si16":"[object Uint16Array]"===d?g+="ur16":"[object Int32Array]"===d?g+="si32":"[object Uint32Array]"===d?g+="ui32":"[object Float32Array]"===d?g+="fl32":"[object Float64Array]"===d?g+="fl64":c(Error("Failed to get type for BinaryArray")));c(g+b(f))}else if("[object Blob]"===d)d=new FileReader,d.onload=function(){var a=b(this.result);c("__lfsc__:blob"+a)},d.readAsArrayBuffer(a);else try{c(JSON.stringify(a))}catch(h){window.console.error("Couldn't convert value into a JSON string: ",a),c(null,
h)}},deserialize:function(a){if("__lfsc__:"!==a.substring(0,9))return JSON.parse(a);var b=a.substring(13);a=a.substring(9,13);b=c(b);switch(a){case "arbf":return b;case "blob":return new Blob([b]);case "si08":return new Int8Array(b);case "ui08":return new Uint8Array(b);case "uic8":return new Uint8ClampedArray(b);case "si16":return new Int16Array(b);case "ur16":return new Uint16Array(b);case "si32":return new Int32Array(b);case "ui32":return new Uint32Array(b);case "fl32":return new Float32Array(b);
case "fl64":return new Float64Array(b);default:throw Error("Unkown type: "+a);}},stringToBuffer:c,bufferToString:b};"undefined"!==typeof l&&l.exports?l.exports=a:this.localforageSerializer=a}).call(window)},{}],38:[function(f,l,g){function c(){}f=l.exports={};f.nextTick=function(){if("undefined"!==typeof window&&window.setImmediate)return function(b){return window.setImmediate(b)};if("undefined"!==typeof window&&window.postMessage&&window.addEventListener){var b=[];window.addEventListener("message",
function(c){var a=c.source;a!==window&&null!==a||"process-tick"!==c.data||(c.stopPropagation(),0<b.length&&b.shift()())},!0);return function(c){b.push(c);window.postMessage("process-tick","*")}}return function(b){setTimeout(b,0)}}();f.title="browser";f.browser=!0;f.env={};f.argv=[];f.on=c;f.addListener=c;f.once=c;f.off=c;f.removeListener=c;f.removeAllListeners=c;f.emit=c;f.binding=function(b){throw Error("process.binding is not supported");};f.cwd=function(){return"/"};f.chdir=function(b){throw Error("process.chdir is not supported");
}},{}]},{},[1])(1)});
|
DemoApp/src/containers/all-components.js | andyfen/react-native-UIKit | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
ScrollView
} from 'react-native';
import { AlertMessage, ArticleText, ArticleList, Avatar, AvatarHeader, Button,
ButtonOutline, Card, Carousel, Close, DateItem, Divider, FieldError, Grid, GalleryOffset,
Heading, ImageCustom, InputField, LikeBtn, ListBasic, LoginForm, Message, ProfileHeader,
MessageList, RatingBox, ReviewCell, ThumbSwiper, Time
} from '../../lib'
/*
import { AlertMessage, ArticleText, ArticleList, Avatar, AvatarHeader, Button,
ButtonOutline, Card, Carousel, Close, DateItem, Divider, FieldError, Grid, GalleryOffset,
Heading, ImageCustom, InputField, LikeBtn, ListBasic, LoginForm, Message, ProfileHeader,
MessageList, RatingBox, ReviewCell, ThumbSwiper, Time
} from 'react-native-uikit';
*/
const AllComponents = () => (
<ScrollView style={{flex:1}}>
<AlertMessage
message={'This is the alert message here'}
onPress={() => console.log('pressed')}
/>
<ArticleText
username={'username'}
text={'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'}
onPress={() => console.log('pressed')}
/>
<ArticleList
headerContent={<Text style={{textAlign:'center', fontSize: 20, padding: 10, backgroundColor: '#eee', marginBottom: 3}}>HEADER CONTENT</Text>}
items={[
{id:0, category:'Misc', timestamp: 1463338637801, title:'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', src:'https://placehold.it/200/798466'},
{id:1, category:'Misc', timestamp: 1463338637801, title:'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', src:'https://placehold.it/200/311112'},
{id:2, category:'Misc', timestamp: 1463338637801, title:'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', src:'https://placehold.it/200/D4BB69'},
{id:3, category:'Misc', timestamp: 1463338637801, title:'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', src:'https://placehold.it/200/ABB2B8'},
{id:4, category:'Misc', timestamp: 1463338637801, title:'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', src:'https://placehold.it/200/798466'},
{id:5, category:'Misc', timestamp: 1463338637801, title:'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', src:'https://placehold.it/200/919888'},
]}
footerContent={<Text style={{textAlign:'center', fontSize: 20, padding: 10, backgroundColor: '#eee'}}>FOOTER CONTENT</Text>}
onPress={(id) => console.log(id)}
/>
<Avatar
src={'https://s3.amazonaws.com/uifaces/faces/twitter/evagiselle/128.jpg'}
size={40}
circle={true}
onPress={() => console.log('pressed')}
/>
<View>
<AvatarHeader src={'https://s3.amazonaws.com/uifaces/faces/twitter/evagiselle/128.jpg'}
heading={'Lynsey Smith'}
timestamp={1460227647478}
circle={true}
backgroundColor={'#fff'}
height={40}
gutter={10}
/>
</View>
<Button
color={'#fff'}
backgroundColor={'#0094EA'}
radius={5}>
Submit
</Button>
<ButtonOutline
color={'#222'}
borderWidth={4}
fontWeight={'bold'}
fontSize={19}
radius={1}>
Submit
</ButtonOutline>
<Card
onPress={() => console.log('card pressed')}
src={'https://s-media-cache-ak0.pinimg.com/736x/5f/70/41/5f704159cdf6512cf21000ec4827fc03.jpg'}
title={'Card title - Some quick example text to build on the card title and make up the bulk of the card'}
link={'www.example.com'}
radius={5}
marginBottom={30}
/>
<View>
<Carousel
images={[
{id:0, src:'https://placehold.it/600/311112'},
{id:1, src:'https://placehold.it/600/59C480'},
{id:2, src:'https://placehold.it/600/546C80'},
{id:3, src:'https://placehold.it/600/D58554'},
{id:4, src:'https://placehold.it/600/F0CD9B'},
{id:5, src:'https://placehold.it/600/311112'},
]}
height={300}
/>
</View>
<Close
size={50}
color={'#222'}
onPress={() => console.log('closed')}
/>
<DateItem
timestamp={1460227647478}
color={'#222'}
marginLeft={10}
/>
<Divider
color={'#eee'}
/>
<FieldError
errorMsg={'error something has gone wrong!'}
error={true}
color={'red'}
marginBottom={40}
/>
<View>
<Grid
headerContent={<Text style={{textAlign:'center', fontSize: 20, padding: 10, backgroundColor: '#eee', marginBottom: 3}}>HEADER CONTENT</Text>}
images={[
{id:0, src:'https://placehold.it/200/798466'},
{id:1, src:'https://placehold.it/200/311112'},
{id:2, src:'https://placehold.it/200/ABB2B8'},
{id:3, src:'https://placehold.it/200/D4BB69'},
{id:4, src:'https://placehold.it/200/798466'},
{id:5, src:'https://placehold.it/200/919888'},
{id:6, src:'https://placehold.it/200/ABB2B8'},
{id:7, src:'https://placehold.it/200/919888'},
{id:8, src:'https://placehold.it/200/A9C781'},
{id:9, src:'https://placehold.it/200/311112'},
]}
footerContent={<Text style={{textAlign:'center', fontSize: 20, padding: 10, backgroundColor: '#eee'}}>FOOTER CONTENT</Text>}
onPress={(id) => console.log(id)}
itemsPerRow={3}
spacing={2}
/>
</View>
<GalleryOffset
imagesArray={[
'http://2.bp.blogspot.com/-QnUrv6hrusQ/UTuCbLI45xI/AAAAAAAAvEo/REbD2Sp3r84/s1600/benoit-paille1.jpg',
'http://justsomething.co/wp-content/uploads/2013/09/black-and-white-photography-benoit-courti-1.jpg',
'http://i.imgur.com/YaQDc.jpg?1',
'http://farm4.staticflickr.com/3284/3032859171_9a71ea30c1_z.jpg',
'http://livefastmag.com/wp-content/uploads/2011/10/1499c4834a64469dd570a47a08d503d2.jpg',
'http://41.media.tumblr.com/7fcdee1b773bda7859eee69d2eb1e0f8/tumblr_nfvzenuIqW1tof0p4o1_1280.jpg',
]}
display={'row'}
/>
<ImageCustom
src={'https://s-media-cache-ak0.pinimg.com/736x/9c/11/d8/9c11d813826489f82b3f4c02a06ea815.jpg'}
height={300}
overlayColor={'#222'}
overlayOpacity={0.8}
fullHeight={true}
>
<View style={{flex:1, justifyContent:'center'}}>
<Text style={{color:'#fff', backgroundColor:'transparent',fontSize:90, fontWeight: '100', textAlign:'center'}}>YES HELLO</Text>
</View>
</ImageCustom>
<InputField
placeHolder={'i am the placeholder txt'}
gutter={10}
color={'#222'}
backgroundColor={'#eee'}
radius={5}
/>
<LikeBtn
active={true}
likes={322}
//color={'#fa0008'}
onPress={() => console.log('liked')}
/>
<ListBasic
headerContent={<Text style={{textAlign:'center', fontSize: 20, padding: 10, backgroundColor: '#eee', marginBottom: 3}}>HEADER CONTENT</Text>}
items={[
{id: 0, title:'Label'},
{id: 1, title:'Label'},
{id: 2, title:'Label'},
{id: 3, title:'Label'}
]}
footerContent={<Text style={{textAlign:'center', fontSize: 20, padding: 10, backgroundColor: '#eee'}}>FOOTER CONTENT</Text>}
onPress={(i) => console.log(id)}
/>
<LoginForm
loginFb={() => console.log('login with facebook')}
onSubmit={(email, password) => console.log(email, password)}
error={false}
errorMsg={'username or password incorrect'}
/>
<Message
active={true}
user={'Jon Snow'}
title={'Winter is Coming'}
message={'Hey Rob, have you seen the weather report on tv ?'}
timestamp={1460227614421}
/>
<MessageList
headerContent={<Text style={{textAlign:'center', fontSize: 20, padding: 10, backgroundColor: '#eee', marginBottom: 3}}>HEADER CONTENT</Text>}
items={[
{id:0, active:false, user: 'Jon Snow', title: 'Winter is Coming', message: 'Hey Rob, have you seen the weather report on tv ?', timestamp: 1460223614421},
{id:1, active:true, user: 'Ric Lowe', title: 'Guess what I found?', message: 'Hey Rob, checkout this story ?', timestamp: 1460221614421},
{id:2, active:true ,user: 'Jon Snow', title: 'title 3', message: 'Hey Rob, have you seen the weather report on tv ?', timestamp: 1460227614421},
]}
footerContent={<Text style={{textAlign:'center', fontSize: 20, padding: 10, backgroundColor: '#eee'}}>FOOTER CONTENT</Text>}
onPress={(id) => console.log(id)}
/>
<ProfileHeader
profileImg={'https://s3.amazonaws.com/uifaces/faces/twitter/evagiselle/128.jpg'}
backgroundImg={'http://petapixel.com/assets/uploads/2014/05/ae5a74db2757e40b78ad13eb119a9224.jpg'}
/>
<RatingBox rating={4} outOf={5}/>
<View>
<ReviewCell
title={'Gaucho'}
description={'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore'}
src={'https://lh5.googleusercontent.com/proxy/lvLgnhcoHke5BEhTG-bVydssje9jV_GytcBidVZh4ADXEuiybVwXN4mlIbgxxOKn2pF1uharMho8lAqGSXcMGKJMigr42UH_qZ1THp4bZplV7uyThhmwEtq38oAhKW7V5Y_6j46jAEkxkrewm9wrd_T4K2JBUw8=w271-h180'}
onPress={() => console.log('pressed')}
rating={4}
outOf={5}
/>
</View>
<View>
<ThumbSwiper
images={[
{id:0, src:'https://placehold.it/200/798466'},
{id:1, src:'https://placehold.it/200/311112'},
{id:2, src:'https://placehold.it/200/ABB2B8'},
{id:3, src:'https://placehold.it/200/D4BB69'},
{id:4, src:'https://placehold.it/200/798466'},
{id:5, src:'https://placehold.it/200/919888'},
{id:6, src:'https://placehold.it/200/ABB2B8'},
{id:7, src:'https://placehold.it/200/919888'},
{id:8, src:'https://placehold.it/200/A9C781'},
{id:9, src:'https://placehold.it/200/311112'},
]}
onPress={(id) => console.log(id)}
/>
</View>
<Time
timestamp={1460227647478}
color={'#222'}
/>
</ScrollView>
)
export default AllComponents;
|
ajax/libs/inferno/1.0.0-beta30/inferno-compat.js | x112358/cdnjs | /*!
* inferno-compat v1.0.0-beta30
* (c) 2016 Dominic Gannaway
* Released under the MIT License.
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('./inferno-component')) :
typeof define === 'function' && define.amd ? define(['exports', 'inferno-component'], factory) :
(factory((global.Inferno = global.Inferno || {}),global.Inferno.Component));
}(this, (function (exports,Component) { 'use strict';
Component = 'default' in Component ? Component['default'] : Component;
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var index$1 = createCommonjsModule(function (module, exports) {
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
define('PropTypes', ['exports', 'module'], factory);
} else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
factory(exports, module);
} else {
var mod = {
exports: {}
};
factory(mod.exports, mod);
global.PropTypes = mod.exports;
}
})(commonjsGlobal, function (exports, module) {
'use strict';
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
var ReactElement = {};
ReactElement.isValidElement = function (object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
};
var ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
var emptyFunction = {
thatReturns: function thatReturns(what) {
return function () {
return what;
};
}
};
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
var ANONYMOUS = '<<anonymous>>';
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
function createChainableTypeChecker(validate) {
function checkType(isRequired, props, propName, componentName, location, propFullName) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (props[propName] == null) {
var locationName = ReactPropTypeLocationNames[location];
if (isRequired) {
return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
var locationName = ReactPropTypeLocationNames[location];
var preciseType = getPreciseType(propValue);
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturns(null));
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var locationName = ReactPropTypeLocationNames[location];
var propType = getPropType(propValue);
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']');
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!ReactElement.isValidElement(props[propName])) {
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var locationName = ReactPropTypeLocationNames[location];
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
return createChainableTypeChecker(function () {
return new Error('Invalid argument supplied to oneOf, expected an instance of array.');
});
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (propValue === expectedValues[i]) {
return null;
}
}
var locationName = ReactPropTypeLocationNames[location];
var valuesString = JSON.stringify(expectedValues);
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
return createChainableTypeChecker(function () {
return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');
});
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName) == null) {
return null;
}
}
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
var locationName = ReactPropTypeLocationNames[location];
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || ReactElement.isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
return 'object';
}
return propType;
}
function getPreciseType(propValue) {
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
module.exports = ReactPropTypes;
});
});
var NO_OP = '$NO_OP';
var ERROR_MSG = 'a runtime error occured! Use Inferno in development environment to find the error.';
var isBrowser = typeof window !== 'undefined' && window.document;
// this is MUCH faster than .constructor === Array and instanceof Array
// in Node 7 and the later versions of V8, slower in older versions though
var isArray = Array.isArray;
function isStatefulComponent(o) {
return !isUndefined(o.prototype) && !isUndefined(o.prototype.render);
}
function isStringOrNumber(obj) {
return isString(obj) || isNumber(obj);
}
function isNullOrUndef(obj) {
return isUndefined(obj) || isNull(obj);
}
function isInvalid(obj) {
return isNull(obj) || obj === false || isTrue(obj) || isUndefined(obj);
}
function isFunction(obj) {
return typeof obj === 'function';
}
function isAttrAnEvent(attr) {
return attr[0] === 'o' && attr[1] === 'n' && attr.length > 3;
}
function isString(obj) {
return typeof obj === 'string';
}
function isNumber(obj) {
return typeof obj === 'number';
}
function isNull(obj) {
return obj === null;
}
function isTrue(obj) {
return obj === true;
}
function isUndefined(obj) {
return obj === undefined;
}
function isObject(o) {
return typeof o === 'object';
}
function throwError(message) {
if (!message) {
message = ERROR_MSG;
}
throw new Error(("Inferno Error: " + message));
}
var EMPTY_OBJ = {};
function isValidElement(obj) {
var isNotANullObject = isObject(obj) && isNull(obj) === false;
if (isNotANullObject === false) {
return false;
}
var flags = obj.flags;
return !!(flags & (28 /* Component */ | 3970 /* Element */));
}
// don't autobind these methods since they already have guaranteed context.
var AUTOBIND_BLACKLIST = {
constructor: 1,
render: 1,
shouldComponentUpdate: 1,
componentWillRecieveProps: 1,
componentWillUpdate: 1,
componentDidUpdate: 1,
componentWillMount: 1,
componentDidMount: 1,
componentWillUnmount: 1,
componentDidUnmount: 1
};
function extend(base, props, all) {
for (var key in props) {
if (all === true || !isNullOrUndef(props[key])) {
base[key] = props[key];
}
}
return base;
}
function bindAll(ctx) {
for (var i in ctx) {
var v = ctx[i];
if (typeof v === 'function' && !v.__bound && !AUTOBIND_BLACKLIST[i]) {
(ctx[i] = v.bind(ctx)).__bound = true;
}
}
}
function collateMixins(mixins, keyed) {
if ( keyed === void 0 ) keyed = {};
for (var i = 0; i < mixins.length; i++) {
var mixin = mixins[i];
// Surprise: Mixins can have mixins
if (mixin.mixins) {
// Recursively collate sub-mixins
collateMixins(mixin.mixins, keyed);
}
for (var key in mixin) {
if (mixin.hasOwnProperty(key) && typeof mixin[key] === 'function') {
(keyed[key] || (keyed[key] = [])).push(mixin[key]);
}
}
}
return keyed;
}
function applyMixin(key, inst, mixin) {
var original = inst[key];
inst[key] = function () {
var arguments$1 = arguments;
var ret;
for (var i = 0; i < mixin.length; i++) {
var method = mixin[i];
var _ret = method.apply(inst, arguments$1);
if (!isUndefined(_ret)) {
ret = _ret;
}
}
if (original) {
var _ret$1 = original.call(inst);
if (!isUndefined(_ret$1)) {
ret = _ret$1;
}
}
return ret;
};
}
function applyMixins(inst, mixins) {
for (var key in mixins) {
if (mixins.hasOwnProperty(key)) {
var mixin = mixins[key];
if (isFunction(mixin[0])) {
applyMixin(key, inst, mixin);
}
else {
inst[key] = mixin;
}
}
}
}
function createClass(obj) {
var Cl = (function (Component$$1) {
function Cl(props) {
Component$$1.call(this, props);
this.isMounted = function () { return !this._unmounted; };
extend(this, obj);
if (Cl.mixins) {
applyMixins(this, Cl.mixins);
}
bindAll(this);
if (obj.getInitialState) {
this.state = obj.getInitialState.call(this);
}
}
if ( Component$$1 ) Cl.__proto__ = Component$$1;
Cl.prototype = Object.create( Component$$1 && Component$$1.prototype );
Cl.prototype.constructor = Cl;
return Cl;
}(Component));
Cl.displayName = obj.displayName || 'Component';
Cl.propTypes = obj.propTypes;
Cl.defaultProps = obj.getDefaultProps ? obj.getDefaultProps() : undefined;
Cl.mixins = obj.mixins && collateMixins(obj.mixins);
if (obj.statics) {
extend(Cl, obj.statics);
}
return Cl;
}
function cloneVNode(vNodeToClone, props) {
var _children = [], len = arguments.length - 2;
while ( len-- > 0 ) _children[ len ] = arguments[ len + 2 ];
var children = _children;
if (_children.length > 0 && !isNull(_children[0])) {
if (!props) {
props = {};
}
if (_children.length === 1) {
children = _children[0];
}
if (isUndefined(props.children)) {
props.children = children;
}
else {
if (isArray(children)) {
if (isArray(props.children)) {
props.children = props.children.concat(children);
}
else {
props.children = [props.children].concat(children);
}
}
else {
if (isArray(props.children)) {
props.children.push(children);
}
else {
props.children = [props.children];
props.children.push(children);
}
}
}
}
children = null;
var flags = vNodeToClone.flags;
var events = vNodeToClone.events || (props && props.events) || null;
var newVNode;
if (isArray(vNodeToClone)) {
newVNode = vNodeToClone.map(function (vNode) { return cloneVNode(vNode); });
}
else if (isNullOrUndef(props) && isNullOrUndef(children)) {
newVNode = Object.assign({}, vNodeToClone);
}
else {
var key = !isNullOrUndef(vNodeToClone.key) ? vNodeToClone.key : props.key;
var ref = vNodeToClone.ref || props.ref;
if (flags & 28 /* Component */) {
newVNode = createVNode(flags, vNodeToClone.type, Object.assign({}, vNodeToClone.props, props), null, events, key, ref, true);
}
else if (flags & 3970 /* Element */) {
children = (props && props.children) || vNodeToClone.children;
newVNode = createVNode(flags, vNodeToClone.type, Object.assign({}, vNodeToClone.props, props), children, events, key, ref, !children);
}
}
if (flags & 28 /* Component */) {
var newProps = newVNode.props;
if (newProps) {
var newChildren = newProps.children;
// we need to also clone component children that are in props
// as the children may also have been hoisted
if (newChildren) {
if (isArray(newChildren)) {
for (var i = 0; i < newChildren.length; i++) {
var child = newChildren[i];
if (!isInvalid(child) && isVNode(child)) {
newProps.children[i] = cloneVNode(child);
}
}
}
else if (isVNode(newChildren)) {
newProps.children = cloneVNode(newChildren);
}
}
}
newVNode.children = null;
}
newVNode.dom = null;
return newVNode;
}
function _normalizeVNodes(nodes, result, i) {
for (; i < nodes.length; i++) {
var n = nodes[i];
if (!isInvalid(n)) {
if (Array.isArray(n)) {
_normalizeVNodes(n, result, 0);
}
else {
if (isStringOrNumber(n)) {
n = createTextVNode(n);
}
else if (isVNode(n) && n.dom) {
n = cloneVNode(n);
}
result.push(n);
}
}
}
}
function normalizeVNodes(nodes) {
var newNodes;
// we assign $ which basically means we've flagged this array for future note
// if it comes back again, we need to clone it, as people are using it
// in an immutable way
// tslint:disable
if (nodes['$']) {
nodes = nodes.slice();
}
else {
nodes['$'] = true;
}
// tslint:enable
for (var i = 0; i < nodes.length; i++) {
var n = nodes[i];
if (isInvalid(n)) {
if (!newNodes) {
newNodes = nodes.slice(0, i);
}
newNodes.push(n);
}
else if (Array.isArray(n)) {
var result = (newNodes || nodes).slice(0, i);
_normalizeVNodes(nodes, result, i);
return result;
}
else if (isStringOrNumber(n)) {
if (!newNodes) {
newNodes = nodes.slice(0, i);
}
newNodes.push(createTextVNode(n));
}
else if (isVNode(n) && n.dom) {
if (!newNodes) {
newNodes = nodes.slice(0, i);
}
newNodes.push(cloneVNode(n));
}
else if (newNodes) {
newNodes.push(cloneVNode(n));
}
}
return newNodes || nodes;
}
function normalizeChildren(children) {
if (isArray(children)) {
return normalizeVNodes(children);
}
else if (isVNode(children) && children.dom) {
return cloneVNode(children);
}
return children;
}
function normalizeProps$1(vNode, props, children) {
if (!(vNode.flags & 28 /* Component */) && isNullOrUndef(children) && !isNullOrUndef(props.children)) {
vNode.children = props.children;
}
if (props.ref) {
vNode.ref = props.ref;
}
if (props.events) {
vNode.events = props.events;
}
if (!isNullOrUndef(props.key)) {
vNode.key = props.key;
}
}
function normalize(vNode) {
var props = vNode.props;
var children = vNode.children;
// convert a wrongly created type back to element
if (isString(vNode.type) && (vNode.flags & 28 /* Component */)) {
vNode.flags = 3970 /* Element */;
}
if (props) {
normalizeProps$1(vNode, props, children);
}
if (!isInvalid(children)) {
vNode.children = normalizeChildren(children);
}
if (props && !isInvalid(props.children)) {
props.children = normalizeChildren(props.children);
}
}
function createVNode(flags, type, props, children, events, key, ref, noNormalise) {
if (flags & 16 /* ComponentUnknown */) {
flags = isStatefulComponent(type) ? 4 /* ComponentClass */ : 8 /* ComponentFunction */;
}
var vNode = {
children: isUndefined(children) ? null : children,
dom: null,
events: events || null,
flags: flags || 0,
key: key === undefined ? null : key,
props: props || null,
ref: ref || null,
type: type
};
if (!noNormalise) {
normalize(vNode);
}
return vNode;
}
// when a components root VNode is also a component, we can run into issues
// this will recursively look for vNode.parentNode if the VNode is a component
function updateParentComponentVNodes(vNode, dom) {
if (vNode.flags & 28 /* Component */) {
var parentVNode = vNode.parentVNode;
if (parentVNode) {
parentVNode.dom = dom;
updateParentComponentVNodes(parentVNode, dom);
}
}
}
function createVoidVNode() {
return createVNode(4096 /* Void */);
}
function createTextVNode(text) {
return createVNode(1 /* Text */, null, null, text);
}
function isVNode(o) {
return !!o.flags;
}
var componentHooks = {
onComponentWillMount: true,
onComponentDidMount: true,
onComponentWillUnmount: true,
onComponentShouldUpdate: true,
onComponentWillUpdate: true,
onComponentDidUpdate: true
};
function createElement$1(name, props) {
var _children = [], len = arguments.length - 2;
while ( len-- > 0 ) _children[ len ] = arguments[ len + 2 ];
if (isInvalid(name) || isObject(name)) {
throw new Error('Inferno Error: createElement() name paramater cannot be undefined, null, false or true, It must be a string, class or function.');
}
var children = _children;
var vNode = createVNode(0);
var ref = null;
var key = null;
var events = null;
var flags = 0;
if (_children) {
if (_children.length === 1) {
children = _children[0];
}
else if (_children.length === 0) {
children = undefined;
}
}
if (isString(name)) {
flags = 2 /* HtmlElement */;
switch (name) {
case 'svg':
flags = 128 /* SvgElement */;
break;
case 'input':
flags = 512 /* InputElement */;
break;
case 'textarea':
flags = 1024 /* TextareaElement */;
break;
case 'select':
flags = 2048 /* SelectElement */;
break;
default:
}
for (var prop in props) {
if (prop === 'key') {
key = props.key;
delete props.key;
}
else if (prop === 'children' && isUndefined(children)) {
children = props.children; // always favour children args, default to props
}
else if (prop === 'ref') {
ref = props.ref;
}
else if (isAttrAnEvent(prop)) {
if (!events) {
events = {};
}
events[prop] = props[prop];
delete props[prop];
}
}
}
else {
flags = isStatefulComponent(name) ? 4 /* ComponentClass */ : 8 /* ComponentFunction */;
if (!isUndefined(children)) {
if (!props) {
props = {};
}
props.children = children;
}
for (var prop$1 in props) {
if (componentHooks[prop$1]) {
if (!ref) {
ref = {};
}
ref[prop$1] = props[prop$1];
}
else if (prop$1 === 'key') {
key = props.key;
delete props.key;
}
}
vNode.props = props;
}
return createVNode(flags, name, props, children, events, key, ref);
}
function escapeText(_string) {
var string = _string + '';
var length = string.length;
var characters = '';
for (var i = 0; i < length; i++) {
switch (string.charCodeAt(i)) {
case 38:
characters += '&';
break;
case 39:
characters += ''';
break;
case 34:
characters += '"';
break;
case 60:
characters += '<';
break;
case 62:
characters += '>';
break;
default:
characters += string[i];
}
}
return characters;
}
var uppercasePattern = /[A-Z]/g;
var msPattern = /^ms-/;
function toHyphenCase(str) {
return str.replace(uppercasePattern, '-$&').toLowerCase().replace(msPattern, '-ms-');
}
var voidElements = {
area: true,
base: true,
br: true,
col: true,
command: true,
embed: true,
hr: true,
img: true,
input: true,
keygen: true,
link: true,
meta: true,
param: true,
source: true,
track: true,
wbr: true
};
function isVoidElement(str) {
return !!voidElements[str];
}
var devToolsStatus = {
connected: false
};
var internalIncrementer = {
id: 0
};
var componentIdMap = new Map();
function getIncrementalId() {
return internalIncrementer.id++;
}
function sendToDevTools(global, data) {
var event = new CustomEvent('inferno.client.message', {
detail: JSON.stringify(data, function (key, val) {
if (!isNull(val) && !isUndefined(val)) {
if (key === '_vComponent' || !isUndefined(val.nodeType)) {
return;
}
else if (isFunction(val)) {
return ("$$f:" + (val.name));
}
}
return val;
})
});
global.dispatchEvent(event);
}
function rerenderRoots() {
for (var i = 0; i < roots.length; i++) {
var root = roots[i];
render(root.input, root.dom);
}
}
function sendRoots(global) {
sendToDevTools(global, { type: 'roots', data: roots });
}
var Lifecycle = function Lifecycle() {
this.listeners = [];
this.fastUnmount = true;
};
Lifecycle.prototype.addListener = function addListener (callback) {
this.listeners.push(callback);
};
Lifecycle.prototype.trigger = function trigger () {
var this$1 = this;
for (var i = 0; i < this.listeners.length; i++) {
this$1.listeners[i]();
}
};
function constructDefaults(string, object, value) {
/* eslint no-return-assign: 0 */
string.split(',').forEach(function (i) { return object[i] = value; });
}
var xlinkNS = 'http://www.w3.org/1999/xlink';
var xmlNS = 'http://www.w3.org/XML/1998/namespace';
var svgNS = 'http://www.w3.org/2000/svg';
var strictProps = {};
var booleanProps = {};
var namespaces = {};
var isUnitlessNumber = {};
var skipProps = {};
var dehyphenProps = {
textAnchor: 'text-anchor'
};
var delegatedProps = {};
constructDefaults('xlink:href,xlink:arcrole,xlink:actuate,xlink:role,xlink:titlef,xlink:type', namespaces, xlinkNS);
constructDefaults('xml:base,xml:lang,xml:space', namespaces, xmlNS);
constructDefaults('volume,defaultValue,defaultChecked', strictProps, true);
constructDefaults('children,ref,key,selected,checked,value,multiple', skipProps, true);
constructDefaults('onClick,onMouseDown,onMouseUp,onMouseMove', delegatedProps, true);
constructDefaults('muted,scoped,loop,open,checked,default,capture,disabled,readonly,required,autoplay,controls,seamless,reversed,allowfullscreen,novalidate', booleanProps, true);
constructDefaults('animationIterationCount,borderImageOutset,borderImageSlice,borderImageWidth,boxFlex,boxFlexGroup,boxOrdinalGroup,columnCount,flex,flexGrow,flexPositive,flexShrink,flexNegative,flexOrder,gridRow,gridColumn,fontWeight,lineClamp,lineHeight,opacity,order,orphans,tabSize,widows,zIndex,zoom,fillOpacity,floodOpacity,stopOpacity,strokeDasharray,strokeDashoffset,strokeMiterlimit,strokeOpacity,strokeWidth,', isUnitlessNumber, true);
var delegatedEvents = new Map();
function handleEvent(name, lastEvent, nextEvent, dom) {
var delegatedRoots = delegatedEvents.get(name);
if (nextEvent) {
if (!delegatedRoots) {
delegatedRoots = { items: new Map(), count: 0, docEvent: null };
var docEvent = attachEventToDocument(name, delegatedRoots);
delegatedRoots.docEvent = docEvent;
delegatedEvents.set(name, delegatedRoots);
}
if (!lastEvent) {
delegatedRoots.count++;
}
delegatedRoots.items.set(dom, nextEvent);
}
else if (delegatedRoots) {
if (delegatedRoots.items.has(dom)) {
delegatedRoots.count--;
delegatedRoots.items.delete(dom);
if (delegatedRoots.count === 0) {
document.removeEventListener(normalizeEventName(name), delegatedRoots.docEvent);
delegatedEvents.delete(name);
}
}
}
}
function dispatchEvent(event, dom, items, count, eventData) {
var eventsToTrigger = items.get(dom);
if (eventsToTrigger) {
count--;
// linkEvent object
eventData.dom = dom;
if (eventsToTrigger.event) {
eventsToTrigger.event(eventsToTrigger.data, event);
}
else {
eventsToTrigger(event);
}
if (eventData.stopPropagation) {
return;
}
}
var parentDom = dom.parentNode;
if (count > 0 && (parentDom || parentDom === document.body)) {
dispatchEvent(event, parentDom, items, count, eventData);
}
}
function normalizeEventName(name) {
return name.substr(2).toLowerCase();
}
function attachEventToDocument(name, delegatedRoots) {
var docEvent = function (event) {
var eventData = {
stopPropagation: false,
dom: document
};
Object.defineProperty(event, 'currentTarget', {
get: function get() {
return eventData.dom;
}
});
event.stopPropagation = function () {
eventData.stopPropagation = true;
};
var count = delegatedRoots.count;
if (count > 0) {
dispatchEvent(event, event.target, delegatedRoots.items, count, eventData);
}
};
document.addEventListener(normalizeEventName(name), docEvent);
return docEvent;
}
function isCheckedType(type) {
return type === 'checkbox' || type === 'radio';
}
function isControlled(props) {
var usesChecked = isCheckedType(props.type);
return usesChecked ? !isNullOrUndef(props.checked) : !isNullOrUndef(props.value);
}
function onTextInputChange(e) {
var vNode = this.vNode;
var events = vNode.events || EMPTY_OBJ;
var dom = vNode.dom;
if (events.onInput) {
events.onInput(e);
}
else if (events.oninput) {
events.oninput(e);
}
// the user may have updated the vNode from the above onInput events
// so we need to get it from the context of `this` again
applyValue(this.vNode, dom);
}
function onCheckboxChange(e) {
var vNode = this.vNode;
var events = vNode.events || EMPTY_OBJ;
var dom = vNode.dom;
if (events.onClick) {
events.onClick(e);
}
else if (events.onclick) {
events.onclick(e);
}
// the user may have updated the vNode from the above onClick events
// so we need to get it from the context of `this` again
applyValue(this.vNode, dom);
}
function handleAssociatedRadioInputs(name) {
var inputs = document.querySelectorAll(("input[type=\"radio\"][name=\"" + name + "\"]"));
[].forEach.call(inputs, function (dom) {
var inputWrapper = wrappers.get(dom);
if (inputWrapper) {
var props = inputWrapper.vNode.props;
if (props) {
dom.checked = inputWrapper.vNode.props.checked;
}
}
});
}
function processInput(vNode, dom) {
var props = vNode.props || EMPTY_OBJ;
applyValue(vNode, dom);
if (isControlled(props)) {
var inputWrapper = wrappers.get(dom);
if (!inputWrapper) {
inputWrapper = {
vNode: vNode
};
if (isCheckedType(props.type)) {
dom.onclick = onCheckboxChange.bind(inputWrapper);
dom.onclick.wrapped = true;
}
else {
dom.oninput = onTextInputChange.bind(inputWrapper);
dom.oninput.wrapped = true;
}
wrappers.set(dom, inputWrapper);
}
inputWrapper.vNode = vNode;
}
}
function applyValue(vNode, dom) {
var props = vNode.props || EMPTY_OBJ;
var type = props.type;
var value = props.value;
var checked = props.checked;
if (type !== dom.type && type) {
dom.type = type;
}
if (props.multiple !== dom.multiple) {
dom.multiple = props.multiple;
}
if (isCheckedType(type)) {
if (!isNullOrUndef(value)) {
dom.value = value;
}
dom.checked = checked;
if (type === 'radio' && props.name) {
handleAssociatedRadioInputs(props.name);
}
}
else {
if (!isNullOrUndef(value) && dom.value !== value) {
dom.value = value;
}
else if (!isNullOrUndef(checked)) {
dom.checked = checked;
}
}
}
function isControlled$1(props) {
return !isNullOrUndef(props.value);
}
function updateChildOption(vNode, value) {
var props = vNode.props || EMPTY_OBJ;
var dom = vNode.dom;
// we do this as multiple may have changed
dom.value = props.value;
if ((isArray(value) && value.indexOf(props.value) !== -1) || props.value === value) {
dom.selected = true;
}
else {
dom.selected = props.selected || false;
}
}
function onSelectChange(e) {
var vNode = this.vNode;
var events = vNode.events || EMPTY_OBJ;
var dom = vNode.dom;
if (events.onChange) {
events.onChange(e);
}
else if (events.onchange) {
events.onchange(e);
}
// the user may have updated the vNode from the above onChange events
// so we need to get it from the context of `this` again
applyValue$1(this.vNode, dom);
}
function processSelect(vNode, dom) {
var props = vNode.props || EMPTY_OBJ;
applyValue$1(vNode, dom);
if (isControlled$1(props)) {
var selectWrapper = wrappers.get(dom);
if (!selectWrapper) {
selectWrapper = {
vNode: vNode
};
dom.onchange = onSelectChange.bind(selectWrapper);
dom.onchange.wrapped = true;
wrappers.set(dom, selectWrapper);
}
selectWrapper.vNode = vNode;
}
}
function applyValue$1(vNode, dom) {
var props = vNode.props || EMPTY_OBJ;
if (props.multiple !== dom.multiple) {
dom.multiple = props.multiple;
}
var children = vNode.children;
var value = props.value;
if (isArray(children)) {
for (var i = 0; i < children.length; i++) {
updateChildOption(children[i], value);
}
}
else if (isVNode(children)) {
updateChildOption(children, value);
}
}
function isControlled$2(props) {
return !isNullOrUndef(props.value);
}
function onTextareaInputChange(e) {
var vNode = this.vNode;
var events = vNode.events || EMPTY_OBJ;
var dom = vNode.dom;
if (events.onInput) {
events.onInput(e);
}
else if (events.oninput) {
events.oninput(e);
}
// the user may have updated the vNode from the above onInput events
// so we need to get it from the context of `this` again
applyValue$2(this.vNode, dom);
}
function processTextarea(vNode, dom) {
var props = vNode.props || EMPTY_OBJ;
applyValue$2(vNode, dom);
var textareaWrapper = wrappers.get(dom);
if (isControlled$2(props)) {
if (!textareaWrapper) {
textareaWrapper = {
vNode: vNode
};
dom.oninput = onTextareaInputChange.bind(textareaWrapper);
dom.oninput.wrapped = true;
wrappers.set(dom, textareaWrapper);
}
textareaWrapper.vNode = vNode;
}
}
function applyValue$2(vNode, dom) {
var props = vNode.props || EMPTY_OBJ;
var value = props.value;
if (dom.value !== value) {
dom.value = value;
}
}
var wrappers = new Map();
function processElement(flags, vNode, dom) {
if (flags & 512 /* InputElement */) {
processInput(vNode, dom);
}
else if (flags & 2048 /* SelectElement */) {
processSelect(vNode, dom);
}
else if (flags & 1024 /* TextareaElement */) {
processTextarea(vNode, dom);
}
}
function unmount(vNode, parentDom, lifecycle, canRecycle, shallowUnmount, isRecycling) {
var flags = vNode.flags;
if (flags & 28 /* Component */) {
unmountComponent(vNode, parentDom, lifecycle, canRecycle, shallowUnmount, isRecycling);
}
else if (flags & 3970 /* Element */) {
unmountElement(vNode, parentDom, lifecycle, canRecycle, shallowUnmount, isRecycling);
}
else if (flags & (1 /* Text */ | 4096 /* Void */)) {
unmountVoidOrText(vNode, parentDom);
}
}
function unmountVoidOrText(vNode, parentDom) {
if (parentDom) {
removeChild(parentDom, vNode.dom);
}
}
function unmountComponent(vNode, parentDom, lifecycle, canRecycle, shallowUnmount, isRecycling) {
var instance = vNode.children;
var flags = vNode.flags;
var isStatefulComponent$$1 = flags & 4;
var ref = vNode.ref;
var dom = vNode.dom;
if (!isRecycling) {
if (!shallowUnmount) {
if (isStatefulComponent$$1) {
var subLifecycle = instance._lifecycle;
if (!subLifecycle.fastUnmount) {
unmount(instance._lastInput, null, lifecycle, false, shallowUnmount, isRecycling);
}
}
else {
if (!lifecycle.fastUnmount) {
unmount(instance, null, lifecycle, false, shallowUnmount, isRecycling);
}
}
}
if (isStatefulComponent$$1) {
instance._ignoreSetState = true;
instance.componentWillUnmount();
if (ref && !isRecycling) {
ref(null);
}
instance._unmounted = true;
findDOMNodeEnabled && componentToDOMNodeMap.delete(instance);
}
else if (!isNullOrUndef(ref)) {
if (!isNullOrUndef(ref.onComponentWillUnmount)) {
ref.onComponentWillUnmount(dom);
}
}
}
if (parentDom) {
var lastInput = instance._lastInput;
if (isNullOrUndef(lastInput)) {
lastInput = instance;
}
removeChild(parentDom, dom);
}
if (recyclingEnabled && !isStatefulComponent$$1 && (parentDom || canRecycle)) {
poolComponent(vNode);
}
}
function unmountElement(vNode, parentDom, lifecycle, canRecycle, shallowUnmount, isRecycling) {
var dom = vNode.dom;
var ref = vNode.ref;
var events = vNode.events;
if (!shallowUnmount && !lifecycle.fastUnmount) {
if (ref && !isRecycling) {
unmountRef(ref);
}
var children = vNode.children;
if (!isNullOrUndef(children)) {
unmountChildren$1(children, lifecycle, shallowUnmount, isRecycling);
}
}
if (!isNull(events)) {
for (var name in events) {
// do not add a hasOwnProperty check here, it affects performance
patchEvent(name, events[name], null, dom, lifecycle);
events[name] = null;
}
}
if (parentDom) {
removeChild(parentDom, dom);
}
if (recyclingEnabled && (parentDom || canRecycle)) {
poolElement(vNode);
}
}
function unmountChildren$1(children, lifecycle, shallowUnmount, isRecycling) {
if (isArray(children)) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (!isInvalid(child) && isObject(child)) {
unmount(child, null, lifecycle, false, shallowUnmount, isRecycling);
}
}
}
else if (isObject(children)) {
unmount(children, null, lifecycle, false, shallowUnmount, isRecycling);
}
}
function unmountRef(ref) {
if (isFunction(ref)) {
ref(null);
}
else {
if (isInvalid(ref)) {
return;
}
if (process.env.NODE_ENV !== 'production') {
throwError('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.');
}
throwError();
}
}
function patch(lastVNode, nextVNode, parentDom, lifecycle, context, isSVG, isRecycling) {
if (lastVNode !== nextVNode) {
var lastFlags = lastVNode.flags;
var nextFlags = nextVNode.flags;
if (nextFlags & 28 /* Component */) {
if (lastFlags & 28 /* Component */) {
patchComponent(lastVNode, nextVNode, parentDom, lifecycle, context, isSVG, nextFlags & 4 /* ComponentClass */, isRecycling);
}
else {
replaceVNode(parentDom, mountComponent(nextVNode, null, lifecycle, context, isSVG, nextFlags & 4 /* ComponentClass */), lastVNode, lifecycle, isRecycling);
}
}
else if (nextFlags & 3970 /* Element */) {
if (lastFlags & 3970 /* Element */) {
patchElement(lastVNode, nextVNode, parentDom, lifecycle, context, isSVG, isRecycling);
}
else {
replaceVNode(parentDom, mountElement(nextVNode, null, lifecycle, context, isSVG), lastVNode, lifecycle, isRecycling);
}
}
else if (nextFlags & 1 /* Text */) {
if (lastFlags & 1 /* Text */) {
patchText(lastVNode, nextVNode);
}
else {
replaceVNode(parentDom, mountText(nextVNode, null), lastVNode, lifecycle, isRecycling);
}
}
else if (nextFlags & 4096 /* Void */) {
if (lastFlags & 4096 /* Void */) {
patchVoid(lastVNode, nextVNode);
}
else {
replaceVNode(parentDom, mountVoid(nextVNode, null), lastVNode, lifecycle, isRecycling);
}
}
else {
// Error case: mount new one replacing old one
replaceLastChildAndUnmount(lastVNode, nextVNode, parentDom, lifecycle, context, isSVG, isRecycling);
}
}
}
function unmountChildren(children, dom, lifecycle, isRecycling) {
if (isVNode(children)) {
unmount(children, dom, lifecycle, true, false, isRecycling);
}
else if (isArray(children)) {
removeAllChildren(dom, children, lifecycle, false, isRecycling);
}
else {
dom.textContent = '';
}
}
function patchElement(lastVNode, nextVNode, parentDom, lifecycle, context, isSVG, isRecycling) {
var nextTag = nextVNode.type;
var lastTag = lastVNode.type;
if (lastTag !== nextTag) {
replaceWithNewNode(lastVNode, nextVNode, parentDom, lifecycle, context, isSVG, isRecycling);
}
else {
var dom = lastVNode.dom;
var lastProps = lastVNode.props;
var nextProps = nextVNode.props;
var lastChildren = lastVNode.children;
var nextChildren = nextVNode.children;
var lastFlags = lastVNode.flags;
var nextFlags = nextVNode.flags;
var lastRef = lastVNode.ref;
var nextRef = nextVNode.ref;
var lastEvents = lastVNode.events;
var nextEvents = nextVNode.events;
nextVNode.dom = dom;
if (isSVG || (nextFlags & 128 /* SvgElement */)) {
isSVG = true;
}
if (lastChildren !== nextChildren) {
patchChildren(lastFlags, nextFlags, lastChildren, nextChildren, dom, lifecycle, context, isSVG, isRecycling);
}
if (!(nextFlags & 2 /* HtmlElement */)) {
processElement(nextFlags, nextVNode, dom);
}
if (lastProps !== nextProps) {
patchProps(lastProps, nextProps, dom, lifecycle, context, isSVG);
}
if (lastEvents !== nextEvents) {
patchEvents(lastEvents, nextEvents, dom, lifecycle);
}
if (nextRef) {
if (lastRef !== nextRef || isRecycling) {
mountRef(dom, nextRef, lifecycle);
}
}
}
}
function patchChildren(lastFlags, nextFlags, lastChildren, nextChildren, dom, lifecycle, context, isSVG, isRecycling) {
var patchArray = false;
var patchKeyed = false;
if (nextFlags & 64 /* HasNonKeyedChildren */) {
patchArray = true;
}
else if ((lastFlags & 32 /* HasKeyedChildren */) && (nextFlags & 32 /* HasKeyedChildren */)) {
patchKeyed = true;
patchArray = true;
}
else if (isInvalid(nextChildren)) {
unmountChildren(lastChildren, dom, lifecycle, isRecycling);
}
else if (isInvalid(lastChildren)) {
if (isStringOrNumber(nextChildren)) {
setTextContent(dom, nextChildren);
}
else {
if (isArray(nextChildren)) {
mountArrayChildren(nextChildren, dom, lifecycle, context, isSVG);
}
else {
mount(nextChildren, dom, lifecycle, context, isSVG);
}
}
}
else if (isStringOrNumber(nextChildren)) {
if (isStringOrNumber(lastChildren)) {
updateTextContent(dom, nextChildren);
}
else {
unmountChildren(lastChildren, dom, lifecycle, isRecycling);
setTextContent(dom, nextChildren);
}
}
else if (isArray(nextChildren)) {
if (isArray(lastChildren)) {
patchArray = true;
if (isKeyed(lastChildren, nextChildren)) {
patchKeyed = true;
}
}
else {
unmountChildren(lastChildren, dom, lifecycle, isRecycling);
mountArrayChildren(nextChildren, dom, lifecycle, context, isSVG);
}
}
else if (isArray(lastChildren)) {
removeAllChildren(dom, lastChildren, lifecycle, false, isRecycling);
mount(nextChildren, dom, lifecycle, context, isSVG);
}
else if (isVNode(nextChildren)) {
if (isVNode(lastChildren)) {
patch(lastChildren, nextChildren, dom, lifecycle, context, isSVG, isRecycling);
}
else {
unmountChildren(lastChildren, dom, lifecycle, isRecycling);
mount(nextChildren, dom, lifecycle, context, isSVG);
}
}
else if (isVNode(lastChildren)) {
}
else {
}
if (patchArray) {
if (patchKeyed) {
patchKeyedChildren(lastChildren, nextChildren, dom, lifecycle, context, isSVG, isRecycling);
}
else {
patchNonKeyedChildren(lastChildren, nextChildren, dom, lifecycle, context, isSVG, isRecycling);
}
}
}
function patchComponent(lastVNode, nextVNode, parentDom, lifecycle, context, isSVG, isClass, isRecycling) {
var lastType = lastVNode.type;
var nextType = nextVNode.type;
var nextProps = nextVNode.props || EMPTY_OBJ;
var lastKey = lastVNode.key;
var nextKey = nextVNode.key;
if (lastType !== nextType) {
if (isClass) {
replaceWithNewNode(lastVNode, nextVNode, parentDom, lifecycle, context, isSVG, isRecycling);
}
else {
var lastInput = lastVNode.children._lastInput || lastVNode.children;
var nextInput = createStatelessComponentInput(nextVNode, nextType, nextProps, context);
patch(lastInput, nextInput, parentDom, lifecycle, context, isSVG, isRecycling);
var dom = nextVNode.dom = nextInput.dom;
nextVNode.children = nextInput;
mountStatelessComponentCallbacks(nextVNode.ref, dom, lifecycle);
unmount(lastVNode, null, lifecycle, false, true, isRecycling);
}
}
else {
if (isClass) {
if (lastKey !== nextKey) {
replaceWithNewNode(lastVNode, nextVNode, parentDom, lifecycle, context, isSVG, isRecycling);
return false;
}
var instance = lastVNode.children;
if (instance._unmounted) {
if (isNull(parentDom)) {
return true;
}
replaceChild(parentDom, mountComponent(nextVNode, null, lifecycle, context, isSVG, nextVNode.flags & 4 /* ComponentClass */), lastVNode.dom);
}
else {
var defaultProps = nextType.defaultProps;
var lastProps = instance.props;
if (instance._devToolsStatus.connected && !instance._devToolsId) {
componentIdMap.set(instance._devToolsId = getIncrementalId(), instance);
}
lifecycle.fastUnmount = false;
if (!isUndefined(defaultProps)) {
copyPropsTo(lastProps, nextProps);
nextVNode.props = nextProps;
}
var lastState = instance.state;
var nextState = instance.state;
var childContext = instance.getChildContext();
nextVNode.children = instance;
instance._isSVG = isSVG;
if (!isNullOrUndef(childContext)) {
childContext = Object.assign({}, context, childContext);
}
else {
childContext = context;
}
var lastInput$1 = instance._lastInput;
var nextInput$1 = instance._updateComponent(lastState, nextState, lastProps, nextProps, context, false);
var didUpdate = true;
instance._childContext = childContext;
if (isInvalid(nextInput$1)) {
nextInput$1 = createVoidVNode();
}
else if (isArray(nextInput$1)) {
if (process.env.NODE_ENV !== 'production') {
throwError('a valid Inferno VNode (or null) must be returned from a component render. You may have returned an array or an invalid object.');
}
throwError();
}
else if (nextInput$1 === NO_OP) {
nextInput$1 = lastInput$1;
didUpdate = false;
}
else if (isObject(nextInput$1) && nextInput$1.dom) {
nextInput$1 = cloneVNode(nextInput$1);
}
if (nextInput$1.flags & 28 /* Component */) {
nextInput$1.parentVNode = nextVNode;
}
else if (lastInput$1.flags & 28 /* Component */) {
lastInput$1.parentVNode = nextVNode;
}
instance._lastInput = nextInput$1;
instance._vNode = nextVNode;
if (didUpdate) {
var fastUnmount = lifecycle.fastUnmount;
var subLifecycle = instance._lifecycle;
lifecycle.fastUnmount = subLifecycle.fastUnmount;
patch(lastInput$1, nextInput$1, parentDom, lifecycle, childContext, isSVG, isRecycling);
subLifecycle.fastUnmount = lifecycle.unmount;
lifecycle.fastUnmount = fastUnmount;
instance.componentDidUpdate(lastProps, lastState);
findDOMNodeEnabled && componentToDOMNodeMap.set(instance, nextInput$1.dom);
}
nextVNode.dom = nextInput$1.dom;
}
}
else {
var shouldUpdate = true;
var lastProps$1 = lastVNode.props;
var nextHooks = nextVNode.ref;
var nextHooksDefined = !isNullOrUndef(nextHooks);
var lastInput$2 = lastVNode.children;
var nextInput$2 = lastInput$2;
nextVNode.dom = lastVNode.dom;
nextVNode.children = lastInput$2;
if (lastKey !== nextKey) {
shouldUpdate = true;
}
else {
if (nextHooksDefined && !isNullOrUndef(nextHooks.onComponentShouldUpdate)) {
shouldUpdate = nextHooks.onComponentShouldUpdate(lastProps$1, nextProps);
}
}
if (shouldUpdate !== false) {
if (nextHooksDefined && !isNullOrUndef(nextHooks.onComponentWillUpdate)) {
lifecycle.fastUnmount = false;
nextHooks.onComponentWillUpdate(lastProps$1, nextProps);
}
nextInput$2 = nextType(nextProps, context);
if (isInvalid(nextInput$2)) {
nextInput$2 = createVoidVNode();
}
else if (isArray(nextInput$2)) {
if (process.env.NODE_ENV !== 'production') {
throwError('a valid Inferno VNode (or null) must be returned from a component render. You may have returned an array or an invalid object.');
}
throwError();
}
else if (isObject(nextInput$2) && nextInput$2.dom) {
nextInput$2 = cloneVNode(nextInput$2);
}
if (nextInput$2 !== NO_OP) {
patch(lastInput$2, nextInput$2, parentDom, lifecycle, context, isSVG, isRecycling);
nextVNode.children = nextInput$2;
if (nextHooksDefined && !isNullOrUndef(nextHooks.onComponentDidUpdate)) {
lifecycle.fastUnmount = false;
nextHooks.onComponentDidUpdate(lastProps$1, nextProps);
}
nextVNode.dom = nextInput$2.dom;
}
}
if (nextInput$2.flags & 28 /* Component */) {
nextInput$2.parentVNode = nextVNode;
}
else if (lastInput$2.flags & 28 /* Component */) {
lastInput$2.parentVNode = nextVNode;
}
}
}
return false;
}
function patchText(lastVNode, nextVNode) {
var nextText = nextVNode.children;
var dom = lastVNode.dom;
nextVNode.dom = dom;
if (lastVNode.children !== nextText) {
dom.nodeValue = nextText;
}
}
function patchVoid(lastVNode, nextVNode) {
nextVNode.dom = lastVNode.dom;
}
function patchNonKeyedChildren(lastChildren, nextChildren, dom, lifecycle, context, isSVG, isRecycling) {
var lastChildrenLength = lastChildren.length;
var nextChildrenLength = nextChildren.length;
var commonLength = lastChildrenLength > nextChildrenLength ? nextChildrenLength : lastChildrenLength;
var i;
var nextNode = null;
var newNode;
// Loop backwards so we can use insertBefore
if (lastChildrenLength < nextChildrenLength) {
for (i = nextChildrenLength - 1; i >= commonLength; i--) {
var child = nextChildren[i];
if (!isInvalid(child)) {
if (child.dom) {
nextChildren[i] = child = cloneVNode(child);
}
newNode = mount(child, null, lifecycle, context, isSVG);
insertOrAppend(dom, newNode, nextNode);
nextNode = newNode;
}
}
}
else if (nextChildrenLength === 0) {
removeAllChildren(dom, lastChildren, lifecycle, false, isRecycling);
}
else if (lastChildrenLength > nextChildrenLength) {
for (i = commonLength; i < lastChildrenLength; i++) {
var child$1 = lastChildren[i];
if (!isInvalid(child$1)) {
unmount(lastChildren[i], dom, lifecycle, false, false, isRecycling);
}
}
}
for (i = commonLength - 1; i >= 0; i--) {
var lastChild = lastChildren[i];
var nextChild = nextChildren[i];
if (isInvalid(nextChild)) {
if (!isInvalid(lastChild)) {
unmount(lastChild, dom, lifecycle, true, false, isRecycling);
}
}
else {
if (nextChild.dom) {
nextChildren[i] = nextChild = cloneVNode(nextChild);
}
if (isInvalid(lastChild)) {
newNode = mount(nextChild, null, lifecycle, context, isSVG);
insertOrAppend(dom, newNode, nextNode);
nextNode = newNode;
}
else {
patch(lastChild, nextChild, dom, lifecycle, context, isSVG, isRecycling);
nextNode = nextChild.dom;
}
}
}
}
function patchKeyedChildren(a, b, dom, lifecycle, context, isSVG, isRecycling) {
var aLength = a.length;
var bLength = b.length;
var aEnd = aLength - 1;
var bEnd = bLength - 1;
var aStart = 0;
var bStart = 0;
var i;
var j;
var aNode;
var bNode;
var nextNode;
var nextPos;
var node;
if (aLength === 0) {
if (bLength !== 0) {
mountArrayChildren(b, dom, lifecycle, context, isSVG);
}
return;
}
else if (bLength === 0) {
removeAllChildren(dom, a, lifecycle, false, isRecycling);
return;
}
var aStartNode = a[aStart];
var bStartNode = b[bStart];
var aEndNode = a[aEnd];
var bEndNode = b[bEnd];
if (bStartNode.dom) {
b[bStart] = bStartNode = cloneVNode(bStartNode);
}
if (bEndNode.dom) {
b[bEnd] = bEndNode = cloneVNode(bEndNode);
}
// Step 1
/* eslint no-constant-condition: 0 */
outer: while (true) {
// Sync nodes with the same key at the beginning.
while (aStartNode.key === bStartNode.key) {
patch(aStartNode, bStartNode, dom, lifecycle, context, isSVG, isRecycling);
aStart++;
bStart++;
if (aStart > aEnd || bStart > bEnd) {
break outer;
}
aStartNode = a[aStart];
bStartNode = b[bStart];
if (bStartNode.dom) {
b[bStart] = bStartNode = cloneVNode(bStartNode);
}
}
// Sync nodes with the same key at the end.
while (aEndNode.key === bEndNode.key) {
patch(aEndNode, bEndNode, dom, lifecycle, context, isSVG, isRecycling);
aEnd--;
bEnd--;
if (aStart > aEnd || bStart > bEnd) {
break outer;
}
aEndNode = a[aEnd];
bEndNode = b[bEnd];
if (bEndNode.dom) {
b[bEnd] = bEndNode = cloneVNode(bEndNode);
}
}
// Move and sync nodes from right to left.
if (aEndNode.key === bStartNode.key) {
patch(aEndNode, bStartNode, dom, lifecycle, context, isSVG, isRecycling);
insertOrAppend(dom, bStartNode.dom, aStartNode.dom);
aEnd--;
bStart++;
aEndNode = a[aEnd];
bStartNode = b[bStart];
if (bStartNode.dom) {
b[bStart] = bStartNode = cloneVNode(bStartNode);
}
continue;
}
// Move and sync nodes from left to right.
if (aStartNode.key === bEndNode.key) {
patch(aStartNode, bEndNode, dom, lifecycle, context, isSVG, isRecycling);
nextPos = bEnd + 1;
nextNode = nextPos < b.length ? b[nextPos].dom : null;
insertOrAppend(dom, bEndNode.dom, nextNode);
aStart++;
bEnd--;
aStartNode = a[aStart];
bEndNode = b[bEnd];
if (bEndNode.dom) {
b[bEnd] = bEndNode = cloneVNode(bEndNode);
}
continue;
}
break;
}
if (aStart > aEnd) {
if (bStart <= bEnd) {
nextPos = bEnd + 1;
nextNode = nextPos < b.length ? b[nextPos].dom : null;
while (bStart <= bEnd) {
node = b[bStart];
if (node.dom) {
b[bStart] = node = cloneVNode(node);
}
bStart++;
insertOrAppend(dom, mount(node, null, lifecycle, context, isSVG), nextNode);
}
}
}
else if (bStart > bEnd) {
while (aStart <= aEnd) {
unmount(a[aStart++], dom, lifecycle, false, false, isRecycling);
}
}
else {
aLength = aEnd - aStart + 1;
bLength = bEnd - bStart + 1;
var aNullable = a;
var sources = new Array(bLength);
// Mark all nodes as inserted.
for (i = 0; i < bLength; i++) {
sources[i] = -1;
}
var moved = false;
var pos = 0;
var patched = 0;
if ((bLength <= 4) || (aLength * bLength <= 16)) {
for (i = aStart; i <= aEnd; i++) {
aNode = a[i];
if (patched < bLength) {
for (j = bStart; j <= bEnd; j++) {
bNode = b[j];
if (aNode.key === bNode.key) {
sources[j - bStart] = i;
if (pos > j) {
moved = true;
}
else {
pos = j;
}
if (bNode.dom) {
b[j] = bNode = cloneVNode(bNode);
}
patch(aNode, bNode, dom, lifecycle, context, isSVG, isRecycling);
patched++;
aNullable[i] = null;
break;
}
}
}
}
}
else {
var keyIndex = new Map();
for (i = bStart; i <= bEnd; i++) {
node = b[i];
keyIndex.set(node.key, i);
}
for (i = aStart; i <= aEnd; i++) {
aNode = a[i];
if (patched < bLength) {
j = keyIndex.get(aNode.key);
if (!isUndefined(j)) {
bNode = b[j];
sources[j - bStart] = i;
if (pos > j) {
moved = true;
}
else {
pos = j;
}
if (bNode.dom) {
b[j] = bNode = cloneVNode(bNode);
}
patch(aNode, bNode, dom, lifecycle, context, isSVG, isRecycling);
patched++;
aNullable[i] = null;
}
}
}
}
if (aLength === a.length && patched === 0) {
removeAllChildren(dom, a, lifecycle, false, isRecycling);
while (bStart < bLength) {
node = b[bStart];
if (node.dom) {
b[bStart] = node = cloneVNode(node);
}
bStart++;
insertOrAppend(dom, mount(node, null, lifecycle, context, isSVG), null);
}
}
else {
i = aLength - patched;
while (i > 0) {
aNode = aNullable[aStart++];
if (!isNull(aNode)) {
unmount(aNode, dom, lifecycle, false, false, isRecycling);
i--;
}
}
if (moved) {
var seq = lis_algorithm(sources);
j = seq.length - 1;
for (i = bLength - 1; i >= 0; i--) {
if (sources[i] === -1) {
pos = i + bStart;
node = b[pos];
if (node.dom) {
b[pos] = node = cloneVNode(node);
}
nextPos = pos + 1;
nextNode = nextPos < b.length ? b[nextPos].dom : null;
insertOrAppend(dom, mount(node, dom, lifecycle, context, isSVG), nextNode);
}
else {
if (j < 0 || i !== seq[j]) {
pos = i + bStart;
node = b[pos];
nextPos = pos + 1;
nextNode = nextPos < b.length ? b[nextPos].dom : null;
insertOrAppend(dom, node.dom, nextNode);
}
else {
j--;
}
}
}
}
else if (patched !== bLength) {
for (i = bLength - 1; i >= 0; i--) {
if (sources[i] === -1) {
pos = i + bStart;
node = b[pos];
if (node.dom) {
b[pos] = node = cloneVNode(node);
}
nextPos = pos + 1;
nextNode = nextPos < b.length ? b[nextPos].dom : null;
insertOrAppend(dom, mount(node, null, lifecycle, context, isSVG), nextNode);
}
}
}
}
}
}
// // https://en.wikipedia.org/wiki/Longest_increasing_subsequence
function lis_algorithm(a) {
var p = a.slice(0);
var result = [];
result.push(0);
var i;
var j;
var u;
var v;
var c;
for (i = 0; i < a.length; i++) {
if (a[i] === -1) {
continue;
}
j = result[result.length - 1];
if (a[j] < a[i]) {
p[i] = j;
result.push(i);
continue;
}
u = 0;
v = result.length - 1;
while (u < v) {
c = ((u + v) / 2) | 0;
if (a[result[c]] < a[i]) {
u = c + 1;
}
else {
v = c;
}
}
if (a[i] < a[result[u]]) {
if (u > 0) {
p[i] = result[u - 1];
}
result[u] = i;
}
}
u = result.length;
v = result[u - 1];
while (u-- > 0) {
result[u] = v;
v = p[v];
}
return result;
}
function patchProp(prop, lastValue, nextValue, dom, isSVG, lifecycle) {
if (skipProps[prop]) {
return;
}
if (booleanProps[prop]) {
dom[prop] = nextValue ? true : false;
}
else if (strictProps[prop]) {
var value = isNullOrUndef(nextValue) ? '' : nextValue;
if (dom[prop] !== value) {
dom[prop] = value;
}
}
else if (isAttrAnEvent(prop)) {
patchEvent(prop, lastValue, nextValue, dom, lifecycle);
}
else if (lastValue !== nextValue) {
if (isNullOrUndef(nextValue)) {
dom.removeAttribute(prop);
}
else if (prop === 'className') {
if (isSVG) {
dom.setAttribute('class', nextValue);
}
else {
dom.className = nextValue;
}
}
else if (prop === 'style') {
patchStyle(lastValue, nextValue, dom);
}
else if (prop === 'dangerouslySetInnerHTML') {
var lastHtml = lastValue && lastValue.__html;
var nextHtml = nextValue && nextValue.__html;
if (lastHtml !== nextHtml) {
if (!isNullOrUndef(nextHtml)) {
dom.innerHTML = nextHtml;
}
}
}
else if (prop !== 'childrenType' && prop !== 'ref' && prop !== 'key') {
var dehyphenProp = dehyphenProps[prop];
var ns = namespaces[prop];
if (ns) {
dom.setAttributeNS(ns, dehyphenProp || prop, nextValue);
}
else {
dom.setAttribute(dehyphenProp || prop, nextValue);
}
}
}
}
function patchEvents(lastEvents, nextEvents, dom, lifecycle) {
lastEvents = lastEvents || EMPTY_OBJ;
nextEvents = nextEvents || EMPTY_OBJ;
if (nextEvents !== EMPTY_OBJ) {
for (var name in nextEvents) {
// do not add a hasOwnProperty check here, it affects performance
patchEvent(name, lastEvents[name], nextEvents[name], dom, lifecycle);
}
}
if (lastEvents !== EMPTY_OBJ) {
for (var name$1 in lastEvents) {
// do not add a hasOwnProperty check here, it affects performance
if (isNullOrUndef(nextEvents[name$1])) {
patchEvent(name$1, lastEvents[name$1], null, dom, lifecycle);
}
}
}
}
function patchEvent(name, lastValue, nextValue, dom, lifecycle) {
if (lastValue !== nextValue) {
if (delegatedProps[name]) {
lifecycle.fastUnmount = false;
handleEvent(name, lastValue, nextValue, dom);
}
else {
name = name.toLowerCase();
var event = dom[name];
if (!event || !event.wrapped) {
dom[name] = nextValue;
}
}
}
}
function patchProps(lastProps, nextProps, dom, lifecycle, context, isSVG) {
lastProps = lastProps || EMPTY_OBJ;
nextProps = nextProps || EMPTY_OBJ;
if (nextProps !== EMPTY_OBJ) {
for (var prop in nextProps) {
// do not add a hasOwnProperty check here, it affects performance
var nextValue = nextProps[prop];
var lastValue = lastProps[prop];
if (isNullOrUndef(nextValue)) {
removeProp(prop, dom);
}
else {
patchProp(prop, lastValue, nextValue, dom, isSVG, lifecycle);
}
}
}
if (lastProps !== EMPTY_OBJ) {
for (var prop$1 in lastProps) {
// do not add a hasOwnProperty check here, it affects performance
if (isNullOrUndef(nextProps[prop$1])) {
removeProp(prop$1, dom);
}
}
}
}
// We are assuming here that we come from patchProp routine
// -nextAttrValue cannot be null or undefined
function patchStyle(lastAttrValue, nextAttrValue, dom) {
if (isString(nextAttrValue)) {
dom.style.cssText = nextAttrValue;
return;
}
for (var style in nextAttrValue) {
// do not add a hasOwnProperty check here, it affects performance
var value = nextAttrValue[style];
if (isNumber(value) && !isUnitlessNumber[style]) {
dom.style[style] = value + 'px';
}
else {
dom.style[style] = value;
}
}
if (!isNullOrUndef(lastAttrValue)) {
for (var style$1 in lastAttrValue) {
if (isNullOrUndef(nextAttrValue[style$1])) {
dom.style[style$1] = '';
}
}
}
}
function removeProp(prop, dom) {
if (prop === 'className') {
dom.removeAttribute('class');
}
else if (prop === 'value') {
dom.value = '';
}
else if (prop === 'style') {
dom.style.cssText = null;
dom.removeAttribute('style');
}
else if (delegatedProps[prop]) {
handleEvent(prop, null, null, dom);
}
else {
dom.removeAttribute(prop);
}
}
var recyclingEnabled = true;
var componentPools = new Map();
var elementPools = new Map();
function recycleElement(vNode, lifecycle, context, isSVG) {
var tag = vNode.type;
var key = vNode.key;
var pools = elementPools.get(tag);
if (!isUndefined(pools)) {
var pool = key === null ? pools.nonKeyed : pools.keyed.get(key);
if (!isUndefined(pool)) {
var recycledVNode = pool.pop();
if (!isUndefined(recycledVNode)) {
patchElement(recycledVNode, vNode, null, lifecycle, context, isSVG, true);
return vNode.dom;
}
}
}
return null;
}
function poolElement(vNode) {
var tag = vNode.type;
var key = vNode.key;
var pools = elementPools.get(tag);
if (isUndefined(pools)) {
pools = {
nonKeyed: [],
keyed: new Map()
};
elementPools.set(tag, pools);
}
if (isNull(key)) {
pools.nonKeyed.push(vNode);
}
else {
var pool = pools.keyed.get(key);
if (isUndefined(pool)) {
pool = [];
pools.keyed.set(key, pool);
}
pool.push(vNode);
}
}
function recycleComponent(vNode, lifecycle, context, isSVG) {
var type = vNode.type;
var key = vNode.key;
var pools = componentPools.get(type);
if (!isUndefined(pools)) {
var pool = key === null ? pools.nonKeyed : pools.keyed.get(key);
if (!isUndefined(pool)) {
var recycledVNode = pool.pop();
if (!isUndefined(recycledVNode)) {
var flags = vNode.flags;
var failed = patchComponent(recycledVNode, vNode, null, lifecycle, context, isSVG, flags & 4 /* ComponentClass */, true);
if (!failed) {
return vNode.dom;
}
}
}
}
return null;
}
function poolComponent(vNode) {
var type = vNode.type;
var key = vNode.key;
var hooks = vNode.ref;
var nonRecycleHooks = hooks && (hooks.onComponentWillMount ||
hooks.onComponentWillUnmount ||
hooks.onComponentDidMount ||
hooks.onComponentWillUpdate ||
hooks.onComponentDidUpdate);
if (nonRecycleHooks) {
return;
}
var pools = componentPools.get(type);
if (isUndefined(pools)) {
pools = {
nonKeyed: [],
keyed: new Map()
};
componentPools.set(type, pools);
}
if (isNull(key)) {
pools.nonKeyed.push(vNode);
}
else {
var pool = pools.keyed.get(key);
if (isUndefined(pool)) {
pool = [];
pools.keyed.set(key, pool);
}
pool.push(vNode);
}
}
function mount(vNode, parentDom, lifecycle, context, isSVG) {
var flags = vNode.flags;
if (flags & 3970 /* Element */) {
return mountElement(vNode, parentDom, lifecycle, context, isSVG);
}
else if (flags & 28 /* Component */) {
return mountComponent(vNode, parentDom, lifecycle, context, isSVG, flags & 4 /* ComponentClass */);
}
else if (flags & 4096 /* Void */) {
return mountVoid(vNode, parentDom);
}
else if (flags & 1 /* Text */) {
return mountText(vNode, parentDom);
}
else {
if (process.env.NODE_ENV !== 'production') {
throwError(("mount() expects a valid VNode, instead it received an object with the type \"" + (typeof vNode) + "\"."));
}
throwError();
}
}
function mountText(vNode, parentDom) {
var dom = document.createTextNode(vNode.children);
vNode.dom = dom;
if (parentDom) {
appendChild(parentDom, dom);
}
return dom;
}
function mountVoid(vNode, parentDom) {
var dom = document.createTextNode('');
vNode.dom = dom;
if (parentDom) {
appendChild(parentDom, dom);
}
return dom;
}
function mountElement(vNode, parentDom, lifecycle, context, isSVG) {
if (recyclingEnabled) {
var dom$1 = recycleElement(vNode, lifecycle, context, isSVG);
if (!isNull(dom$1)) {
if (!isNull(parentDom)) {
appendChild(parentDom, dom$1);
}
return dom$1;
}
}
var tag = vNode.type;
var flags = vNode.flags;
if (isSVG || (flags & 128 /* SvgElement */)) {
isSVG = true;
}
var dom = documentCreateElement(tag, isSVG);
var children = vNode.children;
var props = vNode.props;
var events = vNode.events;
var ref = vNode.ref;
vNode.dom = dom;
if (!isNull(children)) {
if (isStringOrNumber(children)) {
setTextContent(dom, children);
}
else if (isArray(children)) {
mountArrayChildren(children, dom, lifecycle, context, isSVG);
}
else if (isVNode(children)) {
mount(children, dom, lifecycle, context, isSVG);
}
}
if (!(flags & 2 /* HtmlElement */)) {
processElement(flags, vNode, dom);
}
if (!isNull(props)) {
for (var prop in props) {
// do not add a hasOwnProperty check here, it affects performance
patchProp(prop, null, props[prop], dom, isSVG, lifecycle);
}
}
if (!isNull(events)) {
for (var name in events) {
// do not add a hasOwnProperty check here, it affects performance
patchEvent(name, null, events[name], dom, lifecycle);
}
}
if (!isNull(ref)) {
mountRef(dom, ref, lifecycle);
}
if (!isNull(parentDom)) {
appendChild(parentDom, dom);
}
return dom;
}
function mountArrayChildren(children, dom, lifecycle, context, isSVG) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (!isInvalid(child)) {
if (child.dom) {
children[i] = child = cloneVNode(child);
}
mount(children[i], dom, lifecycle, context, isSVG);
}
}
}
function mountComponent(vNode, parentDom, lifecycle, context, isSVG, isClass) {
if (recyclingEnabled) {
var dom$1 = recycleComponent(vNode, lifecycle, context, isSVG);
if (!isNull(dom$1)) {
if (!isNull(parentDom)) {
appendChild(parentDom, dom$1);
}
return dom$1;
}
}
var type = vNode.type;
var props = vNode.props || EMPTY_OBJ;
var ref = vNode.ref;
var dom;
if (isClass) {
var defaultProps = type.defaultProps;
lifecycle.fastUnmount = false;
if (!isUndefined(defaultProps)) {
copyPropsTo(defaultProps, props);
vNode.props = props;
}
var instance = createStatefulComponentInstance(vNode, type, props, context, isSVG, devToolsStatus);
var input = instance._lastInput;
var fastUnmount = lifecycle.fastUnmount;
// we store the fastUnmount value, but we set it back to true on the lifecycle
// we do this so we can determine if the component render has a fastUnmount or not
lifecycle.fastUnmount = true;
instance._vNode = vNode;
vNode.dom = dom = mount(input, null, lifecycle, instance._childContext, isSVG);
// we now create a lifecycle for this component and store the fastUnmount value
var subLifecycle = instance._lifecycle = new Lifecycle();
subLifecycle.fastUnmount = lifecycle.fastUnmount;
// we then set the lifecycle fastUnmount value back to what it was before the mount
lifecycle.fastUnmount = fastUnmount;
if (!isNull(parentDom)) {
appendChild(parentDom, dom);
}
mountStatefulComponentCallbacks(ref, instance, lifecycle);
findDOMNodeEnabled && componentToDOMNodeMap.set(instance, dom);
vNode.children = instance;
}
else {
var input$1 = createStatelessComponentInput(vNode, type, props, context);
vNode.dom = dom = mount(input$1, null, lifecycle, context, isSVG);
vNode.children = input$1;
mountStatelessComponentCallbacks(ref, dom, lifecycle);
if (!isNull(parentDom)) {
appendChild(parentDom, dom);
}
}
return dom;
}
function mountStatefulComponentCallbacks(ref, instance, lifecycle) {
if (ref) {
if (isFunction(ref)) {
ref(instance);
}
else {
if (process.env.NODE_ENV !== 'production') {
throwError('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.');
}
throwError();
}
}
if (!isNull(instance.componentDidMount)) {
lifecycle.addListener(function () {
instance.componentDidMount();
});
}
}
function mountStatelessComponentCallbacks(ref, dom, lifecycle) {
if (ref) {
if (!isNullOrUndef(ref.onComponentWillMount)) {
lifecycle.fastUnmount = false;
ref.onComponentWillMount();
}
if (!isNullOrUndef(ref.onComponentDidMount)) {
lifecycle.fastUnmount = false;
lifecycle.addListener(function () { return ref.onComponentDidMount(dom); });
}
}
}
function mountRef(dom, value, lifecycle) {
if (isFunction(value)) {
lifecycle.fastUnmount = false;
lifecycle.addListener(function () { return value(dom); });
}
else {
if (isInvalid(value)) {
return;
}
if (process.env.NODE_ENV !== 'production') {
throwError('string "refs" are not supported in Inferno 1.0. Use callback "refs" instead.');
}
throwError();
}
}
function normaliseChildNodes(dom) {
var rawChildNodes = dom.childNodes;
var length = rawChildNodes.length;
var i = 0;
while (i < length) {
var rawChild = rawChildNodes[i];
if (rawChild.nodeType === 8) {
if (rawChild.data === '!') {
var placeholder = document.createTextNode('');
dom.replaceChild(placeholder, rawChild);
i++;
}
else {
dom.removeChild(rawChild);
length--;
}
}
else {
i++;
}
}
}
function hydrateComponent(vNode, dom, lifecycle, context, isSVG, isClass) {
var type = vNode.type;
var props = vNode.props || {};
var ref = vNode.ref;
vNode.dom = dom;
if (isClass) {
var _isSVG = dom.namespaceURI === svgNS;
var defaultProps = type.defaultProps;
lifecycle.fastUnmount = false;
if (!isUndefined(defaultProps)) {
copyPropsTo(defaultProps, props);
vNode.props = props;
}
var instance = createStatefulComponentInstance(vNode, type, props, context, _isSVG, devToolsStatus);
var input = instance._lastInput;
var fastUnmount = lifecycle.fastUnmount;
// we store the fastUnmount value, but we set it back to true on the lifecycle
// we do this so we can determine if the component render has a fastUnmount or not
lifecycle.fastUnmount = true;
instance._vComponent = vNode;
instance._vNode = vNode;
hydrate(input, dom, lifecycle, instance._childContext, _isSVG);
var subLifecycle = instance._lifecycle = new Lifecycle();
subLifecycle.fastUnmount = lifecycle.fastUnmount;
// we then set the lifecycle fastUnmount value back to what it was before the mount
lifecycle.fastUnmount = fastUnmount;
mountStatefulComponentCallbacks(ref, instance, lifecycle);
findDOMNodeEnabled && componentToDOMNodeMap.set(instance, dom);
vNode.children = instance;
}
else {
var input$1 = createStatelessComponentInput(vNode, type, props, context);
hydrate(input$1, dom, lifecycle, context, isSVG);
vNode.children = input$1;
vNode.dom = input$1.dom;
mountStatelessComponentCallbacks(ref, dom, lifecycle);
}
}
function hydrateElement(vNode, dom, lifecycle, context, isSVG) {
var tag = vNode.type;
var children = vNode.children;
var props = vNode.props;
var events = vNode.events;
var flags = vNode.flags;
if (isSVG || (flags & 128 /* SvgElement */)) {
isSVG = true;
}
if (dom.nodeType !== 1 || dom.tagName.toLowerCase() !== tag) {
var newDom = mountElement(vNode, null, lifecycle, context, isSVG);
vNode.dom = newDom;
replaceChild(dom.parentNode, newDom, dom);
}
else {
vNode.dom = dom;
if (children) {
hydrateChildren(children, dom, lifecycle, context, isSVG);
}
if (!(flags & 2 /* HtmlElement */)) {
processElement(flags, vNode, dom);
}
for (var prop in props) {
patchProp(prop, null, props[prop], dom, isSVG, lifecycle);
}
for (var name in events) {
patchEvent(name, null, events[name], dom, lifecycle);
}
}
}
function hydrateChildren(children, dom, lifecycle, context, isSVG) {
normaliseChildNodes(dom);
var domNodes = Array.prototype.slice.call(dom.childNodes);
var childNodeIndex = 0;
if (isArray(children)) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (isObject(child) && !isNull(child)) {
hydrate(child, domNodes[childNodeIndex++], lifecycle, context, isSVG);
}
}
}
else if (isObject(children)) {
hydrate(children, dom.firstChild, lifecycle, context, isSVG);
}
}
function hydrateText(vNode, dom) {
if (dom.nodeType === 3) {
var newDom = mountText(vNode, null);
vNode.dom = newDom;
replaceChild(dom.parentNode, newDom, dom);
}
else {
vNode.dom = dom;
}
}
function hydrateVoid(vNode, dom) {
vNode.dom = dom;
}
function hydrate(vNode, dom, lifecycle, context, isSVG) {
if (process.env.NODE_ENV !== 'production') {
if (isInvalid(dom)) {
throwError("failed to hydrate. The server-side render doesn't match client side.");
}
}
var flags = vNode.flags;
if (flags & 28 /* Component */) {
return hydrateComponent(vNode, dom, lifecycle, context, isSVG, flags & 4 /* ComponentClass */);
}
else if (flags & 3970 /* Element */) {
return hydrateElement(vNode, dom, lifecycle, context, isSVG);
}
else if (flags & 1 /* Text */) {
return hydrateText(vNode, dom);
}
else if (flags & 4096 /* Void */) {
return hydrateVoid(vNode, dom);
}
else {
if (process.env.NODE_ENV !== 'production') {
throwError(("hydrate() expects a valid VNode, instead it received an object with the type \"" + (typeof vNode) + "\"."));
}
throwError();
}
}
function hydrateRoot(input, parentDom, lifecycle) {
if (parentDom && parentDom.nodeType === 1 && parentDom.firstChild) {
hydrate(input, parentDom.firstChild, lifecycle, {}, false);
return true;
}
return false;
}
// rather than use a Map, like we did before, we can use an array here
// given there shouldn't be THAT many roots on the page, the difference
// in performance is huge: https://esbench.com/bench/5802a691330ab09900a1a2da
var roots = [];
var componentToDOMNodeMap = new Map();
var findDOMNodeEnabled = false;
function enableFindDOMNode() {
findDOMNodeEnabled = true;
}
function findDOMNode(ref) {
if (!findDOMNodeEnabled) {
if (process.env.NODE_ENV !== 'production') {
throwError('findDOMNode() has been disabled, use enableFindDOMNode() enabled findDOMNode(). Warning this can significantly impact performance!');
}
throwError();
}
var dom = ref && ref.nodeType ? ref : null;
return componentToDOMNodeMap.get(ref) || dom;
}
function getRoot(dom) {
for (var i = 0; i < roots.length; i++) {
var root = roots[i];
if (root.dom === dom) {
return root;
}
}
return null;
}
function setRoot(dom, input, lifecycle) {
roots.push({
dom: dom,
input: input,
lifecycle: lifecycle
});
}
function removeRoot(root) {
for (var i = 0; i < roots.length; i++) {
if (roots[i] === root) {
roots.splice(i, 1);
return;
}
}
}
var documentBody = isBrowser ? document.body : null;
function render(input, parentDom) {
if (documentBody === parentDom) {
if (process.env.NODE_ENV !== 'production') {
throwError('you cannot render() to the "document.body". Use an empty element as a container instead.');
}
throwError();
}
if (input === NO_OP) {
return;
}
var root = getRoot(parentDom);
if (isNull(root)) {
var lifecycle = new Lifecycle();
if (!isInvalid(input)) {
if (input.dom) {
input = cloneVNode(input);
}
if (!hydrateRoot(input, parentDom, lifecycle)) {
mount(input, parentDom, lifecycle, {}, false);
}
lifecycle.trigger();
setRoot(parentDom, input, lifecycle);
}
}
else {
var lifecycle$1 = root.lifecycle;
lifecycle$1.listeners = [];
if (isNullOrUndef(input)) {
unmount(root.input, parentDom, lifecycle$1, false, false, false);
removeRoot(root);
}
else {
if (input.dom) {
input = cloneVNode(input);
}
patch(root.input, input, parentDom, lifecycle$1, {}, false, false);
}
lifecycle$1.trigger();
root.input = input;
}
if (devToolsStatus.connected) {
sendRoots(window);
}
}
function copyPropsTo(copyFrom, copyTo) {
for (var prop in copyFrom) {
if (isUndefined(copyTo[prop])) {
copyTo[prop] = copyFrom[prop];
}
}
}
function createStatefulComponentInstance(vNode, Component$$1, props, context, isSVG, devToolsStatus) {
if (isUndefined(context)) {
context = {};
}
var instance = new Component$$1(props, context);
instance.context = context;
if (instance.props === EMPTY_OBJ) {
instance.props = props;
}
instance._patch = patch;
instance._devToolsStatus = devToolsStatus;
if (findDOMNodeEnabled) {
instance._componentToDOMNodeMap = componentToDOMNodeMap;
}
var childContext = instance.getChildContext();
if (!isNullOrUndef(childContext)) {
instance._childContext = Object.assign({}, context, childContext);
}
else {
instance._childContext = context;
}
instance._unmounted = false;
instance._pendingSetState = true;
instance._isSVG = isSVG;
instance.componentWillMount();
instance._beforeRender && instance._beforeRender();
var input = instance.render(props, instance.state, context);
instance._afterRender && instance._afterRender();
if (isArray(input)) {
if (process.env.NODE_ENV !== 'production') {
throwError('a valid Inferno VNode (or null) must be returned from a component render. You may have returned an array or an invalid object.');
}
throwError();
}
else if (isInvalid(input)) {
input = createVoidVNode();
}
else {
if (input.dom) {
input = cloneVNode(input);
}
if (input.flags & 28 /* Component */) {
// if we have an input that is also a component, we run into a tricky situation
// where the root vNode needs to always have the correct DOM entry
// so we break monomorphism on our input and supply it our vNode as parentVNode
// we can optimise this in the future, but this gets us out of a lot of issues
input.parentVNode = vNode;
}
}
instance._pendingSetState = false;
instance._lastInput = input;
return instance;
}
function replaceLastChildAndUnmount(lastInput, nextInput, parentDom, lifecycle, context, isSVG, isRecycling) {
replaceVNode(parentDom, mount(nextInput, null, lifecycle, context, isSVG), lastInput, lifecycle, isRecycling);
}
function replaceVNode(parentDom, dom, vNode, lifecycle, isRecycling) {
var shallowUnmount = false;
// we cannot cache nodeType here as vNode might be re-assigned below
if (vNode.flags & 28 /* Component */) {
// if we are accessing a stateful or stateless component, we want to access their last rendered input
// accessing their DOM node is not useful to us here
unmount(vNode, null, lifecycle, false, false, isRecycling);
vNode = vNode.children._lastInput || vNode.children;
shallowUnmount = true;
}
replaceChild(parentDom, dom, vNode.dom);
unmount(vNode, null, lifecycle, false, shallowUnmount, isRecycling);
}
function createStatelessComponentInput(vNode, component, props, context) {
var input = component(props, context);
if (isArray(input)) {
if (process.env.NODE_ENV !== 'production') {
throwError('a valid Inferno VNode (or null) must be returned from a component render. You may have returned an array or an invalid object.');
}
throwError();
}
else if (isInvalid(input)) {
input = createVoidVNode();
}
else {
if (input.dom) {
input = cloneVNode(input);
}
if (input.flags & 28 /* Component */) {
// if we have an input that is also a component, we run into a tricky situation
// where the root vNode needs to always have the correct DOM entry
// so we break monomorphism on our input and supply it our vNode as parentVNode
// we can optimise this in the future, but this gets us out of a lot of issues
input.parentVNode = vNode;
}
}
return input;
}
function setTextContent(dom, text) {
if (text !== '') {
dom.textContent = text;
}
else {
dom.appendChild(document.createTextNode(''));
}
}
function updateTextContent(dom, text) {
dom.firstChild.nodeValue = text;
}
function appendChild(parentDom, dom) {
parentDom.appendChild(dom);
}
function insertOrAppend(parentDom, newNode, nextNode) {
if (isNullOrUndef(nextNode)) {
appendChild(parentDom, newNode);
}
else {
parentDom.insertBefore(newNode, nextNode);
}
}
function documentCreateElement(tag, isSVG) {
if (isSVG === true) {
return document.createElementNS(svgNS, tag);
}
else {
return document.createElement(tag);
}
}
function replaceWithNewNode(lastNode, nextNode, parentDom, lifecycle, context, isSVG, isRecycling) {
unmount(lastNode, null, lifecycle, false, false, isRecycling);
var dom = mount(nextNode, null, lifecycle, context, isSVG);
nextNode.dom = dom;
replaceChild(parentDom, dom, lastNode.dom);
}
function replaceChild(parentDom, nextDom, lastDom) {
if (!parentDom) {
parentDom = lastDom.parentNode;
}
parentDom.replaceChild(nextDom, lastDom);
}
function removeChild(parentDom, dom) {
parentDom.removeChild(dom);
}
function removeAllChildren(dom, children, lifecycle, shallowUnmount, isRecycling) {
dom.textContent = '';
if (!lifecycle.fastUnmount) {
removeChildren(null, children, lifecycle, shallowUnmount, isRecycling);
}
}
function removeChildren(dom, children, lifecycle, shallowUnmount, isRecycling) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (!isInvalid(child)) {
unmount(child, dom, lifecycle, true, shallowUnmount, isRecycling);
}
}
}
function isKeyed(lastChildren, nextChildren) {
return nextChildren.length && !isNullOrUndef(nextChildren[0]) && !isNullOrUndef(nextChildren[0].key)
&& lastChildren.length && !isNullOrUndef(lastChildren[0]) && !isNullOrUndef(lastChildren[0].key);
}
function renderStylesToString(styles) {
if (isStringOrNumber(styles)) {
return styles;
}
else {
var renderedString = '';
for (var styleName in styles) {
var value = styles[styleName];
var px = isNumber(value) && !isUnitlessNumber[styleName] ? 'px' : '';
if (!isNullOrUndef(value)) {
renderedString += (toHyphenCase(styleName)) + ":" + (escapeText(value)) + px + ";";
}
}
return renderedString;
}
}
function renderVNodeToString(vNode, context, firstChild) {
var flags = vNode.flags;
var type = vNode.type;
var props = vNode.props;
var children = vNode.children;
if (flags & 28 /* Component */) {
var isClass = flags & 4;
// Primitive node doesn't have defaultProps, only Component
if (!isNullOrUndef(type.defaultProps)) {
copyPropsTo(type.defaultProps, props);
vNode.props = props;
}
if (isClass) {
var instance = new type(props, context);
var childContext = instance.getChildContext();
if (!isNullOrUndef(childContext)) {
context = Object.assign({}, context, childContext);
}
instance.context = context;
instance._pendingSetState = true;
if (isFunction(instance.componentWillMount)) {
instance.componentWillMount();
}
var nextVNode = instance.render(props, vNode.context);
instance._pendingSetState = false;
// In case render returns invalid stuff
if (!nextVNode) {
return '';
}
return renderVNodeToString(nextVNode, context, true);
}
else {
return renderVNodeToString(type(props, context), context, true);
}
}
else if (flags & 3970 /* Element */) {
var renderedString = "<" + type;
var html;
var isVoidElement$$1 = isVoidElement(type);
if (!isNull(props)) {
for (var prop in props) {
var value = props[prop];
if (prop === 'dangerouslySetInnerHTML') {
html = value.__html;
}
else if (prop === 'style') {
renderedString += " style=\"" + (renderStylesToString(props.style)) + "\"";
}
else if (prop === 'className') {
renderedString += " class=\"" + (escapeText(value)) + "\"";
}
else {
if (isStringOrNumber(value)) {
renderedString += " " + prop + "=\"" + (escapeText(value)) + "\"";
}
else if (isTrue(value)) {
renderedString += " " + prop;
}
}
}
}
if (isVoidElement$$1) {
renderedString += ">";
}
else {
renderedString += ">";
if (!isInvalid(children)) {
if (isArray(children)) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (!isInvalid(child)) {
renderedString += renderVNodeToString(child, context, i === 0);
}
}
}
else if (isStringOrNumber(children)) {
renderedString += escapeText(children);
}
else {
renderedString += renderVNodeToString(children, context, true);
}
}
else if (html) {
renderedString += html;
}
if (!isVoidElement$$1) {
renderedString += "</" + type + ">";
}
}
return renderedString;
}
else if (flags & 1 /* Text */) {
return (firstChild ? '' : '<!---->') + escapeText(children);
}
else {
if (process.env.NODE_ENV !== 'production') {
throwError(("renderToString() expects a valid VNode, instead it received an object with the type \"" + (typeof vNode) + "\"."));
}
throwError();
}
}
function renderToString(input) {
return renderVNodeToString(input, null, true);
}
function renderToStaticMarkup(input) {
return renderVNodeToString(input, null, true);
}
enableFindDOMNode();
function unmountComponentAtNode(container) {
render(null, container);
return true;
}
var ARR = [];
var Children = {
map: function map(children, fn, ctx) {
children = Children.toArray(children);
if (ctx && ctx!==children) { fn = fn.bind(ctx); }
return children.map(fn);
},
forEach: function forEach(children, fn, ctx) {
children = Children.toArray(children);
if (ctx && ctx!==children) { fn = fn.bind(ctx); }
children.forEach(fn);
},
count: function count(children) {
children = Children.toArray(children);
return children.length;
},
only: function only(children) {
children = Children.toArray(children);
if (children.length!==1) { throw new Error('Children.only() expects only one child.'); }
return children[0];
},
toArray: function toArray(children) {
return Array.isArray && Array.isArray(children) ? children : ARR.concat(children);
}
};
var currentComponent = null;
Component.prototype.isReactComponent = {};
Component.prototype._beforeRender = function() {
currentComponent = this;
};
Component.prototype._afterRender = function() {
currentComponent = null;
};
var cloneElement = cloneVNode;
var version = '15.4.1';
function normalizeProps(name, props) {
if ((name === 'input' || name === 'textarea') && props.onChange) {
var eventName = props.type === 'checkbox' ? 'onclick' : 'oninput';
if (!props[eventName]) {
props[eventName] = props.onChange;
delete props.onChange;
}
}
}
// we need to add persist() to Event (as React has it for synthetic events)
// this is a hack and we really shouldn't be modifying a global object this way,
// but there isn't a performant way of doing this apart from trying to proxy
// every prop event that starts with "on", i.e. onClick or onKeyPress
// but in reality devs use onSomething for many things, not only for
// input events
if (typeof Event !== 'undefined' && !Event.prototype.persist) {
Event.prototype.persist = function () {};
}
var createElement = function (name, _props) {
var children = [], len = arguments.length - 2;
while ( len-- > 0 ) children[ len ] = arguments[ len + 2 ];
var props = _props || {};
var ref = props.ref;
if (typeof ref === 'string') {
props.ref = function (val) {
if (this && this.refs) {
this.refs[ref] = val;
}
}.bind(currentComponent || null);
}
if (typeof name === 'string') {
normalizeProps(name, props);
}
return createElement$1.apply(void 0, [ name, props ].concat( children ));
};
// Credit: preact-compat - https://github.com/developit/preact-compat :)
function shallowDiffers (a, b) {
for (var i in a) { if (!(i in b)) { return true; } }
for (var i$1 in b) { if (a[i$1] !== b[i$1]) { return true; } }
return false;
}
function PureComponent(props, context) {
Component.call(this, props, context);
}
PureComponent.prototype = new Component({}, {});
PureComponent.prototype.shouldComponentUpdate = function (props, state) {
return shallowDiffers(this.props, props) || shallowDiffers(this.state, state);
};
var index = {
createVNode: createVNode,
render: render,
isValidElement: isValidElement,
createElement: createElement,
Component: Component,
PureComponent: PureComponent,
unmountComponentAtNode: unmountComponentAtNode,
cloneElement: cloneElement,
PropTypes: index$1,
createClass: createClass,
findDOMNode: findDOMNode,
Children: Children,
cloneVNode: cloneVNode,
NO_OP: NO_OP,
version: version,
renderToString: renderToString,
renderToStaticMarkup: renderToStaticMarkup
};
exports.createVNode = createVNode;
exports.render = render;
exports.isValidElement = isValidElement;
exports.createElement = createElement;
exports.Component = Component;
exports.PureComponent = PureComponent;
exports.unmountComponentAtNode = unmountComponentAtNode;
exports.cloneElement = cloneElement;
exports.PropTypes = index$1;
exports.createClass = createClass;
exports.findDOMNode = findDOMNode;
exports.Children = Children;
exports.cloneVNode = cloneVNode;
exports.NO_OP = NO_OP;
exports.version = version;
exports.renderToString = renderToString;
exports.renderToStaticMarkup = renderToStaticMarkup;
exports['default'] = index;
Object.defineProperty(exports, '__esModule', { value: true });
})));
|
app/components/DownloadedGames/UserGameList.js | cdiezmoran/AlphaStage-desktop | // @flow
import React, { Component } from 'react';
import type { UserGame } from '../../utils/globalTypes';
import UserGameListItem from './UserGameListItem';
class UserGameList extends Component {
props: {
games: UserGame[]
}
render() {
const { games } = this.props;
const items = games.map((game) =>
<UserGameListItem game={game} key={game._id} />
);
return (
<div className="user-game-list row">
{items}
</div>
);
}
}
export default UserGameList;
|
app/mixins/stretch-mixin.js | midknightmare/budge-money | import React from 'react/addons';
let bp = require('react-breakpoints-mixin').BreakpointsMixin;
let stretchMixin = {
mixins: [ bp ],
componentWillUnmount: function () {
this.trackSize(false);
},
getInitialState: function () {
return {
track: false,
size: {
width: undefined,
height: undefined
},
forceUpdate: false
};
},
trackSize: function(toggle) {
toggle = (toggle == undefined) ? true : toggle;
// ignore if already set
if(this.state.track === toggle) {
return;
}
if(toggle) {
this.addListeners();
this.state.forceUpdate = true;
} else {
this.removeListeners();
}
this.setState({ track: toggle});
},
addListeners: function() {
window.addEventListener('resize', this.evaluateSize);
},
removeListeners: function() {
window.removeEventListener('resize', this.evaluateSize);
},
componentDidUpdate: function() {
// flag is used to ensure size is evaluated following size changes in the render function
if(this.state.forceUpdate) {
this.state.forceUpdate = false;
this.evaluateSize();
}
},
evaluateSize: function() {
let elementWidth = this.getDOMNode().offsetWidth;
let elementHeight = this.getDOMNode().offsetHeight;
this.setState({
size: {
width: elementWidth,
height: elementHeight
}
});
},
debug: function() {
console.log(this.state);
},
width: function() {
return this.state.size.width;
},
height: function() {
return this.state.size.height;
},
sizeMatches: function(property, point) {
return this.breakpointMatched(property, point);
},
stretch: function(baseClassName) {
let classes = this.breakpointsClasses(baseClassName);
let changed = {};
for(var key in classes) {
if(classes.hasOwnProperty(key)) {
if(key !== baseClassName) {
key = key.replace(baseClassName + '--', '');
}
changed[key] = true;
}
}
return React.addons.classSet(changed);
}
};
module.exports = stretchMixin; |
src/js/app/index.js | alskjstl/learnGitBranching | var Backbone = require('backbone');
var EventEmitter = require('events').EventEmitter;
var React = require('react');
var assign = require('object-assign');
var util = require('../util');
var intl = require('../intl');
var LocaleStore = require('../stores/LocaleStore');
var LocaleActions = require('../actions/LocaleActions');
/**
* Globals
*/
var events = assign(
{},
EventEmitter.prototype,
{
trigger: function() {
// alias this for backwards compatibility
this.emit.apply(this, arguments);
}
}
);
var commandUI;
var sandbox;
var eventBaton;
var levelDropdown;
///////////////////////////////////////////////////////////////////////
var init = function() {
/**
* There is a decent amount of bootstrapping we need just to hook
* everything up. The init() method takes on these responsibilities,
* including but not limited to:
* - setting up Events and EventBaton
* - calling the constructor for the main visualization
* - initializing the command input bar
* - handling window.focus and zoom events
**/
var Sandbox = require('../sandbox/').Sandbox;
var EventBaton = require('../util/eventBaton').EventBaton;
var LevelDropdownView = require('../views/levelDropdownView').LevelDropdownView;
eventBaton = new EventBaton();
commandUI = new CommandUI();
sandbox = new Sandbox();
levelDropdown = new LevelDropdownView({
wait: true
});
LocaleStore.subscribe(function() {
if (LocaleStore.getLocale() !== LocaleStore.getDefaultLocale()) {
intlRefresh();
}
});
events.on('vcsModeChange', vcsModeRefresh);
initRootEvents(eventBaton);
initDemo(sandbox);
// unfortunate global export for casper tests
window.LocaleStore = LocaleStore;
window.LocaleActions = LocaleActions;
window.intl = intl;
};
var vcsModeRefresh = function(eventData) {
if (!window.$) { return; }
var mode = eventData.mode;
var isGit = eventData.mode === 'git';
var displayMode = mode.slice(0, 1).toUpperCase() + mode.slice(1);
var otherMode = (displayMode === 'Git') ? 'Hg' : 'Git';
var regex = new RegExp(otherMode, 'g');
document.title = intl.str('learn-git-branching').replace(regex, displayMode);
$('span.vcs-mode-aware').each(function(i, el) {
var text = $(el).text().replace(regex, displayMode);
$(el).text(text);
});
$('body').toggleClass('gitMode', isGit);
$('body').toggleClass('hgMode', !isGit);
};
var intlRefresh = function() {
if (!window.$) { return; }
$('span.intl-aware').each(function(i, el) {
var intl = require('../intl');
var key = $(el).attr('data-intl');
$(el).text(intl.str(key).toUpperCase());
});
};
var initRootEvents = function(eventBaton) {
// we always want to focus the text area to collect input
var focusTextArea = function() {
$('#commandTextField').focus();
};
focusTextArea();
$(window).focus(function(e) {
eventBaton.trigger('windowFocus', e);
});
$(document).click(function(e) {
eventBaton.trigger('documentClick', e);
});
$(document).bind('keydown', function(e) {
eventBaton.trigger('docKeydown', e);
});
$(document).bind('keyup', function(e) {
eventBaton.trigger('docKeyup', e);
});
$(window).on('resize', function(e) {
events.trigger('resize', e);
});
eventBaton.stealBaton('docKeydown', function() { });
eventBaton.stealBaton('docKeyup', function() { });
// the default action on window focus and document click is to just focus the text area
eventBaton.stealBaton('windowFocus', focusTextArea);
eventBaton.stealBaton('documentClick', focusTextArea);
// but when the input is fired in the text area, we pipe that to whoever is
// listenining
var makeKeyListener = function(name) {
return function() {
var args = [name];
Array.prototype.slice.apply(arguments).forEach(function(arg) {
args.push(arg);
});
eventBaton.trigger.apply(eventBaton, args);
};
};
$('#commandTextField').on('keydown', makeKeyListener('keydown'));
$('#commandTextField').on('keyup', makeKeyListener('keyup'));
$(window).trigger('resize');
};
var initDemo = function(sandbox) {
var params = util.parseQueryString(window.location.href);
// being the smart programmer I am (not), I dont include a true value on demo, so
// I have to check if the key exists here
var commands;
if (/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent) || /android/i.test(navigator.userAgent)) {
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger('commandSubmitted', 'mobile alert');
});
}
if (params.hasOwnProperty('demo')) {
commands = [
"git commit; git checkout -b bugFix C1; git commit; git merge master; git checkout master; git commit; git rebase bugFix;",
"delay 1000; reset;",
"level advanced1 --noFinishDialog --noStartCommand --noIntroDialog;",
"delay 2000; show goal; delay 1000; hide goal;",
"git checkout bugFix; git rebase master; git checkout side; git rebase bugFix;",
"git checkout another; git rebase side; git rebase another master;",
"help; levels"
];
} else if (params.hasOwnProperty('hgdemo')) {
commands = [
'importTreeNow {"branches":{"master":{"target":"C3","id":"master"},"feature":{"target":"C2","id":"feature"},"debug":{"target":"C4","id":"debug"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"},"C2":{"parents":["C1"],"id":"C2"},"C3":{"parents":["C1"],"id":"C3"},"C4":{"parents":["C2"],"id":"C4"}},"HEAD":{"target":"feature","id":"HEAD"}}',
'delay 1000',
'git rebase master',
'delay 1000',
'undo',
'hg book',
'delay 1000',
'hg rebase -d master'
];
commands = commands.join(';#').split('#'); // hax
} else if (params.hasOwnProperty('hgdemo2')) {
commands = [
'importTreeNow {"branches":{"master":{"target":"C3","id":"master"},"feature":{"target":"C2","id":"feature"},"debug":{"target":"C4","id":"debug"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"},"C2":{"parents":["C1"],"id":"C2"},"C3":{"parents":["C1"],"id":"C3"},"C4":{"parents":["C2"],"id":"C4"}},"HEAD":{"target":"debug","id":"HEAD"}}',
'delay 1000',
'git rebase master',
'delay 1000',
'undo',
'hg sum',
'delay 1000',
'hg rebase -d master'
];
commands = commands.join(';#').split('#'); // hax
} else if (params.hasOwnProperty('remoteDemo')) {
commands = [
'git clone',
'git commit',
'git fakeTeamwork',
'git pull',
'git push',
'git commit',
'git fakeTeamwork',
'git pull --rebase',
'git push',
'levels'
];
commands = commands.join(';#').split('#'); // hax
} else if (params.gist_level_id) {
$.ajax({
url: 'https://api.github.com/gists/' + params.gist_level_id,
type: 'GET',
dataType: 'jsonp',
success: function(response) {
var data = response.data || {};
var files = data.files || {};
if (!Object.keys(files).length) {
console.warn('no files found');
return;
}
var file = files[Object.keys(files)[0]];
if (!file.content) {
console.warn('file empty');
}
eventBaton.trigger(
'commandSubmitted',
'importLevelNow ' + escape(file.content) + '; clear'
);
}
});
} else if (!params.hasOwnProperty('NODEMO')) {
commands = [
"help;",
"levels"
];
}
if (params.hasOwnProperty('STARTREACT')) {
/*
React.render(
React.createElement(CommandView, {}),
document.getElementById(params['STARTREACT'])
);*/
}
if (commands) {
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger('commandSubmitted', commands.join(''));
});
}
if (params.locale !== undefined && params.locale.length) {
LocaleActions.changeLocaleFromURI(params.locale);
} else {
tryLocaleDetect();
}
if (params.command) {
var command = unescape(params.command);
sandbox.mainVis.customEvents.on('gitEngineReady', function() {
eventBaton.trigger('commandSubmitted', command);
});
}
};
function tryLocaleDetect() {
// lets fire off a request to get our headers which then
// can help us identify what locale the browser is in.
// wrap everything in a try since this is a third party service
try {
$.ajax({
url: 'http://ajaxhttpheaders.appspot.com',
dataType: 'jsonp',
success: function(headers) {
changeLocaleFromHeaders(headers['Accept-Language']);
}
});
} catch (e) {
console.warn('locale detect fail', e);
}
}
function changeLocaleFromHeaders(langString) {
LocaleActions.changeLocaleFromHeader(langString);
}
if (require('../util').isBrowser()) {
// this file gets included via node sometimes as well
$(document).ready(init);
}
/**
* the UI method simply bootstraps the command buffer and
* command prompt views. It only interacts with user input
* and simply pipes commands to the main events system
**/
function CommandUI() {
Backbone.$ = $; // lol WTF BACKBONE MANAGE YOUR DEPENDENCIES
var Views = require('../views');
var Collections = require('../models/collections');
var CommandViews = require('../views/commandViews');
var CommandHistoryView = require('../react_views/CommandHistoryView.jsx');
var MainHelperBarView = require('../react_views/MainHelperBarView.jsx');
this.commandCollection = new Collections.CommandCollection();
this.commandBuffer = new Collections.CommandBuffer({
collection: this.commandCollection
});
this.commandPromptView = new CommandViews.CommandPromptView({
el: $('#commandLineBar')
});
React.render(
React.createElement(MainHelperBarView),
document.getElementById('helperBarMount')
);
React.render(
React.createElement(
CommandHistoryView,
{ commandCollection: this.commandCollection }
),
document.getElementById('commandDisplay')
);
}
exports.getEvents = function() {
return events;
};
exports.getSandbox = function() {
return sandbox;
};
exports.getEventBaton = function() {
return eventBaton;
};
exports.getCommandUI = function() {
return commandUI;
};
exports.getLevelDropdown = function() {
return levelDropdown;
};
exports.init = init;
|
packages/material-ui-icons/src/SentimentSatisfiedRounded.js | kybarg/material-ui | import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><circle cx="15.5" cy="9.5" r="1.5" /><circle cx="8.5" cy="9.5" r="1.5" /><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm4.41-6.11c-.35-.22-.82-.11-1.03.24-.74 1.17-2 1.87-3.38 1.87s-2.64-.7-3.38-1.88c-.22-.35-.68-.46-1.03-.24-.35.22-.46.68-.24 1.03C8.37 16.54 10.1 17.5 12 17.5s3.63-.97 4.65-2.58c.22-.35.11-.81-.24-1.03z" /></React.Fragment>
, 'SentimentSatisfiedRounded');
|
src/svg-icons/image/switch-camera.js | ngbrown/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ImageSwitchCamera = (props) => (
<SvgIcon {...props}>
<path d="M20 4h-3.17L15 2H9L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-5 11.5V13H9v2.5L5.5 12 9 8.5V11h6V8.5l3.5 3.5-3.5 3.5z"/>
</SvgIcon>
);
ImageSwitchCamera = pure(ImageSwitchCamera);
ImageSwitchCamera.displayName = 'ImageSwitchCamera';
ImageSwitchCamera.muiName = 'SvgIcon';
export default ImageSwitchCamera;
|
packages/custom/mail-templates/node_modules/email-templates/node_modules/consolidate/lib/consolidate.js | komarudin02/Public | 'use strict';
/*
* Engines which do not support caching of their file contents
* should use the `read()` function defined in consolidate.js
* On top of this, when an engine compiles to a `Function`,
* these functions should either be cached within consolidate.js
* or the engine itself via `options.cache`. This will allow
* users and frameworks to pass `options.cache = true` for
* `NODE_ENV=production`, however edit the file(s) without
* re-loading the application in development.
*/
/**
* Module dependencies.
*/
var fs = require('fs')
, path = require('path')
, join = path.join
, resolve = path.resolve
, extname = path.extname
, Promise = require('bluebird')
, dirname = path.dirname;
var readCache = {};
/**
* Require cache.
*/
var cacheStore = {};
/**
* Require cache.
*/
var requires = {};
/**
* Clear the cache.
*
* @api public
*/
exports.clearCache = function(){
cacheStore = {};
};
/**
* Conditionally cache `compiled` template based
* on the `options` filename and `.cache` boolean.
*
* @param {Object} options
* @param {Function} compiled
* @return {Function}
* @api private
*/
function cache(options, compiled) {
// cachable
if (compiled && options.filename && options.cache) {
delete readCache[options.filename];
cacheStore[options.filename] = compiled;
return compiled;
}
// check cache
if (options.filename && options.cache) {
return cacheStore[options.filename];
}
return compiled;
}
/**
* Read `path` with `options` with
* callback `(err, str)`. When `options.cache`
* is true the template string will be cached.
*
* @param {String} options
* @param {Function} fn
* @api private
*/
function read(path, options, fn) {
var str = readCache[path];
var cached = options.cache && str && typeof str === 'string';
// cached (only if cached is a string and not a compiled template function)
if (cached) return fn(null, str);
// read
fs.readFile(path, 'utf8', function(err, str){
if (err) return fn(err);
// remove extraneous utf8 BOM marker
str = str.replace(/^\uFEFF/, '');
if (options.cache) readCache[path] = str;
fn(null, str);
});
}
/**
* Read `path` with `options` with
* callback `(err, str)`. When `options.cache`
* is true the partial string will be cached.
*
* @param {String} options
* @param {Function} fn
* @api private
*/
function readPartials(path, options, fn) {
if (!options.partials) return fn();
var partials = options.partials;
var keys = Object.keys(partials);
function next(index) {
if (index === keys.length) return fn(null);
var key = keys[index];
var file = join(dirname(path), partials[key] + extname(path));
read(file, options, function(err, str){
if (err) return fn(err);
options.partials[key] = str;
next(++index);
});
}
next(0);
}
/**
* promisify
*/
function promisify(fn, exec) {
return new Promise(function (res, rej) {
fn = fn || function (err, html) {
if (err) {
return rej(err);
}
res(html);
};
exec(fn);
});
}
/**
* fromStringRenderer
*/
function fromStringRenderer(name) {
return function(path, options, fn){
options.filename = path;
return promisify(fn, function(fn) {
readPartials(path, options, function (err) {
if (err) return fn(err);
if (cache(options)) {
exports[name].render('', options, fn);
} else {
read(path, options, function(err, str){
if (err) return fn(err);
exports[name].render(str, options, fn);
});
}
});
});
};
}
/**
* Liquid support.
*/
exports.liquid = fromStringRenderer('liquid');
/**
* Liquid string support.
*/
/**
* Note that in order to get filters and custom tags we've had to push
* all user-defined locals down into @locals. However, just to make things
* backwards-compatible, any property of `options` that is left after
* processing and removing `locals`, `meta`, `filters`, `customTags` and
* `includeDir` will also become a local.
*/
exports.liquid.render = function(str, options, fn){
return promisify(fn, function (fn) {
var engine = requires.liquid || (requires.liquid = require('tinyliquid'));
try {
var context = engine.newContext();
var k;
/**
* Note that there's a bug in the library that doesn't allow us to pass
* the locals to newContext(), hence looping through the keys:
*/
if (options.locals){
for (k in options.locals){
context.setLocals(k, options.locals[k]);
}
delete options.locals;
}
if (options.meta){
context.setLocals('page', options.meta);
delete options.meta;
}
/**
* Add any defined filters:
*/
if (options.filters){
for (k in options.filters){
context.setFilter(k, options.filters[k]);
}
delete options.filters;
}
/**
* Set up a callback for the include directory:
*/
var includeDir = options.includeDir || process.cwd();
context.onInclude(function (name, callback) {
var extname = path.extname(name) ? '' : '.liquid';
var filename = path.resolve(includeDir, name + extname);
fs.readFile(filename, {encoding: 'utf8'}, function (err, data){
if (err) return callback(err);
callback(null, engine.parse(data));
});
});
delete options.includeDir;
/**
* The custom tag functions need to have their results pushed back
* through the parser, so set up a shim before calling the provided
* callback:
*/
var compileOptions = {
customTags: {}
};
if (options.customTags){
var tagFunctions = options.customTags;
for (k in options.customTags){
/*Tell jshint there's no problem with having this function in the loop */
/*jshint -W083 */
compileOptions.customTags[k] = function (context, name, body){
var tpl = tagFunctions[name](body.trim());
context.astStack.push(engine.parse(tpl));
};
/*jshint +W083 */
}
delete options.customTags;
}
/**
* Now anything left in `options` becomes a local:
*/
for (k in options){
context.setLocals(k, options[k]);
}
/**
* Finally, execute the template:
*/
var tmpl = cache(context) || cache(context, engine.compile(str, compileOptions));
tmpl(context, fn);
} catch (err) {
fn(err);
}
});
};
/**
* Jade support.
*/
exports.jade = function(path, options, fn){
return promisify(fn, function (fn) {
var engine = requires.jade;
if (!engine) {
try {
engine = requires.jade = require('jade');
} catch (err) {
try {
engine = requires.jade = require('then-jade');
} catch (otherError) {
throw err;
}
}
}
try {
var tmpl = cache(options) || cache(options, engine.compileFile(path, options));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* Jade string support.
*/
exports.jade.render = function(str, options, fn){
return promisify(fn, function (fn) {
var engine = requires.jade;
if (!engine) {
try {
engine = requires.jade = require('jade');
} catch (err) {
try {
engine = requires.jade = require('then-jade');
} catch (otherError) {
throw err;
}
}
}
try {
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* Dust support.
*/
exports.dust = fromStringRenderer('dust');
/**
* Dust string support.
*/
exports.dust.render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires.dust;
if (!engine) {
try {
engine = requires.dust = require('dust');
} catch (err) {
try {
engine = requires.dust = require('dustjs-helpers');
} catch (err) {
engine = requires.dust = require('dustjs-linkedin');
}
}
}
var ext = 'dust'
, views = '.';
if (options) {
if (options.ext) ext = options.ext;
if (options.views) views = options.views;
if (options.settings && options.settings.views) views = options.settings.views;
}
if (!options || (options && !options.cache)) engine.cache = {};
engine.onLoad = function(path, callback){
if ('' === extname(path)) path += '.' + ext;
if ('/' !== path[0]) path = views + '/' + path;
read(path, options, callback);
};
try {
var tmpl = cache(options) || cache(options, engine.compileFn(str));
tmpl(options, fn);
} catch (err) {
fn(err);
}
});
};
/**
* Swig support.
*/
exports.swig = fromStringRenderer('swig');
/**
* Swig string support.
*/
exports.swig.render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires.swig || (requires.swig = require('swig'));
try {
if(options.cache === true) options.cache = 'memory';
engine.setDefaults({ cache: options.cache });
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* Atpl support.
*/
exports.atpl = fromStringRenderer('atpl');
/**
* Atpl string support.
*/
exports.atpl.render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires.atpl || (requires.atpl = require('atpl'));
try {
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* Liquor support,
*/
exports.liquor = fromStringRenderer('liquor');
/**
* Liquor string support.
*/
exports.liquor.render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires.liquor || (requires.liquor = require('liquor'));
try {
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* Twig support.
*/
exports.twig = fromStringRenderer('twig');
/**
* Twig string support.
*/
exports.twig.render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires.twig || (requires.twig = require('twig').twig);
var templateData = {
data: str
};
try {
var tmpl = cache(templateData) || cache(templateData, engine(templateData));
fn(null, tmpl.render(options));
} catch (err) {
fn(err);
}
});
};
/**
* EJS support.
*/
exports.ejs = fromStringRenderer('ejs');
/**
* EJS string support.
*/
exports.ejs.render = function(str, options, fn){
return promisify(fn, function (fn) {
var engine = requires.ejs || (requires.ejs = require('ejs'));
try {
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* Eco support.
*/
exports.eco = fromStringRenderer('eco');
/**
* Eco string support.
*/
exports.eco.render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires.eco || (requires.eco = require('eco'));
try {
fn(null, engine.render(str, options));
} catch (err) {
fn(err);
}
});
};
/**
* Jazz support.
*/
exports.jazz = fromStringRenderer('jazz');
/**
* Jazz string support.
*/
exports.jazz.render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires.jazz || (requires.jazz = require('jazz'));
try {
var tmpl = cache(options) || cache(options, engine.compile(str, options));
tmpl.eval(options, function(str){
fn(null, str);
});
} catch (err) {
fn(err);
}
});
};
/**
* JQTPL support.
*/
exports.jqtpl = fromStringRenderer('jqtpl');
/**
* JQTPL string support.
*/
exports.jqtpl.render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires.jqtpl || (requires.jqtpl = require('jqtpl'));
try {
engine.template(str, str);
fn(null, engine.tmpl(str, options));
} catch (err) {
fn(err);
}
});
};
/**
* Haml support.
*/
exports.haml = fromStringRenderer('haml');
/**
* Haml string support.
*/
exports.haml.render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires.haml || (requires.haml = require('hamljs'));
try {
options.locals = options;
fn(null, engine.render(str, options).trimLeft());
} catch (err) {
fn(err);
}
});
};
/**
* Hamlet support.
*/
exports.hamlet = fromStringRenderer('hamlet');
/**
* Hamlet string support.
*/
exports.hamlet.render = function(str, options, fn){
return promisify(fn, function (fn) {
var engine = requires.hamlet || (requires.hamlet = require('hamlet'));
try {
options.locals = options;
fn(null, engine.render(str, options).trimLeft());
} catch (err) {
fn(err);
}
});
};
/**
* Whiskers support.
*/
exports.whiskers = function(path, options, fn){
return promisify(fn, function (fn) {
var engine = requires.whiskers || (requires.whiskers = require('whiskers'));
engine.__express(path, options, fn);
});
};
/**
* Whiskers string support.
*/
exports.whiskers.render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires.whiskers || (requires.whiskers = require('whiskers'));
try {
fn(null, engine.render(str, options));
} catch (err) {
fn(err);
}
});
};
/**
* Coffee-HAML support.
*/
exports['haml-coffee'] = fromStringRenderer('haml-coffee');
/**
* Coffee-HAML string support.
*/
exports['haml-coffee'].render = function(str, options, fn){
return promisify(fn, function(fn) {
var engine = requires['haml-coffee'] || (requires['haml-coffee'] = require('haml-coffee'));
try {
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* Hogan support.
*/
exports.hogan = fromStringRenderer('hogan');
/**
* Hogan string support.
*/
exports.hogan.render = function(str, options, fn){
return promisify(fn, function (fn) {
var engine = requires.hogan || (requires.hogan = require('hogan.js'));
try {
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl.render(options, options.partials));
} catch (err) {
fn(err);
}
});
};
/**
* templayed.js support.
*/
exports.templayed = fromStringRenderer('templayed');
/**
* templayed.js string support.
*/
exports.templayed.render = function(str, options, fn){
return promisify(fn, function (fn) {
var engine = requires.templayed || (requires.templayed = require('templayed'));
try {
var tmpl = cache(options) || cache(options, engine(str));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* Handlebars support.
*/
exports.handlebars = fromStringRenderer('handlebars');
/**
* Handlebars string support.
*/
exports.handlebars.render = function(str, options, fn) {
return promisify(fn, function(fn) {
var engine = requires.handlebars || (requires.handlebars = require('handlebars'));
try {
for (var partial in options.partials) {
engine.registerPartial(partial, options.partials[partial]);
}
for (var helper in options.helpers) {
engine.registerHelper(helper, options.helpers[helper]);
}
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* Underscore support.
*/
exports.underscore = fromStringRenderer('underscore');
/**
* Underscore string support.
*/
exports.underscore.render = function(str, options, fn) {
return promisify(fn, function(fn) {
var engine = requires.underscore || (requires.underscore = require('underscore'));
try {
var tmpl = cache(options) || cache(options, engine.template(str, null, options));
fn(null, tmpl(options).replace(/\n$/, ''));
} catch (err) {
fn(err);
}
});
};
/**
* Lodash support.
*/
exports.lodash = fromStringRenderer('lodash');
/**
* Lodash string support.
*/
exports.lodash.render = function(str, options, fn) {
return promisify(fn, function (fn) {
var engine = requires.lodash || (requires.lodash = require('lodash'));
try {
var tmpl = cache(options) || cache(options, engine.template(str, options));
fn(null, tmpl(options).replace(/\n$/, ''));
} catch (err) {
fn(err);
}
});
};
/**
* QEJS support.
*/
exports.qejs = fromStringRenderer('qejs');
/**
* QEJS string support.
*/
exports.qejs.render = function (str, options, fn) {
return promisify(fn, function (fn) {
try {
var engine = requires.qejs || (requires.qejs = require('qejs'));
engine.render(str, options).then(function (result) {
fn(null, result);
}, function (err) {
fn(err);
}).done();
} catch (err) {
fn(err);
}
});
};
/**
* Walrus support.
*/
exports.walrus = fromStringRenderer('walrus');
/**
* Walrus string support.
*/
exports.walrus.render = function (str, options, fn) {
return promisify(fn, function (fn) {
var engine = requires.walrus || (requires.walrus = require('walrus'));
try {
var tmpl = cache(options) || cache(options, engine.parse(str));
fn(null, tmpl.compile(options));
} catch (err) {
fn(err);
}
});
};
/**
* Mustache support.
*/
exports.mustache = fromStringRenderer('mustache');
/**
* Mustache string support.
*/
exports.mustache.render = function(str, options, fn) {
return promisify(fn, function (fn) {
var engine = requires.mustache || (requires.mustache = require('mustache'));
try {
fn(null, engine.to_html(str, options, options.partials));
} catch (err) {
fn(err);
}
});
};
/**
* Just support.
*/
exports.just = function(path, options, fn){
return promisify(fn, function(fn) {
var engine = requires.just;
if (!engine) {
var JUST = require('just');
engine = requires.just = new JUST();
}
engine.configure({ useCache: options.cache });
engine.render(path, options, fn);
});
};
/**
* Just string support.
*/
exports.just.render = function(str, options, fn){
return promisify(fn, function (fn) {
var JUST = require('just');
var engine = new JUST({ root: { page: str }});
engine.render('page', options, fn);
});
};
/**
* ECT support.
*/
exports.ect = function(path, options, fn){
return promisify(fn, function (fn) {
var engine = requires.ect;
if (!engine) {
var ECT = require('ect');
engine = requires.ect = new ECT(options);
}
engine.configure({ cache: options.cache });
engine.render(path, options, fn);
});
};
/**
* ECT string support.
*/
exports.ect.render = function(str, options, fn){
return promisify(fn, function (fn) {
var ECT = require('ect');
var engine = new ECT({ root: { page: str }});
engine.render('page', options, fn);
});
};
/**
* mote support.
*/
exports.mote = fromStringRenderer('mote');
/**
* mote string support.
*/
exports.mote.render = function(str, options, fn){
return promisify(fn, function (fn) {
var engine = requires.mote || (requires.mote = require('mote'));
try {
var tmpl = cache(options) || cache(options, engine.compile(str));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* Toffee support.
*/
exports.toffee = function(path, options, fn){
return promisify(fn, function (fn) {
var toffee = requires.toffee || (requires.toffee = require('toffee'));
toffee.__consolidate_engine_render(path, options, fn);
});
};
/**
* Toffee string support.
*/
exports.toffee.render = function(str, options, fn) {
return promisify(fn, function (fn) {
var engine = requires.toffee || (requires.toffee = require('toffee'));
try {
engine.str_render(str, options,fn);
} catch (err) {
fn(err);
}
});
};
/**
* doT support.
*/
exports.dot = fromStringRenderer('dot');
/**
* doT string support.
*/
exports.dot.render = function (str, options, fn) {
return promisify(fn, function (fn) {
var engine = requires.dot || (requires.dot = require('dot'));
try {
var tmpl = cache(options) || cache(options, engine.compile(str, options && options._def));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* Ractive support.
*/
exports.ractive = fromStringRenderer('ractive');
/**
* Ractive string support.
*/
exports.ractive.render = function(str, options, fn){
return promisify(fn, function (fn) {
var engine = requires.ractive || (requires.ractive = require('ractive'));
var template = cache(options) || cache(options, engine.parse(str));
options.template = template;
if (options.data === null || options.data === undefined)
{
var extend = (requires.extend || (requires.extend = require('util')._extend));
// Shallow clone the options object
options.data = extend({}, options);
// Remove consolidate-specific properties from the clone
var i, length;
var properties = ["template", "filename", "cache", "partials"];
for (i = 0, length = properties.length; i < length; i++) {
var property = properties[i];
delete options.data[property];
}
}
try {
fn(null, new engine(options).toHTML());
} catch (err) {
fn(err);
}
});
};
/**
* Nunjucks support.
*/
exports.nunjucks = fromStringRenderer('nunjucks');
/**
* Nunjucks string support.
*/
exports.nunjucks.render = function(str, options, fn) {
return promisify(fn, function (fn) {
try {
var engine = requires.nunjucks || (requires.nunjucks = require('nunjucks'));
var loader = options.loader;
if (loader) {
var env = new engine.Environment(new loader(options));
env.renderString(str, options, fn);
} else {
engine.renderString(str, options, fn);
}
} catch (err) {
throw fn(err);
}
});
};
/**
* HTMLing support.
*/
exports.htmling = fromStringRenderer('htmling');
/**
* HTMLing string support.
*/
exports.htmling.render = function(str, options, fn) {
return promisify(fn, function (fn) {
var engine = requires.htmling || (requires.htmling = require('htmling'));
try {
var tmpl = cache(options) || cache(options, engine.string(str));
fn(null, tmpl.render(options));
} catch (err) {
fn(err);
}
});
};
/**
* Rendering function
*/
function requireReact(module, filename) {
var tools = requires.reactTools || (requires.reactTools = require('react-tools'));
var content = fs.readFileSync(filename, 'utf8');
var compiled = tools.transform(content, {harmony: true});
return module._compile(compiled, filename);
}
exports.requireReact = requireReact;
/**
* Converting a string into a node module.
*/
function requireReactString(src, filename) {
var tools = requires.reactTools || (requires.reactTools = require('react-tools'));
var m = new module.constructor();
// Compile Using React
src = tools.transform(src, {harmony: true});
// Compile as a module
m.paths = module.paths;
m._compile(src, filename);
return m.exports;
}
/**
* A naive helper to replace {{tags}} with options.tags content
*/
function reactBaseTmpl(data, options){
var exp,
regex;
// Iterates through the keys in file object
// and interpolate / replace {{key}} with it's value
for (var k in options){
if (options.hasOwnProperty(k)){
exp = '{{'+k+'}}';
regex = new RegExp(exp, 'g');
if (data.match(regex)) {
data = data.replace(regex, options[k]);
}
}
}
return data;
}
/**
* The main render parser for React bsaed templates
*/
function reactRenderer(type){
// Ensure JSX is transformed on require
if (!require.extensions['.jsx']) {
require.extensions['.jsx'] = requireReact;
}
// Supporting .react extension as well as test cases
// Using .react extension is not recommended.
if (!require.extensions['.react']) {
require.extensions['.react'] = requireReact;
}
// Return rendering fx
return function(str, options, fn) {
return promisify(fn, function(fn) {
// React Import
var engine = requires.react || (requires.react = require('react'));
// Assign HTML Base
var base = options.base;
delete options.base;
var enableCache = options.cache;
delete options.cache;
var isNonStatic = options.isNonStatic;
delete options.isNonStatic;
// Start Conversion
try {
var Code,
Factory;
var baseStr,
content,
parsed;
if (!cache(options)){
// Parsing
Code = (type === 'path') ? require(resolve(str)) : requireReactString(str);
Factory = cache(options, engine.createFactory(Code));
} else {
Factory = cache(options);
}
parsed = new Factory(options);
content = (isNonStatic) ? engine.renderToString(parsed) : engine.renderToStaticMarkup(parsed);
if (base){
baseStr = readCache[str] || fs.readFileSync(resolve(base), 'utf8');
if (enableCache){
readCache[str] = baseStr;
}
options.content = content;
content = reactBaseTmpl(baseStr, options);
}
fn(null, content);
} catch (err) {
fn(err);
}
});
};
}
/**
* React JS Support
*/
exports.react = reactRenderer('path');
/**
* React JS string support.
*/
exports.react.render = reactRenderer('string');
/**
* Vash support
*/
exports.vash = fromStringRenderer('vash');
/**
* Vash string support
*/
exports.vash.render = function(str, options, fn) {
return promisify(fn, function(fn) {
var engine = requires.vash || (requires.vash = require('vash'));
try {
// helper system : https://github.com/kirbysayshi/vash#helper-system
if (options.helpers) {
for (var key in options.helpers) {
if (!options.helpers.hasOwnProperty(key) || typeof options.helpers[key] !== 'function') {
continue;
}
engine.helpers[key] = options.helpers[key];
}
}
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl(options).replace(/\n$/, ''));
} catch (err) {
fn(err);
}
});
};
/**
* Slm support.
*/
exports.slm = fromStringRenderer('slm');
/**
* Slm string support.
*/
exports.slm.render = function(str, options, fn) {
return promisify(fn, function (fn) {
var engine = requires.slm || (requires.slm = require('slm'));
try {
var tmpl = cache(options) || cache(options, engine.compile(str, options));
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
};
/**
* expose the instance of the engine
*/
exports.requires = requires;
|
public/scripts/containers/Root.js | nicrocs/react-form-builder | import React, { Component } from 'react';
import { Provider } from 'react-redux';
import configureStore from '../configureStore';
import FormBuilder from './FormBuilder';
const store = configureStore();
export default class Root extends Component {
render() {
return (
<Provider store={store}>
<FormBuilder url="/api/questions" />
</Provider>
)
}
}
|
src/renderers/dom/client/__tests__/ReactMount-test.js | mgmcdermott/react | /**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @emails react-core
*/
'use strict';
var React;
var ReactDOM;
var ReactDOMServer;
var ReactMount;
var ReactTestUtils;
var WebComponents;
describe('ReactMount', function() {
beforeEach(function() {
jest.resetModuleRegistry();
React = require('React');
ReactDOM = require('ReactDOM');
ReactDOMServer = require('ReactDOMServer');
ReactMount = require('ReactMount');
ReactTestUtils = require('ReactTestUtils');
try {
if (WebComponents === undefined && typeof jest !== 'undefined') {
WebComponents = require('WebComponents');
}
} catch (e) {
// Parse error expected on engines that don't support setters
// or otherwise aren't supportable by the polyfill.
// Leave WebComponents undefined.
}
});
describe('unmountComponentAtNode', function() {
it('throws when given a non-node', function() {
var nodeArray = document.getElementsByTagName('div');
expect(function() {
ReactDOM.unmountComponentAtNode(nodeArray);
}).toThrow(
'unmountComponentAtNode(...): Target container is not a DOM element.'
);
});
});
it('throws when given a string', function() {
expect(function() {
ReactTestUtils.renderIntoDocument('div');
}).toThrow(
'ReactDOM.render(): Invalid component element. Instead of passing a ' +
'string like \'div\', pass React.createElement(\'div\') or <div />.'
);
});
it('throws when given a factory', function() {
var Component = React.createClass({
render: function() {
return <div />;
},
});
expect(function() {
ReactTestUtils.renderIntoDocument(Component);
}).toThrow(
'ReactDOM.render(): Invalid component element. Instead of passing a ' +
'class like Foo, pass React.createElement(Foo) or <Foo />.'
);
});
it('should render different components in same root', function() {
var container = document.createElement('container');
document.body.appendChild(container);
ReactMount.render(<div></div>, container);
expect(container.firstChild.nodeName).toBe('DIV');
ReactMount.render(<span></span>, container);
expect(container.firstChild.nodeName).toBe('SPAN');
});
it('should unmount and remount if the key changes', function() {
var container = document.createElement('container');
var mockMount = jest.genMockFn();
var mockUnmount = jest.genMockFn();
var Component = React.createClass({
componentDidMount: mockMount,
componentWillUnmount: mockUnmount,
render: function() {
return <span>{this.props.text}</span>;
},
});
expect(mockMount.mock.calls.length).toBe(0);
expect(mockUnmount.mock.calls.length).toBe(0);
ReactMount.render(<Component text="orange" key="A" />, container);
expect(container.firstChild.innerHTML).toBe('orange');
expect(mockMount.mock.calls.length).toBe(1);
expect(mockUnmount.mock.calls.length).toBe(0);
// If we change the key, the component is unmounted and remounted
ReactMount.render(<Component text="green" key="B" />, container);
expect(container.firstChild.innerHTML).toBe('green');
expect(mockMount.mock.calls.length).toBe(2);
expect(mockUnmount.mock.calls.length).toBe(1);
// But if we don't change the key, the component instance is reused
ReactMount.render(<Component text="blue" key="B" />, container);
expect(container.firstChild.innerHTML).toBe('blue');
expect(mockMount.mock.calls.length).toBe(2);
expect(mockUnmount.mock.calls.length).toBe(1);
});
it('should reuse markup if rendering to the same target twice', function() {
var container = document.createElement('container');
var instance1 = ReactDOM.render(<div />, container);
var instance2 = ReactDOM.render(<div />, container);
expect(instance1 === instance2).toBe(true);
});
it('should warn if mounting into dirty rendered markup', function() {
var container = document.createElement('container');
container.innerHTML = ReactDOMServer.renderToString(<div />) + ' ';
spyOn(console, 'error');
ReactMount.render(<div />, container);
expect(console.error.calls.length).toBe(1);
container.innerHTML = ' ' + ReactDOMServer.renderToString(<div />);
ReactMount.render(<div />, container);
expect(console.error.calls.length).toBe(2);
});
it('should not warn if mounting into non-empty node', function() {
var container = document.createElement('container');
container.innerHTML = '<div></div>';
spyOn(console, 'error');
ReactMount.render(<div />, container);
expect(console.error.calls.length).toBe(0);
});
it('should warn when mounting into document.body', function() {
var iFrame = document.createElement('iframe');
document.body.appendChild(iFrame);
spyOn(console, 'error');
ReactMount.render(<div />, iFrame.contentDocument.body);
expect(console.error.calls.length).toBe(1);
expect(console.error.argsForCall[0][0]).toContain(
'Rendering components directly into document.body is discouraged'
);
});
it('should account for escaping on a checksum mismatch', function() {
var div = document.createElement('div');
var markup = ReactDOMServer.renderToString(
<div>This markup contains an nbsp entity: server text</div>);
div.innerHTML = markup;
spyOn(console, 'error');
ReactDOM.render(
<div>This markup contains an nbsp entity: client text</div>,
div
);
expect(console.error.calls.length).toBe(1);
expect(console.error.argsForCall[0][0]).toContain(
' (client) nbsp entity: client text</div>\n' +
' (server) nbsp entity: server text</div>'
);
});
if (WebComponents !== undefined) {
it('should allow mounting/unmounting to document fragment container', function() {
var shadowRoot;
var proto = Object.create(HTMLElement.prototype, {
createdCallback: {
value: function() {
shadowRoot = this.createShadowRoot();
ReactDOM.render(<div>Hi, from within a WC!</div>, shadowRoot);
expect(shadowRoot.firstChild.tagName).toBe('DIV');
ReactDOM.render(<span>Hi, from within a WC!</span>, shadowRoot);
expect(shadowRoot.firstChild.tagName).toBe('SPAN');
},
},
});
proto.unmount = function() {
ReactDOM.unmountComponentAtNode(shadowRoot);
};
document.registerElement('x-foo', {prototype: proto});
var element = document.createElement('x-foo');
element.unmount();
});
}
it('should warn if render removes React-rendered children', function() {
var container = document.createElement('container');
var Component = React.createClass({
render: function() {
return <div><div /></div>;
},
});
ReactDOM.render(<Component />, container);
// Test that blasting away children throws a warning
spyOn(console, 'error');
var rootNode = container.firstChild;
ReactDOM.render(<span />, rootNode);
expect(console.error.calls.length).toBe(1);
expect(console.error.argsForCall[0][0]).toBe(
'Warning: render(...): Replacing React-rendered children with a new ' +
'root component. If you intended to update the children of this node, ' +
'you should instead have the existing children update their state and ' +
'render the new components instead of calling ReactDOM.render.'
);
});
it('passes the correct callback context', function() {
var container = document.createElement('div');
var calls = 0;
ReactDOM.render(<div />, container, function() {
expect(this.nodeName).toBe('DIV');
calls++;
});
// Update, no type change
ReactDOM.render(<div />, container, function() {
expect(this.nodeName).toBe('DIV');
calls++;
});
// Update, type change
ReactDOM.render(<span />, container, function() {
expect(this.nodeName).toBe('SPAN');
calls++;
});
// Batched update, no type change
ReactDOM.unstable_batchedUpdates(function() {
ReactDOM.render(<span />, container, function() {
expect(this.nodeName).toBe('SPAN');
calls++;
});
});
// Batched update, type change
ReactDOM.unstable_batchedUpdates(function() {
ReactDOM.render(<article />, container, function() {
expect(this.nodeName).toBe('ARTICLE');
calls++;
});
});
expect(calls).toBe(5);
});
it('tracks root instances', function() {
// Used by devtools.
expect(Object.keys(ReactMount._instancesByReactRootID).length).toBe(0);
ReactTestUtils.renderIntoDocument(<span />);
expect(Object.keys(ReactMount._instancesByReactRootID).length).toBe(1);
var container = document.createElement('div');
ReactDOM.render(<span />, container);
expect(Object.keys(ReactMount._instancesByReactRootID).length).toBe(2);
ReactDOM.unmountComponentAtNode(container);
expect(Object.keys(ReactMount._instancesByReactRootID).length).toBe(1);
});
it('marks top-level mounts', function() {
var ReactFeatureFlags = require('ReactFeatureFlags');
var Foo = React.createClass({
render: function() {
return <Bar />;
},
});
var Bar = React.createClass({
render: function() {
return <div />;
},
});
try {
ReactFeatureFlags.logTopLevelRenders = true;
spyOn(console, 'time');
spyOn(console, 'timeEnd');
ReactTestUtils.renderIntoDocument(<Foo />);
expect(console.time.argsForCall.length).toBe(1);
expect(console.time.argsForCall[0][0]).toBe('React mount: Foo');
expect(console.timeEnd.argsForCall.length).toBe(1);
expect(console.timeEnd.argsForCall[0][0]).toBe('React mount: Foo');
} finally {
ReactFeatureFlags.logTopLevelRenders = false;
}
});
});
|
src/client/auth/login.react.js | skaldo/este | import './login.styl';
import Component from '../components/component.react';
import React from 'react';
import exposeRouter from '../components/exposerouter';
import {focusInvalidField} from '../lib/validation';
@exposeRouter
export default class Login extends Component {
static propTypes = {
actions: React.PropTypes.object.isRequired,
auth: React.PropTypes.object.isRequired,
msg: React.PropTypes.object.isRequired,
router: React.PropTypes.func
}
onFormSubmit(e) {
e.preventDefault();
const {actions: {auth}, auth: {form}} = this.props;
auth.login(form.fields)
.then(() => this.redirectAfterLogin())
.catch(focusInvalidField(this));
}
redirectAfterLogin() {
const {router} = this.props;
const nextPath = router.getCurrentQuery().nextPath;
router.replaceWith(nextPath || 'home');
}
render() {
const {
actions: {auth: actions},
auth: {form},
msg: {auth: {form: msg}}
} = this.props;
return (
<div className="login">
<form onSubmit={::this.onFormSubmit}>
<fieldset disabled={form.disabled}>
<legend>{msg.legend}</legend>
<input
autoFocus
name="email"
onChange={actions.setFormField}
placeholder={msg.placeholder.email}
value={form.fields.email}
/>
<br />
<input
name="password"
onChange={actions.setFormField}
placeholder={msg.placeholder.password}
type="password"
value={form.fields.password}
/>
<br />
<button
children={msg.button.login}
type="submit"
/>
{form.error &&
<span className="error-message">{form.error.message}</span>
}
<div>{msg.hint}</div>
</fieldset>
</form>
</div>
);
}
}
|
client/admin/info/RuntimeEnvironmentSection.js | iiet/iiet-chat | import { Skeleton } from '@rocket.chat/fuselage';
import React from 'react';
import s from 'underscore.string';
import Subtitle from '../../components/basic/Subtitle';
import { useTranslation } from '../../contexts/TranslationContext';
import { useFormatMemorySize } from '../../hooks/useFormatMemorySize';
import { useFormatDuration } from '../../hooks/useFormatDuration';
import { DescriptionList } from './DescriptionList';
const formatCPULoad = (load) => {
if (!load) {
return null;
}
const [oneMinute, fiveMinutes, fifteenMinutes] = load;
return `${ s.numberFormat(oneMinute, 2) }, ${ s.numberFormat(fiveMinutes, 2) }, ${ s.numberFormat(fifteenMinutes, 2) }`;
};
export const RuntimeEnvironmentSection = React.memo(function RuntimeEnvironmentSection({ statistics, isLoading }) {
const s = (fn) => (isLoading ? <Skeleton width='50%' /> : fn());
const t = useTranslation();
const formatMemorySize = useFormatMemorySize();
const formatDuration = useFormatDuration();
return <DescriptionList
data-qa='runtime-env-list'
title={<Subtitle data-qa='runtime-env-title'>{t('Runtime_Environment')}</Subtitle>}
>
<DescriptionList.Entry label={t('OS_Type')}>{s(() => statistics.os.type)}</DescriptionList.Entry>
<DescriptionList.Entry label={t('OS_Platform')}>{s(() => statistics.os.platform)}</DescriptionList.Entry>
<DescriptionList.Entry label={t('OS_Arch')}>{s(() => statistics.os.arch)}</DescriptionList.Entry>
<DescriptionList.Entry label={t('OS_Release')}>{s(() => statistics.os.release)}</DescriptionList.Entry>
<DescriptionList.Entry label={t('Node_version')}>{s(() => statistics.process.nodeVersion)}</DescriptionList.Entry>
<DescriptionList.Entry label={t('Mongo_version')}>{s(() => statistics.mongoVersion)}</DescriptionList.Entry>
<DescriptionList.Entry label={t('Mongo_storageEngine')}>{s(() => statistics.mongoStorageEngine)}</DescriptionList.Entry>
<DescriptionList.Entry label={t('OS_Uptime')}>{s(() => formatDuration(statistics.os.uptime))}</DescriptionList.Entry>
<DescriptionList.Entry label={t('OS_Loadavg')}>{s(() => formatCPULoad(statistics.os.loadavg))}</DescriptionList.Entry>
<DescriptionList.Entry label={t('OS_Totalmem')}>{s(() => formatMemorySize(statistics.os.totalmem))}</DescriptionList.Entry>
<DescriptionList.Entry label={t('OS_Freemem')}>{s(() => formatMemorySize(statistics.os.freemem))}</DescriptionList.Entry>
<DescriptionList.Entry label={t('OS_Cpus')}>{s(() => statistics.os.cpus.length)}</DescriptionList.Entry>
</DescriptionList>;
});
|
rest-ui-scripts/fixtures/kitchensink/src/features/webpack/JsonInclusion.js | RestUI/create-rest-ui-app | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
import React from 'react';
import { abstract } from './assets/abstract.json';
export default () => <summary id="feature-json-inclusion">{abstract}</summary>;
|
components/Table/Intro/MoneySelection.js | mattbajorek/blackJackReact | import React, { Component } from 'react';
import { formatMoney } from 'accounting';
import './MoneySelection.scss';
import actions from '../../../redux/actions';
class MoneySelection extends Component {
handleClick(e) {
this.props.dispatch(actions.select(this.props.num));
}
render() {
return (
<button
className={this.props.total === this.props.num ? "button-selected":"selection"}
num={this.props.num}
onClick={this.handleClick.bind(this)}>
{formatMoney(this.props.num, "$", 0)}
</button>
)
}
}
export default MoneySelection; |
newclient/scripts/components/admin/detail-view/approval-confirmation/index.js | kuali/research-coi | /*
The Conflict of Interest (COI) module of Kuali Research
Copyright © 2005-2016 Kuali, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
import styles from './style';
import React from 'react';
import {GreyButton} from '../../../grey-button';
import {BlueButton} from '../../../blue-button';
import {AdminActions} from '../../../../actions/admin-actions';
import classNames from 'classnames';
export default function ApprovalConfirmation(props) {
let dispositionWarning = '';
if (props.showDispositionWarning) {
dispositionWarning = 'A disposition has not been set for every project. ';
}
return (
<div className={classNames(styles.container, props.className)} >
<div className={styles.question}>
{`${dispositionWarning}Are you sure you want to approve this disclosure?`}
</div>
<BlueButton
onClick={AdminActions.approveDisclosure}
className={`${styles.override} ${styles.yesButton}`}
>
YES, CONFIRM
</BlueButton>
<GreyButton
onClick={AdminActions.toggleApprovalConfirmation}
className={`${styles.override} ${styles.button}`}
>
NO, CANCEL
</GreyButton>
</div>
);
}
|
src/examples/button.js | JiaoJian1221/react-mdc-web | import React from 'react';
import {
Checkbox,
Button,
FormField,
FAButton,
ITButton,
} from '../components'
export class ButtonTest extends React.Component {
state = {
dense: false,
primary: false,
compact: false,
accent: false,
raised: true,
}
render() {
let {dense, primary, compact, accent, raised} = this.state;
return (
<section>
<h1>Button</h1>
<div style={{display: 'flex', justifyContent: 'space-between', width: 600}}>
<FormField><Checkbox checked={dense} onClick={({target: {checked}}) => this.setState({dense: checked})}/><label>Dense</label></FormField>
<FormField><Checkbox checked={primary} onClick={({target: {checked}}) => this.setState({primary: checked})}/><label>Primary</label></FormField>
<FormField><Checkbox checked={compact} onClick={({target: {checked}}) => this.setState({compact: checked})}/><label>Compact</label></FormField>
<FormField><Checkbox checked={accent} onClick={({target: {checked}}) => this.setState({accent: checked})}/><label>Accent</label></FormField>
<FormField><Checkbox checked={raised} onClick={({target: {checked}}) => this.setState({raised: checked})}/><label>Raised</label></FormField>
</div>
<Button style={{marginTop: 10}} dense={dense} primary={primary} compact={compact} accent={accent} raised={raised}>Example Button</Button>
<Button tag='div' style={{marginTop: 10, marginLeft: 10}} dense={dense} primary={primary} compact={compact} accent={accent} raised={raised}>Example Button (DIV)</Button>
<h1>Floating Action Button</h1>
<FAButton onClick={e => console.log(e)}>
<svg width="24" height="24" viewBox="0 0 24 24">
<path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path>
</svg>
</FAButton>
<h1>Icon Toggle Button</h1>
<ITButton toggleOnIcon='favorite' toggleOffIcon='favorite_border' onChange={e => console.log(e)} />
</section>
);
}
}
|
examples/webpack/src/components/RandomButton.js | sapegin/react-styleguidist | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import sample from 'lodash/sample';
import './RandomButton.css';
/**
* Button that changes label on every click.
*/
export default class RandomButton extends Component {
static propTypes = {
/**
* List of possible labels.
*/
variants: PropTypes.array.isRequired,
};
constructor(props) {
super();
this.state = {
label: sample(props.variants),
};
}
handleClick = () => {
this.setState({
label: sample(this.props.variants),
});
};
render() {
return (
<button className="random-button" onClick={this.handleClick}>
{this.state.label}
</button>
);
}
}
|
node_modules/react-bootstrap/es/Glyphicon.js | Chen-Hailin/iTCM.github.io | import _extends from 'babel-runtime/helpers/extends';
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import classNames from 'classnames';
import React from 'react';
import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
var propTypes = {
/**
* An icon name. See e.g. http://getbootstrap.com/components/#glyphicons
*/
glyph: React.PropTypes.string.isRequired
};
var Glyphicon = function (_React$Component) {
_inherits(Glyphicon, _React$Component);
function Glyphicon() {
_classCallCheck(this, Glyphicon);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Glyphicon.prototype.render = function render() {
var _extends2;
var _props = this.props;
var glyph = _props.glyph;
var className = _props.className;
var props = _objectWithoutProperties(_props, ['glyph', 'className']);
var _splitBsProps = splitBsProps(props);
var bsProps = _splitBsProps[0];
var elementProps = _splitBsProps[1];
var classes = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[prefix(bsProps, glyph)] = true, _extends2));
return React.createElement('span', _extends({}, elementProps, {
className: classNames(className, classes)
}));
};
return Glyphicon;
}(React.Component);
Glyphicon.propTypes = propTypes;
export default bsClass('glyphicon', Glyphicon); |
src/app/containers/HomePage.js | ConnorGBrewster/FLLSS | import React, { Component } from 'react';
import Home from '../components/Home';
export default class HomePage extends Component {
render() {
return (
<Home />
);
}
}
|
openex-front/src/utils/Environment.js | Luatix/OpenEx | import { Subject, timer } from 'rxjs';
import { debounce } from 'rxjs/operators';
import * as R from 'ramda';
import React from 'react';
import Slide from '@mui/material/Slide';
// Service bus
const MESSENGER$ = new Subject().pipe(debounce(() => timer(500)));
export const MESSAGING$ = {
messages: MESSENGER$,
notifyError: (text) => MESSENGER$.next([{ type: 'error', text }]),
notifySuccess: (text) => MESSENGER$.next([{ type: 'message', text }]),
redirect: new Subject(),
};
// Default application exception.
export class ApplicationError extends Error {
constructor(errors) {
super();
this.data = errors;
}
}
// Network
const isEmptyPath = R.isNil(window.BASE_PATH) || R.isEmpty(window.BASE_PATH);
const contextPath = isEmptyPath || window.BASE_PATH === '/' ? '' : window.BASE_PATH;
export const APP_BASE_PATH = isEmptyPath || contextPath.startsWith('/') ? contextPath : `/${contextPath}`;
// Transition
export const Transition = React.forwardRef((props, ref) => (
<Slide direction="up" ref={ref} {...props} />
));
Transition.displayName = 'TransitionSlide';
// Export
const escape = (value) => value?.toString().replaceAll('"', '""');
export const exportData = (
type,
keys,
data,
tagsMap,
organizationsMap,
exercisesMap,
) => {
return data
.map((d) => R.pick(keys, d))
.map((d) => {
let entry = d;
if (entry[`${type}_tags`]) {
entry = R.assoc(
`${type}_tags`,
entry[`${type}_tags`].map((t) => tagsMap[t]?.tag_name),
entry,
);
}
if (entry[`${type}_exercises`]) {
entry = R.assoc(
`${type}_exercises`,
entry[`${type}_exercises`].map((e) => exercisesMap[e]?.exercise_name),
entry,
);
}
if (entry[`${type}_organization`]) {
entry = R.assoc(
`${type}_organization`,
organizationsMap[entry[`${type}_organization`]]?.organization_name,
entry,
);
}
if (entry.inject_content) {
entry = R.assoc(
'inject_content',
JSON.stringify(entry.inject_content),
entry,
);
}
return R.mapObjIndexed(escape, entry);
});
};
|
packages/material-ui-icons/src/VerticalAlignTopSharp.js | allanalexandre/material-ui | import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path d="M8 11h3v10h2V11h3l-4-4-4 4zM4 3v2h16V3H4z" /></React.Fragment>
, 'VerticalAlignTopSharp');
|
src/interface/home/ReportSelectionHeader.js | sMteX/WoWAnalyzer | import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Trans } from '@lingui/macro';
import { hasPremium } from 'interface/selectors/user';
import { ReactComponent as Logo } from 'interface/images/logo.svg';
import Warning from 'interface/common/Alert/Warning';
import { getReportHistory } from 'interface/selectors/reportHistory';
import CharacterSearch from 'interface/character/Search';
import ReportSelecter from '../others/ReportSelecter';
import ReportHistory from './ReportHistory';
import '../Header.scss';
class ReportSelectionHeader extends React.PureComponent {
static propTypes = {
reportHistory: PropTypes.array.isRequired,
};
constructor(props) {
super(props);
this.state = {
reportSelectionActive: true,
};
this.handleToggleCharacterSearchClick = this.handleToggleCharacterSearchClick.bind(this);
this.handleToggleReportSelectorClick = this.handleToggleReportSelectorClick.bind(this);
}
handleToggleCharacterSearchClick(e) {
e.preventDefault();
this.setState({
reportSelectionActive: false,
});
}
handleToggleReportSelectorClick(e) {
e.preventDefault();
this.setState({
reportSelectionActive: true,
});
}
render() {
const { reportHistory } = this.props;
return (
<header className="report-selection">
<div className="container">
<div className="row">
<div className={reportHistory.length !== 0 ? 'col-md-8' : 'col-md-12'}>
<a href="/" className="brand-name">
<Logo />
<h1>WoWAnalyzer</h1>
</a>
<Trans>Improve your performance with personal feedback and stats. Just enter the link of a <a href="https://warcraftlogs.com" target="_blank" rel="noopener noreferrer">Warcraft Logs</a> report:</Trans>
<div style={{ margin: '30px auto', maxWidth: 700, textAlign: 'left' }}>
{this.state.reportSelectionActive ? (
<>
<ReportSelecter />
<Trans>or <a href="/" onClick={this.handleToggleCharacterSearchClick}>
search for a character
</a>.</Trans>
</>
) : (
<>
<CharacterSearch />
<Trans>or <a href="/" onClick={this.handleToggleReportSelectorClick}>
enter a report link
</a>.</Trans><br /><br />
<Warning>
<Trans>
The character page will only show fights that have been ranked by Warcraft Logs. Wipes are not included and during busy periods there might be a delay before new reports appear. Manually find the report on Warcraft Logs and copy the direct report link to still analyze these fights.
</Trans>
</Warning>
</>
)}
</div>
</div>
{reportHistory.length !== 0 && (
<div className="col-md-4 text-left" style={{ marginTop: -10, marginBottom: -10 }}>
<small><Trans>Recently viewed</Trans></small><br />
<ReportHistory reportHistory={reportHistory} />
</div>
)}
</div>
</div>
</header>
);
}
}
const mapStateToProps = state => ({
reportHistory: getReportHistory(state),
premium: hasPremium(state),
});
export default connect(
mapStateToProps
)(ReportSelectionHeader);
|
packages/react-router-website/examples/Params.js | rafrex/react-router | import React from 'react'
import Route from 'react-router/Route'
import Router from 'react-router-dom/BrowserRouter'
import Link from 'react-router-dom/Link'
const ParamsExample = () => (
<Router>
<div>
<h2>Accounts</h2>
<ul>
<li><Link to="/netflix">Netflix</Link></li>
<li><Link to="/zillow-group">Zillow Group</Link></li>
<li><Link to="/yahoo">Yahoo</Link></li>
<li><Link to="/modus-create">Modus Create</Link></li>
</ul>
<Route path="/:id" component={Child}/>
</div>
</Router>
)
const Child = ({ match }) => (
<div>
<h3>ID: {match.params.id}</h3>
</div>
)
export default ParamsExample
|
pootle/static/js/auth/components/PasswordResetForm.js | Jobava/pootle | /*
* Copyright (C) Pootle contributors.
*
* This file is a part of the Pootle project. It is distributed under the GPL3
* or later license. See the LICENSE file for a copy of the license and the
* AUTHORS file for copyright and authorship information.
*/
'use strict';
import assign from 'object-assign';
import React from 'react';
import { PureRenderMixin } from 'react/addons';
import { FormElement } from 'components/forms';
import { FormMixin } from 'mixins/forms';
import AuthContent from './AuthContent';
import AuthProgress from './AuthProgress';
let PasswordResetForm = React.createClass({
mixins: [PureRenderMixin, FormMixin],
propTypes: {
formErrors: React.PropTypes.object.isRequired,
isLoading: React.PropTypes.bool.isRequired,
tokenFailed: React.PropTypes.bool.isRequired,
},
/* Lifecycle */
getInitialState() {
this.initialData = {
password1: '',
password2: '',
};
return {
formData: assign({}, this.initialData),
};
},
componentWillReceiveProps(nextProps) {
if (this.state.errors !== nextProps.formErrors) {
this.setState({errors: nextProps.formErrors});
}
},
/* Handlers */
handlePasswordReset(e) {
e.preventDefault();
this.props.flux.getActions('auth').gotoScreen('requestPasswordReset');
},
handleFormSubmit(e) {
e.preventDefault();
let url = window.location.pathname;
this.props.flux.getActions('auth').passwordReset(this.state.formData, url);
},
/* Others */
hasData() {
let { formData } = this.state;
return (formData.password1 !== '' && formData.password2 !== '' &&
formData.password1 === formData.password2);
},
/* Layout */
renderTokenFailed() {
return (
<AuthContent>
<p>{gettext('The password reset link was invalid, possibly because it has already been used. Please request a new password reset.')}</p>
<div className="actions">
<button
className="btn btn-primary"
onClick={this.handlePasswordReset}
>
{gettext('Reset Password')}
</button>
</div>
</AuthContent>
);
},
render() {
if (this.props.tokenFailed) {
return this.renderTokenFailed();
}
if (this.props.redirectTo) {
return <AuthProgress msg={gettext('Password changed, signing in...')} />
}
let { errors } = this.state;
let { formData } = this.state;
return (
<AuthContent>
<form
method="post"
onSubmit={this.handleFormSubmit}>
<div className="fields">
<FormElement
type="password"
attribute="password1"
label={gettext('Password')}
autoFocus={true}
handleChange={this.handleChange}
formData={formData}
errors={errors}
/>
<FormElement
type="password"
attribute="password2"
label={gettext('Repeat Password')}
handleChange={this.handleChange}
formData={formData}
errors={errors}
/>
</div>
{this.renderAllFormErrors()}
<div className="actions">
<div>
<input
type="submit"
className="btn btn-primary"
disabled={!this.hasData() | this.props.isLoading}
value={gettext('Set New Password')}
/>
</div>
<div>
<p>{gettext('After changing your password you will sign in automatically.')}</p>
</div>
</div>
</form>
</AuthContent>
);
}
});
export default PasswordResetForm;
|
electron/app/app.js | midsnow/snowelectric |
// end globals
import React from 'react';
import { render } from 'react-dom'
import createBrowserHistory from 'history/lib/createBrowserHistory'
import { Router } from 'react-router'
import rootRoute from './routes';
import Debug from 'debug'
window.myDebug = Debug
render( <Router history={createBrowserHistory()} routes={rootRoute} />, document.getElementById('snowstreams'));
|
src/components/ChallengeControl.js | petercollingridge/math-for-programmers-prototype | import React from 'react';
import PropTypes from 'prop-types';
const ChallengeControl = ({ runTests }) => {
return (
<div className='ChallengeControl'>
<button onClick={runTests}>Run Tests (Ctrl/Cmd + Enter)</button>
<button
onClick={() =>
window.open(
'https://github.com/freecodecamp/' +
'math-for-programmers-prototype/issues'
)}
>
Bugs
</button>
</div>
);
};
ChallengeControl.propTypes = {
runTests: PropTypes.func
};
export default ChallengeControl;
|
client/__test__/components/DashboardNav.spec.js | sasili-adetunji/post-it-app-2 | import React from 'react';
import { shallow, render } from 'enzyme';
import DashboardNav from '../../components/protected/DashboardNav.jsx';
function setup() {
const props = {
onChange: () => {},
componentDidMount: () => {},
componentWillUnmount: () => {},
};
return shallow(<DashboardNav {...props} />);
}
describe(' DashboardNav Component', () => {
const component = setup();
it('renders without crashing', () => {
shallow(<DashboardNav />);
});
it('renders Create Group', () => {
expect(component.find('CreateGroup').length).toEqual(1);
});
it('renders GroupList components', () => {
expect(component.find('GroupList').length).toEqual(1);
});
it('renders Add Member components', () => {
expect(component.find('AddMember').length).toEqual(1);
});
it('renders UserList components', () => {
expect(component.find('UserList').length).toEqual(1);
});
});
|
src/components/dataVisualization/eCharts/BarYCategory.js | SmiletoSUN/react-redux-demo | import React from 'react';
import ECharts from 'echarts-for-react';
const option = {
title: {
text: '世界人口总量',
subtext: '数据来自网络',
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
},
legend: {
data: ['2011年', '2012年'],
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01],
},
xAxis: {
type: 'category',
data: ['巴西', '印尼', '美国', '印度', '中国', '世界人口(万)'],
},
series: [
{
name: '2011年',
type: 'bar',
data: [18203, 23489, 29034, 104970, 131744, 630230],
},
{
name: '2012年',
type: 'bar',
data: [19325, 23438, 31000, 121594, 134141, 681807],
},
],
};
const BarStack = () => (
<ECharts
option={option}
className="react_for_echarts"
/>
);
export default BarStack;
|
lib/ImageCache.js | VonD/react-canvas | 'use strict';
var EventEmitter = require('events');
var assign = require('react/lib/Object.assign');
var NOOP = function () {};
function Img (src) {
this._originalSrc = src;
this._img = new Image();
this._img.onload = this.emit.bind(this, 'load');
this._img.onerror = this.emit.bind(this, 'error');
this._img.src = src;
// The default impl of events emitter will throw on any 'error' event unless
// there is at least 1 handler. Logging anything in this case is unnecessary
// since the browser console will log it too.
this.on('error', NOOP);
// Default is just 10.
this.setMaxListeners(100);
}
assign(Img.prototype, EventEmitter.prototype, {
/**
* Pooling owner looks for this
*/
destructor: function () {
// Make sure we aren't leaking callbacks.
this.removeAllListeners();
},
/**
* Retrieve the original image URL before browser normalization
*
* @return {String}
*/
getOriginalSrc: function () {
return this._originalSrc;
},
/**
* Retrieve a reference to the underyling <img> node.
*
* @return {HTMLImageElement}
*/
getRawImage: function () {
return this._img;
},
/**
* Retrieve the loaded image width
*
* @return {Number}
*/
getWidth: function () {
return this._img.naturalWidth;
},
/**
* Retrieve the loaded image height
*
* @return {Number}
*/
getHeight: function () {
return this._img.naturalHeight;
},
/**
* @return {Bool}
*/
isLoaded: function () {
return this._img.naturalHeight > 0;
}
});
var kInstancePoolLength = 300;
var _instancePool = {
length: 0,
// Keep all the nodes in memory.
elements: {
},
// Push with 0 frequency
push: function (hash, data) {
this.length++;
this.elements[hash] = {
hash: hash, // Helps identifying
freq: 0,
data: data
};
},
get: function (path) {
var element = this.elements[path];
if( element ){
element.freq++;
return element.data;
}
return null;
},
// used to explicitely remove the path
removeElement: function (path) {
// Now almighty GC can claim this soul
var element = this.elements[path];
delete this.elements[path];
this.length--;
return element;
},
_reduceLeastUsed: function (least, currentHash) {
var current = _instancePool.elements[currentHash];
if( least.freq > current.freq ){
return current;
}
return least;
},
popLeastUsed: function () {
var reducer = _instancePool._reduceLeastUsed;
var minUsed = Object.keys(this.elements).reduce(reducer, { freq: Infinity });
if( minUsed.hash ){
return this.removeElement(minUsed.hash);
}
return null;
}
};
var ImageCache = {
/**
* Retrieve an image from the cache
*
* @return {Img}
*/
get: function (src) {
var image = _instancePool.get(src);
if (!image) {
// Awesome LRU
image = new Img(src);
if (_instancePool.length >= kInstancePoolLength) {
_instancePool.popLeastUsed().destructor();
}
_instancePool.push(image.getOriginalSrc(), image);
}
return image;
}
};
module.exports = ImageCache;
|
ajax/libs/react-popper/0.7.2/react-popper.js | sashberd/cdnjs | /*!
* React Popper 0.7.2
* https://github.com/souporserious/react-popper
* Copyright (c) 2017 React Popper Authors
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"), require("prop-types"));
else if(typeof define === 'function' && define.amd)
define(["react", "prop-types"], factory);
else if(typeof exports === 'object')
exports["ReactPopper"] = factory(require("react"), require("prop-types"));
else
root["ReactPopper"] = factory(root["React"], root["PropTypes"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "dist/";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Arrow = exports.Popper = exports.Target = exports.Manager = undefined;
var _Manager2 = __webpack_require__(1);
var _Manager3 = _interopRequireDefault(_Manager2);
var _Target2 = __webpack_require__(4);
var _Target3 = _interopRequireDefault(_Target2);
var _Popper2 = __webpack_require__(5);
var _Popper3 = _interopRequireDefault(_Popper2);
var _Arrow2 = __webpack_require__(9);
var _Arrow3 = _interopRequireDefault(_Arrow2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.Manager = _Manager3.default;
exports.Target = _Target3.default;
exports.Popper = _Popper3.default;
exports.Arrow = _Arrow3.default;
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
'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 = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(3);
var _propTypes2 = _interopRequireDefault(_propTypes);
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 Manager = function (_Component) {
_inherits(Manager, _Component);
function Manager() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Manager);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Manager.__proto__ || Object.getPrototypeOf(Manager)).call.apply(_ref, [this].concat(args))), _this), _this._setTargetNode = function (node) {
_this._targetNode = node;
}, _this._getTargetNode = function () {
return _this._targetNode;
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Manager, [{
key: 'getChildContext',
value: function getChildContext() {
return {
popperManager: {
setTargetNode: this._setTargetNode,
getTargetNode: this._getTargetNode
}
};
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
tag = _props.tag,
children = _props.children,
restProps = _objectWithoutProperties(_props, ['tag', 'children']);
if (tag !== false) {
return (0, _react.createElement)(tag, restProps, children);
} else {
return children;
}
}
}]);
return Manager;
}(_react.Component);
Manager.childContextTypes = {
popperManager: _propTypes2.default.object.isRequired
};
Manager.propTypes = {
tag: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.bool])
};
Manager.defaultProps = {
tag: 'div'
};
exports.default = Manager;
/***/ }),
/* 2 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
/***/ }),
/* 3 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(3);
var _propTypes2 = _interopRequireDefault(_propTypes);
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; }
var Target = function Target(props, context) {
var _props$component = props.component,
component = _props$component === undefined ? 'div' : _props$component,
innerRef = props.innerRef,
children = props.children,
restProps = _objectWithoutProperties(props, ['component', 'innerRef', 'children']);
var popperManager = context.popperManager;
var targetRef = function targetRef(node) {
popperManager.setTargetNode(node);
if (typeof innerRef === 'function') {
innerRef(node);
}
};
if (typeof children === 'function') {
var targetProps = { ref: targetRef };
return children({ targetProps: targetProps, restProps: restProps });
}
var componentProps = _extends({}, restProps);
if (typeof component === 'string') {
componentProps.ref = targetRef;
} else {
componentProps.innerRef = targetRef;
}
return (0, _react.createElement)(component, componentProps, children);
};
Target.contextTypes = {
popperManager: _propTypes2.default.object.isRequired
};
Target.propTypes = {
component: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]),
innerRef: _propTypes2.default.func,
children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func])
};
exports.default = Target;
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
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 = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(3);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _popper = __webpack_require__(6);
var _popper2 = _interopRequireDefault(_popper);
var _isEqualShallow = __webpack_require__(7);
var _isEqualShallow2 = _interopRequireDefault(_isEqualShallow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return 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 noop = function noop() {
return null;
};
var Popper = function (_Component) {
_inherits(Popper, _Component);
function Popper() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Popper);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Popper.__proto__ || Object.getPrototypeOf(Popper)).call.apply(_ref, [this].concat(args))), _this), _this.state = {}, _this._setArrowNode = function (node) {
_this._arrowNode = node;
}, _this._getTargetNode = function () {
return _this.context.popperManager.getTargetNode();
}, _this._updateStateModifier = {
enabled: true,
order: 900,
fn: function fn(data) {
if (_this.state.data && !(0, _isEqualShallow2.default)(data.offsets, _this.state.data.offsets) || !_this.state.data) {
_this.setState({ data: data });
}
return data;
}
}, _this._getPopperStyle = function () {
var data = _this.state.data;
// If Popper isn't instantiated, hide the popperElement
// to avoid flash of unstyled content
if (!_this._popper || !data) {
return {
position: 'absolute',
pointerEvents: 'none',
opacity: 0
};
}
var _data$offsets$popper = data.offsets.popper,
top = _data$offsets$popper.top,
left = _data$offsets$popper.left,
position = _data$offsets$popper.position;
return _extends({
position: position
}, data.styles);
}, _this._getPopperPlacement = function () {
return !!_this.state.data ? _this.state.data.placement : undefined;
}, _this._getArrowStyle = function () {
if (!_this.state.data || !_this.state.data.offsets.arrow) {
return {};
} else {
var _this$state$data$offs = _this.state.data.offsets.arrow,
top = _this$state$data$offs.top,
left = _this$state$data$offs.left;
return { top: top, left: left };
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Popper, [{
key: 'getChildContext',
value: function getChildContext() {
return {
popper: {
setArrowNode: this._setArrowNode,
getArrowStyle: this._getArrowStyle
}
};
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
this._updatePopper();
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(lastProps) {
if (lastProps.placement !== this.props.placement || lastProps.eventsEnabled !== this.props.eventsEnabled) {
this._updatePopper();
}
if (this._popper && lastProps.children !== this.props.children) {
this._popper.scheduleUpdate();
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this._destroyPopper();
}
}, {
key: '_updatePopper',
value: function _updatePopper() {
this._destroyPopper();
if (this._node) {
this._createPopper();
}
}
}, {
key: '_createPopper',
value: function _createPopper() {
var _props = this.props,
placement = _props.placement,
eventsEnabled = _props.eventsEnabled;
var modifiers = _extends({}, this.props.modifiers, {
applyStyle: { enabled: false },
updateState: this._updateStateModifier
});
if (this._arrowNode) {
modifiers.arrow = {
element: this._arrowNode
};
}
this._popper = new _popper2.default(this._getTargetNode(), this._node, {
placement: placement,
eventsEnabled: eventsEnabled,
modifiers: modifiers
});
// schedule an update to make sure everything gets positioned correct
// after being instantiated
this._popper.scheduleUpdate();
}
}, {
key: '_destroyPopper',
value: function _destroyPopper() {
if (this._popper) {
this._popper.destroy();
}
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var _props2 = this.props,
component = _props2.component,
innerRef = _props2.innerRef,
placement = _props2.placement,
eventsEnabled = _props2.eventsEnabled,
modifiers = _props2.modifiers,
children = _props2.children,
restProps = _objectWithoutProperties(_props2, ['component', 'innerRef', 'placement', 'eventsEnabled', 'modifiers', 'children']);
var popperRef = function popperRef(node) {
_this2._node = node;
if (typeof innerRef === 'function') {
innerRef(node);
}
};
var popperStyle = this._getPopperStyle();
var popperPlacement = this._getPopperPlacement();
if (typeof children === 'function') {
var popperProps = _defineProperty({
ref: popperRef,
style: popperStyle
}, 'data-placement', popperPlacement);
return children({
popperProps: popperProps,
restProps: restProps,
scheduleUpdate: this._popper && this._popper.scheduleUpdate
});
}
var componentProps = _extends({}, restProps, {
style: _extends({}, restProps.style, popperStyle),
'data-placement': popperPlacement
});
if (typeof component === 'string') {
componentProps.ref = popperRef;
} else {
componentProps.innerRef = popperRef;
}
return (0, _react.createElement)(component, componentProps, children);
}
}]);
return Popper;
}(_react.Component);
Popper.contextTypes = {
popperManager: _propTypes2.default.object.isRequired
};
Popper.childContextTypes = {
popper: _propTypes2.default.object.isRequired
};
Popper.propTypes = {
component: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]),
innerRef: _propTypes2.default.func,
placement: _propTypes2.default.oneOf(_popper2.default.placements),
eventsEnabled: _propTypes2.default.bool,
modifiers: _propTypes2.default.object,
children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func])
};
Popper.defaultProps = {
component: 'div',
placement: 'bottom',
eventsEnabled: true,
modifiers: {}
};
exports.default = Popper;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global) {'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.10.8
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
(function (global, factory) {
( false ? 'undefined' : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : global.Popper = factory();
})(undefined, function () {
'use strict';
var nativeHints = ['native code', '[object MutationObserverConstructor]'];
/**
* Determine if a function is implemented natively (as opposed to a polyfill).
* @method
* @memberof Popper.Utils
* @argument {Function | undefined} fn the function to check
* @returns {Boolean}
*/
var isNative = function isNative(fn) {
return nativeHints.some(function (hint) {
return (fn || '').toString().indexOf(hint) > -1;
});
};
var isBrowser = typeof window !== 'undefined';
var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
var timeoutDuration = 0;
for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
timeoutDuration = 1;
break;
}
}
function microtaskDebounce(fn) {
var scheduled = false;
var i = 0;
var elem = document.createElement('span');
// MutationObserver provides a mechanism for scheduling microtasks, which
// are scheduled *before* the next task. This gives us a way to debounce
// a function but ensure it's called *before* the next paint.
var observer = new MutationObserver(function () {
fn();
scheduled = false;
});
observer.observe(elem, { attributes: true });
return function () {
if (!scheduled) {
scheduled = true;
elem.setAttribute('x-index', i);
i = i + 1; // don't use compund (+=) because it doesn't get optimized in V8
}
};
}
function taskDebounce(fn) {
var scheduled = false;
return function () {
if (!scheduled) {
scheduled = true;
setTimeout(function () {
scheduled = false;
fn();
}, timeoutDuration);
}
};
}
// It's common for MutationObserver polyfills to be seen in the wild, however
// these rely on Mutation Events which only occur when an element is connected
// to the DOM. The algorithm used in this module does not use a connected element,
// and so we must ensure that a *native* MutationObserver is available.
var supportsNativeMutationObserver = isBrowser && isNative(window.MutationObserver);
/**
* Create a debounced version of a method, that's asynchronously deferred
* but called in the minimum time possible.
*
* @method
* @memberof Popper.Utils
* @argument {Function} fn
* @returns {Function}
*/
var debounce = supportsNativeMutationObserver ? microtaskDebounce : taskDebounce;
/**
* Check if the given variable is a function
* @method
* @memberof Popper.Utils
* @argument {Any} functionToCheck - variable to check
* @returns {Boolean} answer to: is a function?
*/
function isFunction(functionToCheck) {
var getType = {};
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
}
/**
* Get CSS computed property of the given element
* @method
* @memberof Popper.Utils
* @argument {Eement} element
* @argument {String} property
*/
function getStyleComputedProperty(element, property) {
if (element.nodeType !== 1) {
return [];
}
// NOTE: 1 DOM access here
var css = window.getComputedStyle(element, null);
return property ? css[property] : css;
}
/**
* Returns the parentNode or the host of the element
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @returns {Element} parent
*/
function getParentNode(element) {
if (element.nodeName === 'HTML') {
return element;
}
return element.parentNode || element.host;
}
/**
* Returns the scrolling parent of the given element
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @returns {Element} scroll parent
*/
function getScrollParent(element) {
// Return body, `getScroll` will take care to get the correct `scrollTop` from it
if (!element || ['HTML', 'BODY', '#document'].indexOf(element.nodeName) !== -1) {
return window.document.body;
}
// Firefox want us to check `-x` and `-y` variations as well
var _getStyleComputedProp = getStyleComputedProperty(element),
overflow = _getStyleComputedProp.overflow,
overflowX = _getStyleComputedProp.overflowX,
overflowY = _getStyleComputedProp.overflowY;
if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) {
return element;
}
return getScrollParent(getParentNode(element));
}
function isOffsetContainer(element) {
var nodeName = element.nodeName;
if (nodeName === 'BODY') {
return false;
}
return nodeName === 'HTML' || element.firstElementChild.offsetParent === element;
}
/**
* Finds the root node (document, shadowDOM root) of the given element
* @method
* @memberof Popper.Utils
* @argument {Element} node
* @returns {Element} root node
*/
function getRoot(node) {
if (node.parentNode !== null) {
return getRoot(node.parentNode);
}
return node;
}
/**
* Returns the offset parent of the given element
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @returns {Element} offset parent
*/
function getOffsetParent(element) {
// NOTE: 1 DOM access here
var offsetParent = element && element.offsetParent;
var nodeName = offsetParent && offsetParent.nodeName;
if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
return window.document.documentElement;
}
return offsetParent;
}
/**
* Finds the offset parent common to the two provided nodes
* @method
* @memberof Popper.Utils
* @argument {Element} element1
* @argument {Element} element2
* @returns {Element} common offset parent
*/
function findCommonOffsetParent(element1, element2) {
// This check is needed to avoid errors in case one of the elements isn't defined for any reason
if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
return window.document.documentElement;
}
// Here we make sure to give as "start" the element that comes first in the DOM
var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
var start = order ? element1 : element2;
var end = order ? element2 : element1;
// Get common ancestor container
var range = document.createRange();
range.setStart(start, 0);
range.setEnd(end, 0);
var commonAncestorContainer = range.commonAncestorContainer;
// Both nodes are inside #document
if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
if (isOffsetContainer(commonAncestorContainer)) {
return commonAncestorContainer;
}
return getOffsetParent(commonAncestorContainer);
}
// one of the nodes is inside shadowDOM, find which one
var element1root = getRoot(element1);
if (element1root.host) {
return findCommonOffsetParent(element1root.host, element2);
} else {
return findCommonOffsetParent(element1, getRoot(element2).host);
}
}
/**
* Gets the scroll value of the given element in the given side (top and left)
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @argument {String} side `top` or `left`
* @returns {number} amount of scrolled pixels
*/
function getScroll(element) {
var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
var nodeName = element.nodeName;
if (nodeName === 'BODY' || nodeName === 'HTML') {
var html = window.document.documentElement;
var scrollingElement = window.document.scrollingElement || html;
return scrollingElement[upperSide];
}
return element[upperSide];
}
/*
* Sum or subtract the element scroll values (left and top) from a given rect object
* @method
* @memberof Popper.Utils
* @param {Object} rect - Rect object you want to change
* @param {HTMLElement} element - The element from the function reads the scroll values
* @param {Boolean} subtract - set to true if you want to subtract the scroll values
* @return {Object} rect - The modifier rect object
*/
function includeScroll(rect, element) {
var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var scrollTop = getScroll(element, 'top');
var scrollLeft = getScroll(element, 'left');
var modifier = subtract ? -1 : 1;
rect.top += scrollTop * modifier;
rect.bottom += scrollTop * modifier;
rect.left += scrollLeft * modifier;
rect.right += scrollLeft * modifier;
return rect;
}
/*
* Helper to detect borders of a given element
* @method
* @memberof Popper.Utils
* @param {CSSStyleDeclaration} styles
* Result of `getStyleComputedProperty` on the given element
* @param {String} axis - `x` or `y`
* @return {number} borders - The borders size of the given axis
*/
function getBordersSize(styles, axis) {
var sideA = axis === 'x' ? 'Left' : 'Top';
var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
return +styles['border' + sideA + 'Width'].split('px')[0] + +styles['border' + sideB + 'Width'].split('px')[0];
}
/**
* Tells if you are running Internet Explorer 10
* @method
* @memberof Popper.Utils
* @returns {Boolean} isIE10
*/
var isIE10 = undefined;
var isIE10$1 = function isIE10$1() {
if (isIE10 === undefined) {
isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1;
}
return isIE10;
};
function getSize(axis, body, html, computedStyle) {
return Math.max(body['offset' + axis], html['client' + axis], html['offset' + axis], isIE10$1() ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);
}
function getWindowSizes() {
var body = window.document.body;
var html = window.document.documentElement;
var computedStyle = isIE10$1() && window.getComputedStyle(html);
return {
height: getSize('Height', body, html, computedStyle),
width: getSize('Width', body, html, computedStyle)
};
}
var classCallCheck = function classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
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 defineProperty = function defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
};
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
/**
* Given element offsets, generate an output similar to getBoundingClientRect
* @method
* @memberof Popper.Utils
* @argument {Object} offsets
* @returns {Object} ClientRect like output
*/
function getClientRect(offsets) {
return _extends({}, offsets, {
right: offsets.left + offsets.width,
bottom: offsets.top + offsets.height
});
}
/**
* Get bounding client rect of given element
* @method
* @memberof Popper.Utils
* @param {HTMLElement} element
* @return {Object} client rect
*/
function getBoundingClientRect(element) {
var rect = {};
// IE10 10 FIX: Please, don't ask, the element isn't
// considered in DOM in some circumstances...
// This isn't reproducible in IE10 compatibility mode of IE11
if (isIE10$1()) {
try {
rect = element.getBoundingClientRect();
var scrollTop = getScroll(element, 'top');
var scrollLeft = getScroll(element, 'left');
rect.top += scrollTop;
rect.left += scrollLeft;
rect.bottom += scrollTop;
rect.right += scrollLeft;
} catch (err) {}
} else {
rect = element.getBoundingClientRect();
}
var result = {
left: rect.left,
top: rect.top,
width: rect.right - rect.left,
height: rect.bottom - rect.top
};
// subtract scrollbar size from sizes
var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {};
var width = sizes.width || element.clientWidth || result.right - result.left;
var height = sizes.height || element.clientHeight || result.bottom - result.top;
var horizScrollbar = element.offsetWidth - width;
var vertScrollbar = element.offsetHeight - height;
// if an hypothetical scrollbar is detected, we must be sure it's not a `border`
// we make this check conditional for performance reasons
if (horizScrollbar || vertScrollbar) {
var styles = getStyleComputedProperty(element);
horizScrollbar -= getBordersSize(styles, 'x');
vertScrollbar -= getBordersSize(styles, 'y');
result.width -= horizScrollbar;
result.height -= vertScrollbar;
}
return getClientRect(result);
}
function getOffsetRectRelativeToArbitraryNode(children, parent) {
var isIE10 = isIE10$1();
var isHTML = parent.nodeName === 'HTML';
var childrenRect = getBoundingClientRect(children);
var parentRect = getBoundingClientRect(parent);
var scrollParent = getScrollParent(children);
var styles = getStyleComputedProperty(parent);
var borderTopWidth = +styles.borderTopWidth.split('px')[0];
var borderLeftWidth = +styles.borderLeftWidth.split('px')[0];
var offsets = getClientRect({
top: childrenRect.top - parentRect.top - borderTopWidth,
left: childrenRect.left - parentRect.left - borderLeftWidth,
width: childrenRect.width,
height: childrenRect.height
});
offsets.marginTop = 0;
offsets.marginLeft = 0;
// Subtract margins of documentElement in case it's being used as parent
// we do this only on HTML because it's the only element that behaves
// differently when margins are applied to it. The margins are included in
// the box of the documentElement, in the other cases not.
if (!isIE10 && isHTML) {
var marginTop = +styles.marginTop.split('px')[0];
var marginLeft = +styles.marginLeft.split('px')[0];
offsets.top -= borderTopWidth - marginTop;
offsets.bottom -= borderTopWidth - marginTop;
offsets.left -= borderLeftWidth - marginLeft;
offsets.right -= borderLeftWidth - marginLeft;
// Attach marginTop and marginLeft because in some circumstances we may need them
offsets.marginTop = marginTop;
offsets.marginLeft = marginLeft;
}
if (isIE10 ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
offsets = includeScroll(offsets, parent);
}
return offsets;
}
function getViewportOffsetRectRelativeToArtbitraryNode(element) {
var html = window.document.documentElement;
var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
var width = Math.max(html.clientWidth, window.innerWidth || 0);
var height = Math.max(html.clientHeight, window.innerHeight || 0);
var scrollTop = getScroll(html);
var scrollLeft = getScroll(html, 'left');
var offset = {
top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
width: width,
height: height
};
return getClientRect(offset);
}
/**
* Check if the given element is fixed or is inside a fixed parent
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @argument {Element} customContainer
* @returns {Boolean} answer to "isFixed?"
*/
function isFixed(element) {
var nodeName = element.nodeName;
if (nodeName === 'BODY' || nodeName === 'HTML') {
return false;
}
if (getStyleComputedProperty(element, 'position') === 'fixed') {
return true;
}
return isFixed(getParentNode(element));
}
/**
* Computed the boundaries limits and return them
* @method
* @memberof Popper.Utils
* @param {HTMLElement} popper
* @param {HTMLElement} reference
* @param {number} padding
* @param {HTMLElement} boundariesElement - Element used to define the boundaries
* @returns {Object} Coordinates of the boundaries
*/
function getBoundaries(popper, reference, padding, boundariesElement) {
// NOTE: 1 DOM access here
var boundaries = { top: 0, left: 0 };
var offsetParent = findCommonOffsetParent(popper, reference);
// Handle viewport case
if (boundariesElement === 'viewport') {
boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent);
} else {
// Handle other cases based on DOM element used as boundaries
var boundariesNode = void 0;
if (boundariesElement === 'scrollParent') {
boundariesNode = getScrollParent(getParentNode(popper));
if (boundariesNode.nodeName === 'BODY') {
boundariesNode = window.document.documentElement;
}
} else if (boundariesElement === 'window') {
boundariesNode = window.document.documentElement;
} else {
boundariesNode = boundariesElement;
}
var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent);
// In case of HTML, we need a different computation
if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
var _getWindowSizes = getWindowSizes(),
height = _getWindowSizes.height,
width = _getWindowSizes.width;
boundaries.top += offsets.top - offsets.marginTop;
boundaries.bottom = height + offsets.top;
boundaries.left += offsets.left - offsets.marginLeft;
boundaries.right = width + offsets.left;
} else {
// for all the other DOM elements, this one is good
boundaries = offsets;
}
}
// Add paddings
boundaries.left += padding;
boundaries.top += padding;
boundaries.right -= padding;
boundaries.bottom -= padding;
return boundaries;
}
function getArea(_ref) {
var width = _ref.width,
height = _ref.height;
return width * height;
}
/**
* Utility used to transform the `auto` placement to the placement with more
* available space.
* @method
* @memberof Popper.Utils
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
if (placement.indexOf('auto') === -1) {
return placement;
}
var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
var rects = {
top: {
width: boundaries.width,
height: refRect.top - boundaries.top
},
right: {
width: boundaries.right - refRect.right,
height: boundaries.height
},
bottom: {
width: boundaries.width,
height: boundaries.bottom - refRect.bottom
},
left: {
width: refRect.left - boundaries.left,
height: boundaries.height
}
};
var sortedAreas = Object.keys(rects).map(function (key) {
return _extends({
key: key
}, rects[key], {
area: getArea(rects[key])
});
}).sort(function (a, b) {
return b.area - a.area;
});
var filteredAreas = sortedAreas.filter(function (_ref2) {
var width = _ref2.width,
height = _ref2.height;
return width >= popper.clientWidth && height >= popper.clientHeight;
});
var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
var variation = placement.split('-')[1];
return computedPlacement + (variation ? '-' + variation : '');
}
/**
* Get offsets to the reference element
* @method
* @memberof Popper.Utils
* @param {Object} state
* @param {Element} popper - the popper element
* @param {Element} reference - the reference element (the popper will be relative to this)
* @returns {Object} An object containing the offsets which will be applied to the popper
*/
function getReferenceOffsets(state, popper, reference) {
var commonOffsetParent = findCommonOffsetParent(popper, reference);
return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent);
}
/**
* Get the outer sizes of the given element (offset size + margins)
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @returns {Object} object containing width and height properties
*/
function getOuterSizes(element) {
var styles = window.getComputedStyle(element);
var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
var result = {
width: element.offsetWidth + y,
height: element.offsetHeight + x
};
return result;
}
/**
* Get the opposite placement of the given one
* @method
* @memberof Popper.Utils
* @argument {String} placement
* @returns {String} flipped placement
*/
function getOppositePlacement(placement) {
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
return placement.replace(/left|right|bottom|top/g, function (matched) {
return hash[matched];
});
}
/**
* Get offsets to the popper
* @method
* @memberof Popper.Utils
* @param {Object} position - CSS position the Popper will get applied
* @param {HTMLElement} popper - the popper element
* @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
* @param {String} placement - one of the valid placement options
* @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
*/
function getPopperOffsets(popper, referenceOffsets, placement) {
placement = placement.split('-')[0];
// Get popper node sizes
var popperRect = getOuterSizes(popper);
// Add position, width and height to our offsets object
var popperOffsets = {
width: popperRect.width,
height: popperRect.height
};
// depending by the popper placement we have to compute its offsets slightly differently
var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
var mainSide = isHoriz ? 'top' : 'left';
var secondarySide = isHoriz ? 'left' : 'top';
var measurement = isHoriz ? 'height' : 'width';
var secondaryMeasurement = !isHoriz ? 'height' : 'width';
popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
if (placement === secondarySide) {
popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
} else {
popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
}
return popperOffsets;
}
/**
* Mimics the `find` method of Array
* @method
* @memberof Popper.Utils
* @argument {Array} arr
* @argument prop
* @argument value
* @returns index or -1
*/
function find(arr, check) {
// use native find if supported
if (Array.prototype.find) {
return arr.find(check);
}
// use `filter` to obtain the same behavior of `find`
return arr.filter(check)[0];
}
/**
* Return the index of the matching object
* @method
* @memberof Popper.Utils
* @argument {Array} arr
* @argument prop
* @argument value
* @returns index or -1
*/
function findIndex(arr, prop, value) {
// use native findIndex if supported
if (Array.prototype.findIndex) {
return arr.findIndex(function (cur) {
return cur[prop] === value;
});
}
// use `find` + `indexOf` if `findIndex` isn't supported
var match = find(arr, function (obj) {
return obj[prop] === value;
});
return arr.indexOf(match);
}
/**
* Loop trough the list of modifiers and run them in order,
* each of them will then edit the data object.
* @method
* @memberof Popper.Utils
* @param {dataObject} data
* @param {Array} modifiers
* @param {String} ends - Optional modifier name used as stopper
* @returns {dataObject}
*/
function runModifiers(modifiers, data, ends) {
var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
modifiersToRun.forEach(function (modifier) {
if (modifier.function) {
console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
}
var fn = modifier.function || modifier.fn;
if (modifier.enabled && isFunction(fn)) {
// Add properties to offsets to make them a complete clientRect object
// we do this before each modifier to make sure the previous one doesn't
// mess with these values
data.offsets.popper = getClientRect(data.offsets.popper);
data.offsets.reference = getClientRect(data.offsets.reference);
data = fn(data, modifier);
}
});
return data;
}
/**
* Updates the position of the popper, computing the new offsets and applying
* the new style.<br />
* Prefer `scheduleUpdate` over `update` because of performance reasons.
* @method
* @memberof Popper
*/
function update() {
// if popper is destroyed, don't perform any further update
if (this.state.isDestroyed) {
return;
}
var data = {
instance: this,
styles: {},
attributes: {},
flipped: false,
offsets: {}
};
// compute reference element offsets
data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference);
// compute auto placement, store placement inside the data object,
// modifiers will be able to edit `placement` if needed
// and refer to originalPlacement to know the original value
data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
// store the computed placement inside `originalPlacement`
data.originalPlacement = data.placement;
// compute the popper offsets
data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
data.offsets.popper.position = 'absolute';
// run the modifiers
data = runModifiers(this.modifiers, data);
// the first `update` will call `onCreate` callback
// the other ones will call `onUpdate` callback
if (!this.state.isCreated) {
this.state.isCreated = true;
this.options.onCreate(data);
} else {
this.options.onUpdate(data);
}
}
/**
* Helper used to know if the given modifier is enabled.
* @method
* @memberof Popper.Utils
* @returns {Boolean}
*/
function isModifierEnabled(modifiers, modifierName) {
return modifiers.some(function (_ref) {
var name = _ref.name,
enabled = _ref.enabled;
return enabled && name === modifierName;
});
}
/**
* Get the prefixed supported property name
* @method
* @memberof Popper.Utils
* @argument {String} property (camelCase)
* @returns {String} prefixed property (camelCase)
*/
function getSupportedPropertyName(property) {
var prefixes = [false, 'ms', 'webkit', 'moz', 'o'];
var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
for (var i = 0; i < prefixes.length - 1; i++) {
var prefix = prefixes[i];
var toCheck = prefix ? '' + prefix + upperProp : property;
if (typeof window.document.body.style[toCheck] !== 'undefined') {
return toCheck;
}
}
return null;
}
/**
* Destroy the popper
* @method
* @memberof Popper
*/
function destroy() {
this.state.isDestroyed = true;
// touch DOM only if `applyStyle` modifier is enabled
if (isModifierEnabled(this.modifiers, 'applyStyle')) {
this.popper.removeAttribute('x-placement');
this.popper.style.left = '';
this.popper.style.position = '';
this.popper.style.top = '';
this.popper.style[getSupportedPropertyName('transform')] = '';
}
this.disableEventListeners();
// remove the popper if user explicity asked for the deletion on destroy
// do not use `remove` because IE11 doesn't support it
if (this.options.removeOnDestroy) {
this.popper.parentNode.removeChild(this.popper);
}
return this;
}
function attachToScrollParents(scrollParent, event, callback, scrollParents) {
var isBody = scrollParent.nodeName === 'BODY';
var target = isBody ? window : scrollParent;
target.addEventListener(event, callback, { passive: true });
if (!isBody) {
attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
}
scrollParents.push(target);
}
/**
* Setup needed event listeners used to update the popper position
* @method
* @memberof Popper.Utils
* @private
*/
function setupEventListeners(reference, options, state, updateBound) {
// Resize event listener on window
state.updateBound = updateBound;
window.addEventListener('resize', state.updateBound, { passive: true });
// Scroll event listener on scroll parents
var scrollElement = getScrollParent(reference);
attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
state.scrollElement = scrollElement;
state.eventsEnabled = true;
return state;
}
/**
* It will add resize/scroll events and start recalculating
* position of the popper element when they are triggered.
* @method
* @memberof Popper
*/
function enableEventListeners() {
if (!this.state.eventsEnabled) {
this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
}
}
/**
* Remove event listeners used to update the popper position
* @method
* @memberof Popper.Utils
* @private
*/
function removeEventListeners(reference, state) {
// Remove resize event listener on window
window.removeEventListener('resize', state.updateBound);
// Remove scroll event listener on scroll parents
state.scrollParents.forEach(function (target) {
target.removeEventListener('scroll', state.updateBound);
});
// Reset state
state.updateBound = null;
state.scrollParents = [];
state.scrollElement = null;
state.eventsEnabled = false;
return state;
}
/**
* It will remove resize/scroll events and won't recalculate popper position
* when they are triggered. It also won't trigger onUpdate callback anymore,
* unless you call `update` method manually.
* @method
* @memberof Popper
*/
function disableEventListeners() {
if (this.state.eventsEnabled) {
window.cancelAnimationFrame(this.scheduleUpdate);
this.state = removeEventListeners(this.reference, this.state);
}
}
/**
* Tells if a given input is a number
* @method
* @memberof Popper.Utils
* @param {*} input to check
* @return {Boolean}
*/
function isNumeric(n) {
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
}
/**
* Set the style to the given popper
* @method
* @memberof Popper.Utils
* @argument {Element} element - Element to apply the style to
* @argument {Object} styles
* Object with a list of properties and values which will be applied to the element
*/
function setStyles(element, styles) {
Object.keys(styles).forEach(function (prop) {
var unit = '';
// add unit if the value is numeric and is one of the following
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
unit = 'px';
}
element.style[prop] = styles[prop] + unit;
});
}
/**
* Set the attributes to the given popper
* @method
* @memberof Popper.Utils
* @argument {Element} element - Element to apply the attributes to
* @argument {Object} styles
* Object with a list of properties and values which will be applied to the element
*/
function setAttributes(element, attributes) {
Object.keys(attributes).forEach(function (prop) {
var value = attributes[prop];
if (value !== false) {
element.setAttribute(prop, attributes[prop]);
} else {
element.removeAttribute(prop);
}
});
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by `update` method
* @argument {Object} data.styles - List of style properties - values to apply to popper element
* @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The same data object
*/
function applyStyle(data) {
// any property present in `data.styles` will be applied to the popper,
// in this way we can make the 3rd party modifiers add custom styles to it
// Be aware, modifiers could override the properties defined in the previous
// lines of this modifier!
setStyles(data.instance.popper, data.styles);
// any property present in `data.attributes` will be applied to the popper,
// they will be set as HTML attributes of the element
setAttributes(data.instance.popper, data.attributes);
// if the arrow style has been computed, apply the arrow style
if (data.offsets.arrow) {
setStyles(data.arrowElement, data.offsets.arrow);
}
return data;
}
/**
* Set the x-placement attribute before everything else because it could be used
* to add margins to the popper margins needs to be calculated to get the
* correct popper offsets.
* @method
* @memberof Popper.modifiers
* @param {HTMLElement} reference - The reference element used to position the popper
* @param {HTMLElement} popper - The HTML element used as popper.
* @param {Object} options - Popper.js options
*/
function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
// compute reference element offsets
var referenceOffsets = getReferenceOffsets(state, popper, reference);
// compute auto placement, store placement inside the data object,
// modifiers will be able to edit `placement` if needed
// and refer to originalPlacement to know the original value
var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
popper.setAttribute('x-placement', placement);
// Apply `position` to popper before anything else because
// without the position applied we can't guarantee correct computations
setStyles(popper, { position: 'absolute' });
return options;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by `update` method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function computeStyle(data, options) {
var x = options.x,
y = options.y;
var popper = data.offsets.popper;
// Remove this legacy support in Popper.js v2
var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
return modifier.name === 'applyStyle';
}).gpuAcceleration;
if (legacyGpuAccelerationOption !== undefined) {
console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
}
var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
var offsetParent = getOffsetParent(data.instance.popper);
var offsetParentRect = getBoundingClientRect(offsetParent);
// Styles
var styles = {
position: popper.position
};
// floor sides to avoid blurry text
var offsets = {
left: Math.floor(popper.left),
top: Math.floor(popper.top),
bottom: Math.floor(popper.bottom),
right: Math.floor(popper.right)
};
var sideA = x === 'bottom' ? 'top' : 'bottom';
var sideB = y === 'right' ? 'left' : 'right';
// if gpuAcceleration is set to `true` and transform is supported,
// we use `translate3d` to apply the position to the popper we
// automatically use the supported prefixed version if needed
var prefixedProperty = getSupportedPropertyName('transform');
// now, let's make a step back and look at this code closely (wtf?)
// If the content of the popper grows once it's been positioned, it
// may happen that the popper gets misplaced because of the new content
// overflowing its reference element
// To avoid this problem, we provide two options (x and y), which allow
// the consumer to define the offset origin.
// If we position a popper on top of a reference element, we can set
// `x` to `top` to make the popper grow towards its top instead of
// its bottom.
var left = void 0,
top = void 0;
if (sideA === 'bottom') {
top = -offsetParentRect.height + offsets.bottom;
} else {
top = offsets.top;
}
if (sideB === 'right') {
left = -offsetParentRect.width + offsets.right;
} else {
left = offsets.left;
}
if (gpuAcceleration && prefixedProperty) {
styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
styles[sideA] = 0;
styles[sideB] = 0;
styles.willChange = 'transform';
} else {
// othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
var invertTop = sideA === 'bottom' ? -1 : 1;
var invertLeft = sideB === 'right' ? -1 : 1;
styles[sideA] = top * invertTop;
styles[sideB] = left * invertLeft;
styles.willChange = sideA + ', ' + sideB;
}
// Attributes
var attributes = {
'x-placement': data.placement
};
// Update attributes and styles of `data`
data.attributes = _extends({}, attributes, data.attributes);
data.styles = _extends({}, styles, data.styles);
return data;
}
/**
* Helper used to know if the given modifier depends from another one.<br />
* It checks if the needed modifier is listed and enabled.
* @method
* @memberof Popper.Utils
* @param {Array} modifiers - list of modifiers
* @param {String} requestingName - name of requesting modifier
* @param {String} requestedName - name of requested modifier
* @returns {Boolean}
*/
function isModifierRequired(modifiers, requestingName, requestedName) {
var requesting = find(modifiers, function (_ref) {
var name = _ref.name;
return name === requestingName;
});
var isRequired = !!requesting && modifiers.some(function (modifier) {
return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
});
if (!isRequired) {
var _requesting = '`' + requestingName + '`';
var requested = '`' + requestedName + '`';
console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
}
return isRequired;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function arrow(data, options) {
// arrow depends on keepTogether in order to work
if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
return data;
}
var arrowElement = options.element;
// if arrowElement is a string, suppose it's a CSS selector
if (typeof arrowElement === 'string') {
arrowElement = data.instance.popper.querySelector(arrowElement);
// if arrowElement is not found, don't run the modifier
if (!arrowElement) {
return data;
}
} else {
// if the arrowElement isn't a query selector we must check that the
// provided DOM node is child of its popper node
if (!data.instance.popper.contains(arrowElement)) {
console.warn('WARNING: `arrow.element` must be child of its popper element!');
return data;
}
}
var placement = data.placement.split('-')[0];
var _data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
var len = isVertical ? 'height' : 'width';
var side = isVertical ? 'top' : 'left';
var altSide = isVertical ? 'left' : 'top';
var opSide = isVertical ? 'bottom' : 'right';
var arrowElementSize = getOuterSizes(arrowElement)[len];
//
// extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
//
// top/left side
if (reference[opSide] - arrowElementSize < popper[side]) {
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
}
// bottom/right side
if (reference[side] + arrowElementSize > popper[opSide]) {
data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
}
// compute center of the popper
var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
// Compute the sideValue using the updated popper offsets
var sideValue = center - getClientRect(data.offsets.popper)[side];
// prevent arrowElement from being placed not contiguously to its popper
sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
data.arrowElement = arrowElement;
data.offsets.arrow = {};
data.offsets.arrow[side] = Math.round(sideValue);
data.offsets.arrow[altSide] = ''; // make sure to unset any eventual altSide value from the DOM node
return data;
}
/**
* Get the opposite placement variation of the given one
* @method
* @memberof Popper.Utils
* @argument {String} placement variation
* @returns {String} flipped placement variation
*/
function getOppositeVariation(variation) {
if (variation === 'end') {
return 'start';
} else if (variation === 'start') {
return 'end';
}
return variation;
}
/**
* List of accepted placements to use as values of the `placement` option.<br />
* Valid placements are:
* - `auto`
* - `top`
* - `right`
* - `bottom`
* - `left`
*
* Each placement can have a variation from this list:
* - `-start`
* - `-end`
*
* Variations are interpreted easily if you think of them as the left to right
* written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
* is right.<br />
* Vertically (`left` and `right`), `start` is top and `end` is bottom.
*
* Some valid examples are:
* - `top-end` (on top of reference, right aligned)
* - `right-start` (on right of reference, top aligned)
* - `bottom` (on bottom, centered)
* - `auto-right` (on the side with more space available, alignment depends by placement)
*
* @static
* @type {Array}
* @enum {String}
* @readonly
* @method placements
* @memberof Popper
*/
var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
// Get rid of `auto` `auto-start` and `auto-end`
var validPlacements = placements.slice(3);
/**
* Given an initial placement, returns all the subsequent placements
* clockwise (or counter-clockwise).
*
* @method
* @memberof Popper.Utils
* @argument {String} placement - A valid placement (it accepts variations)
* @argument {Boolean} counter - Set to true to walk the placements counterclockwise
* @returns {Array} placements including their variations
*/
function clockwise(placement) {
var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var index = validPlacements.indexOf(placement);
var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
return counter ? arr.reverse() : arr;
}
var BEHAVIORS = {
FLIP: 'flip',
CLOCKWISE: 'clockwise',
COUNTERCLOCKWISE: 'counterclockwise'
};
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function flip(data, options) {
// if `inner` modifier is enabled, we can't use the `flip` modifier
if (isModifierEnabled(data.instance.modifiers, 'inner')) {
return data;
}
if (data.flipped && data.placement === data.originalPlacement) {
// seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
return data;
}
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement);
var placement = data.placement.split('-')[0];
var placementOpposite = getOppositePlacement(placement);
var variation = data.placement.split('-')[1] || '';
var flipOrder = [];
switch (options.behavior) {
case BEHAVIORS.FLIP:
flipOrder = [placement, placementOpposite];
break;
case BEHAVIORS.CLOCKWISE:
flipOrder = clockwise(placement);
break;
case BEHAVIORS.COUNTERCLOCKWISE:
flipOrder = clockwise(placement, true);
break;
default:
flipOrder = options.behavior;
}
flipOrder.forEach(function (step, index) {
if (placement !== step || flipOrder.length === index + 1) {
return data;
}
placement = data.placement.split('-')[0];
placementOpposite = getOppositePlacement(placement);
var popperOffsets = data.offsets.popper;
var refOffsets = data.offsets.reference;
// using floor because the reference offsets may contain decimals we are not going to consider here
var floor = Math.floor;
var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
// flip the variation if required
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
if (overlapsRef || overflowsBoundaries || flippedVariation) {
// this boolean to detect any flip loop
data.flipped = true;
if (overlapsRef || overflowsBoundaries) {
placement = flipOrder[index + 1];
}
if (flippedVariation) {
variation = getOppositeVariation(variation);
}
data.placement = placement + (variation ? '-' + variation : '');
// this object contains `position`, we want to preserve it along with
// any additional property we may add in the future
data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
data = runModifiers(data.instance.modifiers, data, 'flip');
}
});
return data;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function keepTogether(data) {
var _data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var placement = data.placement.split('-')[0];
var floor = Math.floor;
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
var side = isVertical ? 'right' : 'bottom';
var opSide = isVertical ? 'left' : 'top';
var measurement = isVertical ? 'width' : 'height';
if (popper[side] < floor(reference[opSide])) {
data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
}
if (popper[opSide] > floor(reference[side])) {
data.offsets.popper[opSide] = floor(reference[side]);
}
return data;
}
/**
* Converts a string containing value + unit into a px value number
* @function
* @memberof {modifiers~offset}
* @private
* @argument {String} str - Value + unit string
* @argument {String} measurement - `height` or `width`
* @argument {Object} popperOffsets
* @argument {Object} referenceOffsets
* @returns {Number|String}
* Value in pixels, or original string if no values were extracted
*/
function toValue(str, measurement, popperOffsets, referenceOffsets) {
// separate value from unit
var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
var value = +split[1];
var unit = split[2];
// If it's not a number it's an operator, I guess
if (!value) {
return str;
}
if (unit.indexOf('%') === 0) {
var element = void 0;
switch (unit) {
case '%p':
element = popperOffsets;
break;
case '%':
case '%r':
default:
element = referenceOffsets;
}
var rect = getClientRect(element);
return rect[measurement] / 100 * value;
} else if (unit === 'vh' || unit === 'vw') {
// if is a vh or vw, we calculate the size based on the viewport
var size = void 0;
if (unit === 'vh') {
size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
} else {
size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
}
return size / 100 * value;
} else {
// if is an explicit pixel unit, we get rid of the unit and keep the value
// if is an implicit unit, it's px, and we return just the value
return value;
}
}
/**
* Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
* @function
* @memberof {modifiers~offset}
* @private
* @argument {String} offset
* @argument {Object} popperOffsets
* @argument {Object} referenceOffsets
* @argument {String} basePlacement
* @returns {Array} a two cells array with x and y offsets in numbers
*/
function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
var offsets = [0, 0];
// Use height if placement is left or right and index is 0 otherwise use width
// in this way the first offset will use an axis and the second one
// will use the other one
var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
// Split the offset string to obtain a list of values and operands
// The regex addresses values with the plus or minus sign in front (+10, -20, etc)
var fragments = offset.split(/(\+|\-)/).map(function (frag) {
return frag.trim();
});
// Detect if the offset string contains a pair of values or a single one
// they could be separated by comma or space
var divider = fragments.indexOf(find(fragments, function (frag) {
return frag.search(/,|\s/) !== -1;
}));
if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
}
// If divider is found, we divide the list of values and operands to divide
// them by ofset X and Y.
var splitRegex = /\s*,\s*|\s+/;
var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
// Convert the values with units to absolute pixels to allow our computations
ops = ops.map(function (op, index) {
// Most of the units rely on the orientation of the popper
var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
var mergeWithPrevious = false;
return op
// This aggregates any `+` or `-` sign that aren't considered operators
// e.g.: 10 + +5 => [10, +, +5]
.reduce(function (a, b) {
if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
a[a.length - 1] = b;
mergeWithPrevious = true;
return a;
} else if (mergeWithPrevious) {
a[a.length - 1] += b;
mergeWithPrevious = false;
return a;
} else {
return a.concat(b);
}
}, [])
// Here we convert the string values into number values (in px)
.map(function (str) {
return toValue(str, measurement, popperOffsets, referenceOffsets);
});
});
// Loop trough the offsets arrays and execute the operations
ops.forEach(function (op, index) {
op.forEach(function (frag, index2) {
if (isNumeric(frag)) {
offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
}
});
});
return offsets;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @argument {Number|String} options.offset=0
* The offset value as described in the modifier description
* @returns {Object} The data object, properly modified
*/
function offset(data, _ref) {
var offset = _ref.offset;
var placement = data.placement,
_data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var basePlacement = placement.split('-')[0];
var offsets = void 0;
if (isNumeric(+offset)) {
offsets = [+offset, 0];
} else {
offsets = parseOffset(offset, popper, reference, basePlacement);
}
if (basePlacement === 'left') {
popper.top += offsets[0];
popper.left -= offsets[1];
} else if (basePlacement === 'right') {
popper.top += offsets[0];
popper.left += offsets[1];
} else if (basePlacement === 'top') {
popper.left += offsets[0];
popper.top -= offsets[1];
} else if (basePlacement === 'bottom') {
popper.left += offsets[0];
popper.top += offsets[1];
}
data.popper = popper;
return data;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by `update` method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function preventOverflow(data, options) {
var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
// If offsetParent is the reference element, we really want to
// go one step up and use the next offsetParent as reference to
// avoid to make this modifier completely useless and look like broken
if (data.instance.reference === boundariesElement) {
boundariesElement = getOffsetParent(boundariesElement);
}
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement);
options.boundaries = boundaries;
var order = options.priority;
var popper = data.offsets.popper;
var check = {
primary: function primary(placement) {
var value = popper[placement];
if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
value = Math.max(popper[placement], boundaries[placement]);
}
return defineProperty({}, placement, value);
},
secondary: function secondary(placement) {
var mainSide = placement === 'right' ? 'left' : 'top';
var value = popper[mainSide];
if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
}
return defineProperty({}, mainSide, value);
}
};
order.forEach(function (placement) {
var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
popper = _extends({}, popper, check[side](placement));
});
data.offsets.popper = popper;
return data;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by `update` method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function shift(data) {
var placement = data.placement;
var basePlacement = placement.split('-')[0];
var shiftvariation = placement.split('-')[1];
// if shift shiftvariation is specified, run the modifier
if (shiftvariation) {
var _data$offsets = data.offsets,
reference = _data$offsets.reference,
popper = _data$offsets.popper;
var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
var side = isVertical ? 'left' : 'top';
var measurement = isVertical ? 'width' : 'height';
var shiftOffsets = {
start: defineProperty({}, side, reference[side]),
end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
};
data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
}
return data;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function hide(data) {
if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
return data;
}
var refRect = data.offsets.reference;
var bound = find(data.instance.modifiers, function (modifier) {
return modifier.name === 'preventOverflow';
}).boundaries;
if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
// Avoid unnecessary DOM access if visibility hasn't changed
if (data.hide === true) {
return data;
}
data.hide = true;
data.attributes['x-out-of-boundaries'] = '';
} else {
// Avoid unnecessary DOM access if visibility hasn't changed
if (data.hide === false) {
return data;
}
data.hide = false;
data.attributes['x-out-of-boundaries'] = false;
}
return data;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by `update` method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function inner(data) {
var placement = data.placement;
var basePlacement = placement.split('-')[0];
var _data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
popper[isHoriz ? 'left' : 'top'] = reference[placement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
data.placement = getOppositePlacement(placement);
data.offsets.popper = getClientRect(popper);
return data;
}
/**
* Modifier function, each modifier can have a function of this type assigned
* to its `fn` property.<br />
* These functions will be called on each update, this means that you must
* make sure they are performant enough to avoid performance bottlenecks.
*
* @function ModifierFn
* @argument {dataObject} data - The data object generated by `update` method
* @argument {Object} options - Modifiers configuration and options
* @returns {dataObject} The data object, properly modified
*/
/**
* Modifiers are plugins used to alter the behavior of your poppers.<br />
* Popper.js uses a set of 9 modifiers to provide all the basic functionalities
* needed by the library.
*
* Usually you don't want to override the `order`, `fn` and `onLoad` props.
* All the other properties are configurations that could be tweaked.
* @namespace modifiers
*/
var modifiers = {
/**
* Modifier used to shift the popper on the start or end of its reference
* element.<br />
* It will read the variation of the `placement` property.<br />
* It can be one either `-end` or `-start`.
* @memberof modifiers
* @inner
*/
shift: {
/** @prop {number} order=100 - Index used to define the order of execution */
order: 100,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: shift
},
/**
* The `offset` modifier can shift your popper on both its axis.
*
* It accepts the following units:
* - `px` or unitless, interpreted as pixels
* - `%` or `%r`, percentage relative to the length of the reference element
* - `%p`, percentage relative to the length of the popper element
* - `vw`, CSS viewport width unit
* - `vh`, CSS viewport height unit
*
* For length is intended the main axis relative to the placement of the popper.<br />
* This means that if the placement is `top` or `bottom`, the length will be the
* `width`. In case of `left` or `right`, it will be the height.
*
* You can provide a single value (as `Number` or `String`), or a pair of values
* as `String` divided by a comma or one (or more) white spaces.<br />
* The latter is a deprecated method because it leads to confusion and will be
* removed in v2.<br />
* Additionally, it accepts additions and subtractions between different units.
* Note that multiplications and divisions aren't supported.
*
* Valid examples are:
* ```
* 10
* '10%'
* '10, 10'
* '10%, 10'
* '10 + 10%'
* '10 - 5vh + 3%'
* '-10px + 5vh, 5px - 6%'
* ```
*
* @memberof modifiers
* @inner
*/
offset: {
/** @prop {number} order=200 - Index used to define the order of execution */
order: 200,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: offset,
/** @prop {Number|String} offset=0
* The offset value as described in the modifier description
*/
offset: 0
},
/**
* Modifier used to prevent the popper from being positioned outside the boundary.
*
* An scenario exists where the reference itself is not within the boundaries.<br />
* We can say it has "escaped the boundaries" — or just "escaped".<br />
* In this case we need to decide whether the popper should either:
*
* - detach from the reference and remain "trapped" in the boundaries, or
* - if it should ignore the boundary and "escape with its reference"
*
* When `escapeWithReference` is set to`true` and reference is completely
* outside its boundaries, the popper will overflow (or completely leave)
* the boundaries in order to remain attached to the edge of the reference.
*
* @memberof modifiers
* @inner
*/
preventOverflow: {
/** @prop {number} order=300 - Index used to define the order of execution */
order: 300,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: preventOverflow,
/**
* @prop {Array} [priority=['left','right','top','bottom']]
* Popper will try to prevent overflow following these priorities by default,
* then, it could overflow on the left and on top of the `boundariesElement`
*/
priority: ['left', 'right', 'top', 'bottom'],
/**
* @prop {number} padding=5
* Amount of pixel used to define a minimum distance between the boundaries
* and the popper this makes sure the popper has always a little padding
* between the edges of its container
*/
padding: 5,
/**
* @prop {String|HTMLElement} boundariesElement='scrollParent'
* Boundaries used by the modifier, can be `scrollParent`, `window`,
* `viewport` or any DOM element.
*/
boundariesElement: 'scrollParent'
},
/**
* Modifier used to make sure the reference and its popper stay near eachothers
* without leaving any gap between the two. Expecially useful when the arrow is
* enabled and you want to assure it to point to its reference element.
* It cares only about the first axis, you can still have poppers with margin
* between the popper and its reference element.
* @memberof modifiers
* @inner
*/
keepTogether: {
/** @prop {number} order=400 - Index used to define the order of execution */
order: 400,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: keepTogether
},
/**
* This modifier is used to move the `arrowElement` of the popper to make
* sure it is positioned between the reference element and its popper element.
* It will read the outer size of the `arrowElement` node to detect how many
* pixels of conjuction are needed.
*
* It has no effect if no `arrowElement` is provided.
* @memberof modifiers
* @inner
*/
arrow: {
/** @prop {number} order=500 - Index used to define the order of execution */
order: 500,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: arrow,
/** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
element: '[x-arrow]'
},
/**
* Modifier used to flip the popper's placement when it starts to overlap its
* reference element.
*
* Requires the `preventOverflow` modifier before it in order to work.
*
* **NOTE:** this modifier will interrupt the current update cycle and will
* restart it if it detects the need to flip the placement.
* @memberof modifiers
* @inner
*/
flip: {
/** @prop {number} order=600 - Index used to define the order of execution */
order: 600,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: flip,
/**
* @prop {String|Array} behavior='flip'
* The behavior used to change the popper's placement. It can be one of
* `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
* placements (with optional variations).
*/
behavior: 'flip',
/**
* @prop {number} padding=5
* The popper will flip if it hits the edges of the `boundariesElement`
*/
padding: 5,
/**
* @prop {String|HTMLElement} boundariesElement='viewport'
* The element which will define the boundaries of the popper position,
* the popper will never be placed outside of the defined boundaries
* (except if keepTogether is enabled)
*/
boundariesElement: 'viewport'
},
/**
* Modifier used to make the popper flow toward the inner of the reference element.
* By default, when this modifier is disabled, the popper will be placed outside
* the reference element.
* @memberof modifiers
* @inner
*/
inner: {
/** @prop {number} order=700 - Index used to define the order of execution */
order: 700,
/** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
enabled: false,
/** @prop {ModifierFn} */
fn: inner
},
/**
* Modifier used to hide the popper when its reference element is outside of the
* popper boundaries. It will set a `x-out-of-boundaries` attribute which can
* be used to hide with a CSS selector the popper when its reference is
* out of boundaries.
*
* Requires the `preventOverflow` modifier before it in order to work.
* @memberof modifiers
* @inner
*/
hide: {
/** @prop {number} order=800 - Index used to define the order of execution */
order: 800,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: hide
},
/**
* Computes the style that will be applied to the popper element to gets
* properly positioned.
*
* Note that this modifier will not touch the DOM, it just prepares the styles
* so that `applyStyle` modifier can apply it. This separation is useful
* in case you need to replace `applyStyle` with a custom implementation.
*
* This modifier has `850` as `order` value to maintain backward compatibility
* with previous versions of Popper.js. Expect the modifiers ordering method
* to change in future major versions of the library.
*
* @memberof modifiers
* @inner
*/
computeStyle: {
/** @prop {number} order=850 - Index used to define the order of execution */
order: 850,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: computeStyle,
/**
* @prop {Boolean} gpuAcceleration=true
* If true, it uses the CSS 3d transformation to position the popper.
* Otherwise, it will use the `top` and `left` properties.
*/
gpuAcceleration: true,
/**
* @prop {string} [x='bottom']
* Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
* Change this if your popper should grow in a direction different from `bottom`
*/
x: 'bottom',
/**
* @prop {string} [x='left']
* Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
* Change this if your popper should grow in a direction different from `right`
*/
y: 'right'
},
/**
* Applies the computed styles to the popper element.
*
* All the DOM manipulations are limited to this modifier. This is useful in case
* you want to integrate Popper.js inside a framework or view library and you
* want to delegate all the DOM manipulations to it.
*
* Note that if you disable this modifier, you must make sure the popper element
* has its position set to `absolute` before Popper.js can do its work!
*
* Just disable this modifier and define you own to achieve the desired effect.
*
* @memberof modifiers
* @inner
*/
applyStyle: {
/** @prop {number} order=900 - Index used to define the order of execution */
order: 900,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: applyStyle,
/** @prop {Function} */
onLoad: applyStyleOnLoad,
/**
* @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
* @prop {Boolean} gpuAcceleration=true
* If true, it uses the CSS 3d transformation to position the popper.
* Otherwise, it will use the `top` and `left` properties.
*/
gpuAcceleration: undefined
}
};
/**
* The `dataObject` is an object containing all the informations used by Popper.js
* this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
* @name dataObject
* @property {Object} data.instance The Popper.js instance
* @property {String} data.placement Placement applied to popper
* @property {String} data.originalPlacement Placement originally defined on init
* @property {Boolean} data.flipped True if popper has been flipped by flip modifier
* @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper.
* @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
* @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`)
* @property {Object} data.boundaries Offsets of the popper boundaries
* @property {Object} data.offsets The measurements of popper, reference and arrow elements.
* @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
* @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
* @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
*/
/**
* Default options provided to Popper.js constructor.<br />
* These can be overriden using the `options` argument of Popper.js.<br />
* To override an option, simply pass as 3rd argument an object with the same
* structure of this object, example:
* ```
* new Popper(ref, pop, {
* modifiers: {
* preventOverflow: { enabled: false }
* }
* })
* ```
* @type {Object}
* @static
* @memberof Popper
*/
var Defaults = {
/**
* Popper's placement
* @prop {Popper.placements} placement='bottom'
*/
placement: 'bottom',
/**
* Whether events (resize, scroll) are initially enabled
* @prop {Boolean} eventsEnabled=true
*/
eventsEnabled: true,
/**
* Set to true if you want to automatically remove the popper when
* you call the `destroy` method.
* @prop {Boolean} removeOnDestroy=false
*/
removeOnDestroy: false,
/**
* Callback called when the popper is created.<br />
* By default, is set to no-op.<br />
* Access Popper.js instance with `data.instance`.
* @prop {onCreate}
*/
onCreate: function onCreate() {},
/**
* Callback called when the popper is updated, this callback is not called
* on the initialization/creation of the popper, but only on subsequent
* updates.<br />
* By default, is set to no-op.<br />
* Access Popper.js instance with `data.instance`.
* @prop {onUpdate}
*/
onUpdate: function onUpdate() {},
/**
* List of modifiers used to modify the offsets before they are applied to the popper.
* They provide most of the functionalities of Popper.js
* @prop {modifiers}
*/
modifiers: modifiers
};
/**
* @callback onCreate
* @param {dataObject} data
*/
/**
* @callback onUpdate
* @param {dataObject} data
*/
// Utils
// Methods
var Popper = function () {
/**
* Create a new Popper.js instance
* @class Popper
* @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
* @param {HTMLElement} popper - The HTML element used as popper.
* @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
* @return {Object} instance - The generated Popper.js instance
*/
function Popper(reference, popper) {
var _this = this;
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
classCallCheck(this, Popper);
this.scheduleUpdate = function () {
return requestAnimationFrame(_this.update);
};
// make update() debounced, so that it only runs at most once-per-tick
this.update = debounce(this.update.bind(this));
// with {} we create a new object with the options inside it
this.options = _extends({}, Popper.Defaults, options);
// init state
this.state = {
isDestroyed: false,
isCreated: false,
scrollParents: []
};
// get reference and popper elements (allow jQuery wrappers)
this.reference = reference.jquery ? reference[0] : reference;
this.popper = popper.jquery ? popper[0] : popper;
// Deep merge modifiers options
this.options.modifiers = {};
Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
_this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
});
// Refactoring modifiers' list (Object => Array)
this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
return _extends({
name: name
}, _this.options.modifiers[name]);
})
// sort the modifiers by order
.sort(function (a, b) {
return a.order - b.order;
});
// modifiers have the ability to execute arbitrary code when Popper.js get inited
// such code is executed in the same order of its modifier
// they could add new properties to their options configuration
// BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
this.modifiers.forEach(function (modifierOptions) {
if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
}
});
// fire the first update to position the popper in the right place
this.update();
var eventsEnabled = this.options.eventsEnabled;
if (eventsEnabled) {
// setup event listeners, they will take care of update the position in specific situations
this.enableEventListeners();
}
this.state.eventsEnabled = eventsEnabled;
}
// We can't use class properties because they don't get listed in the
// class prototype and break stuff like Sinon stubs
createClass(Popper, [{
key: 'update',
value: function update$$1() {
return update.call(this);
}
}, {
key: 'destroy',
value: function destroy$$1() {
return destroy.call(this);
}
}, {
key: 'enableEventListeners',
value: function enableEventListeners$$1() {
return enableEventListeners.call(this);
}
}, {
key: 'disableEventListeners',
value: function disableEventListeners$$1() {
return disableEventListeners.call(this);
}
/**
* Schedule an update, it will run on the next UI update available
* @method scheduleUpdate
* @memberof Popper
*/
/**
* Collection of utilities useful when writing custom modifiers.
* Starting from version 1.7, this method is available only if you
* include `popper-utils.js` before `popper.js`.
*
* **DEPRECATION**: This way to access PopperUtils is deprecated
* and will be removed in v2! Use the PopperUtils module directly instead.
* Due to the high instability of the methods contained in Utils, we can't
* guarantee them to follow semver. Use them at your own risk!
* @static
* @private
* @type {Object}
* @deprecated since version 1.8
* @member Utils
* @memberof Popper
*/
}]);
return Popper;
}();
/**
* The `referenceObject` is an object that provides an interface compatible with Popper.js
* and lets you use it as replacement of a real DOM node.<br />
* You can use this method to position a popper relatively to a set of coordinates
* in case you don't have a DOM node to use as reference.
*
* ```
* new Popper(referenceObject, popperNode);
* ```
*
* NB: This feature isn't supported in Internet Explorer 10
* @name referenceObject
* @property {Function} data.getBoundingClientRect
* A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
* @property {number} data.clientWidth
* An ES6 getter that will return the width of the virtual reference element.
* @property {number} data.clientHeight
* An ES6 getter that will return the height of the virtual reference element.
*/
Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
Popper.placements = placements;
Popper.Defaults = Defaults;
return Popper;
});
//# sourceMappingURL=popper.js.map
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
/*!
* is-equal-shallow <https://github.com/jonschlinkert/is-equal-shallow>
*
* Copyright (c) 2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
'use strict';
var isPrimitive = __webpack_require__(8);
module.exports = function isEqual(a, b) {
if (!a && !b) {
return true;
}
if (!a && b || a && !b) {
return false;
}
var numKeysA = 0,
numKeysB = 0,
key;
for (key in b) {
numKeysB++;
if (!isPrimitive(b[key]) || !a.hasOwnProperty(key) || a[key] !== b[key]) {
return false;
}
}
for (key in a) {
numKeysA++;
}
return numKeysA === numKeysB;
};
/***/ }),
/* 8 */
/***/ (function(module, exports) {
/*!
* is-primitive <https://github.com/jonschlinkert/is-primitive>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
'use strict';
// see http://jsperf.com/testing-value-is-primitive/7
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
module.exports = function isPrimitive(value) {
return value == null || typeof value !== 'function' && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object';
};
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(2);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(3);
var _propTypes2 = _interopRequireDefault(_propTypes);
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; }
var Arrow = function Arrow(props, context) {
var _props$component = props.component,
component = _props$component === undefined ? 'span' : _props$component,
innerRef = props.innerRef,
children = props.children,
restProps = _objectWithoutProperties(props, ['component', 'innerRef', 'children']);
var popper = context.popper;
var arrowRef = function arrowRef(node) {
popper.setArrowNode(node);
if (typeof innerRef === 'function') {
innerRef(node);
}
};
var arrowStyle = popper.getArrowStyle();
if (typeof children === 'function') {
var arrowProps = {
ref: arrowRef,
style: arrowStyle
};
return children({ arrowProps: arrowProps, restProps: restProps });
}
var componentProps = _extends({}, restProps, {
style: _extends({}, arrowStyle, restProps.style)
});
if (typeof component === 'string') {
componentProps.ref = arrowRef;
} else {
componentProps.innerRef = arrowRef;
}
return (0, _react.createElement)(component, componentProps, children);
};
Arrow.contextTypes = {
popper: _propTypes2.default.object.isRequired
};
Arrow.propTypes = {
component: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]),
innerRef: _propTypes2.default.func,
children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func])
};
exports.default = Arrow;
/***/ })
/******/ ])
});
; |
Scenarios/Provisioning.Pages/Provisioning.Pages.AppWeb/Scripts/jquery-1.9.1.js | jasoncigan/OfficeDevPnP | /* NUGET: BEGIN LICENSE TEXT
jQuery v1.9.1
Microsoft grants you the right to use these script files for the sole purpose of either: (i) interacting through your browser with the Microsoft website, subject to the website's terms of use; or (ii) using the files as included with a Microsoft product subject to that product's license terms. Microsoft reserves all other rights to the files not expressly granted by Microsoft, whether by implication, estoppel or otherwise. The notices and licenses below are for informational purposes only.
***************************************************
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
********************************
* Includes Sizzle CSS Selector Engine
* http://sizzlejs.com/
* Copyright 2012 jQuery Foundation and other contributors
********************************************************
Provided for Informational Purposes Only
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* NUGET: END LICENSE TEXT */
/*!
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2013-2-4
*/
(function( window, undefined ) {
// Can't do this because several apps including ASP.NET trace
// the stack via arguments.caller.callee and Firefox dies if
// you try to trace through "use strict" call chains. (#13335)
// Support: Firefox 18+
//"use strict";
var
// The deferred used on DOM ready
readyList,
// A central reference to the root jQuery(document)
rootjQuery,
// Support: IE<9
// For `typeof node.method` instead of `node.method !== undefined`
core_strundefined = typeof undefined,
// Use the correct document accordingly with window argument (sandbox)
document = window.document,
location = window.location,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// [[Class]] -> type pairs
class2type = {},
// List of deleted data cache ids, so we can reuse them
core_deletedIds = [],
core_version = "1.9.1",
// Save a reference to some core methods
core_concat = core_deletedIds.concat,
core_push = core_deletedIds.push,
core_slice = core_deletedIds.slice,
core_indexOf = core_deletedIds.indexOf,
core_toString = class2type.toString,
core_hasOwn = class2type.hasOwnProperty,
core_trim = core_version.trim,
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
},
// Used for matching numbers
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
// Used for splitting on whitespace
core_rnotwhite = /\S+/g,
// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
// A simple way to check for HTML strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
// Strict HTML recognition (#11290: must start with <)
rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
// Matches dashed string for camelizing
rmsPrefix = /^-ms-/,
rdashAlpha = /-([\da-z])/gi,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return letter.toUpperCase();
},
// The ready event handler
completed = function( event ) {
// readyState === "complete" is good enough for us to call the dom ready in oldIE
if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
detach();
jQuery.ready();
}
},
// Clean-up method for dom ready events
detach = function() {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", completed, false );
window.removeEventListener( "load", completed, false );
} else {
document.detachEvent( "onreadystatechange", completed );
window.detachEvent( "onload", completed );
}
};
jQuery.fn = jQuery.prototype = {
// The current version of jQuery being used
jquery: core_version,
constructor: jQuery,
init: function( selector, context, rootjQuery ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
return this;
}
// Handle HTML strings
if ( typeof selector === "string" ) {
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check
match = [ null, selector, null ];
} else {
match = rquickExpr.exec( selector );
}
// Match html or make sure no context is specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
context = context instanceof jQuery ? context[0] : context;
// scripts is true for back-compat
jQuery.merge( this, jQuery.parseHTML(
match[1],
context && context.nodeType ? context.ownerDocument || context : document,
true
) );
// HANDLE: $(html, props)
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
for ( match in context ) {
// Properties of context are called as methods if possible
if ( jQuery.isFunction( this[ match ] ) ) {
this[ match ]( context[ match ] );
// ...and otherwise set as attributes
} else {
this.attr( match, context[ match ] );
}
}
}
return this;
// HANDLE: $(#id)
} else {
elem = document.getElementById( match[2] );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
}
// Otherwise, we inject the element directly into the jQuery object
this.length = 1;
this[0] = elem;
}
this.context = document;
this.selector = selector;
return this;
}
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return ( context || rootjQuery ).find( selector );
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
} else {
return this.constructor( context ).find( selector );
}
// HANDLE: $(DOMElement)
} else if ( selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
if ( selector.selector !== undefined ) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.length;
},
toArray: function() {
return core_slice.call( this );
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
return num == null ?
// Return a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this[ this.length + num ] : this[ num ] );
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems ) {
// Build a new jQuery matched element set
var ret = jQuery.merge( this.constructor(), elems );
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context = this.context;
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
return jQuery.each( this, callback, args );
},
ready: function( fn ) {
// Add the callback
jQuery.ready.promise().done( fn );
return this;
},
slice: function() {
return this.pushStack( core_slice.apply( this, arguments ) );
},
first: function() {
return this.eq( 0 );
},
last: function() {
return this.eq( -1 );
},
eq: function( i ) {
var len = this.length,
j = +i + ( i < 0 ? len : 0 );
return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
return this.prevObject || this.constructor(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: core_push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
var src, copyIsArray, copy, name, options, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
target = {};
}
// extend jQuery itself if only one argument is passed
if ( length === i ) {
target = this;
--i;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
clone = src && jQuery.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend({
noConflict: function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
jQuery.readyWait++;
} else {
jQuery.ready( true );
}
},
// Handle when the DOM is ready
ready: function( wait ) {
// Abort if there are pending holds or we're already ready
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
return;
}
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready );
}
// Remember that the DOM is ready
jQuery.isReady = true;
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --jQuery.readyWait > 0 ) {
return;
}
// If there are functions bound, to execute
readyList.resolveWith( document, [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger("ready").off("ready");
}
},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
return jQuery.type(obj) === "function";
},
isArray: Array.isArray || function( obj ) {
return jQuery.type(obj) === "array";
},
isWindow: function( obj ) {
return obj != null && obj == obj.window;
},
isNumeric: function( obj ) {
return !isNaN( parseFloat(obj) ) && isFinite( obj );
},
type: function( obj ) {
if ( obj == null ) {
return String( obj );
}
return typeof obj === "object" || typeof obj === "function" ?
class2type[ core_toString.call(obj) ] || "object" :
typeof obj;
},
isPlainObject: function( obj ) {
// Must be an Object.
// Because of IE, we also have to check the presence of the constructor property.
// Make sure that DOM nodes and window objects don't pass through, as well
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
return false;
}
try {
// Not own constructor property must be Object
if ( obj.constructor &&
!core_hasOwn.call(obj, "constructor") &&
!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
} catch ( e ) {
// IE8,9 Will throw exceptions on certain host objects #9897
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || core_hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw new Error( msg );
},
// data: string of html
// context (optional): If specified, the fragment will be created in this context, defaults to document
// keepScripts (optional): If true, will include scripts passed in the html string
parseHTML: function( data, context, keepScripts ) {
if ( !data || typeof data !== "string" ) {
return null;
}
if ( typeof context === "boolean" ) {
keepScripts = context;
context = false;
}
context = context || document;
var parsed = rsingleTag.exec( data ),
scripts = !keepScripts && [];
// Single tag
if ( parsed ) {
return [ context.createElement( parsed[1] ) ];
}
parsed = jQuery.buildFragment( [ data ], context, scripts );
if ( scripts ) {
jQuery( scripts ).remove();
}
return jQuery.merge( [], parsed.childNodes );
},
parseJSON: function( data ) {
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
return window.JSON.parse( data );
}
if ( data === null ) {
return data;
}
if ( typeof data === "string" ) {
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
if ( data ) {
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
.replace( rvalidtokens, "]" )
.replace( rvalidbraces, "")) ) {
return ( new Function( "return " + data ) )();
}
}
}
jQuery.error( "Invalid JSON: " + data );
},
// Cross-browser xml parsing
parseXML: function( data ) {
var xml, tmp;
if ( !data || typeof data !== "string" ) {
return null;
}
try {
if ( window.DOMParser ) { // Standard
tmp = new DOMParser();
xml = tmp.parseFromString( data , "text/xml" );
} else { // IE
xml = new ActiveXObject( "Microsoft.XMLDOM" );
xml.async = "false";
xml.loadXML( data );
}
} catch( e ) {
xml = undefined;
}
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
jQuery.error( "Invalid XML: " + data );
}
return xml;
},
noop: function() {},
// Evaluates a script in a global context
// Workarounds based on findings by Jim Driscoll
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
globalEval: function( data ) {
if ( data && jQuery.trim( data ) ) {
// We use execScript on Internet Explorer
// We use an anonymous function so that context is window
// rather than jQuery in Firefox
( window.execScript || function( data ) {
window[ "eval" ].call( window, data );
} )( data );
}
},
// Convert dashed to camelCase; used by the css and data modules
// Microsoft forgot to hump their vendor prefix (#9572)
camelCase: function( string ) {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
},
// args is for internal usage only
each: function( obj, callback, args ) {
var value,
i = 0,
length = obj.length,
isArray = isArraylike( obj );
if ( args ) {
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback.apply( obj[ i ], args );
if ( value === false ) {
break;
}
}
} else {
for ( i in obj ) {
value = callback.apply( obj[ i ], args );
if ( value === false ) {
break;
}
}
}
// A special, fast, case for the most common use of each
} else {
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback.call( obj[ i ], i, obj[ i ] );
if ( value === false ) {
break;
}
}
} else {
for ( i in obj ) {
value = callback.call( obj[ i ], i, obj[ i ] );
if ( value === false ) {
break;
}
}
}
}
return obj;
},
// Use native String.trim function wherever possible
trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
function( text ) {
return text == null ?
"" :
core_trim.call( text );
} :
// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
"" :
( text + "" ).replace( rtrim, "" );
},
// results is for internal usage only
makeArray: function( arr, results ) {
var ret = results || [];
if ( arr != null ) {
if ( isArraylike( Object(arr) ) ) {
jQuery.merge( ret,
typeof arr === "string" ?
[ arr ] : arr
);
} else {
core_push.call( ret, arr );
}
}
return ret;
},
inArray: function( elem, arr, i ) {
var len;
if ( arr ) {
if ( core_indexOf ) {
return core_indexOf.call( arr, elem, i );
}
len = arr.length;
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
for ( ; i < len; i++ ) {
// Skip accessing in sparse arrays
if ( i in arr && arr[ i ] === elem ) {
return i;
}
}
}
return -1;
},
merge: function( first, second ) {
var l = second.length,
i = first.length,
j = 0;
if ( typeof l === "number" ) {
for ( ; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var retVal,
ret = [],
i = 0,
length = elems.length;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( ; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
var value,
i = 0,
length = elems.length,
isArray = isArraylike( elems ),
ret = [];
// Go through the array, translating each of the items to their
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
// Go through every key on the object,
} else {
for ( i in elems ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
}
// Flatten any nested arrays
return core_concat.apply( [], ret );
},
// A global GUID counter for objects
guid: 1,
// Bind a function to a context, optionally partially applying any
// arguments.
proxy: function( fn, context ) {
var args, proxy, tmp;
if ( typeof context === "string" ) {
tmp = fn[ context ];
context = fn;
fn = tmp;
}
// Quick check to determine if target is callable, in the spec
// this throws a TypeError, but we will just return undefined.
if ( !jQuery.isFunction( fn ) ) {
return undefined;
}
// Simulated bind
args = core_slice.call( arguments, 2 );
proxy = function() {
return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
};
// Set the guid of unique handler to the same of original handler, so it can be removed
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
return proxy;
},
// Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
length = elems.length,
bulk = key == null;
// Sets many values
if ( jQuery.type( key ) === "object" ) {
chainable = true;
for ( i in key ) {
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
}
// Sets one value
} else if ( value !== undefined ) {
chainable = true;
if ( !jQuery.isFunction( value ) ) {
raw = true;
}
if ( bulk ) {
// Bulk operations run against the entire set
if ( raw ) {
fn.call( elems, value );
fn = null;
// ...except when executing function values
} else {
bulk = fn;
fn = function( elem, key, value ) {
return bulk.call( jQuery( elem ), value );
};
}
}
if ( fn ) {
for ( ; i < length; i++ ) {
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
}
}
}
return chainable ?
elems :
// Gets
bulk ?
fn.call( elems ) :
length ? fn( elems[0], key ) : emptyGet;
},
now: function() {
return ( new Date() ).getTime();
}
});
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
readyList = jQuery.Deferred();
// Catch cases where $(document).ready() is called after the browser event has already occurred.
// we once tried to use readyState "interactive" here, but it caused issues like the one
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
setTimeout( jQuery.ready );
// Standards-based browsers support DOMContentLoaded
} else if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", completed, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", completed, false );
// If IE event model is used
} else {
// Ensure firing before onload, maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", completed );
// A fallback to window.onload, that will always work
window.attachEvent( "onload", completed );
// If IE and not a frame
// continually check to see if the document is ready
var top = false;
try {
top = window.frameElement == null && document.documentElement;
} catch(e) {}
if ( top && top.doScroll ) {
(function doScrollCheck() {
if ( !jQuery.isReady ) {
try {
// Use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
top.doScroll("left");
} catch(e) {
return setTimeout( doScrollCheck, 50 );
}
// detach all dom ready events
detach();
// and execute any waiting functions
jQuery.ready();
}
})();
}
}
}
return readyList.promise( obj );
};
// Populate the class2type map
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
});
function isArraylike( obj ) {
var length = obj.length,
type = jQuery.type( obj );
if ( jQuery.isWindow( obj ) ) {
return false;
}
if ( obj.nodeType === 1 && length ) {
return true;
}
return type === "array" || type !== "function" &&
( length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// String to Object options format cache
var optionsCache = {};
// Convert String-formatted options into Object-formatted ones and store in cache
function createOptions( options ) {
var object = optionsCache[ options ] = {};
jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
object[ flag ] = true;
});
return object;
}
/*
* Create a callback list using the following parameters:
*
* options: an optional list of space-separated options that will change how
* the callback list behaves or a more traditional option object
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible options:
*
* once: will ensure the callback list can only be fired once (like a Deferred)
*
* memory: will keep track of previous values and will call any callback added
* after the list has been fired right away with the latest "memorized"
* values (like a Deferred)
*
* unique: will ensure a callback can only be added once (no duplicate in the list)
*
* stopOnFalse: interrupt callings when a callback returns false
*
*/
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
( optionsCache[ options ] || createOptions( options ) ) :
jQuery.extend( {}, options );
var // Flag to know if list is currently firing
firing,
// Last fire value (for non-forgettable lists)
memory,
// Flag to know if list was already fired
fired,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// First callback to fire (used internally by add and fireWith)
firingStart,
// Actual callback list
list = [],
// Stack of fire calls for repeatable lists
stack = !options.once && [],
// Fire callbacks
fire = function( data ) {
memory = options.memory && data;
fired = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
firing = true;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
memory = false; // To prevent further calls using add
break;
}
}
firing = false;
if ( list ) {
if ( stack ) {
if ( stack.length ) {
fire( stack.shift() );
}
} else if ( memory ) {
list = [];
} else {
self.disable();
}
}
},
// Actual Callbacks object
self = {
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
// First, we save the current length
var start = list.length;
(function add( args ) {
jQuery.each( args, function( _, arg ) {
var type = jQuery.type( arg );
if ( type === "function" ) {
if ( !options.unique || !self.has( arg ) ) {
list.push( arg );
}
} else if ( arg && arg.length && type !== "string" ) {
// Inspect recursively
add( arg );
}
});
})( arguments );
// Do we need to add the callbacks to the
// current firing batch?
if ( firing ) {
firingLength = list.length;
// With memory, if we're not firing then
// we should call right away
} else if ( memory ) {
firingStart = start;
fire( memory );
}
}
return this;
},
// Remove a callback from the list
remove: function() {
if ( list ) {
jQuery.each( arguments, function( _, arg ) {
var index;
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 );
// Handle firing indexes
if ( firing ) {
if ( index <= firingLength ) {
firingLength--;
}
if ( index <= firingIndex ) {
firingIndex--;
}
}
}
});
}
return this;
},
// Check if a given callback is in the list.
// If no argument is given, return whether or not list has callbacks attached.
has: function( fn ) {
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
},
// Remove all callbacks from the list
empty: function() {
list = [];
return this;
},
// Have the list do nothing anymore
disable: function() {
list = stack = memory = undefined;
return this;
},
// Is it disabled?
disabled: function() {
return !list;
},
// Lock the list in its current state
lock: function() {
stack = undefined;
if ( !memory ) {
self.disable();
}
return this;
},
// Is it locked?
locked: function() {
return !stack;
},
// Call all callbacks with the given context and arguments
fireWith: function( context, args ) {
args = args || [];
args = [ context, args.slice ? args.slice() : args ];
if ( list && ( !fired || stack ) ) {
if ( firing ) {
stack.push( args );
} else {
fire( args );
}
}
return this;
},
// Call all the callbacks with the given arguments
fire: function() {
self.fireWith( this, arguments );
return this;
},
// To know if the callbacks have already been called at least once
fired: function() {
return !!fired;
}
};
return self;
};
jQuery.extend({
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
[ "notify", "progress", jQuery.Callbacks("memory") ]
],
state = "pending",
promise = {
state: function() {
return state;
},
always: function() {
deferred.done( arguments ).fail( arguments );
return this;
},
then: function( /* fnDone, fnFail, fnProgress */ ) {
var fns = arguments;
return jQuery.Deferred(function( newDefer ) {
jQuery.each( tuples, function( i, tuple ) {
var action = tuple[ 0 ],
fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
// deferred[ done | fail | progress ] for forwarding actions to newDefer
deferred[ tuple[1] ](function() {
var returned = fn && fn.apply( this, arguments );
if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise()
.done( newDefer.resolve )
.fail( newDefer.reject )
.progress( newDefer.notify );
} else {
newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
}
});
});
fns = null;
}).promise();
},
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
return obj != null ? jQuery.extend( obj, promise ) : promise;
}
},
deferred = {};
// Keep pipe for back-compat
promise.pipe = promise.then;
// Add list-specific methods
jQuery.each( tuples, function( i, tuple ) {
var list = tuple[ 2 ],
stateString = tuple[ 3 ];
// promise[ done | fail | progress ] = list.add
promise[ tuple[1] ] = list.add;
// Handle state
if ( stateString ) {
list.add(function() {
// state = [ resolved | rejected ]
state = stateString;
// [ reject_list | resolve_list ].disable; progress_list.lock
}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
}
// deferred[ resolve | reject | notify ]
deferred[ tuple[0] ] = function() {
deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
return this;
};
deferred[ tuple[0] + "With" ] = list.fireWith;
});
// Make the deferred a promise
promise.promise( deferred );
// Call given func if any
if ( func ) {
func.call( deferred, deferred );
}
// All done!
return deferred;
},
// Deferred helper
when: function( subordinate /* , ..., subordinateN */ ) {
var i = 0,
resolveValues = core_slice.call( arguments ),
length = resolveValues.length,
// the count of uncompleted subordinates
remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
// Update function for both resolve and progress values
updateFunc = function( i, contexts, values ) {
return function( value ) {
contexts[ i ] = this;
values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
if( values === progressValues ) {
deferred.notifyWith( contexts, values );
} else if ( !( --remaining ) ) {
deferred.resolveWith( contexts, values );
}
};
},
progressValues, progressContexts, resolveContexts;
// add listeners to Deferred subordinates; treat others as resolved
if ( length > 1 ) {
progressValues = new Array( length );
progressContexts = new Array( length );
resolveContexts = new Array( length );
for ( ; i < length; i++ ) {
if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
resolveValues[ i ].promise()
.done( updateFunc( i, resolveContexts, resolveValues ) )
.fail( deferred.reject )
.progress( updateFunc( i, progressContexts, progressValues ) );
} else {
--remaining;
}
}
}
// if we're not waiting on anything, resolve the master
if ( !remaining ) {
deferred.resolveWith( resolveContexts, resolveValues );
}
return deferred.promise();
}
});
jQuery.support = (function() {
var support, all, a,
input, select, fragment,
opt, eventName, isSupported, i,
div = document.createElement("div");
// Setup
div.setAttribute( "className", "t" );
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
// Support tests won't run in some limited or non-browser environments
all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[ 0 ];
if ( !all || !a || !all.length ) {
return {};
}
// First batch of tests
select = document.createElement("select");
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName("input")[ 0 ];
a.style.cssText = "top:1px;float:left;opacity:.5";
support = {
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: div.firstChild.nodeType === 3,
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName("tbody").length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName("link").length,
// Get the style information from getAttribute
// (IE uses .cssText instead)
style: /top/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: a.getAttribute("href") === "/a",
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.5/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
checkOn: !!input.value,
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: opt.selected,
// Tests for enctype support on a form (#6743)
enctype: !!document.createElement("form").enctype,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
boxModel: document.compatMode === "CSS1Compat",
// Will be defined later
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true,
boxSizingReliable: true,
pixelPosition: false
};
// Make sure checked status is properly cloned
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
// Make sure that the options inside disabled selects aren't marked as disabled
// (WebKit marks them as disabled)
select.disabled = true;
support.optDisabled = !opt.disabled;
// Support: IE<9
try {
delete div.test;
} catch( e ) {
support.deleteExpando = false;
}
// Check if we can trust getAttribute("value")
input = document.createElement("input");
input.setAttribute( "value", "" );
support.input = input.getAttribute( "value" ) === "";
// Check if an input maintains its value after becoming a radio
input.value = "t";
input.setAttribute( "type", "radio" );
support.radioValue = input.value === "t";
// #11217 - WebKit loses check when the name is after the checked attribute
input.setAttribute( "checked", "t" );
input.setAttribute( "name", "t" );
fragment = document.createDocumentFragment();
fragment.appendChild( input );
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.checked;
// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
// Support: IE<9
// Opera does not clone events (and typeof div.attachEvent === undefined).
// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
if ( div.attachEvent ) {
div.attachEvent( "onclick", function() {
support.noCloneEvent = false;
});
div.cloneNode( true ).click();
}
// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
for ( i in { submit: true, change: true, focusin: true }) {
div.setAttribute( eventName = "on" + i, "t" );
support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
}
div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = "";
support.clearCloneStyle = div.style.backgroundClip === "content-box";
// Run tests that need a body at doc ready
jQuery(function() {
var container, marginDiv, tds,
divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
body = document.getElementsByTagName("body")[0];
if ( !body ) {
// Return for frameset docs that don't have a body
return;
}
container = document.createElement("div");
container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
body.appendChild( container ).appendChild( div );
// Support: IE8
// Check if table cells still have offsetWidth/Height when they are set
// to display:none and there are still other visible table cells in a
// table row; if so, offsetWidth/Height are not reliable for use when
// determining if an element has been hidden directly using
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
tds = div.getElementsByTagName("td");
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
tds[ 1 ].style.display = "none";
// Support: IE8
// Check if empty table cells still have offsetWidth/Height
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
// Check box-sizing and margin behavior
div.innerHTML = "";
div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
support.boxSizing = ( div.offsetWidth === 4 );
support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
// Use window.getComputedStyle because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. (#3333)
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
marginDiv = div.appendChild( document.createElement("div") );
marginDiv.style.cssText = div.style.cssText = divReset;
marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px";
support.reliableMarginRight =
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
}
if ( typeof div.style.zoom !== core_strundefined ) {
// Support: IE<8
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
div.innerHTML = "";
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
// Support: IE6
// Check if elements with layout shrink-wrap their children
div.style.display = "block";
div.innerHTML = "<div></div>";
div.firstChild.style.width = "5px";
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
if ( support.inlineBlockNeedsLayout ) {
// Prevent IE 6 from affecting layout for positioned elements #11048
// Prevent IE from shrinking the body in IE 7 mode #12869
// Support: IE<8
body.style.zoom = 1;
}
}
body.removeChild( container );
// Null elements to avoid leaks in IE
container = div = tds = marginDiv = null;
});
// Null elements to avoid leaks in IE
all = select = fragment = opt = a = input = null;
return support;
})();
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g;
function internalData( elem, name, data, pvt /* Internal Use Only */ ){
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
// We have to handle DOM nodes and JS objects differently because IE6-7
// can't GC object references properly across the DOM-JS boundary
isNode = elem.nodeType,
// Only DOM nodes need the global jQuery cache; JS object data is
// attached directly to the object so GC can occur automatically
cache = isNode ? jQuery.cache : elem,
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
// Avoid doing any more work than we need to when trying to get data on an
// object that has no data at all
if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
return;
}
if ( !id ) {
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
} else {
id = internalKey;
}
}
if ( !cache[ id ] ) {
cache[ id ] = {};
// Avoids exposing jQuery metadata on plain JS objects when the object
// is serialized using JSON.stringify
if ( !isNode ) {
cache[ id ].toJSON = jQuery.noop;
}
}
// An object can be passed to jQuery.data instead of a key/value pair; this gets
// shallow copied over onto the existing cache
if ( typeof name === "object" || typeof name === "function" ) {
if ( pvt ) {
cache[ id ] = jQuery.extend( cache[ id ], name );
} else {
cache[ id ].data = jQuery.extend( cache[ id ].data, name );
}
}
thisCache = cache[ id ];
// jQuery data() is stored in a separate object inside the object's internal data
// cache in order to avoid key collisions between internal data and user-defined
// data.
if ( !pvt ) {
if ( !thisCache.data ) {
thisCache.data = {};
}
thisCache = thisCache.data;
}
if ( data !== undefined ) {
thisCache[ jQuery.camelCase( name ) ] = data;
}
// Check for both converted-to-camel and non-converted data property names
// If a data property was specified
if ( getByName ) {
// First Try to find as-is property data
ret = thisCache[ name ];
// Test for null|undefined property data
if ( ret == null ) {
// Try to find the camelCased property
ret = thisCache[ jQuery.camelCase( name ) ];
}
} else {
ret = thisCache;
}
return ret;
}
function internalRemoveData( elem, name, pvt ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var i, l, thisCache,
isNode = elem.nodeType,
// See jQuery.data for more information
cache = isNode ? jQuery.cache : elem,
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
// If there is already no cache entry for this object, there is no
// purpose in continuing
if ( !cache[ id ] ) {
return;
}
if ( name ) {
thisCache = pvt ? cache[ id ] : cache[ id ].data;
if ( thisCache ) {
// Support array or space separated string names for data keys
if ( !jQuery.isArray( name ) ) {
// try the string as a key before any manipulation
if ( name in thisCache ) {
name = [ name ];
} else {
// split the camel cased version by spaces unless a key with the spaces exists
name = jQuery.camelCase( name );
if ( name in thisCache ) {
name = [ name ];
} else {
name = name.split(" ");
}
}
} else {
// If "name" is an array of keys...
// When data is initially created, via ("key", "val") signature,
// keys will be converted to camelCase.
// Since there is no way to tell _how_ a key was added, remove
// both plain key and camelCase key. #12786
// This will only penalize the array argument path.
name = name.concat( jQuery.map( name, jQuery.camelCase ) );
}
for ( i = 0, l = name.length; i < l; i++ ) {
delete thisCache[ name[i] ];
}
// If there is no data left in the cache, we want to continue
// and let the cache object itself get destroyed
if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
return;
}
}
}
// See jQuery.data for more information
if ( !pvt ) {
delete cache[ id ].data;
// Don't destroy the parent cache unless the internal data object
// had been the only thing left in it
if ( !isEmptyDataObject( cache[ id ] ) ) {
return;
}
}
// Destroy the cache
if ( isNode ) {
jQuery.cleanData( [ elem ], true );
// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
delete cache[ id ];
// When all else fails, null
} else {
cache[ id ] = null;
}
}
jQuery.extend({
cache: {},
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
hasData: function( elem ) {
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
return !!elem && !isEmptyDataObject( elem );
},
data: function( elem, name, data ) {
return internalData( elem, name, data );
},
removeData: function( elem, name ) {
return internalRemoveData( elem, name );
},
// For internal use only.
_data: function( elem, name, data ) {
return internalData( elem, name, data, true );
},
_removeData: function( elem, name ) {
return internalRemoveData( elem, name, true );
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
// Do not set data on non-element because it will not be cleared (#8335).
if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
return false;
}
var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
// nodes accept data unless otherwise specified; rejection can be conditional
return !noData || noData !== true && elem.getAttribute("classid") === noData;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var attrs, name,
elem = this[0],
i = 0,
data = null;
// Gets all values
if ( key === undefined ) {
if ( this.length ) {
data = jQuery.data( elem );
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
attrs = elem.attributes;
for ( ; i < attrs.length; i++ ) {
name = attrs[i].name;
if ( !name.indexOf( "data-" ) ) {
name = jQuery.camelCase( name.slice(5) );
dataAttr( elem, name, data[ name ] );
}
}
jQuery._data( elem, "parsedAttrs", true );
}
}
return data;
}
// Sets multiple values
if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
return jQuery.access( this, function( value ) {
if ( value === undefined ) {
// Try to fetch any internally stored data first
return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
}
this.each(function() {
jQuery.data( this, key, value );
});
}, null, value, arguments.length > 1, null, true );
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
// Only convert to a number if it doesn't change the string
+data + "" === data ? +data :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
// Make sure we set the data so it isn't changed later
jQuery.data( elem, key, data );
} else {
data = undefined;
}
}
return data;
}
// checks a cache object for emptiness
function isEmptyDataObject( obj ) {
var name;
for ( name in obj ) {
// if the public data object is empty, the private is still empty
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
continue;
}
if ( name !== "toJSON" ) {
return false;
}
}
return true;
}
jQuery.extend({
queue: function( elem, type, data ) {
var queue;
if ( elem ) {
type = ( type || "fx" ) + "queue";
queue = jQuery._data( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
if ( !queue || jQuery.isArray(data) ) {
queue = jQuery._data( elem, type, jQuery.makeArray(data) );
} else {
queue.push( data );
}
}
return queue || [];
}
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
startLength = queue.length,
fn = queue.shift(),
hooks = jQuery._queueHooks( elem, type ),
next = function() {
jQuery.dequeue( elem, type );
};
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
startLength--;
}
hooks.cur = fn;
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift( "inprogress" );
}
// clear up the last queue stop function
delete hooks.stop;
fn.call( elem, next, hooks );
}
if ( !startLength && hooks ) {
hooks.empty.fire();
}
},
// not intended for public consumption - generates a queueHooks object, or returns the current one
_queueHooks: function( elem, type ) {
var key = type + "queueHooks";
return jQuery._data( elem, key ) || jQuery._data( elem, key, {
empty: jQuery.Callbacks("once memory").add(function() {
jQuery._removeData( elem, type + "queue" );
jQuery._removeData( elem, key );
})
});
}
});
jQuery.fn.extend({
queue: function( type, data ) {
var setter = 2;
if ( typeof type !== "string" ) {
data = type;
type = "fx";
setter--;
}
if ( arguments.length < setter ) {
return jQuery.queue( this[0], type );
}
return data === undefined ?
this :
this.each(function() {
var queue = jQuery.queue( this, type, data );
// ensure a hooks for this queue
jQuery._queueHooks( this, type );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
type = type || "fx";
return this.queue( type, function( next, hooks ) {
var timeout = setTimeout( next, time );
hooks.stop = function() {
clearTimeout( timeout );
};
});
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
},
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, obj ) {
var tmp,
count = 1,
defer = jQuery.Deferred(),
elements = this,
i = this.length,
resolve = function() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
}
};
if ( typeof type !== "string" ) {
obj = type;
type = undefined;
}
type = type || "fx";
while( i-- ) {
tmp = jQuery._data( elements[ i ], type + "queueHooks" );
if ( tmp && tmp.empty ) {
count++;
tmp.empty.add( resolve );
}
}
resolve();
return defer.promise( obj );
}
});
var nodeHook, boolHook,
rclass = /[\t\r\n]/g,
rreturn = /\r/g,
rfocusable = /^(?:input|select|textarea|button|object)$/i,
rclickable = /^(?:a|area)$/i,
rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
ruseDefault = /^(?:checked|selected)$/i,
getSetAttribute = jQuery.support.getSetAttribute,
getSetInput = jQuery.support.input;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
},
removeProp: function( name ) {
name = jQuery.propFix[ name ] || name;
return this.each(function() {
// try/catch handles cases where IE balks (such as removing a property on window)
try {
this[ name ] = undefined;
delete this[ name ];
} catch( e ) {}
});
},
addClass: function( value ) {
var classes, elem, cur, clazz, j,
i = 0,
len = this.length,
proceed = typeof value === "string" && value;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).addClass( value.call( this, j, this.className ) );
});
}
if ( proceed ) {
// The disjunction here is for better compressibility (see removeClass)
classes = ( value || "" ).match( core_rnotwhite ) || [];
for ( ; i < len; i++ ) {
elem = this[ i ];
cur = elem.nodeType === 1 && ( elem.className ?
( " " + elem.className + " " ).replace( rclass, " " ) :
" "
);
if ( cur ) {
j = 0;
while ( (clazz = classes[j++]) ) {
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
}
elem.className = jQuery.trim( cur );
}
}
}
return this;
},
removeClass: function( value ) {
var classes, elem, cur, clazz, j,
i = 0,
len = this.length,
proceed = arguments.length === 0 || typeof value === "string" && value;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).removeClass( value.call( this, j, this.className ) );
});
}
if ( proceed ) {
classes = ( value || "" ).match( core_rnotwhite ) || [];
for ( ; i < len; i++ ) {
elem = this[ i ];
// This expression is here for better compressibility (see addClass)
cur = elem.nodeType === 1 && ( elem.className ?
( " " + elem.className + " " ).replace( rclass, " " ) :
""
);
if ( cur ) {
j = 0;
while ( (clazz = classes[j++]) ) {
// Remove *all* instances
while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
cur = cur.replace( " " + clazz + " ", " " );
}
}
elem.className = value ? jQuery.trim( cur ) : "";
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function( i ) {
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
});
}
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className,
i = 0,
self = jQuery( this ),
state = stateVal,
classNames = value.match( core_rnotwhite ) || [];
while ( (className = classNames[ i++ ]) ) {
// check each className given, space separated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
// Toggle whole class name
} else if ( type === core_strundefined || type === "boolean" ) {
if ( this.className ) {
// store className if set
jQuery._data( this, "__className__", this.className );
}
// If the element has a class name or if we're passed "false",
// then remove the whole classname (if there was one, the above saved it).
// Otherwise bring back whatever was previously saved (if anything),
// falling back to the empty string if nothing was stored.
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
}
});
},
hasClass: function( selector ) {
var className = " " + selector + " ",
i = 0,
l = this.length;
for ( ; i < l; i++ ) {
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
return true;
}
}
return false;
},
val: function( value ) {
var ret, hooks, isFunction,
elem = this[0];
if ( !arguments.length ) {
if ( elem ) {
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
}
ret = elem.value;
return typeof ret === "string" ?
// handle most common string cases
ret.replace(rreturn, "") :
// handle cases where value is null/undef or number
ret == null ? "" : ret;
}
return;
}
isFunction = jQuery.isFunction( value );
return this.each(function( i ) {
var val,
self = jQuery(this);
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, self.val() );
} else {
val = value;
}
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
} else if ( typeof val === "number" ) {
val += "";
} else if ( jQuery.isArray( val ) ) {
val = jQuery.map(val, function ( value ) {
return value == null ? "" : value + "";
});
}
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
// If set returns undefined, fall back to normal setting
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val;
}
});
}
});
jQuery.extend({
valHooks: {
option: {
get: function( elem ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
},
select: {
get: function( elem ) {
var value, option,
options = elem.options,
index = elem.selectedIndex,
one = elem.type === "select-one" || index < 0,
values = one ? null : [],
max = one ? index + 1 : options.length,
i = index < 0 ?
max :
one ? index : 0;
// Loop through all the selected options
for ( ; i < max; i++ ) {
option = options[ i ];
// oldIE doesn't update selected after form reset (#2551)
if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup
( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
// Get the specific value for the option
value = jQuery( option ).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
return values;
},
set: function( elem, value ) {
var values = jQuery.makeArray( value );
jQuery(elem).find("option").each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
elem.selectedIndex = -1;
}
return values;
}
}
},
attr: function( elem, name, value ) {
var hooks, notxml, ret,
nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
// Fallback to prop when attributes are not supported
if ( typeof elem.getAttribute === core_strundefined ) {
return jQuery.prop( elem, name, value );
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( notxml ) {
name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
elem.setAttribute( name, value + "" );
return value;
}
} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
// In IE9+, Flash objects don't have .getAttribute (#12945)
// Support: IE9+
if ( typeof elem.getAttribute !== core_strundefined ) {
ret = elem.getAttribute( name );
}
// Non-existent attributes return null, we normalize to undefined
return ret == null ?
undefined :
ret;
}
},
removeAttr: function( elem, value ) {
var name, propName,
i = 0,
attrNames = value && value.match( core_rnotwhite );
if ( attrNames && elem.nodeType === 1 ) {
while ( (name = attrNames[i++]) ) {
propName = jQuery.propFix[ name ] || name;
// Boolean attributes get special treatment (#10870)
if ( rboolean.test( name ) ) {
// Set corresponding property to false for boolean attributes
// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
if ( !getSetAttribute && ruseDefault.test( name ) ) {
elem[ jQuery.camelCase( "default-" + name ) ] =
elem[ propName ] = false;
} else {
elem[ propName ] = false;
}
// See #9699 for explanation of this approach (setting first, then removal)
} else {
jQuery.attr( elem, name, "" );
}
elem.removeAttribute( getSetAttribute ? name : propName );
}
}
},
attrHooks: {
type: {
set: function( elem, value ) {
if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to default in case type is set after value during creation
var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
elem.value = val;
}
return value;
}
}
}
},
propFix: {
tabindex: "tabIndex",
readonly: "readOnly",
"for": "htmlFor",
"class": "className",
maxlength: "maxLength",
cellspacing: "cellSpacing",
cellpadding: "cellPadding",
rowspan: "rowSpan",
colspan: "colSpan",
usemap: "useMap",
frameborder: "frameBorder",
contenteditable: "contentEditable"
},
prop: function( elem, name, value ) {
var ret, hooks, notxml,
nType = elem.nodeType;
// don't get/set properties on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
if ( notxml ) {
// Fix name and attach hooks
name = jQuery.propFix[ name ] || name;
hooks = jQuery.propHooks[ name ];
}
if ( value !== undefined ) {
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
return ( elem[ name ] = value );
}
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
return elem[ name ];
}
}
},
propHooks: {
tabIndex: {
get: function( elem ) {
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
var attributeNode = elem.getAttributeNode("tabindex");
return attributeNode && attributeNode.specified ?
parseInt( attributeNode.value, 10 ) :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
}
}
});
// Hook for boolean attributes
boolHook = {
get: function( elem, name ) {
var
// Use .prop to determine if this attribute is understood as boolean
prop = jQuery.prop( elem, name ),
// Fetch it accordingly
attr = typeof prop === "boolean" && elem.getAttribute( name ),
detail = typeof prop === "boolean" ?
getSetInput && getSetAttribute ?
attr != null :
// oldIE fabricates an empty string for missing boolean attributes
// and conflates checked/selected into attroperties
ruseDefault.test( name ) ?
elem[ jQuery.camelCase( "default-" + name ) ] :
!!attr :
// fetch an attribute node for properties not recognized as boolean
elem.getAttributeNode( name );
return detail && detail.value !== false ?
name.toLowerCase() :
undefined;
},
set: function( elem, value, name ) {
if ( value === false ) {
// Remove boolean attributes when set to false
jQuery.removeAttr( elem, name );
} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
// IE<8 needs the *property* name
elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
// Use defaultChecked and defaultSelected for oldIE
} else {
elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
}
return name;
}
};
// fix oldIE value attroperty
if ( !getSetInput || !getSetAttribute ) {
jQuery.attrHooks.value = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return jQuery.nodeName( elem, "input" ) ?
// Ignore the value *property* by using defaultValue
elem.defaultValue :
ret && ret.specified ? ret.value : undefined;
},
set: function( elem, value, name ) {
if ( jQuery.nodeName( elem, "input" ) ) {
// Does not return so that setAttribute is also used
elem.defaultValue = value;
} else {
// Use nodeHook if defined (#1954); otherwise setAttribute is fine
return nodeHook && nodeHook.set( elem, value, name );
}
}
};
}
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !getSetAttribute ) {
// Use this for any attribute in IE6/7
// This fixes almost every IE6/7 issue
nodeHook = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
ret.value :
undefined;
},
set: function( elem, value, name ) {
// Set the existing or create a new attribute node
var ret = elem.getAttributeNode( name );
if ( !ret ) {
elem.setAttributeNode(
(ret = elem.ownerDocument.createAttribute( name ))
);
}
ret.value = value += "";
// Break association with cloned elements by also using setAttribute (#9646)
return name === "value" || value === elem.getAttribute( name ) ?
value :
undefined;
}
};
// Set contenteditable to false on removals(#10429)
// Setting to empty string throws an error as an invalid value
jQuery.attrHooks.contenteditable = {
get: nodeHook.get,
set: function( elem, value, name ) {
nodeHook.set( elem, value === "" ? false : value, name );
}
};
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
// This is for removals
jQuery.each([ "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
});
});
}
// Some attributes require a special call on IE
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !jQuery.support.hrefNormalized ) {
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
get: function( elem ) {
var ret = elem.getAttribute( name, 2 );
return ret == null ? undefined : ret;
}
});
});
// href/src property should get the full normalized URL (#10299/#12915)
jQuery.each([ "href", "src" ], function( i, name ) {
jQuery.propHooks[ name ] = {
get: function( elem ) {
return elem.getAttribute( name, 4 );
}
};
});
}
if ( !jQuery.support.style ) {
jQuery.attrHooks.style = {
get: function( elem ) {
// Return undefined in the case of empty string
// Note: IE uppercases css property names, but if we were to .toLowerCase()
// .cssText, that would destroy case senstitivity in URL's, like in "background"
return elem.style.cssText || undefined;
},
set: function( elem, value ) {
return ( elem.style.cssText = value + "" );
}
};
}
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
get: function( elem ) {
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
// Make sure that it also works with optgroups, see #5701
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
return null;
}
});
}
// IE6/7 call enctype encoding
if ( !jQuery.support.enctype ) {
jQuery.propFix.enctype = "encoding";
}
// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
get: function( elem ) {
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
}
};
});
}
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
}
}
});
});
var rformElems = /^(?:input|select|textarea)$/i,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
function returnTrue() {
return true;
}
function returnFalse() {
return false;
}
/*
* Helper functions for managing events -- not part of the public interface.
* Props to Dean Edwards' addEvent library for many of the ideas.
*/
jQuery.event = {
global: {},
add: function( elem, types, handler, data, selector ) {
var tmp, events, t, handleObjIn,
special, eventHandle, handleObj,
handlers, type, namespaces, origType,
elemData = jQuery._data( elem );
// Don't attach events to noData or text/comment nodes (but allow plain objects)
if ( !elemData ) {
return;
}
// Caller can pass in an object of custom data in lieu of the handler
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
selector = handleObjIn.selector;
}
// Make sure that the handler has a unique ID, used to find/remove it later
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure and main handler, if this is the first
if ( !(events = elemData.events) ) {
events = elemData.events = {};
}
if ( !(eventHandle = elemData.handle) ) {
eventHandle = elemData.handle = function( e ) {
// Discard the second event of a jQuery.event.trigger() and
// when an event is called after a page has unloaded
return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
undefined;
};
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
eventHandle.elem = elem;
}
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
types = ( types || "" ).match( core_rnotwhite ) || [""];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
type = origType = tmp[1];
namespaces = ( tmp[2] || "" ).split( "." ).sort();
// If event changes its type, use the special event handlers for the changed type
special = jQuery.event.special[ type ] || {};
// If selector defined, determine special event api type, otherwise given type
type = ( selector ? special.delegateType : special.bindType ) || type;
// Update special based on newly reset type
special = jQuery.event.special[ type ] || {};
// handleObj is passed to all event handlers
handleObj = jQuery.extend({
type: type,
origType: origType,
data: data,
handler: handler,
guid: handler.guid,
selector: selector,
needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
namespace: namespaces.join(".")
}, handleObjIn );
// Init the event handler queue if we're the first
if ( !(handlers = events[ type ]) ) {
handlers = events[ type ] = [];
handlers.delegateCount = 0;
// Only use addEventListener/attachEvent if the special events handler returns false
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
// Bind the global event handler to the element
if ( elem.addEventListener ) {
elem.addEventListener( type, eventHandle, false );
} else if ( elem.attachEvent ) {
elem.attachEvent( "on" + type, eventHandle );
}
}
}
if ( special.add ) {
special.add.call( elem, handleObj );
if ( !handleObj.handler.guid ) {
handleObj.handler.guid = handler.guid;
}
}
// Add to the element's handler list, delegates in front
if ( selector ) {
handlers.splice( handlers.delegateCount++, 0, handleObj );
} else {
handlers.push( handleObj );
}
// Keep track of which events have ever been used, for event optimization
jQuery.event.global[ type ] = true;
}
// Nullify elem to prevent memory leaks in IE
elem = null;
},
// Detach an event or set of events from an element
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, handleObj, tmp,
origCount, t, events,
special, handlers, type,
namespaces, origType,
elemData = jQuery.hasData( elem ) && jQuery._data( elem );
if ( !elemData || !(events = elemData.events) ) {
return;
}
// Once for each type.namespace in types; type may be omitted
types = ( types || "" ).match( core_rnotwhite ) || [""];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
type = origType = tmp[1];
namespaces = ( tmp[2] || "" ).split( "." ).sort();
// Unbind all events (on this namespace, if provided) for the element
if ( !type ) {
for ( type in events ) {
jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
}
continue;
}
special = jQuery.event.special[ type ] || {};
type = ( selector ? special.delegateType : special.bindType ) || type;
handlers = events[ type ] || [];
tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
// Remove matching events
origCount = j = handlers.length;
while ( j-- ) {
handleObj = handlers[ j ];
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );
if ( handleObj.selector ) {
handlers.delegateCount--;
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
}
// Remove generic event handler if we removed something and no more handlers exist
// (avoids potential for endless recursion during removal of special event handlers)
if ( origCount && !handlers.length ) {
if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
delete elemData.handle;
// removeData also checks for emptiness and clears the expando if empty
// so use it instead of delete
jQuery._removeData( elem, "events" );
}
},
trigger: function( event, data, elem, onlyHandlers ) {
var handle, ontype, cur,
bubbleType, special, tmp, i,
eventPath = [ elem || document ],
type = core_hasOwn.call( event, "type" ) ? event.type : event,
namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
cur = tmp = elem = elem || document;
// Don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
// focus/blur morphs to focusin/out; ensure we're not firing them right now
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
return;
}
if ( type.indexOf(".") >= 0 ) {
// Namespaced trigger; create a regexp to match event type in handle()
namespaces = type.split(".");
type = namespaces.shift();
namespaces.sort();
}
ontype = type.indexOf(":") < 0 && "on" + type;
// Caller can pass in a jQuery.Event object, Object, or just an event type string
event = event[ jQuery.expando ] ?
event :
new jQuery.Event( type, typeof event === "object" && event );
event.isTrigger = true;
event.namespace = namespaces.join(".");
event.namespace_re = event.namespace ?
new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
null;
// Clean up the event in case it is being reused
event.result = undefined;
if ( !event.target ) {
event.target = elem;
}
// Clone any incoming data and prepend the event, creating the handler arg list
data = data == null ?
[ event ] :
jQuery.makeArray( data, [ event ] );
// Allow special events to draw outside the lines
special = jQuery.event.special[ type ] || {};
if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
return;
}
// Determine event propagation path in advance, per W3C events spec (#9951)
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
bubbleType = special.delegateType || type;
if ( !rfocusMorph.test( bubbleType + type ) ) {
cur = cur.parentNode;
}
for ( ; cur; cur = cur.parentNode ) {
eventPath.push( cur );
tmp = cur;
}
// Only add window if we got to document (e.g., not plain obj or detached DOM)
if ( tmp === (elem.ownerDocument || document) ) {
eventPath.push( tmp.defaultView || tmp.parentWindow || window );
}
}
// Fire handlers on the event path
i = 0;
while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
event.type = i > 1 ?
bubbleType :
special.bindType || type;
// jQuery handler
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
if ( handle ) {
handle.apply( cur, data );
}
// Native handler
handle = ontype && cur[ ontype ];
if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
event.preventDefault();
}
}
event.type = type;
// If nobody prevented the default action, do it now
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
// Call a native DOM method on the target with the same name name as the event.
// Can't use an .isFunction() check here because IE6/7 fails that test.
// Don't do default actions on window, that's where global variables be (#6170)
if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
// Don't re-trigger an onFOO event when we call its FOO() method
tmp = elem[ ontype ];
if ( tmp ) {
elem[ ontype ] = null;
}
// Prevent re-triggering of the same event, since we already bubbled it above
jQuery.event.triggered = type;
try {
elem[ type ]();
} catch ( e ) {
// IE<9 dies on focus/blur to hidden element (#1486,#12518)
// only reproducible on winXP IE8 native, not IE9 in IE8 mode
}
jQuery.event.triggered = undefined;
if ( tmp ) {
elem[ ontype ] = tmp;
}
}
}
}
return event.result;
},
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event );
var i, ret, handleObj, matched, j,
handlerQueue = [],
args = core_slice.call( arguments ),
handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
special = jQuery.event.special[ event.type ] || {};
// Use the fix-ed jQuery.Event rather than the (read-only) native event
args[0] = event;
event.delegateTarget = this;
// Call the preDispatch hook for the mapped type, and let it bail if desired
if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
return;
}
// Determine handlers
handlerQueue = jQuery.event.handlers.call( this, event, handlers );
// Run delegates first; they may want to stop propagation beneath us
i = 0;
while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
event.currentTarget = matched.elem;
j = 0;
while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
// Triggered event must either 1) have no namespace, or
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
event.handleObj = handleObj;
event.data = handleObj.data;
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
.apply( matched.elem, args );
if ( ret !== undefined ) {
if ( (event.result = ret) === false ) {
event.preventDefault();
event.stopPropagation();
}
}
}
}
}
// Call the postDispatch hook for the mapped type
if ( special.postDispatch ) {
special.postDispatch.call( this, event );
}
return event.result;
},
handlers: function( event, handlers ) {
var sel, handleObj, matches, i,
handlerQueue = [],
delegateCount = handlers.delegateCount,
cur = event.target;
// Find delegate handlers
// Black-hole SVG <use> instance trees (#13180)
// Avoid non-left-click bubbling in Firefox (#3861)
if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
for ( ; cur != this; cur = cur.parentNode || this ) {
// Don't check non-elements (#13208)
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
matches = [];
for ( i = 0; i < delegateCount; i++ ) {
handleObj = handlers[ i ];
// Don't conflict with Object.prototype properties (#13203)
sel = handleObj.selector + " ";
if ( matches[ sel ] === undefined ) {
matches[ sel ] = handleObj.needsContext ?
jQuery( sel, this ).index( cur ) >= 0 :
jQuery.find( sel, this, null, [ cur ] ).length;
}
if ( matches[ sel ] ) {
matches.push( handleObj );
}
}
if ( matches.length ) {
handlerQueue.push({ elem: cur, handlers: matches });
}
}
}
}
// Add the remaining (directly-bound) handlers
if ( delegateCount < handlers.length ) {
handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
}
return handlerQueue;
},
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
// Create a writable copy of the event object and normalize some properties
var i, prop, copy,
type = event.type,
originalEvent = event,
fixHook = this.fixHooks[ type ];
if ( !fixHook ) {
this.fixHooks[ type ] = fixHook =
rmouseEvent.test( type ) ? this.mouseHooks :
rkeyEvent.test( type ) ? this.keyHooks :
{};
}
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
event = new jQuery.Event( originalEvent );
i = copy.length;
while ( i-- ) {
prop = copy[ i ];
event[ prop ] = originalEvent[ prop ];
}
// Support: IE<9
// Fix target property (#1925)
if ( !event.target ) {
event.target = originalEvent.srcElement || document;
}
// Support: Chrome 23+, Safari?
// Target should not be a text node (#504, #13143)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
// Support: IE<9
// For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
event.metaKey = !!event.metaKey;
return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
},
// Includes some event props shared by KeyEvent and MouseEvent
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
keyHooks: {
props: "char charCode key keyCode".split(" "),
filter: function( event, original ) {
// Add which for key events
if ( event.which == null ) {
event.which = original.charCode != null ? original.charCode : original.keyCode;
}
return event;
}
},
mouseHooks: {
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function( event, original ) {
var body, eventDoc, doc,
button = original.button,
fromElement = original.fromElement;
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && original.clientX != null ) {
eventDoc = event.target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
}
// Add relatedTarget, if necessary
if ( !event.relatedTarget && fromElement ) {
event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
}
// Add which for click: 1 === left; 2 === middle; 3 === right
// Note: button is not normalized, so don't use it
if ( !event.which && button !== undefined ) {
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
}
return event;
}
},
special: {
load: {
// Prevent triggered image.load events from bubbling to window.load
noBubble: true
},
click: {
// For checkbox, fire native event so checked state will be right
trigger: function() {
if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
this.click();
return false;
}
}
},
focus: {
// Fire native event if possible so blur/focus sequence is correct
trigger: function() {
if ( this !== document.activeElement && this.focus ) {
try {
this.focus();
return false;
} catch ( e ) {
// Support: IE<9
// If we error on focus to hidden element (#1486, #12518),
// let .trigger() run the handlers
}
}
},
delegateType: "focusin"
},
blur: {
trigger: function() {
if ( this === document.activeElement && this.blur ) {
this.blur();
return false;
}
},
delegateType: "focusout"
},
beforeunload: {
postDispatch: function( event ) {
// Even when returnValue equals to undefined Firefox will still show alert
if ( event.result !== undefined ) {
event.originalEvent.returnValue = event.result;
}
}
}
},
simulate: function( type, elem, event, bubble ) {
// Piggyback on a donor event to simulate a different one.
// Fake originalEvent to avoid donor's stopPropagation, but if the
// simulated event prevents default then we do the same on the donor.
var e = jQuery.extend(
new jQuery.Event(),
event,
{ type: type,
isSimulated: true,
originalEvent: {}
}
);
if ( bubble ) {
jQuery.event.trigger( e, null, elem );
} else {
jQuery.event.dispatch.call( elem, e );
}
if ( e.isDefaultPrevented() ) {
event.preventDefault();
}
}
};
jQuery.removeEvent = document.removeEventListener ?
function( elem, type, handle ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false );
}
} :
function( elem, type, handle ) {
var name = "on" + type;
if ( elem.detachEvent ) {
// #8545, #7054, preventing memory leaks for custom events in IE6-8
// detachEvent needed property on element, by name of that event, to properly expose it to GC
if ( typeof elem[ name ] === core_strundefined ) {
elem[ name ] = null;
}
elem.detachEvent( name, handle );
}
};
jQuery.Event = function( src, props ) {
// Allow instantiation without the 'new' keyword
if ( !(this instanceof jQuery.Event) ) {
return new jQuery.Event( src, props );
}
// Event object
if ( src && src.type ) {
this.originalEvent = src;
this.type = src.type;
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
// Event type
} else {
this.type = src;
}
// Put explicitly provided properties onto the event object
if ( props ) {
jQuery.extend( this, props );
}
// Create a timestamp if incoming event doesn't have one
this.timeStamp = src && src.timeStamp || jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
};
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse,
preventDefault: function() {
var e = this.originalEvent;
this.isDefaultPrevented = returnTrue;
if ( !e ) {
return;
}
// If preventDefault exists, run it on the original event
if ( e.preventDefault ) {
e.preventDefault();
// Support: IE
// Otherwise set the returnValue property of the original event to false
} else {
e.returnValue = false;
}
},
stopPropagation: function() {
var e = this.originalEvent;
this.isPropagationStopped = returnTrue;
if ( !e ) {
return;
}
// If stopPropagation exists, run it on the original event
if ( e.stopPropagation ) {
e.stopPropagation();
}
// Support: IE
// Set the cancelBubble property of the original event to true
e.cancelBubble = true;
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
}
};
// Create mouseenter/leave events using mouseover/out and event-time checks
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
delegateType: fix,
bindType: fix,
handle: function( event ) {
var ret,
target = this,
related = event.relatedTarget,
handleObj = event.handleObj;
// For mousenter/leave call the handler if related is outside the target.
// NB: No relatedTarget if the mouse left/entered the browser window
if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
event.type = handleObj.origType;
ret = handleObj.handler.apply( this, arguments );
event.type = fix;
}
return ret;
}
};
});
// IE submit delegation
if ( !jQuery.support.submitBubbles ) {
jQuery.event.special.submit = {
setup: function() {
// Only need this for delegated form submit events
if ( jQuery.nodeName( this, "form" ) ) {
return false;
}
// Lazy-add a submit handler when a descendant form may potentially be submitted
jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
// Node name check avoids a VML-related crash in IE (#9807)
var elem = e.target,
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
if ( form && !jQuery._data( form, "submitBubbles" ) ) {
jQuery.event.add( form, "submit._submit", function( event ) {
event._submit_bubble = true;
});
jQuery._data( form, "submitBubbles", true );
}
});
// return undefined since we don't need an event listener
},
postDispatch: function( event ) {
// If form was submitted by the user, bubble the event up the tree
if ( event._submit_bubble ) {
delete event._submit_bubble;
if ( this.parentNode && !event.isTrigger ) {
jQuery.event.simulate( "submit", this.parentNode, event, true );
}
}
},
teardown: function() {
// Only need this for delegated form submit events
if ( jQuery.nodeName( this, "form" ) ) {
return false;
}
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
jQuery.event.remove( this, "._submit" );
}
};
}
// IE change delegation and checkbox/radio fix
if ( !jQuery.support.changeBubbles ) {
jQuery.event.special.change = {
setup: function() {
if ( rformElems.test( this.nodeName ) ) {
// IE doesn't fire change on a check/radio until blur; trigger it on click
// after a propertychange. Eat the blur-change in special.change.handle.
// This still fires onchange a second time for check/radio after blur.
if ( this.type === "checkbox" || this.type === "radio" ) {
jQuery.event.add( this, "propertychange._change", function( event ) {
if ( event.originalEvent.propertyName === "checked" ) {
this._just_changed = true;
}
});
jQuery.event.add( this, "click._change", function( event ) {
if ( this._just_changed && !event.isTrigger ) {
this._just_changed = false;
}
// Allow triggered, simulated change events (#11500)
jQuery.event.simulate( "change", this, event, true );
});
}
return false;
}
// Delegated event; lazy-add a change handler on descendant inputs
jQuery.event.add( this, "beforeactivate._change", function( e ) {
var elem = e.target;
if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
jQuery.event.add( elem, "change._change", function( event ) {
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
jQuery.event.simulate( "change", this.parentNode, event, true );
}
});
jQuery._data( elem, "changeBubbles", true );
}
});
},
handle: function( event ) {
var elem = event.target;
// Swallow native change events from checkbox/radio, we already triggered them above
if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
return event.handleObj.handler.apply( this, arguments );
}
},
teardown: function() {
jQuery.event.remove( this, "._change" );
return !rformElems.test( this.nodeName );
}
};
}
// Create "bubbling" focus and blur events
if ( !jQuery.support.focusinBubbles ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler while someone wants focusin/focusout
var attaches = 0,
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
};
jQuery.event.special[ fix ] = {
setup: function() {
if ( attaches++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --attaches === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
});
}
jQuery.fn.extend({
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
var type, origFn;
// Types can be a map of types/handlers
if ( typeof types === "object" ) {
// ( types-Object, selector, data )
if ( typeof selector !== "string" ) {
// ( types-Object, data )
data = data || selector;
selector = undefined;
}
for ( type in types ) {
this.on( type, selector, data, types[ type ], one );
}
return this;
}
if ( data == null && fn == null ) {
// ( types, fn )
fn = selector;
data = selector = undefined;
} else if ( fn == null ) {
if ( typeof selector === "string" ) {
// ( types, selector, fn )
fn = data;
data = undefined;
} else {
// ( types, data, fn )
fn = data;
data = selector;
selector = undefined;
}
}
if ( fn === false ) {
fn = returnFalse;
} else if ( !fn ) {
return this;
}
if ( one === 1 ) {
origFn = fn;
fn = function( event ) {
// Can use an empty set, since event contains the info
jQuery().off( event );
return origFn.apply( this, arguments );
};
// Use same guid so caller can remove using origFn
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
}
return this.each( function() {
jQuery.event.add( this, types, fn, data, selector );
});
},
one: function( types, selector, data, fn ) {
return this.on( types, selector, data, fn, 1 );
},
off: function( types, selector, fn ) {
var handleObj, type;
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
handleObj = types.handleObj;
jQuery( types.delegateTarget ).off(
handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
handleObj.selector,
handleObj.handler
);
return this;
}
if ( typeof types === "object" ) {
// ( types-object [, selector] )
for ( type in types ) {
this.off( type, selector, types[ type ] );
}
return this;
}
if ( selector === false || typeof selector === "function" ) {
// ( types [, fn] )
fn = selector;
selector = undefined;
}
if ( fn === false ) {
fn = returnFalse;
}
return this.each(function() {
jQuery.event.remove( this, types, fn, selector );
});
},
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
},
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
},
triggerHandler: function( type, data ) {
var elem = this[0];
if ( elem ) {
return jQuery.event.trigger( type, data, elem, true );
}
}
});
/*!
* Sizzle CSS Selector Engine
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://sizzlejs.com/
*/
(function( window, undefined ) {
var i,
cachedruns,
Expr,
getText,
isXML,
compile,
hasDuplicate,
outermostContext,
// Local document vars
setDocument,
document,
docElem,
documentIsXML,
rbuggyQSA,
rbuggyMatches,
matches,
contains,
sortOrder,
// Instance-specific data
expando = "sizzle" + -(new Date()),
preferredDoc = window.document,
support = {},
dirruns = 0,
done = 0,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
// General-purpose constants
strundefined = typeof undefined,
MAX_NEGATIVE = 1 << 31,
// Array methods
arr = [],
pop = arr.pop,
push = arr.push,
slice = arr.slice,
// Use a stripped-down indexOf if we can't use a native one
indexOf = arr.indexOf || function( elem ) {
var i = 0,
len = this.length;
for ( ; i < len; i++ ) {
if ( this[i] === elem ) {
return i;
}
}
return -1;
},
// Regular expressions
// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
whitespace = "[\\x20\\t\\r\\n\\f]",
// http://www.w3.org/TR/css3-syntax/#characters
characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
// Loosely modeled on CSS identifier characters
// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
identifier = characterEncoding.replace( "w", "w#" ),
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
operators = "([*^$|!~]?=)",
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
// Prefer arguments quoted,
// then not containing pseudos/brackets,
// then attribute selectors/non-parenthetical expressions,
// then anything else
// These preferences are here to reduce the number of selectors
// needing tokenize in the PSEUDO preFilter
pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = {
"ID": new RegExp( "^#(" + characterEncoding + ")" ),
"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
"NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
"ATTR": new RegExp( "^" + attributes ),
"PSEUDO": new RegExp( "^" + pseudos ),
"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
// For use in libraries implementing .is()
// We use this for POS matching in `select`
"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
},
rsibling = /[\x20\t\r\n\f]*[+~]/,
rnative = /^[^{]+\{\s*\[native code/,
// Easily-parseable/retrievable ID or TAG or CLASS selectors
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,
rescape = /'|\\/g,
rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
funescape = function( _, escaped ) {
var high = "0x" + escaped - 0x10000;
// NaN means non-codepoint
return high !== high ?
escaped :
// BMP codepoint
high < 0 ?
String.fromCharCode( high + 0x10000 ) :
// Supplemental Plane codepoint (surrogate pair)
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
};
// Use a stripped-down slice if we can't use a native one
try {
slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
} catch ( e ) {
slice = function( i ) {
var elem,
results = [];
while ( (elem = this[i++]) ) {
results.push( elem );
}
return results;
};
}
/**
* For feature detection
* @param {Function} fn The function to test for native support
*/
function isNative( fn ) {
return rnative.test( fn + "" );
}
/**
* Create key-value caches of limited size
* @returns {Function(string, Object)} Returns the Object data after storing it on itself with
* property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
* deleting the oldest entry
*/
function createCache() {
var cache,
keys = [];
return (cache = function( key, value ) {
// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
if ( keys.push( key += " " ) > Expr.cacheLength ) {
// Only keep the most recent entries
delete cache[ keys.shift() ];
}
return (cache[ key ] = value);
});
}
/**
* Mark a function for special use by Sizzle
* @param {Function} fn The function to mark
*/
function markFunction( fn ) {
fn[ expando ] = true;
return fn;
}
/**
* Support testing using an element
* @param {Function} fn Passed the created div and expects a boolean result
*/
function assert( fn ) {
var div = document.createElement("div");
try {
return fn( div );
} catch (e) {
return false;
} finally {
// release memory in IE
div = null;
}
}
function Sizzle( selector, context, results, seed ) {
var match, elem, m, nodeType,
// QSA vars
i, groups, old, nid, newContext, newSelector;
if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
setDocument( context );
}
context = context || document;
results = results || [];
if ( !selector || typeof selector !== "string" ) {
return results;
}
if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
return [];
}
if ( !documentIsXML && !seed ) {
// Shortcuts
if ( (match = rquickExpr.exec( selector )) ) {
// Speed-up: Sizzle("#ID")
if ( (m = match[1]) ) {
if ( nodeType === 9 ) {
elem = context.getElementById( m );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE, Opera, and Webkit return items
// by name instead of ID
if ( elem.id === m ) {
results.push( elem );
return results;
}
} else {
return results;
}
} else {
// Context is not a document
if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
contains( context, elem ) && elem.id === m ) {
results.push( elem );
return results;
}
}
// Speed-up: Sizzle("TAG")
} else if ( match[2] ) {
push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
return results;
// Speed-up: Sizzle(".CLASS")
} else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
return results;
}
}
// QSA path
if ( support.qsa && !rbuggyQSA.test(selector) ) {
old = true;
nid = expando;
newContext = context;
newSelector = nodeType === 9 && selector;
// qSA works strangely on Element-rooted queries
// We can work around this by specifying an extra ID on the root
// and working up from there (Thanks to Andrew Dupont for the technique)
// IE 8 doesn't work on object elements
if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
groups = tokenize( selector );
if ( (old = context.getAttribute("id")) ) {
nid = old.replace( rescape, "\\$&" );
} else {
context.setAttribute( "id", nid );
}
nid = "[id='" + nid + "'] ";
i = groups.length;
while ( i-- ) {
groups[i] = nid + toSelector( groups[i] );
}
newContext = rsibling.test( selector ) && context.parentNode || context;
newSelector = groups.join(",");
}
if ( newSelector ) {
try {
push.apply( results, slice.call( newContext.querySelectorAll(
newSelector
), 0 ) );
return results;
} catch(qsaError) {
} finally {
if ( !old ) {
context.removeAttribute("id");
}
}
}
}
}
// All others
return select( selector.replace( rtrim, "$1" ), context, results, seed );
}
/**
* Detect xml
* @param {Element|Object} elem An element or a document
*/
isXML = Sizzle.isXML = function( elem ) {
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
var documentElement = elem && (elem.ownerDocument || elem).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false;
};
/**
* Sets document-related variables once based on the current document
* @param {Element|Object} [doc] An element or document object to use to set the document
* @returns {Object} Returns the current document
*/
setDocument = Sizzle.setDocument = function( node ) {
var doc = node ? node.ownerDocument || node : preferredDoc;
// If no document and documentElement is available, return
if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
return document;
}
// Set our document
document = doc;
docElem = doc.documentElement;
// Support tests
documentIsXML = isXML( doc );
// Check if getElementsByTagName("*") returns only elements
support.tagNameNoComments = assert(function( div ) {
div.appendChild( doc.createComment("") );
return !div.getElementsByTagName("*").length;
});
// Check if attributes should be retrieved by attribute nodes
support.attributes = assert(function( div ) {
div.innerHTML = "<select></select>";
var type = typeof div.lastChild.getAttribute("multiple");
// IE8 returns a string for some attributes even when not present
return type !== "boolean" && type !== "string";
});
// Check if getElementsByClassName can be trusted
support.getByClassName = assert(function( div ) {
// Opera can't find a second classname (in 9.6)
div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
return false;
}
// Safari 3.2 caches class attributes and doesn't catch changes
div.lastChild.className = "e";
return div.getElementsByClassName("e").length === 2;
});
// Check if getElementById returns elements by name
// Check if getElementsByName privileges form controls or returns elements by ID
support.getByName = assert(function( div ) {
// Inject content
div.id = expando + 0;
div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
docElem.insertBefore( div, docElem.firstChild );
// Test
var pass = doc.getElementsByName &&
// buggy browsers will return fewer than the correct 2
doc.getElementsByName( expando ).length === 2 +
// buggy browsers will return more than the correct 0
doc.getElementsByName( expando + 0 ).length;
support.getIdNotName = !doc.getElementById( expando );
// Cleanup
docElem.removeChild( div );
return pass;
});
// IE6/7 return modified attributes
Expr.attrHandle = assert(function( div ) {
div.innerHTML = "<a href='#'></a>";
return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
div.firstChild.getAttribute("href") === "#";
}) ?
{} :
{
"href": function( elem ) {
return elem.getAttribute( "href", 2 );
},
"type": function( elem ) {
return elem.getAttribute("type");
}
};
// ID find and filter
if ( support.getIdNotName ) {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
var m = context.getElementById( id );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
return m && m.parentNode ? [m] : [];
}
};
Expr.filter["ID"] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
return elem.getAttribute("id") === attrId;
};
};
} else {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
var m = context.getElementById( id );
return m ?
m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
[m] :
undefined :
[];
}
};
Expr.filter["ID"] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
return node && node.value === attrId;
};
};
}
// Tag
Expr.find["TAG"] = support.tagNameNoComments ?
function( tag, context ) {
if ( typeof context.getElementsByTagName !== strundefined ) {
return context.getElementsByTagName( tag );
}
} :
function( tag, context ) {
var elem,
tmp = [],
i = 0,
results = context.getElementsByTagName( tag );
// Filter out possible comments
if ( tag === "*" ) {
while ( (elem = results[i++]) ) {
if ( elem.nodeType === 1 ) {
tmp.push( elem );
}
}
return tmp;
}
return results;
};
// Name
Expr.find["NAME"] = support.getByName && function( tag, context ) {
if ( typeof context.getElementsByName !== strundefined ) {
return context.getElementsByName( name );
}
};
// Class
Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
return context.getElementsByClassName( className );
}
};
// QSA and matchesSelector support
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
rbuggyMatches = [];
// qSa(:focus) reports false when true (Chrome 21),
// no need to also add to buggyMatches since matches checks buggyQSA
// A support test would require too much code (would include document ready)
rbuggyQSA = [ ":focus" ];
if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
// Build QSA regex
// Regex strategy adopted from Diego Perini
assert(function( div ) {
// Select is set to empty string on purpose
// This is to test IE's treatment of not explictly
// setting a boolean content attribute,
// since its presence should be enough
// http://bugs.jquery.com/ticket/12359
div.innerHTML = "<select><option selected=''></option></select>";
// IE8 - Some boolean attributes are not treated correctly
if ( !div.querySelectorAll("[selected]").length ) {
rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
}
// Webkit/Opera - :checked should return selected option elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
// IE8 throws error here and will not see later tests
if ( !div.querySelectorAll(":checked").length ) {
rbuggyQSA.push(":checked");
}
});
assert(function( div ) {
// Opera 10-12/IE8 - ^= $= *= and empty values
// Should not select anything
div.innerHTML = "<input type='hidden' i=''/>";
if ( div.querySelectorAll("[i^='']").length ) {
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
}
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
// IE8 throws error here and will not see later tests
if ( !div.querySelectorAll(":enabled").length ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}
// Opera 10-11 does not throw on post-comma invalid pseudos
div.querySelectorAll("*,:x");
rbuggyQSA.push(",.*:");
});
}
if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
docElem.mozMatchesSelector ||
docElem.webkitMatchesSelector ||
docElem.oMatchesSelector ||
docElem.msMatchesSelector) )) ) {
assert(function( div ) {
// Check to see if it's possible to do matchesSelector
// on a disconnected node (IE 9)
support.disconnectedMatch = matches.call( div, "div" );
// This should fail with an exception
// Gecko does not error, returns false instead
matches.call( div, "[s!='']:x" );
rbuggyMatches.push( "!=", pseudos );
});
}
rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
// Element contains another
// Purposefully does not implement inclusive descendent
// As in, an element does not contain itself
contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && (
adown.contains ?
adown.contains( bup ) :
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
));
} :
function( a, b ) {
if ( b ) {
while ( (b = b.parentNode) ) {
if ( b === a ) {
return true;
}
}
}
return false;
};
// Document order sorting
sortOrder = docElem.compareDocumentPosition ?
function( a, b ) {
var compare;
if ( a === b ) {
hasDuplicate = true;
return 0;
}
if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
if ( a === doc || contains( preferredDoc, a ) ) {
return -1;
}
if ( b === doc || contains( preferredDoc, b ) ) {
return 1;
}
return 0;
}
return compare & 4 ? -1 : 1;
}
return a.compareDocumentPosition ? -1 : 1;
} :
function( a, b ) {
var cur,
i = 0,
aup = a.parentNode,
bup = b.parentNode,
ap = [ a ],
bp = [ b ];
// Exit early if the nodes are identical
if ( a === b ) {
hasDuplicate = true;
return 0;
// Parentless nodes are either documents or disconnected
} else if ( !aup || !bup ) {
return a === doc ? -1 :
b === doc ? 1 :
aup ? -1 :
bup ? 1 :
0;
// If the nodes are siblings, we can do a quick check
} else if ( aup === bup ) {
return siblingCheck( a, b );
}
// Otherwise we need full lists of their ancestors for comparison
cur = a;
while ( (cur = cur.parentNode) ) {
ap.unshift( cur );
}
cur = b;
while ( (cur = cur.parentNode) ) {
bp.unshift( cur );
}
// Walk down the tree looking for a discrepancy
while ( ap[i] === bp[i] ) {
i++;
}
return i ?
// Do a sibling check if the nodes have a common ancestor
siblingCheck( ap[i], bp[i] ) :
// Otherwise nodes in our document sort first
ap[i] === preferredDoc ? -1 :
bp[i] === preferredDoc ? 1 :
0;
};
// Always assume the presence of duplicates if sort doesn't
// pass them to our comparison function (as in Google Chrome).
hasDuplicate = false;
[0, 0].sort( sortOrder );
support.detectDuplicates = hasDuplicate;
return document;
};
Sizzle.matches = function( expr, elements ) {
return Sizzle( expr, null, null, elements );
};
Sizzle.matchesSelector = function( elem, expr ) {
// Set document vars if needed
if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
// Make sure that attribute selectors are quoted
expr = expr.replace( rattributeQuotes, "='$1']" );
// rbuggyQSA always contains :focus, so no need for an existence check
if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
try {
var ret = matches.call( elem, expr );
// IE 9's matchesSelector returns false on disconnected nodes
if ( ret || support.disconnectedMatch ||
// As well, disconnected nodes are said to be in a document
// fragment in IE 9
elem.document && elem.document.nodeType !== 11 ) {
return ret;
}
} catch(e) {}
}
return Sizzle( expr, document, null, [elem] ).length > 0;
};
Sizzle.contains = function( context, elem ) {
// Set document vars if needed
if ( ( context.ownerDocument || context ) !== document ) {
setDocument( context );
}
return contains( context, elem );
};
Sizzle.attr = function( elem, name ) {
var val;
// Set document vars if needed
if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
if ( !documentIsXML ) {
name = name.toLowerCase();
}
if ( (val = Expr.attrHandle[ name ]) ) {
return val( elem );
}
if ( documentIsXML || support.attributes ) {
return elem.getAttribute( name );
}
return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
name :
val && val.specified ? val.value : null;
};
Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
// Document sorting and removing duplicates
Sizzle.uniqueSort = function( results ) {
var elem,
duplicates = [],
i = 1,
j = 0;
// Unless we *know* we can detect duplicates, assume their presence
hasDuplicate = !support.detectDuplicates;
results.sort( sortOrder );
if ( hasDuplicate ) {
for ( ; (elem = results[i]); i++ ) {
if ( elem === results[ i - 1 ] ) {
j = duplicates.push( i );
}
}
while ( j-- ) {
results.splice( duplicates[ j ], 1 );
}
}
return results;
};
function siblingCheck( a, b ) {
var cur = b && a,
diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
// Use IE sourceIndex if available on both nodes
if ( diff ) {
return diff;
}
// Check if b follows a
if ( cur ) {
while ( (cur = cur.nextSibling) ) {
if ( cur === b ) {
return -1;
}
}
}
return a ? 1 : -1;
}
// Returns a function to use in pseudos for input types
function createInputPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === type;
};
}
// Returns a function to use in pseudos for buttons
function createButtonPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return (name === "input" || name === "button") && elem.type === type;
};
}
// Returns a function to use in pseudos for positionals
function createPositionalPseudo( fn ) {
return markFunction(function( argument ) {
argument = +argument;
return markFunction(function( seed, matches ) {
var j,
matchIndexes = fn( [], seed.length, argument ),
i = matchIndexes.length;
// Match elements found at the specified indexes
while ( i-- ) {
if ( seed[ (j = matchIndexes[i]) ] ) {
seed[j] = !(matches[j] = seed[j]);
}
}
});
});
}
/**
* Utility function for retrieving the text value of an array of DOM nodes
* @param {Array|Element} elem
*/
getText = Sizzle.getText = function( elem ) {
var node,
ret = "",
i = 0,
nodeType = elem.nodeType;
if ( !nodeType ) {
// If no nodeType, this is expected to be an array
for ( ; (node = elem[i]); i++ ) {
// Do not traverse comment nodes
ret += getText( node );
}
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
// Use textContent for elements
// innerText usage removed for consistency of new lines (see #11153)
if ( typeof elem.textContent === "string" ) {
return elem.textContent;
} else {
// Traverse its children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
ret += getText( elem );
}
}
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}
// Do not include comment or processing instruction nodes
return ret;
};
Expr = Sizzle.selectors = {
// Can be adjusted by the user
cacheLength: 50,
createPseudo: markFunction,
match: matchExpr,
find: {},
relative: {
">": { dir: "parentNode", first: true },
" ": { dir: "parentNode" },
"+": { dir: "previousSibling", first: true },
"~": { dir: "previousSibling" }
},
preFilter: {
"ATTR": function( match ) {
match[1] = match[1].replace( runescape, funescape );
// Move the given value to match[3] whether quoted or unquoted
match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
if ( match[2] === "~=" ) {
match[3] = " " + match[3] + " ";
}
return match.slice( 0, 4 );
},
"CHILD": function( match ) {
/* matches from matchExpr["CHILD"]
1 type (only|nth|...)
2 what (child|of-type)
3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
4 xn-component of xn+y argument ([+-]?\d*n|)
5 sign of xn-component
6 x of xn-component
7 sign of y-component
8 y of y-component
*/
match[1] = match[1].toLowerCase();
if ( match[1].slice( 0, 3 ) === "nth" ) {
// nth-* requires argument
if ( !match[3] ) {
Sizzle.error( match[0] );
}
// numeric x and y parameters for Expr.filter.CHILD
// remember that false/true cast respectively to 0/1
match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
// other types prohibit arguments
} else if ( match[3] ) {
Sizzle.error( match[0] );
}
return match;
},
"PSEUDO": function( match ) {
var excess,
unquoted = !match[5] && match[2];
if ( matchExpr["CHILD"].test( match[0] ) ) {
return null;
}
// Accept quoted arguments as-is
if ( match[4] ) {
match[2] = match[4];
// Strip excess characters from unquoted arguments
} else if ( unquoted && rpseudo.test( unquoted ) &&
// Get excess from tokenize (recursively)
(excess = tokenize( unquoted, true )) &&
// advance to the next closing parenthesis
(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
// excess is a negative index
match[0] = match[0].slice( 0, excess );
match[2] = unquoted.slice( 0, excess );
}
// Return only captures needed by the pseudo filter method (type and argument)
return match.slice( 0, 3 );
}
},
filter: {
"TAG": function( nodeName ) {
if ( nodeName === "*" ) {
return function() { return true; };
}
nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
};
},
"CLASS": function( className ) {
var pattern = classCache[ className + " " ];
return pattern ||
(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
classCache( className, function( elem ) {
return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
});
},
"ATTR": function( name, operator, check ) {
return function( elem ) {
var result = Sizzle.attr( elem, name );
if ( result == null ) {
return operator === "!=";
}
if ( !operator ) {
return true;
}
result += "";
return operator === "=" ? result === check :
operator === "!=" ? result !== check :
operator === "^=" ? check && result.indexOf( check ) === 0 :
operator === "*=" ? check && result.indexOf( check ) > -1 :
operator === "$=" ? check && result.slice( -check.length ) === check :
operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
false;
};
},
"CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
return first === 1 && last === 0 ?
// Shortcut for :nth-*(n)
function( elem ) {
return !!elem.parentNode;
} :
function( elem, context, xml ) {
var cache, outerCache, node, diff, nodeIndex, start,
dir = simple !== forward ? "nextSibling" : "previousSibling",
parent = elem.parentNode,
name = ofType && elem.nodeName.toLowerCase(),
useCache = !xml && !ofType;
if ( parent ) {
// :(first|last|only)-(child|of-type)
if ( simple ) {
while ( dir ) {
node = elem;
while ( (node = node[ dir ]) ) {
if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
return false;
}
}
// Reverse direction for :only-* (if we haven't yet done so)
start = dir = type === "only" && !start && "nextSibling";
}
return true;
}
start = [ forward ? parent.firstChild : parent.lastChild ];
// non-xml :nth-child(...) stores cache data on `parent`
if ( forward && useCache ) {
// Seek `elem` from a previously-cached index
outerCache = parent[ expando ] || (parent[ expando ] = {});
cache = outerCache[ type ] || [];
nodeIndex = cache[0] === dirruns && cache[1];
diff = cache[0] === dirruns && cache[2];
node = nodeIndex && parent.childNodes[ nodeIndex ];
while ( (node = ++nodeIndex && node && node[ dir ] ||
// Fallback to seeking `elem` from the start
(diff = nodeIndex = 0) || start.pop()) ) {
// When found, cache indexes on `parent` and break
if ( node.nodeType === 1 && ++diff && node === elem ) {
outerCache[ type ] = [ dirruns, nodeIndex, diff ];
break;
}
}
// Use previously-cached element index if available
} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
diff = cache[1];
// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
} else {
// Use the same loop as above to seek `elem` from the start
while ( (node = ++nodeIndex && node && node[ dir ] ||
(diff = nodeIndex = 0) || start.pop()) ) {
if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
// Cache the index of each encountered element
if ( useCache ) {
(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
}
if ( node === elem ) {
break;
}
}
}
}
// Incorporate the offset, then check against cycle size
diff -= last;
return diff === first || ( diff % first === 0 && diff / first >= 0 );
}
};
},
"PSEUDO": function( pseudo, argument ) {
// pseudo-class names are case-insensitive
// http://www.w3.org/TR/selectors/#pseudo-classes
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
// Remember that setFilters inherits from pseudos
var args,
fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
Sizzle.error( "unsupported pseudo: " + pseudo );
// The user may use createPseudo to indicate that
// arguments are needed to create the filter function
// just as Sizzle does
if ( fn[ expando ] ) {
return fn( argument );
}
// But maintain support for old signatures
if ( fn.length > 1 ) {
args = [ pseudo, pseudo, "", argument ];
return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
markFunction(function( seed, matches ) {
var idx,
matched = fn( seed, argument ),
i = matched.length;
while ( i-- ) {
idx = indexOf.call( seed, matched[i] );
seed[ idx ] = !( matches[ idx ] = matched[i] );
}
}) :
function( elem ) {
return fn( elem, 0, args );
};
}
return fn;
}
},
pseudos: {
// Potentially complex pseudos
"not": markFunction(function( selector ) {
// Trim the selector passed to compile
// to avoid treating leading and trailing
// spaces as combinators
var input = [],
results = [],
matcher = compile( selector.replace( rtrim, "$1" ) );
return matcher[ expando ] ?
markFunction(function( seed, matches, context, xml ) {
var elem,
unmatched = matcher( seed, null, xml, [] ),
i = seed.length;
// Match elements unmatched by `matcher`
while ( i-- ) {
if ( (elem = unmatched[i]) ) {
seed[i] = !(matches[i] = elem);
}
}
}) :
function( elem, context, xml ) {
input[0] = elem;
matcher( input, null, xml, results );
return !results.pop();
};
}),
"has": markFunction(function( selector ) {
return function( elem ) {
return Sizzle( selector, elem ).length > 0;
};
}),
"contains": markFunction(function( text ) {
return function( elem ) {
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
};
}),
// "Whether an element is represented by a :lang() selector
// is based solely on the element's language value
// being equal to the identifier C,
// or beginning with the identifier C immediately followed by "-".
// The matching of C against the element's language value is performed case-insensitively.
// The identifier C does not have to be a valid language name."
// http://www.w3.org/TR/selectors/#lang-pseudo
"lang": markFunction( function( lang ) {
// lang value must be a valid identifider
if ( !ridentifier.test(lang || "") ) {
Sizzle.error( "unsupported lang: " + lang );
}
lang = lang.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
var elemLang;
do {
if ( (elemLang = documentIsXML ?
elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
elem.lang) ) {
elemLang = elemLang.toLowerCase();
return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
}
} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
return false;
};
}),
// Miscellaneous
"target": function( elem ) {
var hash = window.location && window.location.hash;
return hash && hash.slice( 1 ) === elem.id;
},
"root": function( elem ) {
return elem === docElem;
},
"focus": function( elem ) {
return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
},
// Boolean properties
"enabled": function( elem ) {
return elem.disabled === false;
},
"disabled": function( elem ) {
return elem.disabled === true;
},
"checked": function( elem ) {
// In CSS3, :checked should return both checked and selected elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
var nodeName = elem.nodeName.toLowerCase();
return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
},
"selected": function( elem ) {
// Accessing this property makes selected-by-default
// options in Safari work properly
if ( elem.parentNode ) {
elem.parentNode.selectedIndex;
}
return elem.selected === true;
},
// Contents
"empty": function( elem ) {
// http://www.w3.org/TR/selectors/#empty-pseudo
// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
// not comment, processing instructions, or others
// Thanks to Diego Perini for the nodeName shortcut
// Greater than "@" means alpha characters (specifically not starting with "#" or "?")
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
return false;
}
}
return true;
},
"parent": function( elem ) {
return !Expr.pseudos["empty"]( elem );
},
// Element/input types
"header": function( elem ) {
return rheader.test( elem.nodeName );
},
"input": function( elem ) {
return rinputs.test( elem.nodeName );
},
"button": function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === "button" || name === "button";
},
"text": function( elem ) {
var attr;
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
// use getAttribute instead to test this case
return elem.nodeName.toLowerCase() === "input" &&
elem.type === "text" &&
( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
},
// Position-in-collection
"first": createPositionalPseudo(function() {
return [ 0 ];
}),
"last": createPositionalPseudo(function( matchIndexes, length ) {
return [ length - 1 ];
}),
"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
return [ argument < 0 ? argument + length : argument ];
}),
"even": createPositionalPseudo(function( matchIndexes, length ) {
var i = 0;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"odd": createPositionalPseudo(function( matchIndexes, length ) {
var i = 1;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument;
for ( ; --i >= 0; ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument;
for ( ; ++i < length; ) {
matchIndexes.push( i );
}
return matchIndexes;
})
}
};
// Add button/input type pseudos
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
Expr.pseudos[ i ] = createInputPseudo( i );
}
for ( i in { submit: true, reset: true } ) {
Expr.pseudos[ i ] = createButtonPseudo( i );
}
function tokenize( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[ selector + " " ];
if ( cached ) {
return parseOnly ? 0 : cached.slice( 0 );
}
soFar = selector;
groups = [];
preFilters = Expr.preFilter;
while ( soFar ) {
// Comma and first run
if ( !matched || (match = rcomma.exec( soFar )) ) {
if ( match ) {
// Don't consume trailing commas as valid
soFar = soFar.slice( match[0].length ) || soFar;
}
groups.push( tokens = [] );
}
matched = false;
// Combinators
if ( (match = rcombinators.exec( soFar )) ) {
matched = match.shift();
tokens.push( {
value: matched,
// Cast descendant combinators to space
type: match[0].replace( rtrim, " " )
} );
soFar = soFar.slice( matched.length );
}
// Filters
for ( type in Expr.filter ) {
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
(match = preFilters[ type ]( match ))) ) {
matched = match.shift();
tokens.push( {
value: matched,
type: type,
matches: match
} );
soFar = soFar.slice( matched.length );
}
}
if ( !matched ) {
break;
}
}
// Return the length of the invalid excess
// if we're just parsing
// Otherwise, throw an error or return tokens
return parseOnly ?
soFar.length :
soFar ?
Sizzle.error( selector ) :
// Cache the tokens
tokenCache( selector, groups ).slice( 0 );
}
function toSelector( tokens ) {
var i = 0,
len = tokens.length,
selector = "";
for ( ; i < len; i++ ) {
selector += tokens[i].value;
}
return selector;
}
function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir,
checkNonElements = base && dir === "parentNode",
doneName = done++;
return combinator.first ?
// Check against closest ancestor/preceding element
function( elem, context, xml ) {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
return matcher( elem, context, xml );
}
}
} :
// Check against all ancestor/preceding elements
function( elem, context, xml ) {
var data, cache, outerCache,
dirkey = dirruns + " " + doneName;
// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
if ( xml ) {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
if ( matcher( elem, context, xml ) ) {
return true;
}
}
}
} else {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
outerCache = elem[ expando ] || (elem[ expando ] = {});
if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
if ( (data = cache[1]) === true || data === cachedruns ) {
return data === true;
}
} else {
cache = outerCache[ dir ] = [ dirkey ];
cache[1] = matcher( elem, context, xml ) || cachedruns;
if ( cache[1] === true ) {
return true;
}
}
}
}
}
};
}
function elementMatcher( matchers ) {
return matchers.length > 1 ?
function( elem, context, xml ) {
var i = matchers.length;
while ( i-- ) {
if ( !matchers[i]( elem, context, xml ) ) {
return false;
}
}
return true;
} :
matchers[0];
}
function condense( unmatched, map, filter, context, xml ) {
var elem,
newUnmatched = [],
i = 0,
len = unmatched.length,
mapped = map != null;
for ( ; i < len; i++ ) {
if ( (elem = unmatched[i]) ) {
if ( !filter || filter( elem, context, xml ) ) {
newUnmatched.push( elem );
if ( mapped ) {
map.push( i );
}
}
}
}
return newUnmatched;
}
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
postFinder = setMatcher( postFinder, postSelector );
}
return markFunction(function( seed, results, context, xml ) {
var temp, i, elem,
preMap = [],
postMap = [],
preexisting = results.length,
// Get initial elements from seed or context
elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
// Prefilter to get matcher input, preserving a map for seed-results synchronization
matcherIn = preFilter && ( seed || !selector ) ?
condense( elems, preMap, preFilter, context, xml ) :
elems,
matcherOut = matcher ?
// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
// ...intermediate processing is necessary
[] :
// ...otherwise use results directly
results :
matcherIn;
// Find primary matches
if ( matcher ) {
matcher( matcherIn, matcherOut, context, xml );
}
// Apply postFilter
if ( postFilter ) {
temp = condense( matcherOut, postMap );
postFilter( temp, [], context, xml );
// Un-match failing elements by moving them back to matcherIn
i = temp.length;
while ( i-- ) {
if ( (elem = temp[i]) ) {
matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
}
}
}
if ( seed ) {
if ( postFinder || preFilter ) {
if ( postFinder ) {
// Get the final matcherOut by condensing this intermediate into postFinder contexts
temp = [];
i = matcherOut.length;
while ( i-- ) {
if ( (elem = matcherOut[i]) ) {
// Restore matcherIn since elem is not yet a final match
temp.push( (matcherIn[i] = elem) );
}
}
postFinder( null, (matcherOut = []), temp, xml );
}
// Move matched elements from seed to results to keep them synchronized
i = matcherOut.length;
while ( i-- ) {
if ( (elem = matcherOut[i]) &&
(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
seed[temp] = !(results[temp] = elem);
}
}
}
// Add elements to results, through postFinder if defined
} else {
matcherOut = condense(
matcherOut === results ?
matcherOut.splice( preexisting, matcherOut.length ) :
matcherOut
);
if ( postFinder ) {
postFinder( null, results, matcherOut, xml );
} else {
push.apply( results, matcherOut );
}
}
});
}
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[0].type ],
implicitRelative = leadingRelative || Expr.relative[" "],
i = leadingRelative ? 1 : 0,
// The foundational matcher ensures that elements are reachable from top-level context(s)
matchContext = addCombinator( function( elem ) {
return elem === checkContext;
}, implicitRelative, true ),
matchAnyContext = addCombinator( function( elem ) {
return indexOf.call( checkContext, elem ) > -1;
}, implicitRelative, true ),
matchers = [ function( elem, context, xml ) {
return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
(checkContext = context).nodeType ?
matchContext( elem, context, xml ) :
matchAnyContext( elem, context, xml ) );
} ];
for ( ; i < len; i++ ) {
if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
} else {
matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
// Return special upon seeing a positional matcher
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[j].type ] ) {
break;
}
}
return setMatcher(
i > 1 && elementMatcher( matchers ),
i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
matcher,
i < j && matcherFromTokens( tokens.slice( i, j ) ),
j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
j < len && toSelector( tokens )
);
}
matchers.push( matcher );
}
}
return elementMatcher( matchers );
}
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
// A counter to specify which element is currently being matched
var matcherCachedRuns = 0,
bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
setMatched = [],
matchedCount = 0,
i = "0",
unmatched = seed && [],
outermost = expandContext != null,
contextBackup = outermostContext,
// We must always have either seed elements or context
elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
// Use integer dirruns iff this is the outermost matcher
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
if ( outermost ) {
outermostContext = context !== document && context;
cachedruns = matcherCachedRuns;
}
// Add elements passing elementMatchers directly to results
// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
for ( ; (elem = elems[i]) != null; i++ ) {
if ( byElement && elem ) {
j = 0;
while ( (matcher = elementMatchers[j++]) ) {
if ( matcher( elem, context, xml ) ) {
results.push( elem );
break;
}
}
if ( outermost ) {
dirruns = dirrunsUnique;
cachedruns = ++matcherCachedRuns;
}
}
// Track unmatched elements for set filters
if ( bySet ) {
// They will have gone through all possible matchers
if ( (elem = !matcher && elem) ) {
matchedCount--;
}
// Lengthen the array for every element, matched or not
if ( seed ) {
unmatched.push( elem );
}
}
}
// Apply set filters to unmatched elements
matchedCount += i;
if ( bySet && i !== matchedCount ) {
j = 0;
while ( (matcher = setMatchers[j++]) ) {
matcher( unmatched, setMatched, context, xml );
}
if ( seed ) {
// Reintegrate element matches to eliminate the need for sorting
if ( matchedCount > 0 ) {
while ( i-- ) {
if ( !(unmatched[i] || setMatched[i]) ) {
setMatched[i] = pop.call( results );
}
}
}
// Discard index placeholder values to get only actual matches
setMatched = condense( setMatched );
}
// Add matches to results
push.apply( results, setMatched );
// Seedless set matches succeeding multiple successful matchers stipulate sorting
if ( outermost && !seed && setMatched.length > 0 &&
( matchedCount + setMatchers.length ) > 1 ) {
Sizzle.uniqueSort( results );
}
}
// Override manipulation of globals by nested matchers
if ( outermost ) {
dirruns = dirrunsUnique;
outermostContext = contextBackup;
}
return unmatched;
};
return bySet ?
markFunction( superMatcher ) :
superMatcher;
}
compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
var i,
setMatchers = [],
elementMatchers = [],
cached = compilerCache[ selector + " " ];
if ( !cached ) {
// Generate a function of recursive functions that can be used to check each element
if ( !group ) {
group = tokenize( selector );
}
i = group.length;
while ( i-- ) {
cached = matcherFromTokens( group[i] );
if ( cached[ expando ] ) {
setMatchers.push( cached );
} else {
elementMatchers.push( cached );
}
}
// Cache the compiled function
cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
}
return cached;
};
function multipleContexts( selector, contexts, results ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
Sizzle( selector, contexts[i], results );
}
return results;
}
function select( selector, context, results, seed ) {
var i, tokens, token, type, find,
match = tokenize( selector );
if ( !seed ) {
// Try to minimize operations if there is only one group
if ( match.length === 1 ) {
// Take a shortcut and set the context if the root selector is an ID
tokens = match[0] = match[0].slice( 0 );
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
context.nodeType === 9 && !documentIsXML &&
Expr.relative[ tokens[1].type ] ) {
context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
if ( !context ) {
return results;
}
selector = selector.slice( tokens.shift().value.length );
}
// Fetch a seed set for right-to-left matching
i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
while ( i-- ) {
token = tokens[i];
// Abort if we hit a combinator
if ( Expr.relative[ (type = token.type) ] ) {
break;
}
if ( (find = Expr.find[ type ]) ) {
// Search, expanding context for leading sibling combinators
if ( (seed = find(
token.matches[0].replace( runescape, funescape ),
rsibling.test( tokens[0].type ) && context.parentNode || context
)) ) {
// If seed is empty or no tokens remain, we can return early
tokens.splice( i, 1 );
selector = seed.length && toSelector( tokens );
if ( !selector ) {
push.apply( results, slice.call( seed, 0 ) );
return results;
}
break;
}
}
}
}
}
// Compile and execute a filtering function
// Provide `match` to avoid retokenization if we modified the selector above
compile( selector, match )(
seed,
context,
documentIsXML,
results,
rsibling.test( selector )
);
return results;
}
// Deprecated
Expr.pseudos["nth"] = Expr.pseudos["eq"];
// Easy API for creating new setFilters
function setFilters() {}
Expr.filters = setFilters.prototype = Expr.pseudos;
Expr.setFilters = new setFilters();
// Initialize with the default document
setDocument();
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.pseudos;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
})( window );
var runtil = /Until$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
rneedsContext = jQuery.expr.match.needsContext,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var i, ret, self,
len = this.length;
if ( typeof selector !== "string" ) {
self = this;
return this.pushStack( jQuery( selector ).filter(function() {
for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
}) );
}
ret = [];
for ( i = 0; i < len; i++ ) {
jQuery.find( selector, this[ i ], ret );
}
// Needed because $( selector, context ) becomes $( context ).find( selector )
ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
return ret;
},
has: function( target ) {
var i,
targets = jQuery( target, this ),
len = targets.length;
return this.filter(function() {
for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false) );
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true) );
},
is: function( selector ) {
return !!selector && (
typeof selector === "string" ?
// If this is a positional/relative selector, check membership in the returned set
// so $("p:first").is("p:last") won't return true for a doc with two "p".
rneedsContext.test( selector ) ?
jQuery( selector, this.context ).index( this[0] ) >= 0 :
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
var cur,
i = 0,
l = this.length,
ret = [],
pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;
for ( ; i < l; i++ ) {
cur = this[i];
while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
}
cur = cur.parentNode;
}
}
return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
},
// Determine the position of an element within
// the matched set of elements
index: function( elem ) {
// No argument, return index in parent
if ( !elem ) {
return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
}
// index in selector
if ( typeof elem === "string" ) {
return jQuery.inArray( this[0], jQuery( elem ) );
}
// Locate the position of the desired element
return jQuery.inArray(
// If it receives a jQuery object, the first element is used
elem.jquery ? elem[0] : elem, this );
},
add: function( selector, context ) {
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( jQuery.unique(all) );
},
addBack: function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter(selector)
);
}
});
jQuery.fn.andSelf = jQuery.fn.addBack;
function sibling( cur, dir ) {
do {
cur = cur[ dir ];
} while ( cur && cur.nodeType !== 1 );
return cur;
}
jQuery.each({
parent: function( elem ) {
var parent = elem.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
parents: function( elem ) {
return jQuery.dir( elem, "parentNode" );
},
parentsUntil: function( elem, i, until ) {
return jQuery.dir( elem, "parentNode", until );
},
next: function( elem ) {
return sibling( elem, "nextSibling" );
},
prev: function( elem ) {
return sibling( elem, "previousSibling" );
},
nextAll: function( elem ) {
return jQuery.dir( elem, "nextSibling" );
},
prevAll: function( elem ) {
return jQuery.dir( elem, "previousSibling" );
},
nextUntil: function( elem, i, until ) {
return jQuery.dir( elem, "nextSibling", until );
},
prevUntil: function( elem, i, until ) {
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );
},
contents: function( elem ) {
return jQuery.nodeName( elem, "iframe" ) ?
elem.contentDocument || elem.contentWindow.document :
jQuery.merge( [], elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var ret = jQuery.map( this, fn, until );
if ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
if ( this.length > 1 && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 ?
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
jQuery.find.matches(expr, elems);
},
dir: function( elem, dir, until ) {
var matched = [],
cur = elem[ dir ];
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
if ( cur.nodeType === 1 ) {
matched.push( cur );
}
cur = cur[dir];
}
return matched;
},
sibling: function( n, elem ) {
var r = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType === 1 && n !== elem ) {
r.push( n );
}
}
return r;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
// Can't pass null or undefined to indexOf in Firefox 4
// Set to 0 to skip string check
qualifier = qualifier || 0;
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem ) {
return ( elem === qualifier ) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem ) {
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
});
}
function createSafeFragment( document ) {
var list = nodeNames.split( "|" ),
safeFrag = document.createDocumentFragment();
if ( safeFrag.createElement ) {
while ( list.length ) {
safeFrag.createElement(
list.pop()
);
}
}
return safeFrag;
}
var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
rleadingWhitespace = /^\s+/,
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&#?\w+;/,
rnoInnerhtml = /<(?:script|style|link)/i,
manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /^$|\/(?:java|ecma)script/i,
rscriptTypeMasked = /^true\/(.*)/,
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
// We have to close these tags to support XHTML (#13200)
wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
area: [ 1, "<map>", "</map>" ],
param: [ 1, "<object>", "</object>" ],
thead: [ 1, "<table>", "</table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
// unless wrapped in a div with non-breaking characters in front of it.
_default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
},
safeFragment = createSafeFragment( document ),
fragmentDiv = safeFragment.appendChild( document.createElement("div") );
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
jQuery.fn.extend({
text: function( value ) {
return jQuery.access( this, function( value ) {
return value === undefined ?
jQuery.text( this ) :
this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
}, null, value, arguments.length );
},
wrapAll: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapAll( html.call(this, i) );
});
}
if ( this[0] ) {
// The elements to wrap the target around
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
if ( this[0].parentNode ) {
wrap.insertBefore( this[0] );
}
wrap.map(function() {
var elem = this;
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
elem = elem.firstChild;
}
return elem;
}).append( this );
}
return this;
},
wrapInner: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapInner( html.call(this, i) );
});
}
return this.each(function() {
var self = jQuery( this ),
contents = self.contents();
if ( contents.length ) {
contents.wrapAll( html );
} else {
self.append( html );
}
});
},
wrap: function( html ) {
var isFunction = jQuery.isFunction( html );
return this.each(function(i) {
jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
});
},
unwrap: function() {
return this.parent().each(function() {
if ( !jQuery.nodeName( this, "body" ) ) {
jQuery( this ).replaceWith( this.childNodes );
}
}).end();
},
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.appendChild( elem );
}
});
},
prepend: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this );
}
});
},
after: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this.nextSibling );
}
});
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
var elem,
i = 0;
for ( ; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
if ( !keepData && elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem ) );
}
if ( elem.parentNode ) {
if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
setGlobalEval( getAll( elem, "script" ) );
}
elem.parentNode.removeChild( elem );
}
}
}
return this;
},
empty: function() {
var elem,
i = 0;
for ( ; (elem = this[i]) != null; i++ ) {
// Remove element nodes and prevent memory leaks
if ( elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem, false ) );
}
// Remove any remaining nodes
while ( elem.firstChild ) {
elem.removeChild( elem.firstChild );
}
// If this is a select, ensure that it displays empty (#12336)
// Support: IE<9
if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
elem.options.length = 0;
}
}
return this;
},
clone: function( dataAndEvents, deepDataAndEvents ) {
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
return this.map( function () {
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
});
},
html: function( value ) {
return jQuery.access( this, function( value ) {
var elem = this[0] || {},
i = 0,
l = this.length;
if ( value === undefined ) {
return elem.nodeType === 1 ?
elem.innerHTML.replace( rinlinejQuery, "" ) :
undefined;
}
// See if we can take a shortcut and just use innerHTML
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
value = value.replace( rxhtmlTag, "<$1></$2>" );
try {
for (; i < l; i++ ) {
// Remove element nodes and prevent memory leaks
elem = this[i] || {};
if ( elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem, false ) );
elem.innerHTML = value;
}
}
elem = 0;
// If using innerHTML throws an exception, use the fallback method
} catch(e) {}
}
if ( elem ) {
this.empty().append( value );
}
}, null, value, arguments.length );
},
replaceWith: function( value ) {
var isFunc = jQuery.isFunction( value );
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( !isFunc && typeof value !== "string" ) {
value = jQuery( value ).not( this ).detach();
}
return this.domManip( [ value ], true, function( elem ) {
var next = this.nextSibling,
parent = this.parentNode;
if ( parent ) {
jQuery( this ).remove();
parent.insertBefore( elem, next );
}
});
},
detach: function( selector ) {
return this.remove( selector, true );
},
domManip: function( args, table, callback ) {
// Flatten any nested arrays
args = core_concat.apply( [], args );
var first, node, hasScripts,
scripts, doc, fragment,
i = 0,
l = this.length,
set = this,
iNoClone = l - 1,
value = args[0],
isFunction = jQuery.isFunction( value );
// We can't cloneNode fragments that contain checked, in WebKit
if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
return this.each(function( index ) {
var self = set.eq( index );
if ( isFunction ) {
args[0] = value.call( this, index, table ? self.html() : undefined );
}
self.domManip( args, table, callback );
});
}
if ( l ) {
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
fragment = first;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
hasScripts = scripts.length;
// Use the original fragment for the last item instead of the first because it can end up
// being emptied incorrectly in certain situations (#8070).
for ( ; i < l; i++ ) {
node = fragment;
if ( i !== iNoClone ) {
node = jQuery.clone( node, true, true );
// Keep references to cloned scripts for later restoration
if ( hasScripts ) {
jQuery.merge( scripts, getAll( node, "script" ) );
}
}
callback.call(
table && jQuery.nodeName( this[i], "table" ) ?
findOrAppend( this[i], "tbody" ) :
this[i],
node,
i
);
}
if ( hasScripts ) {
doc = scripts[ scripts.length - 1 ].ownerDocument;
// Reenable scripts
jQuery.map( scripts, restoreScript );
// Evaluate executable scripts on first document insertion
for ( i = 0; i < hasScripts; i++ ) {
node = scripts[ i ];
if ( rscriptType.test( node.type || "" ) &&
!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
if ( node.src ) {
// Hope ajax is available...
jQuery.ajax({
url: node.src,
type: "GET",
dataType: "script",
async: false,
global: false,
"throws": true
});
} else {
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
}
}
}
}
// Fix #11809: Avoid leaking memory
fragment = first = null;
}
}
return this;
}
});
function findOrAppend( elem, tag ) {
return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
}
// Replace/restore the type attribute of script elements for safe DOM manipulation
function disableScript( elem ) {
var attr = elem.getAttributeNode("type");
elem.type = ( attr && attr.specified ) + "/" + elem.type;
return elem;
}
function restoreScript( elem ) {
var match = rscriptTypeMasked.exec( elem.type );
if ( match ) {
elem.type = match[1];
} else {
elem.removeAttribute("type");
}
return elem;
}
// Mark scripts as having already been evaluated
function setGlobalEval( elems, refElements ) {
var elem,
i = 0;
for ( ; (elem = elems[i]) != null; i++ ) {
jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
}
}
function cloneCopyEvent( src, dest ) {
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
return;
}
var type, i, l,
oldData = jQuery._data( src ),
curData = jQuery._data( dest, oldData ),
events = oldData.events;
if ( events ) {
delete curData.handle;
curData.events = {};
for ( type in events ) {
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
jQuery.event.add( dest, type, events[ type ][ i ] );
}
}
}
// make the cloned public data object a copy from the original
if ( curData.data ) {
curData.data = jQuery.extend( {}, curData.data );
}
}
function fixCloneNodeIssues( src, dest ) {
var nodeName, e, data;
// We do not need to do anything for non-Elements
if ( dest.nodeType !== 1 ) {
return;
}
nodeName = dest.nodeName.toLowerCase();
// IE6-8 copies events bound via attachEvent when using cloneNode.
if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
data = jQuery._data( dest );
for ( e in data.events ) {
jQuery.removeEvent( dest, e, data.handle );
}
// Event data gets referenced instead of copied if the expando gets copied too
dest.removeAttribute( jQuery.expando );
}
// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
if ( nodeName === "script" && dest.text !== src.text ) {
disableScript( dest ).text = src.text;
restoreScript( dest );
// IE6-10 improperly clones children of object elements using classid.
// IE10 throws NoModificationAllowedError if parent is null, #12132.
} else if ( nodeName === "object" ) {
if ( dest.parentNode ) {
dest.outerHTML = src.outerHTML;
}
// This path appears unavoidable for IE9. When cloning an object
// element in IE9, the outerHTML strategy above is not sufficient.
// If the src has innerHTML and the destination does not,
// copy the src.innerHTML into the dest.innerHTML. #10324
if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
dest.innerHTML = src.innerHTML;
}
} else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
// IE6-8 fails to persist the checked state of a cloned checkbox
// or radio button. Worse, IE6-7 fail to give the cloned element
// a checked appearance if the defaultChecked value isn't also set
dest.defaultChecked = dest.checked = src.checked;
// IE6-7 get confused and end up setting the value of a cloned
// checkbox/radio button to an empty string instead of "on"
if ( dest.value !== src.value ) {
dest.value = src.value;
}
// IE6-8 fails to return the selected option to the default selected
// state when cloning options
} else if ( nodeName === "option" ) {
dest.defaultSelected = dest.selected = src.defaultSelected;
// IE6-8 fails to set the defaultValue to the correct value when
// cloning other types of input fields
} else if ( nodeName === "input" || nodeName === "textarea" ) {
dest.defaultValue = src.defaultValue;
}
}
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var elems,
i = 0,
ret = [],
insert = jQuery( selector ),
last = insert.length - 1;
for ( ; i <= last; i++ ) {
elems = i === last ? this : this.clone(true);
jQuery( insert[i] )[ original ]( elems );
// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
core_push.apply( ret, elems.get() );
}
return this.pushStack( ret );
};
});
function getAll( context, tag ) {
var elems, elem,
i = 0,
found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
undefined;
if ( !found ) {
for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
if ( !tag || jQuery.nodeName( elem, tag ) ) {
found.push( elem );
} else {
jQuery.merge( found, getAll( elem, tag ) );
}
}
}
return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
jQuery.merge( [ context ], found ) :
found;
}
// Used in buildFragment, fixes the defaultChecked property
function fixDefaultChecked( elem ) {
if ( manipulation_rcheckableType.test( elem.type ) ) {
elem.defaultChecked = elem.checked;
}
}
jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var destElements, node, clone, i, srcElements,
inPage = jQuery.contains( elem.ownerDocument, elem );
if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
clone = elem.cloneNode( true );
// IE<=8 does not properly clone detached, unknown element nodes
} else {
fragmentDiv.innerHTML = elem.outerHTML;
fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
}
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
destElements = getAll( clone );
srcElements = getAll( elem );
// Fix all IE cloning issues
for ( i = 0; (node = srcElements[i]) != null; ++i ) {
// Ensure that the destination node is not null; Fixes #9587
if ( destElements[i] ) {
fixCloneNodeIssues( node, destElements[i] );
}
}
}
// Copy the events from the original to the clone
if ( dataAndEvents ) {
if ( deepDataAndEvents ) {
srcElements = srcElements || getAll( elem );
destElements = destElements || getAll( clone );
for ( i = 0; (node = srcElements[i]) != null; i++ ) {
cloneCopyEvent( node, destElements[i] );
}
} else {
cloneCopyEvent( elem, clone );
}
}
// Preserve script evaluation history
destElements = getAll( clone, "script" );
if ( destElements.length > 0 ) {
setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
}
destElements = srcElements = node = null;
// Return the cloned set
return clone;
},
buildFragment: function( elems, context, scripts, selection ) {
var j, elem, contains,
tmp, tag, tbody, wrap,
l = elems.length,
// Ensure a safe fragment
safe = createSafeFragment( context ),
nodes = [],
i = 0;
for ( ; i < l; i++ ) {
elem = elems[ i ];
if ( elem || elem === 0 ) {
// Add nodes directly
if ( jQuery.type( elem ) === "object" ) {
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
// Convert non-html into a text node
} else if ( !rhtml.test( elem ) ) {
nodes.push( context.createTextNode( elem ) );
// Convert html into DOM nodes
} else {
tmp = tmp || safe.appendChild( context.createElement("div") );
// Deserialize a standard representation
tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
wrap = wrapMap[ tag ] || wrapMap._default;
tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
// Descend through wrappers to the right content
j = wrap[0];
while ( j-- ) {
tmp = tmp.lastChild;
}
// Manually add leading whitespace removed by IE
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
elem = tag === "table" && !rtbody.test( elem ) ?
tmp.firstChild :
// String was a bare <thead> or <tfoot>
wrap[1] === "<table>" && !rtbody.test( elem ) ?
tmp :
0;
j = elem && elem.childNodes.length;
while ( j-- ) {
if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
elem.removeChild( tbody );
}
}
}
jQuery.merge( nodes, tmp.childNodes );
// Fix #12392 for WebKit and IE > 9
tmp.textContent = "";
// Fix #12392 for oldIE
while ( tmp.firstChild ) {
tmp.removeChild( tmp.firstChild );
}
// Remember the top-level container for proper cleanup
tmp = safe.lastChild;
}
}
}
// Fix #11356: Clear elements from fragment
if ( tmp ) {
safe.removeChild( tmp );
}
// Reset defaultChecked for any radios and checkboxes
// about to be appended to the DOM in IE 6/7 (#8060)
if ( !jQuery.support.appendChecked ) {
jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
}
i = 0;
while ( (elem = nodes[ i++ ]) ) {
// #4087 - If origin and destination elements are the same, and this is
// that element, do not do anything
if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
continue;
}
contains = jQuery.contains( elem.ownerDocument, elem );
// Append to fragment
tmp = getAll( safe.appendChild( elem ), "script" );
// Preserve script evaluation history
if ( contains ) {
setGlobalEval( tmp );
}
// Capture executables
if ( scripts ) {
j = 0;
while ( (elem = tmp[ j++ ]) ) {
if ( rscriptType.test( elem.type || "" ) ) {
scripts.push( elem );
}
}
}
}
tmp = null;
return safe;
},
cleanData: function( elems, /* internal */ acceptData ) {
var elem, type, id, data,
i = 0,
internalKey = jQuery.expando,
cache = jQuery.cache,
deleteExpando = jQuery.support.deleteExpando,
special = jQuery.event.special;
for ( ; (elem = elems[i]) != null; i++ ) {
if ( acceptData || jQuery.acceptData( elem ) ) {
id = elem[ internalKey ];
data = id && cache[ id ];
if ( data ) {
if ( data.events ) {
for ( type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
// This is a shortcut to avoid jQuery.event.remove's overhead
} else {
jQuery.removeEvent( elem, type, data.handle );
}
}
}
// Remove cache only if it was not already removed by jQuery.event.remove
if ( cache[ id ] ) {
delete cache[ id ];
// IE does not allow us to delete expando properties from nodes,
// nor does it have a removeAttribute function on Document nodes;
// we must handle all of these cases
if ( deleteExpando ) {
delete elem[ internalKey ];
} else if ( typeof elem.removeAttribute !== core_strundefined ) {
elem.removeAttribute( internalKey );
} else {
elem[ internalKey ] = null;
}
core_deletedIds.push( id );
}
}
}
}
}
});
var iframe, getStyles, curCSS,
ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity\s*=\s*([^)]*)/,
rposition = /^(top|right|bottom|left)$/,
// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
rmargin = /^margin/,
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
elemdisplay = { BODY: "block" },
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
letterSpacing: 0,
fontWeight: 400
},
cssExpand = [ "Top", "Right", "Bottom", "Left" ],
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
// return a css property mapped to a potentially vendor prefixed property
function vendorPropName( style, name ) {
// shortcut for names that are not vendor prefixed
if ( name in style ) {
return name;
}
// check for vendor prefixed names
var capName = name.charAt(0).toUpperCase() + name.slice(1),
origName = name,
i = cssPrefixes.length;
while ( i-- ) {
name = cssPrefixes[ i ] + capName;
if ( name in style ) {
return name;
}
}
return origName;
}
function isHidden( elem, el ) {
// isHidden might be called from jQuery#filter function;
// in that case, element will be second argument
elem = el || elem;
return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
}
function showHide( elements, show ) {
var display, elem, hidden,
values = [],
index = 0,
length = elements.length;
for ( ; index < length; index++ ) {
elem = elements[ index ];
if ( !elem.style ) {
continue;
}
values[ index ] = jQuery._data( elem, "olddisplay" );
display = elem.style.display;
if ( show ) {
// Reset the inline display of this element to learn if it is
// being hidden by cascaded rules or not
if ( !values[ index ] && display === "none" ) {
elem.style.display = "";
}
// Set elements which have been overridden with display: none
// in a stylesheet to whatever the default browser style is
// for such an element
if ( elem.style.display === "" && isHidden( elem ) ) {
values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
}
} else {
if ( !values[ index ] ) {
hidden = isHidden( elem );
if ( display && display !== "none" || !hidden ) {
jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
}
}
}
}
// Set the display of most of the elements in a second loop
// to avoid the constant reflow
for ( index = 0; index < length; index++ ) {
elem = elements[ index ];
if ( !elem.style ) {
continue;
}
if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
elem.style.display = show ? values[ index ] || "" : "none";
}
}
return elements;
}
jQuery.fn.extend({
css: function( name, value ) {
return jQuery.access( this, function( elem, name, value ) {
var len, styles,
map = {},
i = 0;
if ( jQuery.isArray( name ) ) {
styles = getStyles( elem );
len = name.length;
for ( ; i < len; i++ ) {
map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
}
return map;
}
return value !== undefined ?
jQuery.style( elem, name, value ) :
jQuery.css( elem, name );
}, name, value, arguments.length > 1 );
},
show: function() {
return showHide( this, true );
},
hide: function() {
return showHide( this );
},
toggle: function( state ) {
var bool = typeof state === "boolean";
return this.each(function() {
if ( bool ? state : isHidden( this ) ) {
jQuery( this ).show();
} else {
jQuery( this ).hide();
}
});
}
});
jQuery.extend({
// Add in style property hooks for overriding the default
// behavior of getting and setting a style property
cssHooks: {
opacity: {
get: function( elem, computed ) {
if ( computed ) {
// We should always get a number back from opacity
var ret = curCSS( elem, "opacity" );
return ret === "" ? "1" : ret;
}
}
}
},
// Exclude the following css properties to add px
cssNumber: {
"columnCount": true,
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
"opacity": true,
"orphans": true,
"widows": true,
"zIndex": true,
"zoom": true
},
// Add in properties whose names you wish to fix before
// setting or getting the value
cssProps: {
// normalize float css property
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
},
// Get and set the style property on a DOM Node
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
// Make sure that we're working with the right name
var ret, type, hooks,
origName = jQuery.camelCase( name ),
style = elem.style;
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
// gets hook for the prefixed version
// followed by the unprefixed version
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
// Check if we're setting a value
if ( value !== undefined ) {
type = typeof value;
// convert relative number strings (+= or -=) to relative numbers. #7345
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
// Fixes bug #9237
type = "number";
}
// Make sure that NaN and null values aren't set. See: #7116
if ( value == null || type === "number" && isNaN( value ) ) {
return;
}
// If a number was passed in, add 'px' to the (except for certain CSS properties)
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
value += "px";
}
// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
// but it would mean to define eight (for every problematic property) identical functions
if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
style[ name ] = "inherit";
}
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #5509
try {
style[ name ] = value;
} catch(e) {}
}
} else {
// If a hook was provided get the non-computed value from there
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
return ret;
}
// Otherwise just get the value from the style object
return style[ name ];
}
},
css: function( elem, name, extra, styles ) {
var num, val, hooks,
origName = jQuery.camelCase( name );
// Make sure that we're working with the right name
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
// gets hook for the prefixed version
// followed by the unprefixed version
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
// If a hook was provided get the computed value from there
if ( hooks && "get" in hooks ) {
val = hooks.get( elem, true, extra );
}
// Otherwise, if a way to get the computed value exists, use that
if ( val === undefined ) {
val = curCSS( elem, name, styles );
}
//convert "normal" to computed value
if ( val === "normal" && name in cssNormalTransform ) {
val = cssNormalTransform[ name ];
}
// Return, converting to number if forced or a qualifier was provided and val looks numeric
if ( extra === "" || extra ) {
num = parseFloat( val );
return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
}
return val;
},
// A method for quickly swapping in/out CSS properties to get correct calculations
swap: function( elem, options, callback, args ) {
var ret, name,
old = {};
// Remember the old values, and insert the new ones
for ( name in options ) {
old[ name ] = elem.style[ name ];
elem.style[ name ] = options[ name ];
}
ret = callback.apply( elem, args || [] );
// Revert the old values
for ( name in options ) {
elem.style[ name ] = old[ name ];
}
return ret;
}
});
// NOTE: we've included the "window" in window.getComputedStyle
// because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
getStyles = function( elem ) {
return window.getComputedStyle( elem, null );
};
curCSS = function( elem, name, _computed ) {
var width, minWidth, maxWidth,
computed = _computed || getStyles( elem ),
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
style = elem.style;
if ( computed ) {
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
// A tribute to the "awesome hack by Dean Edwards"
// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
// Remember the original values
width = style.width;
minWidth = style.minWidth;
maxWidth = style.maxWidth;
// Put in the new values to get a computed value out
style.minWidth = style.maxWidth = style.width = ret;
ret = computed.width;
// Revert the changed values
style.width = width;
style.minWidth = minWidth;
style.maxWidth = maxWidth;
}
}
return ret;
};
} else if ( document.documentElement.currentStyle ) {
getStyles = function( elem ) {
return elem.currentStyle;
};
curCSS = function( elem, name, _computed ) {
var left, rs, rsLeft,
computed = _computed || getStyles( elem ),
ret = computed ? computed[ name ] : undefined,
style = elem.style;
// Avoid setting ret to empty string here
// so we don't default to auto
if ( ret == null && style && style[ name ] ) {
ret = style[ name ];
}
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
// but not position css attributes, as those are proportional to the parent element instead
// and we can't measure the parent instead because it might trigger a "stacking dolls" problem
if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
// Remember the original values
left = style.left;
rs = elem.runtimeStyle;
rsLeft = rs && rs.left;
// Put in the new values to get a computed value out
if ( rsLeft ) {
rs.left = elem.currentStyle.left;
}
style.left = name === "fontSize" ? "1em" : ret;
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
if ( rsLeft ) {
rs.left = rsLeft;
}
}
return ret === "" ? "auto" : ret;
};
}
function setPositiveNumber( elem, value, subtract ) {
var matches = rnumsplit.exec( value );
return matches ?
// Guard against undefined "subtract", e.g., when used as in cssHooks
Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
value;
}
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
var i = extra === ( isBorderBox ? "border" : "content" ) ?
// If we already have the right measurement, avoid augmentation
4 :
// Otherwise initialize for horizontal or vertical properties
name === "width" ? 1 : 0,
val = 0;
for ( ; i < 4; i += 2 ) {
// both box models exclude margin, so add it if we want it
if ( extra === "margin" ) {
val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
}
if ( isBorderBox ) {
// border-box includes padding, so remove it if we want content
if ( extra === "content" ) {
val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
}
// at this point, extra isn't border nor margin, so remove border
if ( extra !== "margin" ) {
val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
}
} else {
// at this point, extra isn't content, so add padding
val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
// at this point, extra isn't content nor padding, so add border
if ( extra !== "padding" ) {
val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
}
}
}
return val;
}
function getWidthOrHeight( elem, name, extra ) {
// Start with offset property, which is equivalent to the border-box value
var valueIsBorderBox = true,
val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
styles = getStyles( elem ),
isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
// some non-html elements return undefined for offsetWidth, so check for null/undefined
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
if ( val <= 0 || val == null ) {
// Fall back to computed then uncomputed css if necessary
val = curCSS( elem, name, styles );
if ( val < 0 || val == null ) {
val = elem.style[ name ];
}
// Computed unit is not pixels. Stop here and return.
if ( rnumnonpx.test(val) ) {
return val;
}
// we need the check for style in case a browser which returns unreliable values
// for getComputedStyle silently falls back to the reliable elem.style
valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
// Normalize "", auto, and prepare for extra
val = parseFloat( val ) || 0;
}
// use the active box-sizing model to add/subtract irrelevant styles
return ( val +
augmentWidthOrHeight(
elem,
name,
extra || ( isBorderBox ? "border" : "content" ),
valueIsBorderBox,
styles
)
) + "px";
}
// Try to determine the default display value of an element
function css_defaultDisplay( nodeName ) {
var doc = document,
display = elemdisplay[ nodeName ];
if ( !display ) {
display = actualDisplay( nodeName, doc );
// If the simple way fails, read from inside an iframe
if ( display === "none" || !display ) {
// Use the already-created iframe if possible
iframe = ( iframe ||
jQuery("<iframe frameborder='0' width='0' height='0'/>")
.css( "cssText", "display:block !important" )
).appendTo( doc.documentElement );
// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
doc.write("<!doctype html><html><body>");
doc.close();
display = actualDisplay( nodeName, doc );
iframe.detach();
}
// Store the correct default display
elemdisplay[ nodeName ] = display;
}
return display;
}
// Called ONLY from within css_defaultDisplay
function actualDisplay( name, doc ) {
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
display = jQuery.css( elem[0], "display" );
elem.remove();
return display;
}
jQuery.each([ "height", "width" ], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
if ( computed ) {
// certain elements can have dimension info if we invisibly show them
// however, it must have a current display style that would benefit from this
return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
jQuery.swap( elem, cssShow, function() {
return getWidthOrHeight( elem, name, extra );
}) :
getWidthOrHeight( elem, name, extra );
}
},
set: function( elem, value, extra ) {
var styles = extra && getStyles( elem );
return setPositiveNumber( elem, value, extra ?
augmentWidthOrHeight(
elem,
name,
extra,
jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
styles
) : 0
);
}
};
});
if ( !jQuery.support.opacity ) {
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
computed ? "1" : "";
},
set: function( elem, value ) {
var style = elem.style,
currentStyle = elem.currentStyle,
opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
filter = currentStyle && currentStyle.filter || style.filter || "";
// IE has trouble with opacity if it does not have layout
// Force it by setting the zoom level
style.zoom = 1;
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
// if value === "", then remove inline opacity #12685
if ( ( value >= 1 || value === "" ) &&
jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
style.removeAttribute ) {
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
// if "filter:" is present at all, clearType is disabled, we want to avoid this
// style.removeAttribute is IE Only, but so apparently is this code path...
style.removeAttribute( "filter" );
// if there is no filter style applied in a css rule or unset inline opacity, we are done
if ( value === "" || currentStyle && !currentStyle.filter ) {
return;
}
}
// otherwise, set new filter values
style.filter = ralpha.test( filter ) ?
filter.replace( ralpha, opacity ) :
filter + " " + opacity;
}
};
}
// These hooks cannot be added until DOM ready because the support test
// for it is not run until after DOM ready
jQuery(function() {
if ( !jQuery.support.reliableMarginRight ) {
jQuery.cssHooks.marginRight = {
get: function( elem, computed ) {
if ( computed ) {
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block
return jQuery.swap( elem, { "display": "inline-block" },
curCSS, [ elem, "marginRight" ] );
}
}
};
}
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
// getComputedStyle returns percent when specified for top/left/bottom/right
// rather than make the css module depend on the offset module, we just check for it here
if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
jQuery.each( [ "top", "left" ], function( i, prop ) {
jQuery.cssHooks[ prop ] = {
get: function( elem, computed ) {
if ( computed ) {
computed = curCSS( elem, prop );
// if curCSS returns percentage, fallback to offset
return rnumnonpx.test( computed ) ?
jQuery( elem ).position()[ prop ] + "px" :
computed;
}
}
};
});
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
// These hooks are used by animate to expand properties
jQuery.each({
margin: "",
padding: "",
border: "Width"
}, function( prefix, suffix ) {
jQuery.cssHooks[ prefix + suffix ] = {
expand: function( value ) {
var i = 0,
expanded = {},
// assumes a single number if not a string
parts = typeof value === "string" ? value.split(" ") : [ value ];
for ( ; i < 4; i++ ) {
expanded[ prefix + cssExpand[ i ] + suffix ] =
parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
}
return expanded;
}
};
if ( !rmargin.test( prefix ) ) {
jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
}
});
var r20 = /%20/g,
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
rsubmittable = /^(?:input|select|textarea|keygen)/i;
jQuery.fn.extend({
serialize: function() {
return jQuery.param( this.serializeArray() );
},
serializeArray: function() {
return this.map(function(){
// Can add propHook for "elements" to filter or add form elements
var elements = jQuery.prop( this, "elements" );
return elements ? jQuery.makeArray( elements ) : this;
})
.filter(function(){
var type = this.type;
// Use .is(":disabled") so that fieldset[disabled] works
return this.name && !jQuery( this ).is( ":disabled" ) &&
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
( this.checked || !manipulation_rcheckableType.test( type ) );
})
.map(function( i, elem ){
var val = jQuery( this ).val();
return val == null ?
null :
jQuery.isArray( val ) ?
jQuery.map( val, function( val ){
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}) :
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}).get();
}
});
//Serialize an array of form elements or a set of
//key/values into a query string
jQuery.param = function( a, traditional ) {
var prefix,
s = [],
add = function( key, value ) {
// If value is a function, invoke it and return its value
value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
};
// Set traditional to true for jQuery <= 1.3.2 behavior.
if ( traditional === undefined ) {
traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
}
// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
// Serialize the form elements
jQuery.each( a, function() {
add( this.name, this.value );
});
} else {
// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
for ( prefix in a ) {
buildParams( prefix, a[ prefix ], traditional, add );
}
}
// Return the resulting serialization
return s.join( "&" ).replace( r20, "+" );
};
function buildParams( prefix, obj, traditional, add ) {
var name;
if ( jQuery.isArray( obj ) ) {
// Serialize array item.
jQuery.each( obj, function( i, v ) {
if ( traditional || rbracket.test( prefix ) ) {
// Treat each array item as a scalar.
add( prefix, v );
} else {
// Item is non-scalar (array or object), encode its numeric index.
buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
}
});
} else if ( !traditional && jQuery.type( obj ) === "object" ) {
// Serialize object item.
for ( name in obj ) {
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
}
} else {
// Serialize scalar item.
add( prefix, obj );
}
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( data, fn ) {
return arguments.length > 0 ?
this.on( name, null, data, fn ) :
this.trigger( name );
};
});
jQuery.fn.hover = function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
};
var
// Document location
ajaxLocParts,
ajaxLocation,
ajax_nonce = jQuery.now(),
ajax_rquery = /\?/,
rhash = /#.*$/,
rts = /([?&])_=[^&]*/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
// #7653, #8125, #8152: local protocol detection
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//,
rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
// Keep a copy of the old load method
_load = jQuery.fn.load,
/* Prefilters
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
* 2) These are called:
* - BEFORE asking for a transport
* - AFTER param serialization (s.data is a string if s.processData is true)
* 3) key is the dataType
* 4) the catchall symbol "*" can be used
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
*/
prefilters = {},
/* Transports bindings
* 1) key is the dataType
* 2) the catchall symbol "*" can be used
* 3) selection will start with transport dataType and THEN go to "*" if needed
*/
transports = {},
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes = "*/".concat("*");
// #8138, IE may throw an exception when accessing
// a field from window.location if document.domain has been set
try {
ajaxLocation = location.href;
} catch( e ) {
// Use the href attribute of an A element
// since IE will modify it given document.location
ajaxLocation = document.createElement( "a" );
ajaxLocation.href = "";
ajaxLocation = ajaxLocation.href;
}
// Segment location into parts
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function addToPrefiltersOrTransports( structure ) {
// dataTypeExpression is optional and defaults to "*"
return function( dataTypeExpression, func ) {
if ( typeof dataTypeExpression !== "string" ) {
func = dataTypeExpression;
dataTypeExpression = "*";
}
var dataType,
i = 0,
dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
if ( jQuery.isFunction( func ) ) {
// For each dataType in the dataTypeExpression
while ( (dataType = dataTypes[i++]) ) {
// Prepend if requested
if ( dataType[0] === "+" ) {
dataType = dataType.slice( 1 ) || "*";
(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
// Otherwise append
} else {
(structure[ dataType ] = structure[ dataType ] || []).push( func );
}
}
}
};
}
// Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
var inspected = {},
seekingTransport = ( structure === transports );
function inspect( dataType ) {
var selected;
inspected[ dataType ] = true;
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
options.dataTypes.unshift( dataTypeOrTransport );
inspect( dataTypeOrTransport );
return false;
} else if ( seekingTransport ) {
return !( selected = dataTypeOrTransport );
}
});
return selected;
}
return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
}
// A special extend for ajax options
// that takes "flat" options (not to be deep extended)
// Fixes #9887
function ajaxExtend( target, src ) {
var deep, key,
flatOptions = jQuery.ajaxSettings.flatOptions || {};
for ( key in src ) {
if ( src[ key ] !== undefined ) {
( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
}
}
if ( deep ) {
jQuery.extend( true, target, deep );
}
return target;
}
jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
var selector, response, type,
self = this,
off = url.indexOf(" ");
if ( off >= 0 ) {
selector = url.slice( off, url.length );
url = url.slice( 0, off );
}
// If it's a function
if ( jQuery.isFunction( params ) ) {
// We assume that it's the callback
callback = params;
params = undefined;
// Otherwise, build a param string
} else if ( params && typeof params === "object" ) {
type = "POST";
}
// If we have elements to modify, make the request
if ( self.length > 0 ) {
jQuery.ajax({
url: url,
// if "type" variable is undefined, then "GET" method will be used
type: type,
dataType: "html",
data: params
}).done(function( responseText ) {
// Save response for use in complete callback
response = arguments;
self.html( selector ?
// If a selector was specified, locate the right elements in a dummy div
// Exclude scripts to avoid IE 'Permission Denied' errors
jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
// Otherwise use the full result
responseText );
}).complete( callback && function( jqXHR, status ) {
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
});
}
return this;
};
// Attach a bunch of functions for handling common AJAX events
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
jQuery.fn[ type ] = function( fn ){
return this.on( type, fn );
};
});
jQuery.each( [ "get", "post" ], function( i, method ) {
jQuery[ method ] = function( url, data, callback, type ) {
// shift arguments if data argument was omitted
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
data = undefined;
}
return jQuery.ajax({
url: url,
type: method,
dataType: type,
data: data,
success: callback
});
};
});
jQuery.extend({
// Counter for holding the number of active queries
active: 0,
// Last-Modified header cache for next request
lastModified: {},
etag: {},
ajaxSettings: {
url: ajaxLocation,
type: "GET",
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
global: true,
processData: true,
async: true,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
/*
timeout: 0,
data: null,
dataType: null,
username: null,
password: null,
cache: null,
throws: false,
traditional: false,
headers: {},
*/
accepts: {
"*": allTypes,
text: "text/plain",
html: "text/html",
xml: "application/xml, text/xml",
json: "application/json, text/javascript"
},
contents: {
xml: /xml/,
html: /html/,
json: /json/
},
responseFields: {
xml: "responseXML",
text: "responseText"
},
// Data converters
// Keys separate source (or catchall "*") and destination types with a single space
converters: {
// Convert anything to text
"* text": window.String,
// Text to html (true = no transformation)
"text html": true,
// Evaluate text as a json expression
"text json": jQuery.parseJSON,
// Parse text as xml
"text xml": jQuery.parseXML
},
// For options that shouldn't be deep extended:
// you can add your own custom options here if
// and when you create one that shouldn't be
// deep extended (see ajaxExtend)
flatOptions: {
url: true,
context: true
}
},
// Creates a full fledged settings object into target
// with both ajaxSettings and settings fields.
// If target is omitted, writes into ajaxSettings.
ajaxSetup: function( target, settings ) {
return settings ?
// Building a settings object
ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
// Extending ajaxSettings
ajaxExtend( jQuery.ajaxSettings, target );
},
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
ajaxTransport: addToPrefiltersOrTransports( transports ),
// Main method
ajax: function( url, options ) {
// If url is an object, simulate pre-1.5 signature
if ( typeof url === "object" ) {
options = url;
url = undefined;
}
// Force options to be an object
options = options || {};
var // Cross-domain detection vars
parts,
// Loop variable
i,
// URL without anti-cache param
cacheURL,
// Response headers as string
responseHeadersString,
// timeout handle
timeoutTimer,
// To know if global events are to be dispatched
fireGlobals,
transport,
// Response headers
responseHeaders,
// Create the final options object
s = jQuery.ajaxSetup( {}, options ),
// Callbacks context
callbackContext = s.context || s,
// Context for global events is callbackContext if it is a DOM node or jQuery collection
globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
jQuery( callbackContext ) :
jQuery.event,
// Deferreds
deferred = jQuery.Deferred(),
completeDeferred = jQuery.Callbacks("once memory"),
// Status-dependent callbacks
statusCode = s.statusCode || {},
// Headers (they are sent all at once)
requestHeaders = {},
requestHeadersNames = {},
// The jqXHR state
state = 0,
// Default abort message
strAbort = "canceled",
// Fake xhr
jqXHR = {
readyState: 0,
// Builds headers hashtable if needed
getResponseHeader: function( key ) {
var match;
if ( state === 2 ) {
if ( !responseHeaders ) {
responseHeaders = {};
while ( (match = rheaders.exec( responseHeadersString )) ) {
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
}
}
match = responseHeaders[ key.toLowerCase() ];
}
return match == null ? null : match;
},
// Raw string
getAllResponseHeaders: function() {
return state === 2 ? responseHeadersString : null;
},
// Caches the header
setRequestHeader: function( name, value ) {
var lname = name.toLowerCase();
if ( !state ) {
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
requestHeaders[ name ] = value;
}
return this;
},
// Overrides response content-type header
overrideMimeType: function( type ) {
if ( !state ) {
s.mimeType = type;
}
return this;
},
// Status-dependent callbacks
statusCode: function( map ) {
var code;
if ( map ) {
if ( state < 2 ) {
for ( code in map ) {
// Lazy-add the new callback in a way that preserves old ones
statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
}
} else {
// Execute the appropriate callbacks
jqXHR.always( map[ jqXHR.status ] );
}
}
return this;
},
// Cancel the request
abort: function( statusText ) {
var finalText = statusText || strAbort;
if ( transport ) {
transport.abort( finalText );
}
done( 0, finalText );
return this;
}
};
// Attach deferreds
deferred.promise( jqXHR ).complete = completeDeferred.add;
jqXHR.success = jqXHR.done;
jqXHR.error = jqXHR.fail;
// Remove hash character (#7531: and string promotion)
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
// Handle falsy url in the settings object (#10093: consistency with old signature)
// We also use the url parameter if available
s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
// Alias method option to type as per ticket #12004
s.type = options.method || options.type || s.method || s.type;
// Extract dataTypes list
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
// A cross-domain request is in order when we have a protocol:host:port mismatch
if ( s.crossDomain == null ) {
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( parts &&
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
);
}
// Convert data if not already a string
if ( s.data && s.processData && typeof s.data !== "string" ) {
s.data = jQuery.param( s.data, s.traditional );
}
// Apply prefilters
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
// If request was aborted inside a prefilter, stop there
if ( state === 2 ) {
return jqXHR;
}
// We can fire global events as of now if asked to
fireGlobals = s.global;
// Watch for a new set of requests
if ( fireGlobals && jQuery.active++ === 0 ) {
jQuery.event.trigger("ajaxStart");
}
// Uppercase the type
s.type = s.type.toUpperCase();
// Determine if request has content
s.hasContent = !rnoContent.test( s.type );
// Save the URL in case we're toying with the If-Modified-Since
// and/or If-None-Match header later on
cacheURL = s.url;
// More options handling for requests with no content
if ( !s.hasContent ) {
// If data is available, append data to url
if ( s.data ) {
cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
// #9682: remove data so that it's not used in an eventual retry
delete s.data;
}
// Add anti-cache in url if needed
if ( s.cache === false ) {
s.url = rts.test( cacheURL ) ?
// If there is already a '_' parameter, set its value
cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
// Otherwise add one to the end
cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
}
}
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
if ( jQuery.lastModified[ cacheURL ] ) {
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
}
if ( jQuery.etag[ cacheURL ] ) {
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
}
}
// Set the correct header, if data is being sent
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
jqXHR.setRequestHeader( "Content-Type", s.contentType );
}
// Set the Accepts header for the server, depending on the dataType
jqXHR.setRequestHeader(
"Accept",
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
s.accepts[ "*" ]
);
// Check for headers option
for ( i in s.headers ) {
jqXHR.setRequestHeader( i, s.headers[ i ] );
}
// Allow custom headers/mimetypes and early abort
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
// Abort if not done already and return
return jqXHR.abort();
}
// aborting is no longer a cancellation
strAbort = "abort";
// Install callbacks on deferreds
for ( i in { success: 1, error: 1, complete: 1 } ) {
jqXHR[ i ]( s[ i ] );
}
// Get transport
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
// If no transport, we auto-abort
if ( !transport ) {
done( -1, "No Transport" );
} else {
jqXHR.readyState = 1;
// Send global event
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
}
// Timeout
if ( s.async && s.timeout > 0 ) {
timeoutTimer = setTimeout(function() {
jqXHR.abort("timeout");
}, s.timeout );
}
try {
state = 1;
transport.send( requestHeaders, done );
} catch ( e ) {
// Propagate exception as error if not done
if ( state < 2 ) {
done( -1, e );
// Simply rethrow otherwise
} else {
throw e;
}
}
}
// Callback for when everything is done
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
if ( state === 2 ) {
return;
}
// State is "done" now
state = 2;
// Clear timeout if it exists
if ( timeoutTimer ) {
clearTimeout( timeoutTimer );
}
// Dereference transport for early garbage collection
// (no matter how long the jqXHR object will be used)
transport = undefined;
// Cache response headers
responseHeadersString = headers || "";
// Set readyState
jqXHR.readyState = status > 0 ? 4 : 0;
// Get response data
if ( responses ) {
response = ajaxHandleResponses( s, jqXHR, responses );
}
// If successful, handle type chaining
if ( status >= 200 && status < 300 || status === 304 ) {
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
modified = jqXHR.getResponseHeader("Last-Modified");
if ( modified ) {
jQuery.lastModified[ cacheURL ] = modified;
}
modified = jqXHR.getResponseHeader("etag");
if ( modified ) {
jQuery.etag[ cacheURL ] = modified;
}
}
// if no content
if ( status === 204 ) {
isSuccess = true;
statusText = "nocontent";
// if not modified
} else if ( status === 304 ) {
isSuccess = true;
statusText = "notmodified";
// If we have data, let's convert it
} else {
isSuccess = ajaxConvert( s, response );
statusText = isSuccess.state;
success = isSuccess.data;
error = isSuccess.error;
isSuccess = !error;
}
} else {
// We extract error from statusText
// then normalize statusText and status for non-aborts
error = statusText;
if ( status || !statusText ) {
statusText = "error";
if ( status < 0 ) {
status = 0;
}
}
}
// Set data for the fake xhr object
jqXHR.status = status;
jqXHR.statusText = ( nativeStatusText || statusText ) + "";
// Success/Error
if ( isSuccess ) {
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
} else {
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
}
// Status-dependent callbacks
jqXHR.statusCode( statusCode );
statusCode = undefined;
if ( fireGlobals ) {
globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
[ jqXHR, s, isSuccess ? success : error ] );
}
// Complete
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
// Handle the global AJAX counter
if ( !( --jQuery.active ) ) {
jQuery.event.trigger("ajaxStop");
}
}
}
return jqXHR;
},
getScript: function( url, callback ) {
return jQuery.get( url, undefined, callback, "script" );
},
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
}
});
/* Handles responses to an ajax request:
* - sets all responseXXX fields accordingly
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
var firstDataType, ct, finalDataType, type,
contents = s.contents,
dataTypes = s.dataTypes,
responseFields = s.responseFields;
// Fill responseXXX fields
for ( type in responseFields ) {
if ( type in responses ) {
jqXHR[ responseFields[type] ] = responses[ type ];
}
}
// Remove auto dataType and get content-type in the process
while( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
}
}
// Check if we're dealing with a known content-type
if ( ct ) {
for ( type in contents ) {
if ( contents[ type ] && contents[ type ].test( ct ) ) {
dataTypes.unshift( type );
break;
}
}
}
// Check to see if we have a response for the expected dataType
if ( dataTypes[ 0 ] in responses ) {
finalDataType = dataTypes[ 0 ];
} else {
// Try convertible dataTypes
for ( type in responses ) {
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
finalDataType = type;
break;
}
if ( !firstDataType ) {
firstDataType = type;
}
}
// Or just use first one
finalDataType = finalDataType || firstDataType;
}
// If we found a dataType
// We add the dataType to the list if needed
// and return the corresponding response
if ( finalDataType ) {
if ( finalDataType !== dataTypes[ 0 ] ) {
dataTypes.unshift( finalDataType );
}
return responses[ finalDataType ];
}
}
// Chain conversions given the request and the original response
function ajaxConvert( s, response ) {
var conv2, current, conv, tmp,
converters = {},
i = 0,
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice(),
prev = dataTypes[ 0 ];
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
// Create converters map with lowercased keys
if ( dataTypes[ 1 ] ) {
for ( conv in s.converters ) {
converters[ conv.toLowerCase() ] = s.converters[ conv ];
}
}
// Convert to each sequential dataType, tolerating list modification
for ( ; (current = dataTypes[++i]); ) {
// There's only work to do if current dataType is non-auto
if ( current !== "*" ) {
// Convert response if prev dataType is non-auto and differs from current
if ( prev !== "*" && prev !== current ) {
// Seek a direct converter
conv = converters[ prev + " " + current ] || converters[ "* " + current ];
// If none found, seek a pair
if ( !conv ) {
for ( conv2 in converters ) {
// If conv2 outputs current
tmp = conv2.split(" ");
if ( tmp[ 1 ] === current ) {
// If prev can be converted to accepted input
conv = converters[ prev + " " + tmp[ 0 ] ] ||
converters[ "* " + tmp[ 0 ] ];
if ( conv ) {
// Condense equivalence converters
if ( conv === true ) {
conv = converters[ conv2 ];
// Otherwise, insert the intermediate dataType
} else if ( converters[ conv2 ] !== true ) {
current = tmp[ 0 ];
dataTypes.splice( i--, 0, current );
}
break;
}
}
}
}
// Apply converter (if not an equivalence)
if ( conv !== true ) {
// Unless errors are allowed to bubble, catch and return them
if ( conv && s["throws"] ) {
response = conv( response );
} else {
try {
response = conv( response );
} catch ( e ) {
return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
}
}
}
}
// Update prev for next iteration
prev = current;
}
}
return { state: "success", data: response };
}
// Install script dataType
jQuery.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /(?:java|ecma)script/
},
converters: {
"text script": function( text ) {
jQuery.globalEval( text );
return text;
}
}
});
// Handle cache's special case and global
jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) {
s.cache = false;
}
if ( s.crossDomain ) {
s.type = "GET";
s.global = false;
}
});
// Bind script tag hack transport
jQuery.ajaxTransport( "script", function(s) {
// This transport only deals with cross domain requests
if ( s.crossDomain ) {
var script,
head = document.head || jQuery("head")[0] || document.documentElement;
return {
send: function( _, callback ) {
script = document.createElement("script");
script.async = true;
if ( s.scriptCharset ) {
script.charset = s.scriptCharset;
}
script.src = s.url;
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function( _, isAbort ) {
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
// Remove the script
if ( script.parentNode ) {
script.parentNode.removeChild( script );
}
// Dereference the script
script = null;
// Callback if not abort
if ( !isAbort ) {
callback( 200, "success" );
}
}
};
// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
// Use native DOM manipulation to avoid our domManip AJAX trickery
head.insertBefore( script, head.firstChild );
},
abort: function() {
if ( script ) {
script.onload( undefined, true );
}
}
};
}
});
var oldCallbacks = [],
rjsonp = /(=)\?(?=&|$)|\?\?/;
// Default jsonp settings
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
this[ callback ] = true;
return callback;
}
});
// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
var callbackName, overwritten, responseContainer,
jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
"url" :
typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
);
// Handle iff the expected data type is "jsonp" or we have a parameter to set
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
// Get callback name, remembering preexisting value associated with it
callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
s.jsonpCallback() :
s.jsonpCallback;
// Insert callback into url or form data
if ( jsonProp ) {
s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
} else if ( s.jsonp !== false ) {
s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
}
// Use data converter to retrieve json after script execution
s.converters["script json"] = function() {
if ( !responseContainer ) {
jQuery.error( callbackName + " was not called" );
}
return responseContainer[ 0 ];
};
// force json dataType
s.dataTypes[ 0 ] = "json";
// Install callback
overwritten = window[ callbackName ];
window[ callbackName ] = function() {
responseContainer = arguments;
};
// Clean-up function (fires after converters)
jqXHR.always(function() {
// Restore preexisting value
window[ callbackName ] = overwritten;
// Save back as free
if ( s[ callbackName ] ) {
// make sure that re-using the options doesn't screw things around
s.jsonpCallback = originalSettings.jsonpCallback;
// save the callback name for future use
oldCallbacks.push( callbackName );
}
// Call if it was a function and we have a response
if ( responseContainer && jQuery.isFunction( overwritten ) ) {
overwritten( responseContainer[ 0 ] );
}
responseContainer = overwritten = undefined;
});
// Delegate to script
return "script";
}
});
var xhrCallbacks, xhrSupported,
xhrId = 0,
// #5280: Internet Explorer will keep connections alive if we don't abort on unload
xhrOnUnloadAbort = window.ActiveXObject && function() {
// Abort all pending requests
var key;
for ( key in xhrCallbacks ) {
xhrCallbacks[ key ]( undefined, true );
}
};
// Functions to create xhrs
function createStandardXHR() {
try {
return new window.XMLHttpRequest();
} catch( e ) {}
}
function createActiveXHR() {
try {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} catch( e ) {}
}
// Create the request object
// (This is still attached to ajaxSettings for backward compatibility)
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
/* Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
* so we use the ActiveXObject when it is available
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
function() {
return !this.isLocal && createStandardXHR() || createActiveXHR();
} :
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR;
// Determine support properties
xhrSupported = jQuery.ajaxSettings.xhr();
jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
xhrSupported = jQuery.support.ajax = !!xhrSupported;
// Create transport if the browser can provide an xhr
if ( xhrSupported ) {
jQuery.ajaxTransport(function( s ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( !s.crossDomain || jQuery.support.cors ) {
var callback;
return {
send: function( headers, complete ) {
// Get a new xhr
var handle, i,
xhr = s.xhr();
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
xhr.open( s.type, s.url, s.async, s.username, s.password );
} else {
xhr.open( s.type, s.url, s.async );
}
// Apply custom fields if provided
if ( s.xhrFields ) {
for ( i in s.xhrFields ) {
xhr[ i ] = s.xhrFields[ i ];
}
}
// Override mime type if needed
if ( s.mimeType && xhr.overrideMimeType ) {
xhr.overrideMimeType( s.mimeType );
}
// X-Requested-With header
// For cross-domain requests, seeing as conditions for a preflight are
// akin to a jigsaw puzzle, we simply never set it to be sure.
// (it can always be set on a per-request basis or even using ajaxSetup)
// For same-domain requests, won't change header if already provided.
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
headers["X-Requested-With"] = "XMLHttpRequest";
}
// Need an extra try/catch for cross domain requests in Firefox 3
try {
for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
}
} catch( err ) {}
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( ( s.hasContent && s.data ) || null );
// Listener
callback = function( _, isAbort ) {
var status, responseHeaders, statusText, responses;
// Firefox throws exceptions when accessing properties
// of an xhr when a network error occurred
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
try {
// Was never called and is aborted or complete
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// Only called once
callback = undefined;
// Do not keep as active anymore
if ( handle ) {
xhr.onreadystatechange = jQuery.noop;
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
}
// If it's an abort
if ( isAbort ) {
// Abort it manually if needed
if ( xhr.readyState !== 4 ) {
xhr.abort();
}
} else {
responses = {};
status = xhr.status;
responseHeaders = xhr.getAllResponseHeaders();
// When requesting binary data, IE6-9 will throw an exception
// on any attempt to access responseText (#11426)
if ( typeof xhr.responseText === "string" ) {
responses.text = xhr.responseText;
}
// Firefox throws an exception when accessing
// statusText for faulty cross-domain requests
try {
statusText = xhr.statusText;
} catch( e ) {
// We normalize with Webkit giving an empty statusText
statusText = "";
}
// Filter status for non standard behaviors
// If the request is local and we have data: assume a success
// (success with no data won't get notified, that's the best we
// can do given current implementations)
if ( !status && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
}
}
}
} catch( firefoxAccessException ) {
if ( !isAbort ) {
complete( -1, firefoxAccessException );
}
}
// Call complete if needed
if ( responses ) {
complete( status, statusText, responses, responseHeaders );
}
};
if ( !s.async ) {
// if we're in sync mode we fire the callback
callback();
} else if ( xhr.readyState === 4 ) {
// (IE6 & IE7) if it's in cache and has been
// retrieved directly we need to fire the callback
setTimeout( callback );
} else {
handle = ++xhrId;
if ( xhrOnUnloadAbort ) {
// Create the active xhrs callbacks list if needed
// and attach the unload handler
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
// Add to list of active xhrs callbacks
xhrCallbacks[ handle ] = callback;
}
xhr.onreadystatechange = callback;
}
},
abort: function() {
if ( callback ) {
callback( undefined, true );
}
}
};
}
});
}
var fxNow, timerId,
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
rrun = /queueHooks$/,
animationPrefilters = [ defaultPrefilter ],
tweeners = {
"*": [function( prop, value ) {
var end, unit,
tween = this.createTween( prop, value ),
parts = rfxnum.exec( value ),
target = tween.cur(),
start = +target || 0,
scale = 1,
maxIterations = 20;
if ( parts ) {
end = +parts[2];
unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
// We need to compute starting value
if ( unit !== "px" && start ) {
// Iteratively approximate from a nonzero starting point
// Prefer the current property, because this process will be trivial if it uses the same units
// Fallback to end or a simple constant
start = jQuery.css( tween.elem, prop, true ) || end || 1;
do {
// If previous iteration zeroed out, double until we get *something*
// Use a string for doubling factor so we don't accidentally see scale as unchanged below
scale = scale || ".5";
// Adjust and apply
start = start / scale;
jQuery.style( tween.elem, prop, start + unit );
// Update scale, tolerating zero or NaN from tween.cur()
// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
}
tween.unit = unit;
tween.start = start;
// If a +=/-= token was provided, we're doing a relative animation
tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
}
return tween;
}]
};
// Animations created synchronously will run synchronously
function createFxNow() {
setTimeout(function() {
fxNow = undefined;
});
return ( fxNow = jQuery.now() );
}
function createTweens( animation, props ) {
jQuery.each( props, function( prop, value ) {
var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
index = 0,
length = collection.length;
for ( ; index < length; index++ ) {
if ( collection[ index ].call( animation, prop, value ) ) {
// we're done with this property
return;
}
}
});
}
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = animationPrefilters.length,
deferred = jQuery.Deferred().always( function() {
// don't match elem in the :animated selector
delete tick.elem;
}),
tick = function() {
if ( stopped ) {
return false;
}
var currentTime = fxNow || createFxNow(),
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
temp = remaining / animation.duration || 0,
percent = 1 - temp,
index = 0,
length = animation.tweens.length;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( percent );
}
deferred.notifyWith( elem, [ animation, percent, remaining ]);
if ( percent < 1 && length ) {
return remaining;
} else {
deferred.resolveWith( elem, [ animation ] );
return false;
}
},
animation = deferred.promise({
elem: elem,
props: jQuery.extend( {}, properties ),
opts: jQuery.extend( true, { specialEasing: {} }, options ),
originalProperties: properties,
originalOptions: options,
startTime: fxNow || createFxNow(),
duration: options.duration,
tweens: [],
createTween: function( prop, end ) {
var tween = jQuery.Tween( elem, animation.opts, prop, end,
animation.opts.specialEasing[ prop ] || animation.opts.easing );
animation.tweens.push( tween );
return tween;
},
stop: function( gotoEnd ) {
var index = 0,
// if we are going to the end, we want to run all the tweens
// otherwise we skip this part
length = gotoEnd ? animation.tweens.length : 0;
if ( stopped ) {
return this;
}
stopped = true;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( 1 );
}
// resolve when we played the last frame
// otherwise, reject
if ( gotoEnd ) {
deferred.resolveWith( elem, [ animation, gotoEnd ] );
} else {
deferred.rejectWith( elem, [ animation, gotoEnd ] );
}
return this;
}
}),
props = animation.props;
propFilter( props, animation.opts.specialEasing );
for ( ; index < length ; index++ ) {
result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
if ( result ) {
return result;
}
}
createTweens( animation, props );
if ( jQuery.isFunction( animation.opts.start ) ) {
animation.opts.start.call( elem, animation );
}
jQuery.fx.timer(
jQuery.extend( tick, {
elem: elem,
anim: animation,
queue: animation.opts.queue
})
);
// attach callbacks from options
return animation.progress( animation.opts.progress )
.done( animation.opts.done, animation.opts.complete )
.fail( animation.opts.fail )
.always( animation.opts.always );
}
function propFilter( props, specialEasing ) {
var value, name, index, easing, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {
name = jQuery.camelCase( index );
easing = specialEasing[ name ];
value = props[ index ];
if ( jQuery.isArray( value ) ) {
easing = value[ 1 ];
value = props[ index ] = value[ 0 ];
}
if ( index !== name ) {
props[ name ] = value;
delete props[ index ];
}
hooks = jQuery.cssHooks[ name ];
if ( hooks && "expand" in hooks ) {
value = hooks.expand( value );
delete props[ name ];
// not quite $.extend, this wont overwrite keys already present.
// also - reusing 'index' from above because we have the correct "name"
for ( index in value ) {
if ( !( index in props ) ) {
props[ index ] = value[ index ];
specialEasing[ index ] = easing;
}
}
} else {
specialEasing[ name ] = easing;
}
}
}
jQuery.Animation = jQuery.extend( Animation, {
tweener: function( props, callback ) {
if ( jQuery.isFunction( props ) ) {
callback = props;
props = [ "*" ];
} else {
props = props.split(" ");
}
var prop,
index = 0,
length = props.length;
for ( ; index < length ; index++ ) {
prop = props[ index ];
tweeners[ prop ] = tweeners[ prop ] || [];
tweeners[ prop ].unshift( callback );
}
},
prefilter: function( callback, prepend ) {
if ( prepend ) {
animationPrefilters.unshift( callback );
} else {
animationPrefilters.push( callback );
}
}
});
function defaultPrefilter( elem, props, opts ) {
/*jshint validthis:true */
var prop, index, length,
value, dataShow, toggle,
tween, hooks, oldfire,
anim = this,
style = elem.style,
orig = {},
handled = [],
hidden = elem.nodeType && isHidden( elem );
// handle queue: false promises
if ( !opts.queue ) {
hooks = jQuery._queueHooks( elem, "fx" );
if ( hooks.unqueued == null ) {
hooks.unqueued = 0;
oldfire = hooks.empty.fire;
hooks.empty.fire = function() {
if ( !hooks.unqueued ) {
oldfire();
}
};
}
hooks.unqueued++;
anim.always(function() {
// doing this makes sure that the complete handler will be called
// before this completes
anim.always(function() {
hooks.unqueued--;
if ( !jQuery.queue( elem, "fx" ).length ) {
hooks.empty.fire();
}
});
});
}
// height/width overflow pass
if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
// Make sure that nothing sneaks out
// Record all 3 overflow attributes because IE does not
// change the overflow attribute when overflowX and
// overflowY are set to the same value
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
// Set display property to inline-block for height/width
// animations on inline elements that are having width/height animated
if ( jQuery.css( elem, "display" ) === "inline" &&
jQuery.css( elem, "float" ) === "none" ) {
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
style.display = "inline-block";
} else {
style.zoom = 1;
}
}
}
if ( opts.overflow ) {
style.overflow = "hidden";
if ( !jQuery.support.shrinkWrapBlocks ) {
anim.always(function() {
style.overflow = opts.overflow[ 0 ];
style.overflowX = opts.overflow[ 1 ];
style.overflowY = opts.overflow[ 2 ];
});
}
}
// show/hide pass
for ( index in props ) {
value = props[ index ];
if ( rfxtypes.exec( value ) ) {
delete props[ index ];
toggle = toggle || value === "toggle";
if ( value === ( hidden ? "hide" : "show" ) ) {
continue;
}
handled.push( index );
}
}
length = handled.length;
if ( length ) {
dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
if ( "hidden" in dataShow ) {
hidden = dataShow.hidden;
}
// store state if its toggle - enables .stop().toggle() to "reverse"
if ( toggle ) {
dataShow.hidden = !hidden;
}
if ( hidden ) {
jQuery( elem ).show();
} else {
anim.done(function() {
jQuery( elem ).hide();
});
}
anim.done(function() {
var prop;
jQuery._removeData( elem, "fxshow" );
for ( prop in orig ) {
jQuery.style( elem, prop, orig[ prop ] );
}
});
for ( index = 0 ; index < length ; index++ ) {
prop = handled[ index ];
tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
if ( !( prop in dataShow ) ) {
dataShow[ prop ] = tween.start;
if ( hidden ) {
tween.end = tween.start;
tween.start = prop === "width" || prop === "height" ? 1 : 0;
}
}
}
}
}
function Tween( elem, options, prop, end, easing ) {
return new Tween.prototype.init( elem, options, prop, end, easing );
}
jQuery.Tween = Tween;
Tween.prototype = {
constructor: Tween,
init: function( elem, options, prop, end, easing, unit ) {
this.elem = elem;
this.prop = prop;
this.easing = easing || "swing";
this.options = options;
this.start = this.now = this.cur();
this.end = end;
this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
},
cur: function() {
var hooks = Tween.propHooks[ this.prop ];
return hooks && hooks.get ?
hooks.get( this ) :
Tween.propHooks._default.get( this );
},
run: function( percent ) {
var eased,
hooks = Tween.propHooks[ this.prop ];
if ( this.options.duration ) {
this.pos = eased = jQuery.easing[ this.easing ](
percent, this.options.duration * percent, 0, 1, this.options.duration
);
} else {
this.pos = eased = percent;
}
this.now = ( this.end - this.start ) * eased + this.start;
if ( this.options.step ) {
this.options.step.call( this.elem, this.now, this );
}
if ( hooks && hooks.set ) {
hooks.set( this );
} else {
Tween.propHooks._default.set( this );
}
return this;
}
};
Tween.prototype.init.prototype = Tween.prototype;
Tween.propHooks = {
_default: {
get: function( tween ) {
var result;
if ( tween.elem[ tween.prop ] != null &&
(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
return tween.elem[ tween.prop ];
}
// passing an empty string as a 3rd parameter to .css will automatically
// attempt a parseFloat and fallback to a string if the parse fails
// so, simple values such as "10px" are parsed to Float.
// complex values such as "rotate(1rad)" are returned as is.
result = jQuery.css( tween.elem, tween.prop, "" );
// Empty strings, null, undefined and "auto" are converted to 0.
return !result || result === "auto" ? 0 : result;
},
set: function( tween ) {
// use step hook for back compat - use cssHook if its there - use .style if its
// available and use plain properties where available
if ( jQuery.fx.step[ tween.prop ] ) {
jQuery.fx.step[ tween.prop ]( tween );
} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
} else {
tween.elem[ tween.prop ] = tween.now;
}
}
}
};
// Remove in 2.0 - this supports IE8's panic based approach
// to setting things on disconnected nodes
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
set: function( tween ) {
if ( tween.elem.nodeType && tween.elem.parentNode ) {
tween.elem[ tween.prop ] = tween.now;
}
}
};
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
var cssFn = jQuery.fn[ name ];
jQuery.fn[ name ] = function( speed, easing, callback ) {
return speed == null || typeof speed === "boolean" ?
cssFn.apply( this, arguments ) :
this.animate( genFx( name, true ), speed, easing, callback );
};
});
jQuery.fn.extend({
fadeTo: function( speed, to, easing, callback ) {
// show any hidden elements after setting opacity to 0
return this.filter( isHidden ).css( "opacity", 0 ).show()
// animate to the value specified
.end().animate({ opacity: to }, speed, easing, callback );
},
animate: function( prop, speed, easing, callback ) {
var empty = jQuery.isEmptyObject( prop ),
optall = jQuery.speed( speed, easing, callback ),
doAnimation = function() {
// Operate on a copy of prop so per-property easing won't be lost
var anim = Animation( this, jQuery.extend( {}, prop ), optall );
doAnimation.finish = function() {
anim.stop( true );
};
// Empty animations, or finishing resolves immediately
if ( empty || jQuery._data( this, "finish" ) ) {
anim.stop( true );
}
};
doAnimation.finish = doAnimation;
return empty || optall.queue === false ?
this.each( doAnimation ) :
this.queue( optall.queue, doAnimation );
},
stop: function( type, clearQueue, gotoEnd ) {
var stopQueue = function( hooks ) {
var stop = hooks.stop;
delete hooks.stop;
stop( gotoEnd );
};
if ( typeof type !== "string" ) {
gotoEnd = clearQueue;
clearQueue = type;
type = undefined;
}
if ( clearQueue && type !== false ) {
this.queue( type || "fx", [] );
}
return this.each(function() {
var dequeue = true,
index = type != null && type + "queueHooks",
timers = jQuery.timers,
data = jQuery._data( this );
if ( index ) {
if ( data[ index ] && data[ index ].stop ) {
stopQueue( data[ index ] );
}
} else {
for ( index in data ) {
if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
stopQueue( data[ index ] );
}
}
}
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
timers[ index ].anim.stop( gotoEnd );
dequeue = false;
timers.splice( index, 1 );
}
}
// start the next in the queue if the last step wasn't forced
// timers currently will call their complete callbacks, which will dequeue
// but only if they were gotoEnd
if ( dequeue || !gotoEnd ) {
jQuery.dequeue( this, type );
}
});
},
finish: function( type ) {
if ( type !== false ) {
type = type || "fx";
}
return this.each(function() {
var index,
data = jQuery._data( this ),
queue = data[ type + "queue" ],
hooks = data[ type + "queueHooks" ],
timers = jQuery.timers,
length = queue ? queue.length : 0;
// enable finishing flag on private data
data.finish = true;
// empty the queue first
jQuery.queue( this, type, [] );
if ( hooks && hooks.cur && hooks.cur.finish ) {
hooks.cur.finish.call( this );
}
// look for any active animations, and finish them
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
timers[ index ].anim.stop( true );
timers.splice( index, 1 );
}
}
// look for any animations in the old queue and finish them
for ( index = 0; index < length; index++ ) {
if ( queue[ index ] && queue[ index ].finish ) {
queue[ index ].finish.call( this );
}
}
// turn off finishing flag
delete data.finish;
});
}
});
// Generate parameters to create a standard animation
function genFx( type, includeWidth ) {
var which,
attrs = { height: type },
i = 0;
// if we include width, step value is 1 to do all cssExpand values,
// if we don't include width, step value is 2 to skip over Left and Right
includeWidth = includeWidth? 1 : 0;
for( ; i < 4 ; i += 2 - includeWidth ) {
which = cssExpand[ i ];
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
}
if ( includeWidth ) {
attrs.opacity = attrs.width = type;
}
return attrs;
}
// Generate shortcuts for custom animations
jQuery.each({
slideDown: genFx("show"),
slideUp: genFx("hide"),
slideToggle: genFx("toggle"),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" },
fadeToggle: { opacity: "toggle" }
}, function( name, props ) {
jQuery.fn[ name ] = function( speed, easing, callback ) {
return this.animate( props, speed, easing, callback );
};
});
jQuery.speed = function( speed, easing, fn ) {
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
};
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
// normalize opt.queue - true/undefined/null -> "fx"
if ( opt.queue == null || opt.queue === true ) {
opt.queue = "fx";
}
// Queueing
opt.old = opt.complete;
opt.complete = function() {
if ( jQuery.isFunction( opt.old ) ) {
opt.old.call( this );
}
if ( opt.queue ) {
jQuery.dequeue( this, opt.queue );
}
};
return opt;
};
jQuery.easing = {
linear: function( p ) {
return p;
},
swing: function( p ) {
return 0.5 - Math.cos( p*Math.PI ) / 2;
}
};
jQuery.timers = [];
jQuery.fx = Tween.prototype.init;
jQuery.fx.tick = function() {
var timer,
timers = jQuery.timers,
i = 0;
fxNow = jQuery.now();
for ( ; i < timers.length; i++ ) {
timer = timers[ i ];
// Checks the timer has not already been removed
if ( !timer() && timers[ i ] === timer ) {
timers.splice( i--, 1 );
}
}
if ( !timers.length ) {
jQuery.fx.stop();
}
fxNow = undefined;
};
jQuery.fx.timer = function( timer ) {
if ( timer() && jQuery.timers.push( timer ) ) {
jQuery.fx.start();
}
};
jQuery.fx.interval = 13;
jQuery.fx.start = function() {
if ( !timerId ) {
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
}
};
jQuery.fx.stop = function() {
clearInterval( timerId );
timerId = null;
};
jQuery.fx.speeds = {
slow: 600,
fast: 200,
// Default speed
_default: 400
};
// Back Compat <1.8 extension point
jQuery.fx.step = {};
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
jQuery.fn.offset = function( options ) {
if ( arguments.length ) {
return options === undefined ?
this :
this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
var docElem, win,
box = { top: 0, left: 0 },
elem = this[ 0 ],
doc = elem && elem.ownerDocument;
if ( !doc ) {
return;
}
docElem = doc.documentElement;
// Make sure it's not a disconnected DOM node
if ( !jQuery.contains( docElem, elem ) ) {
return box;
}
// If we don't have gBCR, just use 0,0 rather than error
// BlackBerry 5, iOS 3 (original iPhone)
if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
box = elem.getBoundingClientRect();
}
win = getWindow( doc );
return {
top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
};
};
jQuery.offset = {
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
var curElem = jQuery( elem ),
curOffset = curElem.offset(),
curCSSTop = jQuery.css( elem, "top" ),
curCSSLeft = jQuery.css( elem, "left" ),
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
props = {}, curPosition = {}, curTop, curLeft;
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
if ( calculatePosition ) {
curPosition = curElem.position();
curTop = curPosition.top;
curLeft = curPosition.left;
} else {
curTop = parseFloat( curCSSTop ) || 0;
curLeft = parseFloat( curCSSLeft ) || 0;
}
if ( jQuery.isFunction( options ) ) {
options = options.call( elem, i, curOffset );
}
if ( options.top != null ) {
props.top = ( options.top - curOffset.top ) + curTop;
}
if ( options.left != null ) {
props.left = ( options.left - curOffset.left ) + curLeft;
}
if ( "using" in options ) {
options.using.call( elem, props );
} else {
curElem.css( props );
}
}
};
jQuery.fn.extend({
position: function() {
if ( !this[ 0 ] ) {
return;
}
var offsetParent, offset,
parentOffset = { top: 0, left: 0 },
elem = this[ 0 ];
// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
if ( jQuery.css( elem, "position" ) === "fixed" ) {
// we assume that getBoundingClientRect is available when computed position is fixed
offset = elem.getBoundingClientRect();
} else {
// Get *real* offsetParent
offsetParent = this.offsetParent();
// Get correct offsets
offset = this.offset();
if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
parentOffset = offsetParent.offset();
}
// Add offsetParent borders
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
}
// Subtract parent offsets and element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// are the same in Safari causing offset.left to incorrectly be 0
return {
top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
};
},
offsetParent: function() {
return this.map(function() {
var offsetParent = this.offsetParent || document.documentElement;
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent || document.documentElement;
});
}
});
// Create scrollLeft and scrollTop methods
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
var top = /Y/.test( prop );
jQuery.fn[ method ] = function( val ) {
return jQuery.access( this, function( elem, method, val ) {
var win = getWindow( elem );
if ( val === undefined ) {
return win ? (prop in win) ? win[ prop ] :
win.document.documentElement[ method ] :
elem[ method ];
}
if ( win ) {
win.scrollTo(
!top ? val : jQuery( win ).scrollLeft(),
top ? val : jQuery( win ).scrollTop()
);
} else {
elem[ method ] = val;
}
}, method, val, arguments.length, null );
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
// margin is only for outerHeight, outerWidth
jQuery.fn[ funcName ] = function( margin, value ) {
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
return jQuery.access( this, function( elem, type, value ) {
var doc;
if ( jQuery.isWindow( elem ) ) {
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
// isn't a whole lot we can do. See pull request at this URL for discussion:
// https://github.com/jquery/jquery/pull/764
return elem.document.documentElement[ "client" + name ];
}
// Get document width or height
if ( elem.nodeType === 9 ) {
doc = elem.documentElement;
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
return Math.max(
elem.body[ "scroll" + name ], doc[ "scroll" + name ],
elem.body[ "offset" + name ], doc[ "offset" + name ],
doc[ "client" + name ]
);
}
return value === undefined ?
// Get width or height on the element, requesting but not forcing parseFloat
jQuery.css( elem, type, extra ) :
// Set width or height on the element
jQuery.style( elem, type, value, extra );
}, type, chainable ? margin : undefined, chainable, null );
};
});
});
// Limit scope pollution from any deprecated API
// (function() {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
// in a page that all might call define(). The loader will indicate
// they have special allowances for multiple jQuery versions by
// specifying define.amd.jQuery = true. Register as a named module,
// since jQuery can be concatenated with other files that may use define,
// but not use a proper concatenation script that understands anonymous
// AMD modules. A named AMD is safest and most robust way to register.
// Lowercase jquery is used because AMD module names are derived from
// file names, and jQuery is normally delivered in a lowercase file name.
// Do this after creating the global so that if an AMD module wants to call
// noConflict to hide this version of jQuery, it will work.
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
define( "jquery", [], function () { return jQuery; } );
}
})( window );
|
src/components/Tree/TreeItem.js | wundery/wundery-ui-react | import React from 'react';
import classnames from 'classnames';
import { Icon } from '../Icon';
class TreeItem extends React.Component {
static propTypes = {
label: React.PropTypes.string.isRequired,
depth: React.PropTypes.number.isRequired,
expanded: React.PropTypes.bool.isRequired,
childs: React.PropTypes.array.isRequired,
onClick: React.PropTypes.func.isRequired,
node: React.PropTypes.object.isRequired,
levelPrefix: React.PropTypes.func,
maxDepth: React.PropTypes.number,
itemAddon: React.PropTypes.func,
highlighted: React.PropTypes.func,
};
static defaultProps = {
levelPrefix: null,
maxDepth: null,
itemAddon: null,
highlighted: null,
};
constructor(props) {
super(props);
const { expanded } = props;
this.state = {
expanded,
};
}
render() {
const {
childs,
depth,
highlighted,
itemAddon,
label,
levelPrefix,
maxDepth,
node,
onClick,
} = this.props;
const { expanded } = this.state;
function iconName() {
if (expanded) { return 'minus-square-o'; }
return 'plus-square';
}
const onExpandClick = () => {
this.setState(state => ({ expanded: !state.expanded }));
};
function renderPrefix() {
if (maxDepth && maxDepth === depth) { return null; }
return (
<a className="ui-tree-item-prefix" onClick={onExpandClick} tabIndex={0}>
<Icon name={iconName()} />
</a>
);
}
const onClickWrapper = () => {
onClick(node);
};
const renderAddon = () => {
if (itemAddon) {
const renderedAddon = itemAddon(node, depth);
return renderedAddon && (
<div className="ui-tree-item-details-addon">
{renderedAddon}
</div>
);
}
return null;
};
const renderBox = () => {
const className = classnames('ui-tree-item-box', {
'ui-tree-item-box-clickable': onClick,
});
return (
<a className={className} tabIndex={0} onClick={onClickWrapper}>
{label}
</a>
);
};
const renderChild = (_node, index) => (
<TreeItem
label={_node.label}
depth={_node.depth}
expanded={_node.expanded}
key={index}
childs={_node.childs}
onClick={onClick}
node={_node}
levelPrefix={levelPrefix}
maxDepth={maxDepth}
itemAddon={itemAddon}
highlighted={highlighted}
/>
);
const renderChilds = () => {
if (expanded) {
return (
<div>
<div className="ui-tree-item-indent">
{levelPrefix && levelPrefix(node, depth + 1)}
</div>
<div className="ui-tree-item-childs">
{childs.map(renderChild)}
</div>
</div>
);
}
return null;
};
const className = classnames('ui-tree-item', {
'ui-tree-item-expandable': true,
'ui-tree-item-indent': depth > 0,
'ui-tree-item-with-addon': itemAddon,
'ui-tree-item-highlighted': highlighted && highlighted(node),
});
return (
<div className={className}>
<div className="ui-tree-item-details">
<div className="ui-tree-item-details-inner">
{renderPrefix()}
{renderBox()}
</div>
{renderAddon()}
</div>
<div className="ui-tree-item-childs">
{renderChilds()}
</div>
</div>
);
}
}
export default TreeItem;
|
Samples/Core.EmbedJavaScript.WeekNumbers/Core.EmbedJavaScript.WeekNumbersWeb/Scripts/jquery-1.9.1.js | edrohler/PnP | /* NUGET: BEGIN LICENSE TEXT
jQuery v1.9.1
Microsoft grants you the right to use these script files for the sole purpose of either: (i) interacting through your browser with the Microsoft website, subject to the website's terms of use; or (ii) using the files as included with a Microsoft product subject to that product's license terms. Microsoft reserves all other rights to the files not expressly granted by Microsoft, whether by implication, estoppel or otherwise. The notices and licenses below are for informational purposes only.
***************************************************
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
********************************
* Includes Sizzle CSS Selector Engine
* http://sizzlejs.com/
* Copyright 2012 jQuery Foundation and other contributors
********************************************************
Provided for Informational Purposes Only
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* NUGET: END LICENSE TEXT */
/*!
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2013-2-4
*/
(function( window, undefined ) {
// Can't do this because several apps including ASP.NET trace
// the stack via arguments.caller.callee and Firefox dies if
// you try to trace through "use strict" call chains. (#13335)
// Support: Firefox 18+
//"use strict";
var
// The deferred used on DOM ready
readyList,
// A central reference to the root jQuery(document)
rootjQuery,
// Support: IE<9
// For `typeof node.method` instead of `node.method !== undefined`
core_strundefined = typeof undefined,
// Use the correct document accordingly with window argument (sandbox)
document = window.document,
location = window.location,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// [[Class]] -> type pairs
class2type = {},
// List of deleted data cache ids, so we can reuse them
core_deletedIds = [],
core_version = "1.9.1",
// Save a reference to some core methods
core_concat = core_deletedIds.concat,
core_push = core_deletedIds.push,
core_slice = core_deletedIds.slice,
core_indexOf = core_deletedIds.indexOf,
core_toString = class2type.toString,
core_hasOwn = class2type.hasOwnProperty,
core_trim = core_version.trim,
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
},
// Used for matching numbers
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
// Used for splitting on whitespace
core_rnotwhite = /\S+/g,
// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
// A simple way to check for HTML strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
// Strict HTML recognition (#11290: must start with <)
rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
// Matches dashed string for camelizing
rmsPrefix = /^-ms-/,
rdashAlpha = /-([\da-z])/gi,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return letter.toUpperCase();
},
// The ready event handler
completed = function( event ) {
// readyState === "complete" is good enough for us to call the dom ready in oldIE
if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
detach();
jQuery.ready();
}
},
// Clean-up method for dom ready events
detach = function() {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", completed, false );
window.removeEventListener( "load", completed, false );
} else {
document.detachEvent( "onreadystatechange", completed );
window.detachEvent( "onload", completed );
}
};
jQuery.fn = jQuery.prototype = {
// The current version of jQuery being used
jquery: core_version,
constructor: jQuery,
init: function( selector, context, rootjQuery ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
return this;
}
// Handle HTML strings
if ( typeof selector === "string" ) {
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check
match = [ null, selector, null ];
} else {
match = rquickExpr.exec( selector );
}
// Match html or make sure no context is specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
context = context instanceof jQuery ? context[0] : context;
// scripts is true for back-compat
jQuery.merge( this, jQuery.parseHTML(
match[1],
context && context.nodeType ? context.ownerDocument || context : document,
true
) );
// HANDLE: $(html, props)
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
for ( match in context ) {
// Properties of context are called as methods if possible
if ( jQuery.isFunction( this[ match ] ) ) {
this[ match ]( context[ match ] );
// ...and otherwise set as attributes
} else {
this.attr( match, context[ match ] );
}
}
}
return this;
// HANDLE: $(#id)
} else {
elem = document.getElementById( match[2] );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
}
// Otherwise, we inject the element directly into the jQuery object
this.length = 1;
this[0] = elem;
}
this.context = document;
this.selector = selector;
return this;
}
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return ( context || rootjQuery ).find( selector );
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
} else {
return this.constructor( context ).find( selector );
}
// HANDLE: $(DOMElement)
} else if ( selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
if ( selector.selector !== undefined ) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.length;
},
toArray: function() {
return core_slice.call( this );
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
return num == null ?
// Return a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this[ this.length + num ] : this[ num ] );
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems ) {
// Build a new jQuery matched element set
var ret = jQuery.merge( this.constructor(), elems );
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context = this.context;
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
return jQuery.each( this, callback, args );
},
ready: function( fn ) {
// Add the callback
jQuery.ready.promise().done( fn );
return this;
},
slice: function() {
return this.pushStack( core_slice.apply( this, arguments ) );
},
first: function() {
return this.eq( 0 );
},
last: function() {
return this.eq( -1 );
},
eq: function( i ) {
var len = this.length,
j = +i + ( i < 0 ? len : 0 );
return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
return this.prevObject || this.constructor(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: core_push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
var src, copyIsArray, copy, name, options, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
target = {};
}
// extend jQuery itself if only one argument is passed
if ( length === i ) {
target = this;
--i;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
clone = src && jQuery.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend({
noConflict: function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
jQuery.readyWait++;
} else {
jQuery.ready( true );
}
},
// Handle when the DOM is ready
ready: function( wait ) {
// Abort if there are pending holds or we're already ready
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
return;
}
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready );
}
// Remember that the DOM is ready
jQuery.isReady = true;
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --jQuery.readyWait > 0 ) {
return;
}
// If there are functions bound, to execute
readyList.resolveWith( document, [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger("ready").off("ready");
}
},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
return jQuery.type(obj) === "function";
},
isArray: Array.isArray || function( obj ) {
return jQuery.type(obj) === "array";
},
isWindow: function( obj ) {
return obj != null && obj == obj.window;
},
isNumeric: function( obj ) {
return !isNaN( parseFloat(obj) ) && isFinite( obj );
},
type: function( obj ) {
if ( obj == null ) {
return String( obj );
}
return typeof obj === "object" || typeof obj === "function" ?
class2type[ core_toString.call(obj) ] || "object" :
typeof obj;
},
isPlainObject: function( obj ) {
// Must be an Object.
// Because of IE, we also have to check the presence of the constructor property.
// Make sure that DOM nodes and window objects don't pass through, as well
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
return false;
}
try {
// Not own constructor property must be Object
if ( obj.constructor &&
!core_hasOwn.call(obj, "constructor") &&
!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
} catch ( e ) {
// IE8,9 Will throw exceptions on certain host objects #9897
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || core_hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw new Error( msg );
},
// data: string of html
// context (optional): If specified, the fragment will be created in this context, defaults to document
// keepScripts (optional): If true, will include scripts passed in the html string
parseHTML: function( data, context, keepScripts ) {
if ( !data || typeof data !== "string" ) {
return null;
}
if ( typeof context === "boolean" ) {
keepScripts = context;
context = false;
}
context = context || document;
var parsed = rsingleTag.exec( data ),
scripts = !keepScripts && [];
// Single tag
if ( parsed ) {
return [ context.createElement( parsed[1] ) ];
}
parsed = jQuery.buildFragment( [ data ], context, scripts );
if ( scripts ) {
jQuery( scripts ).remove();
}
return jQuery.merge( [], parsed.childNodes );
},
parseJSON: function( data ) {
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
return window.JSON.parse( data );
}
if ( data === null ) {
return data;
}
if ( typeof data === "string" ) {
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
if ( data ) {
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
.replace( rvalidtokens, "]" )
.replace( rvalidbraces, "")) ) {
return ( new Function( "return " + data ) )();
}
}
}
jQuery.error( "Invalid JSON: " + data );
},
// Cross-browser xml parsing
parseXML: function( data ) {
var xml, tmp;
if ( !data || typeof data !== "string" ) {
return null;
}
try {
if ( window.DOMParser ) { // Standard
tmp = new DOMParser();
xml = tmp.parseFromString( data , "text/xml" );
} else { // IE
xml = new ActiveXObject( "Microsoft.XMLDOM" );
xml.async = "false";
xml.loadXML( data );
}
} catch( e ) {
xml = undefined;
}
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
jQuery.error( "Invalid XML: " + data );
}
return xml;
},
noop: function() {},
// Evaluates a script in a global context
// Workarounds based on findings by Jim Driscoll
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
globalEval: function( data ) {
if ( data && jQuery.trim( data ) ) {
// We use execScript on Internet Explorer
// We use an anonymous function so that context is window
// rather than jQuery in Firefox
( window.execScript || function( data ) {
window[ "eval" ].call( window, data );
} )( data );
}
},
// Convert dashed to camelCase; used by the css and data modules
// Microsoft forgot to hump their vendor prefix (#9572)
camelCase: function( string ) {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
},
// args is for internal usage only
each: function( obj, callback, args ) {
var value,
i = 0,
length = obj.length,
isArray = isArraylike( obj );
if ( args ) {
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback.apply( obj[ i ], args );
if ( value === false ) {
break;
}
}
} else {
for ( i in obj ) {
value = callback.apply( obj[ i ], args );
if ( value === false ) {
break;
}
}
}
// A special, fast, case for the most common use of each
} else {
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback.call( obj[ i ], i, obj[ i ] );
if ( value === false ) {
break;
}
}
} else {
for ( i in obj ) {
value = callback.call( obj[ i ], i, obj[ i ] );
if ( value === false ) {
break;
}
}
}
}
return obj;
},
// Use native String.trim function wherever possible
trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
function( text ) {
return text == null ?
"" :
core_trim.call( text );
} :
// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
"" :
( text + "" ).replace( rtrim, "" );
},
// results is for internal usage only
makeArray: function( arr, results ) {
var ret = results || [];
if ( arr != null ) {
if ( isArraylike( Object(arr) ) ) {
jQuery.merge( ret,
typeof arr === "string" ?
[ arr ] : arr
);
} else {
core_push.call( ret, arr );
}
}
return ret;
},
inArray: function( elem, arr, i ) {
var len;
if ( arr ) {
if ( core_indexOf ) {
return core_indexOf.call( arr, elem, i );
}
len = arr.length;
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
for ( ; i < len; i++ ) {
// Skip accessing in sparse arrays
if ( i in arr && arr[ i ] === elem ) {
return i;
}
}
}
return -1;
},
merge: function( first, second ) {
var l = second.length,
i = first.length,
j = 0;
if ( typeof l === "number" ) {
for ( ; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var retVal,
ret = [],
i = 0,
length = elems.length;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( ; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
var value,
i = 0,
length = elems.length,
isArray = isArraylike( elems ),
ret = [];
// Go through the array, translating each of the items to their
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
// Go through every key on the object,
} else {
for ( i in elems ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
}
// Flatten any nested arrays
return core_concat.apply( [], ret );
},
// A global GUID counter for objects
guid: 1,
// Bind a function to a context, optionally partially applying any
// arguments.
proxy: function( fn, context ) {
var args, proxy, tmp;
if ( typeof context === "string" ) {
tmp = fn[ context ];
context = fn;
fn = tmp;
}
// Quick check to determine if target is callable, in the spec
// this throws a TypeError, but we will just return undefined.
if ( !jQuery.isFunction( fn ) ) {
return undefined;
}
// Simulated bind
args = core_slice.call( arguments, 2 );
proxy = function() {
return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
};
// Set the guid of unique handler to the same of original handler, so it can be removed
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
return proxy;
},
// Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
length = elems.length,
bulk = key == null;
// Sets many values
if ( jQuery.type( key ) === "object" ) {
chainable = true;
for ( i in key ) {
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
}
// Sets one value
} else if ( value !== undefined ) {
chainable = true;
if ( !jQuery.isFunction( value ) ) {
raw = true;
}
if ( bulk ) {
// Bulk operations run against the entire set
if ( raw ) {
fn.call( elems, value );
fn = null;
// ...except when executing function values
} else {
bulk = fn;
fn = function( elem, key, value ) {
return bulk.call( jQuery( elem ), value );
};
}
}
if ( fn ) {
for ( ; i < length; i++ ) {
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
}
}
}
return chainable ?
elems :
// Gets
bulk ?
fn.call( elems ) :
length ? fn( elems[0], key ) : emptyGet;
},
now: function() {
return ( new Date() ).getTime();
}
});
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
readyList = jQuery.Deferred();
// Catch cases where $(document).ready() is called after the browser event has already occurred.
// we once tried to use readyState "interactive" here, but it caused issues like the one
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
setTimeout( jQuery.ready );
// Standards-based browsers support DOMContentLoaded
} else if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", completed, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", completed, false );
// If IE event model is used
} else {
// Ensure firing before onload, maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", completed );
// A fallback to window.onload, that will always work
window.attachEvent( "onload", completed );
// If IE and not a frame
// continually check to see if the document is ready
var top = false;
try {
top = window.frameElement == null && document.documentElement;
} catch(e) {}
if ( top && top.doScroll ) {
(function doScrollCheck() {
if ( !jQuery.isReady ) {
try {
// Use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
top.doScroll("left");
} catch(e) {
return setTimeout( doScrollCheck, 50 );
}
// detach all dom ready events
detach();
// and execute any waiting functions
jQuery.ready();
}
})();
}
}
}
return readyList.promise( obj );
};
// Populate the class2type map
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
});
function isArraylike( obj ) {
var length = obj.length,
type = jQuery.type( obj );
if ( jQuery.isWindow( obj ) ) {
return false;
}
if ( obj.nodeType === 1 && length ) {
return true;
}
return type === "array" || type !== "function" &&
( length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// String to Object options format cache
var optionsCache = {};
// Convert String-formatted options into Object-formatted ones and store in cache
function createOptions( options ) {
var object = optionsCache[ options ] = {};
jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
object[ flag ] = true;
});
return object;
}
/*
* Create a callback list using the following parameters:
*
* options: an optional list of space-separated options that will change how
* the callback list behaves or a more traditional option object
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible options:
*
* once: will ensure the callback list can only be fired once (like a Deferred)
*
* memory: will keep track of previous values and will call any callback added
* after the list has been fired right away with the latest "memorized"
* values (like a Deferred)
*
* unique: will ensure a callback can only be added once (no duplicate in the list)
*
* stopOnFalse: interrupt callings when a callback returns false
*
*/
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
( optionsCache[ options ] || createOptions( options ) ) :
jQuery.extend( {}, options );
var // Flag to know if list is currently firing
firing,
// Last fire value (for non-forgettable lists)
memory,
// Flag to know if list was already fired
fired,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// First callback to fire (used internally by add and fireWith)
firingStart,
// Actual callback list
list = [],
// Stack of fire calls for repeatable lists
stack = !options.once && [],
// Fire callbacks
fire = function( data ) {
memory = options.memory && data;
fired = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
firing = true;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
memory = false; // To prevent further calls using add
break;
}
}
firing = false;
if ( list ) {
if ( stack ) {
if ( stack.length ) {
fire( stack.shift() );
}
} else if ( memory ) {
list = [];
} else {
self.disable();
}
}
},
// Actual Callbacks object
self = {
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
// First, we save the current length
var start = list.length;
(function add( args ) {
jQuery.each( args, function( _, arg ) {
var type = jQuery.type( arg );
if ( type === "function" ) {
if ( !options.unique || !self.has( arg ) ) {
list.push( arg );
}
} else if ( arg && arg.length && type !== "string" ) {
// Inspect recursively
add( arg );
}
});
})( arguments );
// Do we need to add the callbacks to the
// current firing batch?
if ( firing ) {
firingLength = list.length;
// With memory, if we're not firing then
// we should call right away
} else if ( memory ) {
firingStart = start;
fire( memory );
}
}
return this;
},
// Remove a callback from the list
remove: function() {
if ( list ) {
jQuery.each( arguments, function( _, arg ) {
var index;
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 );
// Handle firing indexes
if ( firing ) {
if ( index <= firingLength ) {
firingLength--;
}
if ( index <= firingIndex ) {
firingIndex--;
}
}
}
});
}
return this;
},
// Check if a given callback is in the list.
// If no argument is given, return whether or not list has callbacks attached.
has: function( fn ) {
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
},
// Remove all callbacks from the list
empty: function() {
list = [];
return this;
},
// Have the list do nothing anymore
disable: function() {
list = stack = memory = undefined;
return this;
},
// Is it disabled?
disabled: function() {
return !list;
},
// Lock the list in its current state
lock: function() {
stack = undefined;
if ( !memory ) {
self.disable();
}
return this;
},
// Is it locked?
locked: function() {
return !stack;
},
// Call all callbacks with the given context and arguments
fireWith: function( context, args ) {
args = args || [];
args = [ context, args.slice ? args.slice() : args ];
if ( list && ( !fired || stack ) ) {
if ( firing ) {
stack.push( args );
} else {
fire( args );
}
}
return this;
},
// Call all the callbacks with the given arguments
fire: function() {
self.fireWith( this, arguments );
return this;
},
// To know if the callbacks have already been called at least once
fired: function() {
return !!fired;
}
};
return self;
};
jQuery.extend({
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
[ "notify", "progress", jQuery.Callbacks("memory") ]
],
state = "pending",
promise = {
state: function() {
return state;
},
always: function() {
deferred.done( arguments ).fail( arguments );
return this;
},
then: function( /* fnDone, fnFail, fnProgress */ ) {
var fns = arguments;
return jQuery.Deferred(function( newDefer ) {
jQuery.each( tuples, function( i, tuple ) {
var action = tuple[ 0 ],
fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
// deferred[ done | fail | progress ] for forwarding actions to newDefer
deferred[ tuple[1] ](function() {
var returned = fn && fn.apply( this, arguments );
if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise()
.done( newDefer.resolve )
.fail( newDefer.reject )
.progress( newDefer.notify );
} else {
newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
}
});
});
fns = null;
}).promise();
},
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
return obj != null ? jQuery.extend( obj, promise ) : promise;
}
},
deferred = {};
// Keep pipe for back-compat
promise.pipe = promise.then;
// Add list-specific methods
jQuery.each( tuples, function( i, tuple ) {
var list = tuple[ 2 ],
stateString = tuple[ 3 ];
// promise[ done | fail | progress ] = list.add
promise[ tuple[1] ] = list.add;
// Handle state
if ( stateString ) {
list.add(function() {
// state = [ resolved | rejected ]
state = stateString;
// [ reject_list | resolve_list ].disable; progress_list.lock
}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
}
// deferred[ resolve | reject | notify ]
deferred[ tuple[0] ] = function() {
deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
return this;
};
deferred[ tuple[0] + "With" ] = list.fireWith;
});
// Make the deferred a promise
promise.promise( deferred );
// Call given func if any
if ( func ) {
func.call( deferred, deferred );
}
// All done!
return deferred;
},
// Deferred helper
when: function( subordinate /* , ..., subordinateN */ ) {
var i = 0,
resolveValues = core_slice.call( arguments ),
length = resolveValues.length,
// the count of uncompleted subordinates
remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
// Update function for both resolve and progress values
updateFunc = function( i, contexts, values ) {
return function( value ) {
contexts[ i ] = this;
values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
if( values === progressValues ) {
deferred.notifyWith( contexts, values );
} else if ( !( --remaining ) ) {
deferred.resolveWith( contexts, values );
}
};
},
progressValues, progressContexts, resolveContexts;
// add listeners to Deferred subordinates; treat others as resolved
if ( length > 1 ) {
progressValues = new Array( length );
progressContexts = new Array( length );
resolveContexts = new Array( length );
for ( ; i < length; i++ ) {
if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
resolveValues[ i ].promise()
.done( updateFunc( i, resolveContexts, resolveValues ) )
.fail( deferred.reject )
.progress( updateFunc( i, progressContexts, progressValues ) );
} else {
--remaining;
}
}
}
// if we're not waiting on anything, resolve the master
if ( !remaining ) {
deferred.resolveWith( resolveContexts, resolveValues );
}
return deferred.promise();
}
});
jQuery.support = (function() {
var support, all, a,
input, select, fragment,
opt, eventName, isSupported, i,
div = document.createElement("div");
// Setup
div.setAttribute( "className", "t" );
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
// Support tests won't run in some limited or non-browser environments
all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[ 0 ];
if ( !all || !a || !all.length ) {
return {};
}
// First batch of tests
select = document.createElement("select");
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName("input")[ 0 ];
a.style.cssText = "top:1px;float:left;opacity:.5";
support = {
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: div.firstChild.nodeType === 3,
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName("tbody").length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName("link").length,
// Get the style information from getAttribute
// (IE uses .cssText instead)
style: /top/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: a.getAttribute("href") === "/a",
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.5/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
checkOn: !!input.value,
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: opt.selected,
// Tests for enctype support on a form (#6743)
enctype: !!document.createElement("form").enctype,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
boxModel: document.compatMode === "CSS1Compat",
// Will be defined later
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true,
boxSizingReliable: true,
pixelPosition: false
};
// Make sure checked status is properly cloned
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
// Make sure that the options inside disabled selects aren't marked as disabled
// (WebKit marks them as disabled)
select.disabled = true;
support.optDisabled = !opt.disabled;
// Support: IE<9
try {
delete div.test;
} catch( e ) {
support.deleteExpando = false;
}
// Check if we can trust getAttribute("value")
input = document.createElement("input");
input.setAttribute( "value", "" );
support.input = input.getAttribute( "value" ) === "";
// Check if an input maintains its value after becoming a radio
input.value = "t";
input.setAttribute( "type", "radio" );
support.radioValue = input.value === "t";
// #11217 - WebKit loses check when the name is after the checked attribute
input.setAttribute( "checked", "t" );
input.setAttribute( "name", "t" );
fragment = document.createDocumentFragment();
fragment.appendChild( input );
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.checked;
// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
// Support: IE<9
// Opera does not clone events (and typeof div.attachEvent === undefined).
// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
if ( div.attachEvent ) {
div.attachEvent( "onclick", function() {
support.noCloneEvent = false;
});
div.cloneNode( true ).click();
}
// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
for ( i in { submit: true, change: true, focusin: true }) {
div.setAttribute( eventName = "on" + i, "t" );
support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
}
div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = "";
support.clearCloneStyle = div.style.backgroundClip === "content-box";
// Run tests that need a body at doc ready
jQuery(function() {
var container, marginDiv, tds,
divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
body = document.getElementsByTagName("body")[0];
if ( !body ) {
// Return for frameset docs that don't have a body
return;
}
container = document.createElement("div");
container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
body.appendChild( container ).appendChild( div );
// Support: IE8
// Check if table cells still have offsetWidth/Height when they are set
// to display:none and there are still other visible table cells in a
// table row; if so, offsetWidth/Height are not reliable for use when
// determining if an element has been hidden directly using
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
tds = div.getElementsByTagName("td");
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
tds[ 1 ].style.display = "none";
// Support: IE8
// Check if empty table cells still have offsetWidth/Height
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
// Check box-sizing and margin behavior
div.innerHTML = "";
div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
support.boxSizing = ( div.offsetWidth === 4 );
support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
// Use window.getComputedStyle because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. (#3333)
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
marginDiv = div.appendChild( document.createElement("div") );
marginDiv.style.cssText = div.style.cssText = divReset;
marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px";
support.reliableMarginRight =
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
}
if ( typeof div.style.zoom !== core_strundefined ) {
// Support: IE<8
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
div.innerHTML = "";
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
// Support: IE6
// Check if elements with layout shrink-wrap their children
div.style.display = "block";
div.innerHTML = "<div></div>";
div.firstChild.style.width = "5px";
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
if ( support.inlineBlockNeedsLayout ) {
// Prevent IE 6 from affecting layout for positioned elements #11048
// Prevent IE from shrinking the body in IE 7 mode #12869
// Support: IE<8
body.style.zoom = 1;
}
}
body.removeChild( container );
// Null elements to avoid leaks in IE
container = div = tds = marginDiv = null;
});
// Null elements to avoid leaks in IE
all = select = fragment = opt = a = input = null;
return support;
})();
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g;
function internalData( elem, name, data, pvt /* Internal Use Only */ ){
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
// We have to handle DOM nodes and JS objects differently because IE6-7
// can't GC object references properly across the DOM-JS boundary
isNode = elem.nodeType,
// Only DOM nodes need the global jQuery cache; JS object data is
// attached directly to the object so GC can occur automatically
cache = isNode ? jQuery.cache : elem,
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
// Avoid doing any more work than we need to when trying to get data on an
// object that has no data at all
if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
return;
}
if ( !id ) {
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
} else {
id = internalKey;
}
}
if ( !cache[ id ] ) {
cache[ id ] = {};
// Avoids exposing jQuery metadata on plain JS objects when the object
// is serialized using JSON.stringify
if ( !isNode ) {
cache[ id ].toJSON = jQuery.noop;
}
}
// An object can be passed to jQuery.data instead of a key/value pair; this gets
// shallow copied over onto the existing cache
if ( typeof name === "object" || typeof name === "function" ) {
if ( pvt ) {
cache[ id ] = jQuery.extend( cache[ id ], name );
} else {
cache[ id ].data = jQuery.extend( cache[ id ].data, name );
}
}
thisCache = cache[ id ];
// jQuery data() is stored in a separate object inside the object's internal data
// cache in order to avoid key collisions between internal data and user-defined
// data.
if ( !pvt ) {
if ( !thisCache.data ) {
thisCache.data = {};
}
thisCache = thisCache.data;
}
if ( data !== undefined ) {
thisCache[ jQuery.camelCase( name ) ] = data;
}
// Check for both converted-to-camel and non-converted data property names
// If a data property was specified
if ( getByName ) {
// First Try to find as-is property data
ret = thisCache[ name ];
// Test for null|undefined property data
if ( ret == null ) {
// Try to find the camelCased property
ret = thisCache[ jQuery.camelCase( name ) ];
}
} else {
ret = thisCache;
}
return ret;
}
function internalRemoveData( elem, name, pvt ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var i, l, thisCache,
isNode = elem.nodeType,
// See jQuery.data for more information
cache = isNode ? jQuery.cache : elem,
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
// If there is already no cache entry for this object, there is no
// purpose in continuing
if ( !cache[ id ] ) {
return;
}
if ( name ) {
thisCache = pvt ? cache[ id ] : cache[ id ].data;
if ( thisCache ) {
// Support array or space separated string names for data keys
if ( !jQuery.isArray( name ) ) {
// try the string as a key before any manipulation
if ( name in thisCache ) {
name = [ name ];
} else {
// split the camel cased version by spaces unless a key with the spaces exists
name = jQuery.camelCase( name );
if ( name in thisCache ) {
name = [ name ];
} else {
name = name.split(" ");
}
}
} else {
// If "name" is an array of keys...
// When data is initially created, via ("key", "val") signature,
// keys will be converted to camelCase.
// Since there is no way to tell _how_ a key was added, remove
// both plain key and camelCase key. #12786
// This will only penalize the array argument path.
name = name.concat( jQuery.map( name, jQuery.camelCase ) );
}
for ( i = 0, l = name.length; i < l; i++ ) {
delete thisCache[ name[i] ];
}
// If there is no data left in the cache, we want to continue
// and let the cache object itself get destroyed
if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
return;
}
}
}
// See jQuery.data for more information
if ( !pvt ) {
delete cache[ id ].data;
// Don't destroy the parent cache unless the internal data object
// had been the only thing left in it
if ( !isEmptyDataObject( cache[ id ] ) ) {
return;
}
}
// Destroy the cache
if ( isNode ) {
jQuery.cleanData( [ elem ], true );
// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
delete cache[ id ];
// When all else fails, null
} else {
cache[ id ] = null;
}
}
jQuery.extend({
cache: {},
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
hasData: function( elem ) {
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
return !!elem && !isEmptyDataObject( elem );
},
data: function( elem, name, data ) {
return internalData( elem, name, data );
},
removeData: function( elem, name ) {
return internalRemoveData( elem, name );
},
// For internal use only.
_data: function( elem, name, data ) {
return internalData( elem, name, data, true );
},
_removeData: function( elem, name ) {
return internalRemoveData( elem, name, true );
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
// Do not set data on non-element because it will not be cleared (#8335).
if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
return false;
}
var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
// nodes accept data unless otherwise specified; rejection can be conditional
return !noData || noData !== true && elem.getAttribute("classid") === noData;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var attrs, name,
elem = this[0],
i = 0,
data = null;
// Gets all values
if ( key === undefined ) {
if ( this.length ) {
data = jQuery.data( elem );
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
attrs = elem.attributes;
for ( ; i < attrs.length; i++ ) {
name = attrs[i].name;
if ( !name.indexOf( "data-" ) ) {
name = jQuery.camelCase( name.slice(5) );
dataAttr( elem, name, data[ name ] );
}
}
jQuery._data( elem, "parsedAttrs", true );
}
}
return data;
}
// Sets multiple values
if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
return jQuery.access( this, function( value ) {
if ( value === undefined ) {
// Try to fetch any internally stored data first
return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
}
this.each(function() {
jQuery.data( this, key, value );
});
}, null, value, arguments.length > 1, null, true );
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
// Only convert to a number if it doesn't change the string
+data + "" === data ? +data :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
// Make sure we set the data so it isn't changed later
jQuery.data( elem, key, data );
} else {
data = undefined;
}
}
return data;
}
// checks a cache object for emptiness
function isEmptyDataObject( obj ) {
var name;
for ( name in obj ) {
// if the public data object is empty, the private is still empty
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
continue;
}
if ( name !== "toJSON" ) {
return false;
}
}
return true;
}
jQuery.extend({
queue: function( elem, type, data ) {
var queue;
if ( elem ) {
type = ( type || "fx" ) + "queue";
queue = jQuery._data( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
if ( !queue || jQuery.isArray(data) ) {
queue = jQuery._data( elem, type, jQuery.makeArray(data) );
} else {
queue.push( data );
}
}
return queue || [];
}
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
startLength = queue.length,
fn = queue.shift(),
hooks = jQuery._queueHooks( elem, type ),
next = function() {
jQuery.dequeue( elem, type );
};
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
startLength--;
}
hooks.cur = fn;
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift( "inprogress" );
}
// clear up the last queue stop function
delete hooks.stop;
fn.call( elem, next, hooks );
}
if ( !startLength && hooks ) {
hooks.empty.fire();
}
},
// not intended for public consumption - generates a queueHooks object, or returns the current one
_queueHooks: function( elem, type ) {
var key = type + "queueHooks";
return jQuery._data( elem, key ) || jQuery._data( elem, key, {
empty: jQuery.Callbacks("once memory").add(function() {
jQuery._removeData( elem, type + "queue" );
jQuery._removeData( elem, key );
})
});
}
});
jQuery.fn.extend({
queue: function( type, data ) {
var setter = 2;
if ( typeof type !== "string" ) {
data = type;
type = "fx";
setter--;
}
if ( arguments.length < setter ) {
return jQuery.queue( this[0], type );
}
return data === undefined ?
this :
this.each(function() {
var queue = jQuery.queue( this, type, data );
// ensure a hooks for this queue
jQuery._queueHooks( this, type );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
type = type || "fx";
return this.queue( type, function( next, hooks ) {
var timeout = setTimeout( next, time );
hooks.stop = function() {
clearTimeout( timeout );
};
});
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
},
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, obj ) {
var tmp,
count = 1,
defer = jQuery.Deferred(),
elements = this,
i = this.length,
resolve = function() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
}
};
if ( typeof type !== "string" ) {
obj = type;
type = undefined;
}
type = type || "fx";
while( i-- ) {
tmp = jQuery._data( elements[ i ], type + "queueHooks" );
if ( tmp && tmp.empty ) {
count++;
tmp.empty.add( resolve );
}
}
resolve();
return defer.promise( obj );
}
});
var nodeHook, boolHook,
rclass = /[\t\r\n]/g,
rreturn = /\r/g,
rfocusable = /^(?:input|select|textarea|button|object)$/i,
rclickable = /^(?:a|area)$/i,
rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
ruseDefault = /^(?:checked|selected)$/i,
getSetAttribute = jQuery.support.getSetAttribute,
getSetInput = jQuery.support.input;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
},
removeProp: function( name ) {
name = jQuery.propFix[ name ] || name;
return this.each(function() {
// try/catch handles cases where IE balks (such as removing a property on window)
try {
this[ name ] = undefined;
delete this[ name ];
} catch( e ) {}
});
},
addClass: function( value ) {
var classes, elem, cur, clazz, j,
i = 0,
len = this.length,
proceed = typeof value === "string" && value;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).addClass( value.call( this, j, this.className ) );
});
}
if ( proceed ) {
// The disjunction here is for better compressibility (see removeClass)
classes = ( value || "" ).match( core_rnotwhite ) || [];
for ( ; i < len; i++ ) {
elem = this[ i ];
cur = elem.nodeType === 1 && ( elem.className ?
( " " + elem.className + " " ).replace( rclass, " " ) :
" "
);
if ( cur ) {
j = 0;
while ( (clazz = classes[j++]) ) {
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
}
elem.className = jQuery.trim( cur );
}
}
}
return this;
},
removeClass: function( value ) {
var classes, elem, cur, clazz, j,
i = 0,
len = this.length,
proceed = arguments.length === 0 || typeof value === "string" && value;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).removeClass( value.call( this, j, this.className ) );
});
}
if ( proceed ) {
classes = ( value || "" ).match( core_rnotwhite ) || [];
for ( ; i < len; i++ ) {
elem = this[ i ];
// This expression is here for better compressibility (see addClass)
cur = elem.nodeType === 1 && ( elem.className ?
( " " + elem.className + " " ).replace( rclass, " " ) :
""
);
if ( cur ) {
j = 0;
while ( (clazz = classes[j++]) ) {
// Remove *all* instances
while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
cur = cur.replace( " " + clazz + " ", " " );
}
}
elem.className = value ? jQuery.trim( cur ) : "";
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function( i ) {
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
});
}
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className,
i = 0,
self = jQuery( this ),
state = stateVal,
classNames = value.match( core_rnotwhite ) || [];
while ( (className = classNames[ i++ ]) ) {
// check each className given, space separated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
// Toggle whole class name
} else if ( type === core_strundefined || type === "boolean" ) {
if ( this.className ) {
// store className if set
jQuery._data( this, "__className__", this.className );
}
// If the element has a class name or if we're passed "false",
// then remove the whole classname (if there was one, the above saved it).
// Otherwise bring back whatever was previously saved (if anything),
// falling back to the empty string if nothing was stored.
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
}
});
},
hasClass: function( selector ) {
var className = " " + selector + " ",
i = 0,
l = this.length;
for ( ; i < l; i++ ) {
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
return true;
}
}
return false;
},
val: function( value ) {
var ret, hooks, isFunction,
elem = this[0];
if ( !arguments.length ) {
if ( elem ) {
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
}
ret = elem.value;
return typeof ret === "string" ?
// handle most common string cases
ret.replace(rreturn, "") :
// handle cases where value is null/undef or number
ret == null ? "" : ret;
}
return;
}
isFunction = jQuery.isFunction( value );
return this.each(function( i ) {
var val,
self = jQuery(this);
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, self.val() );
} else {
val = value;
}
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
} else if ( typeof val === "number" ) {
val += "";
} else if ( jQuery.isArray( val ) ) {
val = jQuery.map(val, function ( value ) {
return value == null ? "" : value + "";
});
}
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
// If set returns undefined, fall back to normal setting
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val;
}
});
}
});
jQuery.extend({
valHooks: {
option: {
get: function( elem ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
},
select: {
get: function( elem ) {
var value, option,
options = elem.options,
index = elem.selectedIndex,
one = elem.type === "select-one" || index < 0,
values = one ? null : [],
max = one ? index + 1 : options.length,
i = index < 0 ?
max :
one ? index : 0;
// Loop through all the selected options
for ( ; i < max; i++ ) {
option = options[ i ];
// oldIE doesn't update selected after form reset (#2551)
if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup
( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
// Get the specific value for the option
value = jQuery( option ).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
return values;
},
set: function( elem, value ) {
var values = jQuery.makeArray( value );
jQuery(elem).find("option").each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
elem.selectedIndex = -1;
}
return values;
}
}
},
attr: function( elem, name, value ) {
var hooks, notxml, ret,
nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
// Fallback to prop when attributes are not supported
if ( typeof elem.getAttribute === core_strundefined ) {
return jQuery.prop( elem, name, value );
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( notxml ) {
name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
elem.setAttribute( name, value + "" );
return value;
}
} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
// In IE9+, Flash objects don't have .getAttribute (#12945)
// Support: IE9+
if ( typeof elem.getAttribute !== core_strundefined ) {
ret = elem.getAttribute( name );
}
// Non-existent attributes return null, we normalize to undefined
return ret == null ?
undefined :
ret;
}
},
removeAttr: function( elem, value ) {
var name, propName,
i = 0,
attrNames = value && value.match( core_rnotwhite );
if ( attrNames && elem.nodeType === 1 ) {
while ( (name = attrNames[i++]) ) {
propName = jQuery.propFix[ name ] || name;
// Boolean attributes get special treatment (#10870)
if ( rboolean.test( name ) ) {
// Set corresponding property to false for boolean attributes
// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
if ( !getSetAttribute && ruseDefault.test( name ) ) {
elem[ jQuery.camelCase( "default-" + name ) ] =
elem[ propName ] = false;
} else {
elem[ propName ] = false;
}
// See #9699 for explanation of this approach (setting first, then removal)
} else {
jQuery.attr( elem, name, "" );
}
elem.removeAttribute( getSetAttribute ? name : propName );
}
}
},
attrHooks: {
type: {
set: function( elem, value ) {
if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to default in case type is set after value during creation
var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
elem.value = val;
}
return value;
}
}
}
},
propFix: {
tabindex: "tabIndex",
readonly: "readOnly",
"for": "htmlFor",
"class": "className",
maxlength: "maxLength",
cellspacing: "cellSpacing",
cellpadding: "cellPadding",
rowspan: "rowSpan",
colspan: "colSpan",
usemap: "useMap",
frameborder: "frameBorder",
contenteditable: "contentEditable"
},
prop: function( elem, name, value ) {
var ret, hooks, notxml,
nType = elem.nodeType;
// don't get/set properties on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
if ( notxml ) {
// Fix name and attach hooks
name = jQuery.propFix[ name ] || name;
hooks = jQuery.propHooks[ name ];
}
if ( value !== undefined ) {
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
return ( elem[ name ] = value );
}
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
return elem[ name ];
}
}
},
propHooks: {
tabIndex: {
get: function( elem ) {
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
var attributeNode = elem.getAttributeNode("tabindex");
return attributeNode && attributeNode.specified ?
parseInt( attributeNode.value, 10 ) :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
}
}
});
// Hook for boolean attributes
boolHook = {
get: function( elem, name ) {
var
// Use .prop to determine if this attribute is understood as boolean
prop = jQuery.prop( elem, name ),
// Fetch it accordingly
attr = typeof prop === "boolean" && elem.getAttribute( name ),
detail = typeof prop === "boolean" ?
getSetInput && getSetAttribute ?
attr != null :
// oldIE fabricates an empty string for missing boolean attributes
// and conflates checked/selected into attroperties
ruseDefault.test( name ) ?
elem[ jQuery.camelCase( "default-" + name ) ] :
!!attr :
// fetch an attribute node for properties not recognized as boolean
elem.getAttributeNode( name );
return detail && detail.value !== false ?
name.toLowerCase() :
undefined;
},
set: function( elem, value, name ) {
if ( value === false ) {
// Remove boolean attributes when set to false
jQuery.removeAttr( elem, name );
} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
// IE<8 needs the *property* name
elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
// Use defaultChecked and defaultSelected for oldIE
} else {
elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
}
return name;
}
};
// fix oldIE value attroperty
if ( !getSetInput || !getSetAttribute ) {
jQuery.attrHooks.value = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return jQuery.nodeName( elem, "input" ) ?
// Ignore the value *property* by using defaultValue
elem.defaultValue :
ret && ret.specified ? ret.value : undefined;
},
set: function( elem, value, name ) {
if ( jQuery.nodeName( elem, "input" ) ) {
// Does not return so that setAttribute is also used
elem.defaultValue = value;
} else {
// Use nodeHook if defined (#1954); otherwise setAttribute is fine
return nodeHook && nodeHook.set( elem, value, name );
}
}
};
}
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !getSetAttribute ) {
// Use this for any attribute in IE6/7
// This fixes almost every IE6/7 issue
nodeHook = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
ret.value :
undefined;
},
set: function( elem, value, name ) {
// Set the existing or create a new attribute node
var ret = elem.getAttributeNode( name );
if ( !ret ) {
elem.setAttributeNode(
(ret = elem.ownerDocument.createAttribute( name ))
);
}
ret.value = value += "";
// Break association with cloned elements by also using setAttribute (#9646)
return name === "value" || value === elem.getAttribute( name ) ?
value :
undefined;
}
};
// Set contenteditable to false on removals(#10429)
// Setting to empty string throws an error as an invalid value
jQuery.attrHooks.contenteditable = {
get: nodeHook.get,
set: function( elem, value, name ) {
nodeHook.set( elem, value === "" ? false : value, name );
}
};
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
// This is for removals
jQuery.each([ "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
});
});
}
// Some attributes require a special call on IE
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !jQuery.support.hrefNormalized ) {
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
get: function( elem ) {
var ret = elem.getAttribute( name, 2 );
return ret == null ? undefined : ret;
}
});
});
// href/src property should get the full normalized URL (#10299/#12915)
jQuery.each([ "href", "src" ], function( i, name ) {
jQuery.propHooks[ name ] = {
get: function( elem ) {
return elem.getAttribute( name, 4 );
}
};
});
}
if ( !jQuery.support.style ) {
jQuery.attrHooks.style = {
get: function( elem ) {
// Return undefined in the case of empty string
// Note: IE uppercases css property names, but if we were to .toLowerCase()
// .cssText, that would destroy case senstitivity in URL's, like in "background"
return elem.style.cssText || undefined;
},
set: function( elem, value ) {
return ( elem.style.cssText = value + "" );
}
};
}
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
get: function( elem ) {
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
// Make sure that it also works with optgroups, see #5701
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
return null;
}
});
}
// IE6/7 call enctype encoding
if ( !jQuery.support.enctype ) {
jQuery.propFix.enctype = "encoding";
}
// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
get: function( elem ) {
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
}
};
});
}
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
}
}
});
});
var rformElems = /^(?:input|select|textarea)$/i,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
function returnTrue() {
return true;
}
function returnFalse() {
return false;
}
/*
* Helper functions for managing events -- not part of the public interface.
* Props to Dean Edwards' addEvent library for many of the ideas.
*/
jQuery.event = {
global: {},
add: function( elem, types, handler, data, selector ) {
var tmp, events, t, handleObjIn,
special, eventHandle, handleObj,
handlers, type, namespaces, origType,
elemData = jQuery._data( elem );
// Don't attach events to noData or text/comment nodes (but allow plain objects)
if ( !elemData ) {
return;
}
// Caller can pass in an object of custom data in lieu of the handler
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
selector = handleObjIn.selector;
}
// Make sure that the handler has a unique ID, used to find/remove it later
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure and main handler, if this is the first
if ( !(events = elemData.events) ) {
events = elemData.events = {};
}
if ( !(eventHandle = elemData.handle) ) {
eventHandle = elemData.handle = function( e ) {
// Discard the second event of a jQuery.event.trigger() and
// when an event is called after a page has unloaded
return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
undefined;
};
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
eventHandle.elem = elem;
}
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
types = ( types || "" ).match( core_rnotwhite ) || [""];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
type = origType = tmp[1];
namespaces = ( tmp[2] || "" ).split( "." ).sort();
// If event changes its type, use the special event handlers for the changed type
special = jQuery.event.special[ type ] || {};
// If selector defined, determine special event api type, otherwise given type
type = ( selector ? special.delegateType : special.bindType ) || type;
// Update special based on newly reset type
special = jQuery.event.special[ type ] || {};
// handleObj is passed to all event handlers
handleObj = jQuery.extend({
type: type,
origType: origType,
data: data,
handler: handler,
guid: handler.guid,
selector: selector,
needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
namespace: namespaces.join(".")
}, handleObjIn );
// Init the event handler queue if we're the first
if ( !(handlers = events[ type ]) ) {
handlers = events[ type ] = [];
handlers.delegateCount = 0;
// Only use addEventListener/attachEvent if the special events handler returns false
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
// Bind the global event handler to the element
if ( elem.addEventListener ) {
elem.addEventListener( type, eventHandle, false );
} else if ( elem.attachEvent ) {
elem.attachEvent( "on" + type, eventHandle );
}
}
}
if ( special.add ) {
special.add.call( elem, handleObj );
if ( !handleObj.handler.guid ) {
handleObj.handler.guid = handler.guid;
}
}
// Add to the element's handler list, delegates in front
if ( selector ) {
handlers.splice( handlers.delegateCount++, 0, handleObj );
} else {
handlers.push( handleObj );
}
// Keep track of which events have ever been used, for event optimization
jQuery.event.global[ type ] = true;
}
// Nullify elem to prevent memory leaks in IE
elem = null;
},
// Detach an event or set of events from an element
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, handleObj, tmp,
origCount, t, events,
special, handlers, type,
namespaces, origType,
elemData = jQuery.hasData( elem ) && jQuery._data( elem );
if ( !elemData || !(events = elemData.events) ) {
return;
}
// Once for each type.namespace in types; type may be omitted
types = ( types || "" ).match( core_rnotwhite ) || [""];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
type = origType = tmp[1];
namespaces = ( tmp[2] || "" ).split( "." ).sort();
// Unbind all events (on this namespace, if provided) for the element
if ( !type ) {
for ( type in events ) {
jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
}
continue;
}
special = jQuery.event.special[ type ] || {};
type = ( selector ? special.delegateType : special.bindType ) || type;
handlers = events[ type ] || [];
tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
// Remove matching events
origCount = j = handlers.length;
while ( j-- ) {
handleObj = handlers[ j ];
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );
if ( handleObj.selector ) {
handlers.delegateCount--;
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
}
// Remove generic event handler if we removed something and no more handlers exist
// (avoids potential for endless recursion during removal of special event handlers)
if ( origCount && !handlers.length ) {
if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
delete elemData.handle;
// removeData also checks for emptiness and clears the expando if empty
// so use it instead of delete
jQuery._removeData( elem, "events" );
}
},
trigger: function( event, data, elem, onlyHandlers ) {
var handle, ontype, cur,
bubbleType, special, tmp, i,
eventPath = [ elem || document ],
type = core_hasOwn.call( event, "type" ) ? event.type : event,
namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
cur = tmp = elem = elem || document;
// Don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
// focus/blur morphs to focusin/out; ensure we're not firing them right now
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
return;
}
if ( type.indexOf(".") >= 0 ) {
// Namespaced trigger; create a regexp to match event type in handle()
namespaces = type.split(".");
type = namespaces.shift();
namespaces.sort();
}
ontype = type.indexOf(":") < 0 && "on" + type;
// Caller can pass in a jQuery.Event object, Object, or just an event type string
event = event[ jQuery.expando ] ?
event :
new jQuery.Event( type, typeof event === "object" && event );
event.isTrigger = true;
event.namespace = namespaces.join(".");
event.namespace_re = event.namespace ?
new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
null;
// Clean up the event in case it is being reused
event.result = undefined;
if ( !event.target ) {
event.target = elem;
}
// Clone any incoming data and prepend the event, creating the handler arg list
data = data == null ?
[ event ] :
jQuery.makeArray( data, [ event ] );
// Allow special events to draw outside the lines
special = jQuery.event.special[ type ] || {};
if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
return;
}
// Determine event propagation path in advance, per W3C events spec (#9951)
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
bubbleType = special.delegateType || type;
if ( !rfocusMorph.test( bubbleType + type ) ) {
cur = cur.parentNode;
}
for ( ; cur; cur = cur.parentNode ) {
eventPath.push( cur );
tmp = cur;
}
// Only add window if we got to document (e.g., not plain obj or detached DOM)
if ( tmp === (elem.ownerDocument || document) ) {
eventPath.push( tmp.defaultView || tmp.parentWindow || window );
}
}
// Fire handlers on the event path
i = 0;
while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
event.type = i > 1 ?
bubbleType :
special.bindType || type;
// jQuery handler
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
if ( handle ) {
handle.apply( cur, data );
}
// Native handler
handle = ontype && cur[ ontype ];
if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
event.preventDefault();
}
}
event.type = type;
// If nobody prevented the default action, do it now
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
// Call a native DOM method on the target with the same name name as the event.
// Can't use an .isFunction() check here because IE6/7 fails that test.
// Don't do default actions on window, that's where global variables be (#6170)
if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
// Don't re-trigger an onFOO event when we call its FOO() method
tmp = elem[ ontype ];
if ( tmp ) {
elem[ ontype ] = null;
}
// Prevent re-triggering of the same event, since we already bubbled it above
jQuery.event.triggered = type;
try {
elem[ type ]();
} catch ( e ) {
// IE<9 dies on focus/blur to hidden element (#1486,#12518)
// only reproducible on winXP IE8 native, not IE9 in IE8 mode
}
jQuery.event.triggered = undefined;
if ( tmp ) {
elem[ ontype ] = tmp;
}
}
}
}
return event.result;
},
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event );
var i, ret, handleObj, matched, j,
handlerQueue = [],
args = core_slice.call( arguments ),
handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
special = jQuery.event.special[ event.type ] || {};
// Use the fix-ed jQuery.Event rather than the (read-only) native event
args[0] = event;
event.delegateTarget = this;
// Call the preDispatch hook for the mapped type, and let it bail if desired
if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
return;
}
// Determine handlers
handlerQueue = jQuery.event.handlers.call( this, event, handlers );
// Run delegates first; they may want to stop propagation beneath us
i = 0;
while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
event.currentTarget = matched.elem;
j = 0;
while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
// Triggered event must either 1) have no namespace, or
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
event.handleObj = handleObj;
event.data = handleObj.data;
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
.apply( matched.elem, args );
if ( ret !== undefined ) {
if ( (event.result = ret) === false ) {
event.preventDefault();
event.stopPropagation();
}
}
}
}
}
// Call the postDispatch hook for the mapped type
if ( special.postDispatch ) {
special.postDispatch.call( this, event );
}
return event.result;
},
handlers: function( event, handlers ) {
var sel, handleObj, matches, i,
handlerQueue = [],
delegateCount = handlers.delegateCount,
cur = event.target;
// Find delegate handlers
// Black-hole SVG <use> instance trees (#13180)
// Avoid non-left-click bubbling in Firefox (#3861)
if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
for ( ; cur != this; cur = cur.parentNode || this ) {
// Don't check non-elements (#13208)
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
matches = [];
for ( i = 0; i < delegateCount; i++ ) {
handleObj = handlers[ i ];
// Don't conflict with Object.prototype properties (#13203)
sel = handleObj.selector + " ";
if ( matches[ sel ] === undefined ) {
matches[ sel ] = handleObj.needsContext ?
jQuery( sel, this ).index( cur ) >= 0 :
jQuery.find( sel, this, null, [ cur ] ).length;
}
if ( matches[ sel ] ) {
matches.push( handleObj );
}
}
if ( matches.length ) {
handlerQueue.push({ elem: cur, handlers: matches });
}
}
}
}
// Add the remaining (directly-bound) handlers
if ( delegateCount < handlers.length ) {
handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
}
return handlerQueue;
},
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
// Create a writable copy of the event object and normalize some properties
var i, prop, copy,
type = event.type,
originalEvent = event,
fixHook = this.fixHooks[ type ];
if ( !fixHook ) {
this.fixHooks[ type ] = fixHook =
rmouseEvent.test( type ) ? this.mouseHooks :
rkeyEvent.test( type ) ? this.keyHooks :
{};
}
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
event = new jQuery.Event( originalEvent );
i = copy.length;
while ( i-- ) {
prop = copy[ i ];
event[ prop ] = originalEvent[ prop ];
}
// Support: IE<9
// Fix target property (#1925)
if ( !event.target ) {
event.target = originalEvent.srcElement || document;
}
// Support: Chrome 23+, Safari?
// Target should not be a text node (#504, #13143)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
// Support: IE<9
// For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
event.metaKey = !!event.metaKey;
return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
},
// Includes some event props shared by KeyEvent and MouseEvent
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
keyHooks: {
props: "char charCode key keyCode".split(" "),
filter: function( event, original ) {
// Add which for key events
if ( event.which == null ) {
event.which = original.charCode != null ? original.charCode : original.keyCode;
}
return event;
}
},
mouseHooks: {
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function( event, original ) {
var body, eventDoc, doc,
button = original.button,
fromElement = original.fromElement;
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && original.clientX != null ) {
eventDoc = event.target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
}
// Add relatedTarget, if necessary
if ( !event.relatedTarget && fromElement ) {
event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
}
// Add which for click: 1 === left; 2 === middle; 3 === right
// Note: button is not normalized, so don't use it
if ( !event.which && button !== undefined ) {
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
}
return event;
}
},
special: {
load: {
// Prevent triggered image.load events from bubbling to window.load
noBubble: true
},
click: {
// For checkbox, fire native event so checked state will be right
trigger: function() {
if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
this.click();
return false;
}
}
},
focus: {
// Fire native event if possible so blur/focus sequence is correct
trigger: function() {
if ( this !== document.activeElement && this.focus ) {
try {
this.focus();
return false;
} catch ( e ) {
// Support: IE<9
// If we error on focus to hidden element (#1486, #12518),
// let .trigger() run the handlers
}
}
},
delegateType: "focusin"
},
blur: {
trigger: function() {
if ( this === document.activeElement && this.blur ) {
this.blur();
return false;
}
},
delegateType: "focusout"
},
beforeunload: {
postDispatch: function( event ) {
// Even when returnValue equals to undefined Firefox will still show alert
if ( event.result !== undefined ) {
event.originalEvent.returnValue = event.result;
}
}
}
},
simulate: function( type, elem, event, bubble ) {
// Piggyback on a donor event to simulate a different one.
// Fake originalEvent to avoid donor's stopPropagation, but if the
// simulated event prevents default then we do the same on the donor.
var e = jQuery.extend(
new jQuery.Event(),
event,
{ type: type,
isSimulated: true,
originalEvent: {}
}
);
if ( bubble ) {
jQuery.event.trigger( e, null, elem );
} else {
jQuery.event.dispatch.call( elem, e );
}
if ( e.isDefaultPrevented() ) {
event.preventDefault();
}
}
};
jQuery.removeEvent = document.removeEventListener ?
function( elem, type, handle ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false );
}
} :
function( elem, type, handle ) {
var name = "on" + type;
if ( elem.detachEvent ) {
// #8545, #7054, preventing memory leaks for custom events in IE6-8
// detachEvent needed property on element, by name of that event, to properly expose it to GC
if ( typeof elem[ name ] === core_strundefined ) {
elem[ name ] = null;
}
elem.detachEvent( name, handle );
}
};
jQuery.Event = function( src, props ) {
// Allow instantiation without the 'new' keyword
if ( !(this instanceof jQuery.Event) ) {
return new jQuery.Event( src, props );
}
// Event object
if ( src && src.type ) {
this.originalEvent = src;
this.type = src.type;
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
// Event type
} else {
this.type = src;
}
// Put explicitly provided properties onto the event object
if ( props ) {
jQuery.extend( this, props );
}
// Create a timestamp if incoming event doesn't have one
this.timeStamp = src && src.timeStamp || jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
};
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse,
preventDefault: function() {
var e = this.originalEvent;
this.isDefaultPrevented = returnTrue;
if ( !e ) {
return;
}
// If preventDefault exists, run it on the original event
if ( e.preventDefault ) {
e.preventDefault();
// Support: IE
// Otherwise set the returnValue property of the original event to false
} else {
e.returnValue = false;
}
},
stopPropagation: function() {
var e = this.originalEvent;
this.isPropagationStopped = returnTrue;
if ( !e ) {
return;
}
// If stopPropagation exists, run it on the original event
if ( e.stopPropagation ) {
e.stopPropagation();
}
// Support: IE
// Set the cancelBubble property of the original event to true
e.cancelBubble = true;
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
}
};
// Create mouseenter/leave events using mouseover/out and event-time checks
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
delegateType: fix,
bindType: fix,
handle: function( event ) {
var ret,
target = this,
related = event.relatedTarget,
handleObj = event.handleObj;
// For mousenter/leave call the handler if related is outside the target.
// NB: No relatedTarget if the mouse left/entered the browser window
if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
event.type = handleObj.origType;
ret = handleObj.handler.apply( this, arguments );
event.type = fix;
}
return ret;
}
};
});
// IE submit delegation
if ( !jQuery.support.submitBubbles ) {
jQuery.event.special.submit = {
setup: function() {
// Only need this for delegated form submit events
if ( jQuery.nodeName( this, "form" ) ) {
return false;
}
// Lazy-add a submit handler when a descendant form may potentially be submitted
jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
// Node name check avoids a VML-related crash in IE (#9807)
var elem = e.target,
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
if ( form && !jQuery._data( form, "submitBubbles" ) ) {
jQuery.event.add( form, "submit._submit", function( event ) {
event._submit_bubble = true;
});
jQuery._data( form, "submitBubbles", true );
}
});
// return undefined since we don't need an event listener
},
postDispatch: function( event ) {
// If form was submitted by the user, bubble the event up the tree
if ( event._submit_bubble ) {
delete event._submit_bubble;
if ( this.parentNode && !event.isTrigger ) {
jQuery.event.simulate( "submit", this.parentNode, event, true );
}
}
},
teardown: function() {
// Only need this for delegated form submit events
if ( jQuery.nodeName( this, "form" ) ) {
return false;
}
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
jQuery.event.remove( this, "._submit" );
}
};
}
// IE change delegation and checkbox/radio fix
if ( !jQuery.support.changeBubbles ) {
jQuery.event.special.change = {
setup: function() {
if ( rformElems.test( this.nodeName ) ) {
// IE doesn't fire change on a check/radio until blur; trigger it on click
// after a propertychange. Eat the blur-change in special.change.handle.
// This still fires onchange a second time for check/radio after blur.
if ( this.type === "checkbox" || this.type === "radio" ) {
jQuery.event.add( this, "propertychange._change", function( event ) {
if ( event.originalEvent.propertyName === "checked" ) {
this._just_changed = true;
}
});
jQuery.event.add( this, "click._change", function( event ) {
if ( this._just_changed && !event.isTrigger ) {
this._just_changed = false;
}
// Allow triggered, simulated change events (#11500)
jQuery.event.simulate( "change", this, event, true );
});
}
return false;
}
// Delegated event; lazy-add a change handler on descendant inputs
jQuery.event.add( this, "beforeactivate._change", function( e ) {
var elem = e.target;
if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
jQuery.event.add( elem, "change._change", function( event ) {
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
jQuery.event.simulate( "change", this.parentNode, event, true );
}
});
jQuery._data( elem, "changeBubbles", true );
}
});
},
handle: function( event ) {
var elem = event.target;
// Swallow native change events from checkbox/radio, we already triggered them above
if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
return event.handleObj.handler.apply( this, arguments );
}
},
teardown: function() {
jQuery.event.remove( this, "._change" );
return !rformElems.test( this.nodeName );
}
};
}
// Create "bubbling" focus and blur events
if ( !jQuery.support.focusinBubbles ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler while someone wants focusin/focusout
var attaches = 0,
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
};
jQuery.event.special[ fix ] = {
setup: function() {
if ( attaches++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --attaches === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
});
}
jQuery.fn.extend({
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
var type, origFn;
// Types can be a map of types/handlers
if ( typeof types === "object" ) {
// ( types-Object, selector, data )
if ( typeof selector !== "string" ) {
// ( types-Object, data )
data = data || selector;
selector = undefined;
}
for ( type in types ) {
this.on( type, selector, data, types[ type ], one );
}
return this;
}
if ( data == null && fn == null ) {
// ( types, fn )
fn = selector;
data = selector = undefined;
} else if ( fn == null ) {
if ( typeof selector === "string" ) {
// ( types, selector, fn )
fn = data;
data = undefined;
} else {
// ( types, data, fn )
fn = data;
data = selector;
selector = undefined;
}
}
if ( fn === false ) {
fn = returnFalse;
} else if ( !fn ) {
return this;
}
if ( one === 1 ) {
origFn = fn;
fn = function( event ) {
// Can use an empty set, since event contains the info
jQuery().off( event );
return origFn.apply( this, arguments );
};
// Use same guid so caller can remove using origFn
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
}
return this.each( function() {
jQuery.event.add( this, types, fn, data, selector );
});
},
one: function( types, selector, data, fn ) {
return this.on( types, selector, data, fn, 1 );
},
off: function( types, selector, fn ) {
var handleObj, type;
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
handleObj = types.handleObj;
jQuery( types.delegateTarget ).off(
handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
handleObj.selector,
handleObj.handler
);
return this;
}
if ( typeof types === "object" ) {
// ( types-object [, selector] )
for ( type in types ) {
this.off( type, selector, types[ type ] );
}
return this;
}
if ( selector === false || typeof selector === "function" ) {
// ( types [, fn] )
fn = selector;
selector = undefined;
}
if ( fn === false ) {
fn = returnFalse;
}
return this.each(function() {
jQuery.event.remove( this, types, fn, selector );
});
},
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
},
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
},
triggerHandler: function( type, data ) {
var elem = this[0];
if ( elem ) {
return jQuery.event.trigger( type, data, elem, true );
}
}
});
/*!
* Sizzle CSS Selector Engine
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://sizzlejs.com/
*/
(function( window, undefined ) {
var i,
cachedruns,
Expr,
getText,
isXML,
compile,
hasDuplicate,
outermostContext,
// Local document vars
setDocument,
document,
docElem,
documentIsXML,
rbuggyQSA,
rbuggyMatches,
matches,
contains,
sortOrder,
// Instance-specific data
expando = "sizzle" + -(new Date()),
preferredDoc = window.document,
support = {},
dirruns = 0,
done = 0,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
// General-purpose constants
strundefined = typeof undefined,
MAX_NEGATIVE = 1 << 31,
// Array methods
arr = [],
pop = arr.pop,
push = arr.push,
slice = arr.slice,
// Use a stripped-down indexOf if we can't use a native one
indexOf = arr.indexOf || function( elem ) {
var i = 0,
len = this.length;
for ( ; i < len; i++ ) {
if ( this[i] === elem ) {
return i;
}
}
return -1;
},
// Regular expressions
// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
whitespace = "[\\x20\\t\\r\\n\\f]",
// http://www.w3.org/TR/css3-syntax/#characters
characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
// Loosely modeled on CSS identifier characters
// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
identifier = characterEncoding.replace( "w", "w#" ),
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
operators = "([*^$|!~]?=)",
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
// Prefer arguments quoted,
// then not containing pseudos/brackets,
// then attribute selectors/non-parenthetical expressions,
// then anything else
// These preferences are here to reduce the number of selectors
// needing tokenize in the PSEUDO preFilter
pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = {
"ID": new RegExp( "^#(" + characterEncoding + ")" ),
"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
"NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
"ATTR": new RegExp( "^" + attributes ),
"PSEUDO": new RegExp( "^" + pseudos ),
"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
// For use in libraries implementing .is()
// We use this for POS matching in `select`
"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
},
rsibling = /[\x20\t\r\n\f]*[+~]/,
rnative = /^[^{]+\{\s*\[native code/,
// Easily-parseable/retrievable ID or TAG or CLASS selectors
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,
rescape = /'|\\/g,
rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
funescape = function( _, escaped ) {
var high = "0x" + escaped - 0x10000;
// NaN means non-codepoint
return high !== high ?
escaped :
// BMP codepoint
high < 0 ?
String.fromCharCode( high + 0x10000 ) :
// Supplemental Plane codepoint (surrogate pair)
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
};
// Use a stripped-down slice if we can't use a native one
try {
slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
} catch ( e ) {
slice = function( i ) {
var elem,
results = [];
while ( (elem = this[i++]) ) {
results.push( elem );
}
return results;
};
}
/**
* For feature detection
* @param {Function} fn The function to test for native support
*/
function isNative( fn ) {
return rnative.test( fn + "" );
}
/**
* Create key-value caches of limited size
* @returns {Function(string, Object)} Returns the Object data after storing it on itself with
* property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
* deleting the oldest entry
*/
function createCache() {
var cache,
keys = [];
return (cache = function( key, value ) {
// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
if ( keys.push( key += " " ) > Expr.cacheLength ) {
// Only keep the most recent entries
delete cache[ keys.shift() ];
}
return (cache[ key ] = value);
});
}
/**
* Mark a function for special use by Sizzle
* @param {Function} fn The function to mark
*/
function markFunction( fn ) {
fn[ expando ] = true;
return fn;
}
/**
* Support testing using an element
* @param {Function} fn Passed the created div and expects a boolean result
*/
function assert( fn ) {
var div = document.createElement("div");
try {
return fn( div );
} catch (e) {
return false;
} finally {
// release memory in IE
div = null;
}
}
function Sizzle( selector, context, results, seed ) {
var match, elem, m, nodeType,
// QSA vars
i, groups, old, nid, newContext, newSelector;
if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
setDocument( context );
}
context = context || document;
results = results || [];
if ( !selector || typeof selector !== "string" ) {
return results;
}
if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
return [];
}
if ( !documentIsXML && !seed ) {
// Shortcuts
if ( (match = rquickExpr.exec( selector )) ) {
// Speed-up: Sizzle("#ID")
if ( (m = match[1]) ) {
if ( nodeType === 9 ) {
elem = context.getElementById( m );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE, Opera, and Webkit return items
// by name instead of ID
if ( elem.id === m ) {
results.push( elem );
return results;
}
} else {
return results;
}
} else {
// Context is not a document
if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
contains( context, elem ) && elem.id === m ) {
results.push( elem );
return results;
}
}
// Speed-up: Sizzle("TAG")
} else if ( match[2] ) {
push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
return results;
// Speed-up: Sizzle(".CLASS")
} else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
return results;
}
}
// QSA path
if ( support.qsa && !rbuggyQSA.test(selector) ) {
old = true;
nid = expando;
newContext = context;
newSelector = nodeType === 9 && selector;
// qSA works strangely on Element-rooted queries
// We can work around this by specifying an extra ID on the root
// and working up from there (Thanks to Andrew Dupont for the technique)
// IE 8 doesn't work on object elements
if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
groups = tokenize( selector );
if ( (old = context.getAttribute("id")) ) {
nid = old.replace( rescape, "\\$&" );
} else {
context.setAttribute( "id", nid );
}
nid = "[id='" + nid + "'] ";
i = groups.length;
while ( i-- ) {
groups[i] = nid + toSelector( groups[i] );
}
newContext = rsibling.test( selector ) && context.parentNode || context;
newSelector = groups.join(",");
}
if ( newSelector ) {
try {
push.apply( results, slice.call( newContext.querySelectorAll(
newSelector
), 0 ) );
return results;
} catch(qsaError) {
} finally {
if ( !old ) {
context.removeAttribute("id");
}
}
}
}
}
// All others
return select( selector.replace( rtrim, "$1" ), context, results, seed );
}
/**
* Detect xml
* @param {Element|Object} elem An element or a document
*/
isXML = Sizzle.isXML = function( elem ) {
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
var documentElement = elem && (elem.ownerDocument || elem).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false;
};
/**
* Sets document-related variables once based on the current document
* @param {Element|Object} [doc] An element or document object to use to set the document
* @returns {Object} Returns the current document
*/
setDocument = Sizzle.setDocument = function( node ) {
var doc = node ? node.ownerDocument || node : preferredDoc;
// If no document and documentElement is available, return
if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
return document;
}
// Set our document
document = doc;
docElem = doc.documentElement;
// Support tests
documentIsXML = isXML( doc );
// Check if getElementsByTagName("*") returns only elements
support.tagNameNoComments = assert(function( div ) {
div.appendChild( doc.createComment("") );
return !div.getElementsByTagName("*").length;
});
// Check if attributes should be retrieved by attribute nodes
support.attributes = assert(function( div ) {
div.innerHTML = "<select></select>";
var type = typeof div.lastChild.getAttribute("multiple");
// IE8 returns a string for some attributes even when not present
return type !== "boolean" && type !== "string";
});
// Check if getElementsByClassName can be trusted
support.getByClassName = assert(function( div ) {
// Opera can't find a second classname (in 9.6)
div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
return false;
}
// Safari 3.2 caches class attributes and doesn't catch changes
div.lastChild.className = "e";
return div.getElementsByClassName("e").length === 2;
});
// Check if getElementById returns elements by name
// Check if getElementsByName privileges form controls or returns elements by ID
support.getByName = assert(function( div ) {
// Inject content
div.id = expando + 0;
div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
docElem.insertBefore( div, docElem.firstChild );
// Test
var pass = doc.getElementsByName &&
// buggy browsers will return fewer than the correct 2
doc.getElementsByName( expando ).length === 2 +
// buggy browsers will return more than the correct 0
doc.getElementsByName( expando + 0 ).length;
support.getIdNotName = !doc.getElementById( expando );
// Cleanup
docElem.removeChild( div );
return pass;
});
// IE6/7 return modified attributes
Expr.attrHandle = assert(function( div ) {
div.innerHTML = "<a href='#'></a>";
return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
div.firstChild.getAttribute("href") === "#";
}) ?
{} :
{
"href": function( elem ) {
return elem.getAttribute( "href", 2 );
},
"type": function( elem ) {
return elem.getAttribute("type");
}
};
// ID find and filter
if ( support.getIdNotName ) {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
var m = context.getElementById( id );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
return m && m.parentNode ? [m] : [];
}
};
Expr.filter["ID"] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
return elem.getAttribute("id") === attrId;
};
};
} else {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
var m = context.getElementById( id );
return m ?
m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
[m] :
undefined :
[];
}
};
Expr.filter["ID"] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
return node && node.value === attrId;
};
};
}
// Tag
Expr.find["TAG"] = support.tagNameNoComments ?
function( tag, context ) {
if ( typeof context.getElementsByTagName !== strundefined ) {
return context.getElementsByTagName( tag );
}
} :
function( tag, context ) {
var elem,
tmp = [],
i = 0,
results = context.getElementsByTagName( tag );
// Filter out possible comments
if ( tag === "*" ) {
while ( (elem = results[i++]) ) {
if ( elem.nodeType === 1 ) {
tmp.push( elem );
}
}
return tmp;
}
return results;
};
// Name
Expr.find["NAME"] = support.getByName && function( tag, context ) {
if ( typeof context.getElementsByName !== strundefined ) {
return context.getElementsByName( name );
}
};
// Class
Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
return context.getElementsByClassName( className );
}
};
// QSA and matchesSelector support
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
rbuggyMatches = [];
// qSa(:focus) reports false when true (Chrome 21),
// no need to also add to buggyMatches since matches checks buggyQSA
// A support test would require too much code (would include document ready)
rbuggyQSA = [ ":focus" ];
if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
// Build QSA regex
// Regex strategy adopted from Diego Perini
assert(function( div ) {
// Select is set to empty string on purpose
// This is to test IE's treatment of not explictly
// setting a boolean content attribute,
// since its presence should be enough
// http://bugs.jquery.com/ticket/12359
div.innerHTML = "<select><option selected=''></option></select>";
// IE8 - Some boolean attributes are not treated correctly
if ( !div.querySelectorAll("[selected]").length ) {
rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
}
// Webkit/Opera - :checked should return selected option elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
// IE8 throws error here and will not see later tests
if ( !div.querySelectorAll(":checked").length ) {
rbuggyQSA.push(":checked");
}
});
assert(function( div ) {
// Opera 10-12/IE8 - ^= $= *= and empty values
// Should not select anything
div.innerHTML = "<input type='hidden' i=''/>";
if ( div.querySelectorAll("[i^='']").length ) {
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
}
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
// IE8 throws error here and will not see later tests
if ( !div.querySelectorAll(":enabled").length ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}
// Opera 10-11 does not throw on post-comma invalid pseudos
div.querySelectorAll("*,:x");
rbuggyQSA.push(",.*:");
});
}
if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
docElem.mozMatchesSelector ||
docElem.webkitMatchesSelector ||
docElem.oMatchesSelector ||
docElem.msMatchesSelector) )) ) {
assert(function( div ) {
// Check to see if it's possible to do matchesSelector
// on a disconnected node (IE 9)
support.disconnectedMatch = matches.call( div, "div" );
// This should fail with an exception
// Gecko does not error, returns false instead
matches.call( div, "[s!='']:x" );
rbuggyMatches.push( "!=", pseudos );
});
}
rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
// Element contains another
// Purposefully does not implement inclusive descendent
// As in, an element does not contain itself
contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && (
adown.contains ?
adown.contains( bup ) :
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
));
} :
function( a, b ) {
if ( b ) {
while ( (b = b.parentNode) ) {
if ( b === a ) {
return true;
}
}
}
return false;
};
// Document order sorting
sortOrder = docElem.compareDocumentPosition ?
function( a, b ) {
var compare;
if ( a === b ) {
hasDuplicate = true;
return 0;
}
if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
if ( a === doc || contains( preferredDoc, a ) ) {
return -1;
}
if ( b === doc || contains( preferredDoc, b ) ) {
return 1;
}
return 0;
}
return compare & 4 ? -1 : 1;
}
return a.compareDocumentPosition ? -1 : 1;
} :
function( a, b ) {
var cur,
i = 0,
aup = a.parentNode,
bup = b.parentNode,
ap = [ a ],
bp = [ b ];
// Exit early if the nodes are identical
if ( a === b ) {
hasDuplicate = true;
return 0;
// Parentless nodes are either documents or disconnected
} else if ( !aup || !bup ) {
return a === doc ? -1 :
b === doc ? 1 :
aup ? -1 :
bup ? 1 :
0;
// If the nodes are siblings, we can do a quick check
} else if ( aup === bup ) {
return siblingCheck( a, b );
}
// Otherwise we need full lists of their ancestors for comparison
cur = a;
while ( (cur = cur.parentNode) ) {
ap.unshift( cur );
}
cur = b;
while ( (cur = cur.parentNode) ) {
bp.unshift( cur );
}
// Walk down the tree looking for a discrepancy
while ( ap[i] === bp[i] ) {
i++;
}
return i ?
// Do a sibling check if the nodes have a common ancestor
siblingCheck( ap[i], bp[i] ) :
// Otherwise nodes in our document sort first
ap[i] === preferredDoc ? -1 :
bp[i] === preferredDoc ? 1 :
0;
};
// Always assume the presence of duplicates if sort doesn't
// pass them to our comparison function (as in Google Chrome).
hasDuplicate = false;
[0, 0].sort( sortOrder );
support.detectDuplicates = hasDuplicate;
return document;
};
Sizzle.matches = function( expr, elements ) {
return Sizzle( expr, null, null, elements );
};
Sizzle.matchesSelector = function( elem, expr ) {
// Set document vars if needed
if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
// Make sure that attribute selectors are quoted
expr = expr.replace( rattributeQuotes, "='$1']" );
// rbuggyQSA always contains :focus, so no need for an existence check
if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
try {
var ret = matches.call( elem, expr );
// IE 9's matchesSelector returns false on disconnected nodes
if ( ret || support.disconnectedMatch ||
// As well, disconnected nodes are said to be in a document
// fragment in IE 9
elem.document && elem.document.nodeType !== 11 ) {
return ret;
}
} catch(e) {}
}
return Sizzle( expr, document, null, [elem] ).length > 0;
};
Sizzle.contains = function( context, elem ) {
// Set document vars if needed
if ( ( context.ownerDocument || context ) !== document ) {
setDocument( context );
}
return contains( context, elem );
};
Sizzle.attr = function( elem, name ) {
var val;
// Set document vars if needed
if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
if ( !documentIsXML ) {
name = name.toLowerCase();
}
if ( (val = Expr.attrHandle[ name ]) ) {
return val( elem );
}
if ( documentIsXML || support.attributes ) {
return elem.getAttribute( name );
}
return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
name :
val && val.specified ? val.value : null;
};
Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
// Document sorting and removing duplicates
Sizzle.uniqueSort = function( results ) {
var elem,
duplicates = [],
i = 1,
j = 0;
// Unless we *know* we can detect duplicates, assume their presence
hasDuplicate = !support.detectDuplicates;
results.sort( sortOrder );
if ( hasDuplicate ) {
for ( ; (elem = results[i]); i++ ) {
if ( elem === results[ i - 1 ] ) {
j = duplicates.push( i );
}
}
while ( j-- ) {
results.splice( duplicates[ j ], 1 );
}
}
return results;
};
function siblingCheck( a, b ) {
var cur = b && a,
diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
// Use IE sourceIndex if available on both nodes
if ( diff ) {
return diff;
}
// Check if b follows a
if ( cur ) {
while ( (cur = cur.nextSibling) ) {
if ( cur === b ) {
return -1;
}
}
}
return a ? 1 : -1;
}
// Returns a function to use in pseudos for input types
function createInputPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === type;
};
}
// Returns a function to use in pseudos for buttons
function createButtonPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return (name === "input" || name === "button") && elem.type === type;
};
}
// Returns a function to use in pseudos for positionals
function createPositionalPseudo( fn ) {
return markFunction(function( argument ) {
argument = +argument;
return markFunction(function( seed, matches ) {
var j,
matchIndexes = fn( [], seed.length, argument ),
i = matchIndexes.length;
// Match elements found at the specified indexes
while ( i-- ) {
if ( seed[ (j = matchIndexes[i]) ] ) {
seed[j] = !(matches[j] = seed[j]);
}
}
});
});
}
/**
* Utility function for retrieving the text value of an array of DOM nodes
* @param {Array|Element} elem
*/
getText = Sizzle.getText = function( elem ) {
var node,
ret = "",
i = 0,
nodeType = elem.nodeType;
if ( !nodeType ) {
// If no nodeType, this is expected to be an array
for ( ; (node = elem[i]); i++ ) {
// Do not traverse comment nodes
ret += getText( node );
}
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
// Use textContent for elements
// innerText usage removed for consistency of new lines (see #11153)
if ( typeof elem.textContent === "string" ) {
return elem.textContent;
} else {
// Traverse its children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
ret += getText( elem );
}
}
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}
// Do not include comment or processing instruction nodes
return ret;
};
Expr = Sizzle.selectors = {
// Can be adjusted by the user
cacheLength: 50,
createPseudo: markFunction,
match: matchExpr,
find: {},
relative: {
">": { dir: "parentNode", first: true },
" ": { dir: "parentNode" },
"+": { dir: "previousSibling", first: true },
"~": { dir: "previousSibling" }
},
preFilter: {
"ATTR": function( match ) {
match[1] = match[1].replace( runescape, funescape );
// Move the given value to match[3] whether quoted or unquoted
match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
if ( match[2] === "~=" ) {
match[3] = " " + match[3] + " ";
}
return match.slice( 0, 4 );
},
"CHILD": function( match ) {
/* matches from matchExpr["CHILD"]
1 type (only|nth|...)
2 what (child|of-type)
3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
4 xn-component of xn+y argument ([+-]?\d*n|)
5 sign of xn-component
6 x of xn-component
7 sign of y-component
8 y of y-component
*/
match[1] = match[1].toLowerCase();
if ( match[1].slice( 0, 3 ) === "nth" ) {
// nth-* requires argument
if ( !match[3] ) {
Sizzle.error( match[0] );
}
// numeric x and y parameters for Expr.filter.CHILD
// remember that false/true cast respectively to 0/1
match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
// other types prohibit arguments
} else if ( match[3] ) {
Sizzle.error( match[0] );
}
return match;
},
"PSEUDO": function( match ) {
var excess,
unquoted = !match[5] && match[2];
if ( matchExpr["CHILD"].test( match[0] ) ) {
return null;
}
// Accept quoted arguments as-is
if ( match[4] ) {
match[2] = match[4];
// Strip excess characters from unquoted arguments
} else if ( unquoted && rpseudo.test( unquoted ) &&
// Get excess from tokenize (recursively)
(excess = tokenize( unquoted, true )) &&
// advance to the next closing parenthesis
(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
// excess is a negative index
match[0] = match[0].slice( 0, excess );
match[2] = unquoted.slice( 0, excess );
}
// Return only captures needed by the pseudo filter method (type and argument)
return match.slice( 0, 3 );
}
},
filter: {
"TAG": function( nodeName ) {
if ( nodeName === "*" ) {
return function() { return true; };
}
nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
};
},
"CLASS": function( className ) {
var pattern = classCache[ className + " " ];
return pattern ||
(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
classCache( className, function( elem ) {
return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
});
},
"ATTR": function( name, operator, check ) {
return function( elem ) {
var result = Sizzle.attr( elem, name );
if ( result == null ) {
return operator === "!=";
}
if ( !operator ) {
return true;
}
result += "";
return operator === "=" ? result === check :
operator === "!=" ? result !== check :
operator === "^=" ? check && result.indexOf( check ) === 0 :
operator === "*=" ? check && result.indexOf( check ) > -1 :
operator === "$=" ? check && result.slice( -check.length ) === check :
operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
false;
};
},
"CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
return first === 1 && last === 0 ?
// Shortcut for :nth-*(n)
function( elem ) {
return !!elem.parentNode;
} :
function( elem, context, xml ) {
var cache, outerCache, node, diff, nodeIndex, start,
dir = simple !== forward ? "nextSibling" : "previousSibling",
parent = elem.parentNode,
name = ofType && elem.nodeName.toLowerCase(),
useCache = !xml && !ofType;
if ( parent ) {
// :(first|last|only)-(child|of-type)
if ( simple ) {
while ( dir ) {
node = elem;
while ( (node = node[ dir ]) ) {
if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
return false;
}
}
// Reverse direction for :only-* (if we haven't yet done so)
start = dir = type === "only" && !start && "nextSibling";
}
return true;
}
start = [ forward ? parent.firstChild : parent.lastChild ];
// non-xml :nth-child(...) stores cache data on `parent`
if ( forward && useCache ) {
// Seek `elem` from a previously-cached index
outerCache = parent[ expando ] || (parent[ expando ] = {});
cache = outerCache[ type ] || [];
nodeIndex = cache[0] === dirruns && cache[1];
diff = cache[0] === dirruns && cache[2];
node = nodeIndex && parent.childNodes[ nodeIndex ];
while ( (node = ++nodeIndex && node && node[ dir ] ||
// Fallback to seeking `elem` from the start
(diff = nodeIndex = 0) || start.pop()) ) {
// When found, cache indexes on `parent` and break
if ( node.nodeType === 1 && ++diff && node === elem ) {
outerCache[ type ] = [ dirruns, nodeIndex, diff ];
break;
}
}
// Use previously-cached element index if available
} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
diff = cache[1];
// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
} else {
// Use the same loop as above to seek `elem` from the start
while ( (node = ++nodeIndex && node && node[ dir ] ||
(diff = nodeIndex = 0) || start.pop()) ) {
if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
// Cache the index of each encountered element
if ( useCache ) {
(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
}
if ( node === elem ) {
break;
}
}
}
}
// Incorporate the offset, then check against cycle size
diff -= last;
return diff === first || ( diff % first === 0 && diff / first >= 0 );
}
};
},
"PSEUDO": function( pseudo, argument ) {
// pseudo-class names are case-insensitive
// http://www.w3.org/TR/selectors/#pseudo-classes
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
// Remember that setFilters inherits from pseudos
var args,
fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
Sizzle.error( "unsupported pseudo: " + pseudo );
// The user may use createPseudo to indicate that
// arguments are needed to create the filter function
// just as Sizzle does
if ( fn[ expando ] ) {
return fn( argument );
}
// But maintain support for old signatures
if ( fn.length > 1 ) {
args = [ pseudo, pseudo, "", argument ];
return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
markFunction(function( seed, matches ) {
var idx,
matched = fn( seed, argument ),
i = matched.length;
while ( i-- ) {
idx = indexOf.call( seed, matched[i] );
seed[ idx ] = !( matches[ idx ] = matched[i] );
}
}) :
function( elem ) {
return fn( elem, 0, args );
};
}
return fn;
}
},
pseudos: {
// Potentially complex pseudos
"not": markFunction(function( selector ) {
// Trim the selector passed to compile
// to avoid treating leading and trailing
// spaces as combinators
var input = [],
results = [],
matcher = compile( selector.replace( rtrim, "$1" ) );
return matcher[ expando ] ?
markFunction(function( seed, matches, context, xml ) {
var elem,
unmatched = matcher( seed, null, xml, [] ),
i = seed.length;
// Match elements unmatched by `matcher`
while ( i-- ) {
if ( (elem = unmatched[i]) ) {
seed[i] = !(matches[i] = elem);
}
}
}) :
function( elem, context, xml ) {
input[0] = elem;
matcher( input, null, xml, results );
return !results.pop();
};
}),
"has": markFunction(function( selector ) {
return function( elem ) {
return Sizzle( selector, elem ).length > 0;
};
}),
"contains": markFunction(function( text ) {
return function( elem ) {
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
};
}),
// "Whether an element is represented by a :lang() selector
// is based solely on the element's language value
// being equal to the identifier C,
// or beginning with the identifier C immediately followed by "-".
// The matching of C against the element's language value is performed case-insensitively.
// The identifier C does not have to be a valid language name."
// http://www.w3.org/TR/selectors/#lang-pseudo
"lang": markFunction( function( lang ) {
// lang value must be a valid identifider
if ( !ridentifier.test(lang || "") ) {
Sizzle.error( "unsupported lang: " + lang );
}
lang = lang.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
var elemLang;
do {
if ( (elemLang = documentIsXML ?
elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
elem.lang) ) {
elemLang = elemLang.toLowerCase();
return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
}
} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
return false;
};
}),
// Miscellaneous
"target": function( elem ) {
var hash = window.location && window.location.hash;
return hash && hash.slice( 1 ) === elem.id;
},
"root": function( elem ) {
return elem === docElem;
},
"focus": function( elem ) {
return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
},
// Boolean properties
"enabled": function( elem ) {
return elem.disabled === false;
},
"disabled": function( elem ) {
return elem.disabled === true;
},
"checked": function( elem ) {
// In CSS3, :checked should return both checked and selected elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
var nodeName = elem.nodeName.toLowerCase();
return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
},
"selected": function( elem ) {
// Accessing this property makes selected-by-default
// options in Safari work properly
if ( elem.parentNode ) {
elem.parentNode.selectedIndex;
}
return elem.selected === true;
},
// Contents
"empty": function( elem ) {
// http://www.w3.org/TR/selectors/#empty-pseudo
// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
// not comment, processing instructions, or others
// Thanks to Diego Perini for the nodeName shortcut
// Greater than "@" means alpha characters (specifically not starting with "#" or "?")
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
return false;
}
}
return true;
},
"parent": function( elem ) {
return !Expr.pseudos["empty"]( elem );
},
// Element/input types
"header": function( elem ) {
return rheader.test( elem.nodeName );
},
"input": function( elem ) {
return rinputs.test( elem.nodeName );
},
"button": function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === "button" || name === "button";
},
"text": function( elem ) {
var attr;
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
// use getAttribute instead to test this case
return elem.nodeName.toLowerCase() === "input" &&
elem.type === "text" &&
( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
},
// Position-in-collection
"first": createPositionalPseudo(function() {
return [ 0 ];
}),
"last": createPositionalPseudo(function( matchIndexes, length ) {
return [ length - 1 ];
}),
"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
return [ argument < 0 ? argument + length : argument ];
}),
"even": createPositionalPseudo(function( matchIndexes, length ) {
var i = 0;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"odd": createPositionalPseudo(function( matchIndexes, length ) {
var i = 1;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument;
for ( ; --i >= 0; ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument;
for ( ; ++i < length; ) {
matchIndexes.push( i );
}
return matchIndexes;
})
}
};
// Add button/input type pseudos
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
Expr.pseudos[ i ] = createInputPseudo( i );
}
for ( i in { submit: true, reset: true } ) {
Expr.pseudos[ i ] = createButtonPseudo( i );
}
function tokenize( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[ selector + " " ];
if ( cached ) {
return parseOnly ? 0 : cached.slice( 0 );
}
soFar = selector;
groups = [];
preFilters = Expr.preFilter;
while ( soFar ) {
// Comma and first run
if ( !matched || (match = rcomma.exec( soFar )) ) {
if ( match ) {
// Don't consume trailing commas as valid
soFar = soFar.slice( match[0].length ) || soFar;
}
groups.push( tokens = [] );
}
matched = false;
// Combinators
if ( (match = rcombinators.exec( soFar )) ) {
matched = match.shift();
tokens.push( {
value: matched,
// Cast descendant combinators to space
type: match[0].replace( rtrim, " " )
} );
soFar = soFar.slice( matched.length );
}
// Filters
for ( type in Expr.filter ) {
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
(match = preFilters[ type ]( match ))) ) {
matched = match.shift();
tokens.push( {
value: matched,
type: type,
matches: match
} );
soFar = soFar.slice( matched.length );
}
}
if ( !matched ) {
break;
}
}
// Return the length of the invalid excess
// if we're just parsing
// Otherwise, throw an error or return tokens
return parseOnly ?
soFar.length :
soFar ?
Sizzle.error( selector ) :
// Cache the tokens
tokenCache( selector, groups ).slice( 0 );
}
function toSelector( tokens ) {
var i = 0,
len = tokens.length,
selector = "";
for ( ; i < len; i++ ) {
selector += tokens[i].value;
}
return selector;
}
function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir,
checkNonElements = base && dir === "parentNode",
doneName = done++;
return combinator.first ?
// Check against closest ancestor/preceding element
function( elem, context, xml ) {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
return matcher( elem, context, xml );
}
}
} :
// Check against all ancestor/preceding elements
function( elem, context, xml ) {
var data, cache, outerCache,
dirkey = dirruns + " " + doneName;
// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
if ( xml ) {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
if ( matcher( elem, context, xml ) ) {
return true;
}
}
}
} else {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
outerCache = elem[ expando ] || (elem[ expando ] = {});
if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
if ( (data = cache[1]) === true || data === cachedruns ) {
return data === true;
}
} else {
cache = outerCache[ dir ] = [ dirkey ];
cache[1] = matcher( elem, context, xml ) || cachedruns;
if ( cache[1] === true ) {
return true;
}
}
}
}
}
};
}
function elementMatcher( matchers ) {
return matchers.length > 1 ?
function( elem, context, xml ) {
var i = matchers.length;
while ( i-- ) {
if ( !matchers[i]( elem, context, xml ) ) {
return false;
}
}
return true;
} :
matchers[0];
}
function condense( unmatched, map, filter, context, xml ) {
var elem,
newUnmatched = [],
i = 0,
len = unmatched.length,
mapped = map != null;
for ( ; i < len; i++ ) {
if ( (elem = unmatched[i]) ) {
if ( !filter || filter( elem, context, xml ) ) {
newUnmatched.push( elem );
if ( mapped ) {
map.push( i );
}
}
}
}
return newUnmatched;
}
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
postFinder = setMatcher( postFinder, postSelector );
}
return markFunction(function( seed, results, context, xml ) {
var temp, i, elem,
preMap = [],
postMap = [],
preexisting = results.length,
// Get initial elements from seed or context
elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
// Prefilter to get matcher input, preserving a map for seed-results synchronization
matcherIn = preFilter && ( seed || !selector ) ?
condense( elems, preMap, preFilter, context, xml ) :
elems,
matcherOut = matcher ?
// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
// ...intermediate processing is necessary
[] :
// ...otherwise use results directly
results :
matcherIn;
// Find primary matches
if ( matcher ) {
matcher( matcherIn, matcherOut, context, xml );
}
// Apply postFilter
if ( postFilter ) {
temp = condense( matcherOut, postMap );
postFilter( temp, [], context, xml );
// Un-match failing elements by moving them back to matcherIn
i = temp.length;
while ( i-- ) {
if ( (elem = temp[i]) ) {
matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
}
}
}
if ( seed ) {
if ( postFinder || preFilter ) {
if ( postFinder ) {
// Get the final matcherOut by condensing this intermediate into postFinder contexts
temp = [];
i = matcherOut.length;
while ( i-- ) {
if ( (elem = matcherOut[i]) ) {
// Restore matcherIn since elem is not yet a final match
temp.push( (matcherIn[i] = elem) );
}
}
postFinder( null, (matcherOut = []), temp, xml );
}
// Move matched elements from seed to results to keep them synchronized
i = matcherOut.length;
while ( i-- ) {
if ( (elem = matcherOut[i]) &&
(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
seed[temp] = !(results[temp] = elem);
}
}
}
// Add elements to results, through postFinder if defined
} else {
matcherOut = condense(
matcherOut === results ?
matcherOut.splice( preexisting, matcherOut.length ) :
matcherOut
);
if ( postFinder ) {
postFinder( null, results, matcherOut, xml );
} else {
push.apply( results, matcherOut );
}
}
});
}
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[0].type ],
implicitRelative = leadingRelative || Expr.relative[" "],
i = leadingRelative ? 1 : 0,
// The foundational matcher ensures that elements are reachable from top-level context(s)
matchContext = addCombinator( function( elem ) {
return elem === checkContext;
}, implicitRelative, true ),
matchAnyContext = addCombinator( function( elem ) {
return indexOf.call( checkContext, elem ) > -1;
}, implicitRelative, true ),
matchers = [ function( elem, context, xml ) {
return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
(checkContext = context).nodeType ?
matchContext( elem, context, xml ) :
matchAnyContext( elem, context, xml ) );
} ];
for ( ; i < len; i++ ) {
if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
} else {
matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
// Return special upon seeing a positional matcher
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[j].type ] ) {
break;
}
}
return setMatcher(
i > 1 && elementMatcher( matchers ),
i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
matcher,
i < j && matcherFromTokens( tokens.slice( i, j ) ),
j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
j < len && toSelector( tokens )
);
}
matchers.push( matcher );
}
}
return elementMatcher( matchers );
}
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
// A counter to specify which element is currently being matched
var matcherCachedRuns = 0,
bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
setMatched = [],
matchedCount = 0,
i = "0",
unmatched = seed && [],
outermost = expandContext != null,
contextBackup = outermostContext,
// We must always have either seed elements or context
elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
// Use integer dirruns iff this is the outermost matcher
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
if ( outermost ) {
outermostContext = context !== document && context;
cachedruns = matcherCachedRuns;
}
// Add elements passing elementMatchers directly to results
// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
for ( ; (elem = elems[i]) != null; i++ ) {
if ( byElement && elem ) {
j = 0;
while ( (matcher = elementMatchers[j++]) ) {
if ( matcher( elem, context, xml ) ) {
results.push( elem );
break;
}
}
if ( outermost ) {
dirruns = dirrunsUnique;
cachedruns = ++matcherCachedRuns;
}
}
// Track unmatched elements for set filters
if ( bySet ) {
// They will have gone through all possible matchers
if ( (elem = !matcher && elem) ) {
matchedCount--;
}
// Lengthen the array for every element, matched or not
if ( seed ) {
unmatched.push( elem );
}
}
}
// Apply set filters to unmatched elements
matchedCount += i;
if ( bySet && i !== matchedCount ) {
j = 0;
while ( (matcher = setMatchers[j++]) ) {
matcher( unmatched, setMatched, context, xml );
}
if ( seed ) {
// Reintegrate element matches to eliminate the need for sorting
if ( matchedCount > 0 ) {
while ( i-- ) {
if ( !(unmatched[i] || setMatched[i]) ) {
setMatched[i] = pop.call( results );
}
}
}
// Discard index placeholder values to get only actual matches
setMatched = condense( setMatched );
}
// Add matches to results
push.apply( results, setMatched );
// Seedless set matches succeeding multiple successful matchers stipulate sorting
if ( outermost && !seed && setMatched.length > 0 &&
( matchedCount + setMatchers.length ) > 1 ) {
Sizzle.uniqueSort( results );
}
}
// Override manipulation of globals by nested matchers
if ( outermost ) {
dirruns = dirrunsUnique;
outermostContext = contextBackup;
}
return unmatched;
};
return bySet ?
markFunction( superMatcher ) :
superMatcher;
}
compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
var i,
setMatchers = [],
elementMatchers = [],
cached = compilerCache[ selector + " " ];
if ( !cached ) {
// Generate a function of recursive functions that can be used to check each element
if ( !group ) {
group = tokenize( selector );
}
i = group.length;
while ( i-- ) {
cached = matcherFromTokens( group[i] );
if ( cached[ expando ] ) {
setMatchers.push( cached );
} else {
elementMatchers.push( cached );
}
}
// Cache the compiled function
cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
}
return cached;
};
function multipleContexts( selector, contexts, results ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
Sizzle( selector, contexts[i], results );
}
return results;
}
function select( selector, context, results, seed ) {
var i, tokens, token, type, find,
match = tokenize( selector );
if ( !seed ) {
// Try to minimize operations if there is only one group
if ( match.length === 1 ) {
// Take a shortcut and set the context if the root selector is an ID
tokens = match[0] = match[0].slice( 0 );
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
context.nodeType === 9 && !documentIsXML &&
Expr.relative[ tokens[1].type ] ) {
context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
if ( !context ) {
return results;
}
selector = selector.slice( tokens.shift().value.length );
}
// Fetch a seed set for right-to-left matching
i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
while ( i-- ) {
token = tokens[i];
// Abort if we hit a combinator
if ( Expr.relative[ (type = token.type) ] ) {
break;
}
if ( (find = Expr.find[ type ]) ) {
// Search, expanding context for leading sibling combinators
if ( (seed = find(
token.matches[0].replace( runescape, funescape ),
rsibling.test( tokens[0].type ) && context.parentNode || context
)) ) {
// If seed is empty or no tokens remain, we can return early
tokens.splice( i, 1 );
selector = seed.length && toSelector( tokens );
if ( !selector ) {
push.apply( results, slice.call( seed, 0 ) );
return results;
}
break;
}
}
}
}
}
// Compile and execute a filtering function
// Provide `match` to avoid retokenization if we modified the selector above
compile( selector, match )(
seed,
context,
documentIsXML,
results,
rsibling.test( selector )
);
return results;
}
// Deprecated
Expr.pseudos["nth"] = Expr.pseudos["eq"];
// Easy API for creating new setFilters
function setFilters() {}
Expr.filters = setFilters.prototype = Expr.pseudos;
Expr.setFilters = new setFilters();
// Initialize with the default document
setDocument();
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.pseudos;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
})( window );
var runtil = /Until$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
rneedsContext = jQuery.expr.match.needsContext,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var i, ret, self,
len = this.length;
if ( typeof selector !== "string" ) {
self = this;
return this.pushStack( jQuery( selector ).filter(function() {
for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
}) );
}
ret = [];
for ( i = 0; i < len; i++ ) {
jQuery.find( selector, this[ i ], ret );
}
// Needed because $( selector, context ) becomes $( context ).find( selector )
ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
return ret;
},
has: function( target ) {
var i,
targets = jQuery( target, this ),
len = targets.length;
return this.filter(function() {
for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false) );
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true) );
},
is: function( selector ) {
return !!selector && (
typeof selector === "string" ?
// If this is a positional/relative selector, check membership in the returned set
// so $("p:first").is("p:last") won't return true for a doc with two "p".
rneedsContext.test( selector ) ?
jQuery( selector, this.context ).index( this[0] ) >= 0 :
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
var cur,
i = 0,
l = this.length,
ret = [],
pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;
for ( ; i < l; i++ ) {
cur = this[i];
while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
}
cur = cur.parentNode;
}
}
return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
},
// Determine the position of an element within
// the matched set of elements
index: function( elem ) {
// No argument, return index in parent
if ( !elem ) {
return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
}
// index in selector
if ( typeof elem === "string" ) {
return jQuery.inArray( this[0], jQuery( elem ) );
}
// Locate the position of the desired element
return jQuery.inArray(
// If it receives a jQuery object, the first element is used
elem.jquery ? elem[0] : elem, this );
},
add: function( selector, context ) {
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( jQuery.unique(all) );
},
addBack: function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter(selector)
);
}
});
jQuery.fn.andSelf = jQuery.fn.addBack;
function sibling( cur, dir ) {
do {
cur = cur[ dir ];
} while ( cur && cur.nodeType !== 1 );
return cur;
}
jQuery.each({
parent: function( elem ) {
var parent = elem.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
parents: function( elem ) {
return jQuery.dir( elem, "parentNode" );
},
parentsUntil: function( elem, i, until ) {
return jQuery.dir( elem, "parentNode", until );
},
next: function( elem ) {
return sibling( elem, "nextSibling" );
},
prev: function( elem ) {
return sibling( elem, "previousSibling" );
},
nextAll: function( elem ) {
return jQuery.dir( elem, "nextSibling" );
},
prevAll: function( elem ) {
return jQuery.dir( elem, "previousSibling" );
},
nextUntil: function( elem, i, until ) {
return jQuery.dir( elem, "nextSibling", until );
},
prevUntil: function( elem, i, until ) {
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );
},
contents: function( elem ) {
return jQuery.nodeName( elem, "iframe" ) ?
elem.contentDocument || elem.contentWindow.document :
jQuery.merge( [], elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var ret = jQuery.map( this, fn, until );
if ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
if ( this.length > 1 && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 ?
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
jQuery.find.matches(expr, elems);
},
dir: function( elem, dir, until ) {
var matched = [],
cur = elem[ dir ];
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
if ( cur.nodeType === 1 ) {
matched.push( cur );
}
cur = cur[dir];
}
return matched;
},
sibling: function( n, elem ) {
var r = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType === 1 && n !== elem ) {
r.push( n );
}
}
return r;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
// Can't pass null or undefined to indexOf in Firefox 4
// Set to 0 to skip string check
qualifier = qualifier || 0;
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem ) {
return ( elem === qualifier ) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem ) {
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
});
}
function createSafeFragment( document ) {
var list = nodeNames.split( "|" ),
safeFrag = document.createDocumentFragment();
if ( safeFrag.createElement ) {
while ( list.length ) {
safeFrag.createElement(
list.pop()
);
}
}
return safeFrag;
}
var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
rleadingWhitespace = /^\s+/,
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&#?\w+;/,
rnoInnerhtml = /<(?:script|style|link)/i,
manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /^$|\/(?:java|ecma)script/i,
rscriptTypeMasked = /^true\/(.*)/,
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
// We have to close these tags to support XHTML (#13200)
wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
area: [ 1, "<map>", "</map>" ],
param: [ 1, "<object>", "</object>" ],
thead: [ 1, "<table>", "</table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
// unless wrapped in a div with non-breaking characters in front of it.
_default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
},
safeFragment = createSafeFragment( document ),
fragmentDiv = safeFragment.appendChild( document.createElement("div") );
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
jQuery.fn.extend({
text: function( value ) {
return jQuery.access( this, function( value ) {
return value === undefined ?
jQuery.text( this ) :
this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
}, null, value, arguments.length );
},
wrapAll: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapAll( html.call(this, i) );
});
}
if ( this[0] ) {
// The elements to wrap the target around
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
if ( this[0].parentNode ) {
wrap.insertBefore( this[0] );
}
wrap.map(function() {
var elem = this;
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
elem = elem.firstChild;
}
return elem;
}).append( this );
}
return this;
},
wrapInner: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapInner( html.call(this, i) );
});
}
return this.each(function() {
var self = jQuery( this ),
contents = self.contents();
if ( contents.length ) {
contents.wrapAll( html );
} else {
self.append( html );
}
});
},
wrap: function( html ) {
var isFunction = jQuery.isFunction( html );
return this.each(function(i) {
jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
});
},
unwrap: function() {
return this.parent().each(function() {
if ( !jQuery.nodeName( this, "body" ) ) {
jQuery( this ).replaceWith( this.childNodes );
}
}).end();
},
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.appendChild( elem );
}
});
},
prepend: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this );
}
});
},
after: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this.nextSibling );
}
});
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
var elem,
i = 0;
for ( ; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
if ( !keepData && elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem ) );
}
if ( elem.parentNode ) {
if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
setGlobalEval( getAll( elem, "script" ) );
}
elem.parentNode.removeChild( elem );
}
}
}
return this;
},
empty: function() {
var elem,
i = 0;
for ( ; (elem = this[i]) != null; i++ ) {
// Remove element nodes and prevent memory leaks
if ( elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem, false ) );
}
// Remove any remaining nodes
while ( elem.firstChild ) {
elem.removeChild( elem.firstChild );
}
// If this is a select, ensure that it displays empty (#12336)
// Support: IE<9
if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
elem.options.length = 0;
}
}
return this;
},
clone: function( dataAndEvents, deepDataAndEvents ) {
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
return this.map( function () {
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
});
},
html: function( value ) {
return jQuery.access( this, function( value ) {
var elem = this[0] || {},
i = 0,
l = this.length;
if ( value === undefined ) {
return elem.nodeType === 1 ?
elem.innerHTML.replace( rinlinejQuery, "" ) :
undefined;
}
// See if we can take a shortcut and just use innerHTML
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
value = value.replace( rxhtmlTag, "<$1></$2>" );
try {
for (; i < l; i++ ) {
// Remove element nodes and prevent memory leaks
elem = this[i] || {};
if ( elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem, false ) );
elem.innerHTML = value;
}
}
elem = 0;
// If using innerHTML throws an exception, use the fallback method
} catch(e) {}
}
if ( elem ) {
this.empty().append( value );
}
}, null, value, arguments.length );
},
replaceWith: function( value ) {
var isFunc = jQuery.isFunction( value );
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( !isFunc && typeof value !== "string" ) {
value = jQuery( value ).not( this ).detach();
}
return this.domManip( [ value ], true, function( elem ) {
var next = this.nextSibling,
parent = this.parentNode;
if ( parent ) {
jQuery( this ).remove();
parent.insertBefore( elem, next );
}
});
},
detach: function( selector ) {
return this.remove( selector, true );
},
domManip: function( args, table, callback ) {
// Flatten any nested arrays
args = core_concat.apply( [], args );
var first, node, hasScripts,
scripts, doc, fragment,
i = 0,
l = this.length,
set = this,
iNoClone = l - 1,
value = args[0],
isFunction = jQuery.isFunction( value );
// We can't cloneNode fragments that contain checked, in WebKit
if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
return this.each(function( index ) {
var self = set.eq( index );
if ( isFunction ) {
args[0] = value.call( this, index, table ? self.html() : undefined );
}
self.domManip( args, table, callback );
});
}
if ( l ) {
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
fragment = first;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
hasScripts = scripts.length;
// Use the original fragment for the last item instead of the first because it can end up
// being emptied incorrectly in certain situations (#8070).
for ( ; i < l; i++ ) {
node = fragment;
if ( i !== iNoClone ) {
node = jQuery.clone( node, true, true );
// Keep references to cloned scripts for later restoration
if ( hasScripts ) {
jQuery.merge( scripts, getAll( node, "script" ) );
}
}
callback.call(
table && jQuery.nodeName( this[i], "table" ) ?
findOrAppend( this[i], "tbody" ) :
this[i],
node,
i
);
}
if ( hasScripts ) {
doc = scripts[ scripts.length - 1 ].ownerDocument;
// Reenable scripts
jQuery.map( scripts, restoreScript );
// Evaluate executable scripts on first document insertion
for ( i = 0; i < hasScripts; i++ ) {
node = scripts[ i ];
if ( rscriptType.test( node.type || "" ) &&
!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
if ( node.src ) {
// Hope ajax is available...
jQuery.ajax({
url: node.src,
type: "GET",
dataType: "script",
async: false,
global: false,
"throws": true
});
} else {
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
}
}
}
}
// Fix #11809: Avoid leaking memory
fragment = first = null;
}
}
return this;
}
});
function findOrAppend( elem, tag ) {
return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
}
// Replace/restore the type attribute of script elements for safe DOM manipulation
function disableScript( elem ) {
var attr = elem.getAttributeNode("type");
elem.type = ( attr && attr.specified ) + "/" + elem.type;
return elem;
}
function restoreScript( elem ) {
var match = rscriptTypeMasked.exec( elem.type );
if ( match ) {
elem.type = match[1];
} else {
elem.removeAttribute("type");
}
return elem;
}
// Mark scripts as having already been evaluated
function setGlobalEval( elems, refElements ) {
var elem,
i = 0;
for ( ; (elem = elems[i]) != null; i++ ) {
jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
}
}
function cloneCopyEvent( src, dest ) {
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
return;
}
var type, i, l,
oldData = jQuery._data( src ),
curData = jQuery._data( dest, oldData ),
events = oldData.events;
if ( events ) {
delete curData.handle;
curData.events = {};
for ( type in events ) {
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
jQuery.event.add( dest, type, events[ type ][ i ] );
}
}
}
// make the cloned public data object a copy from the original
if ( curData.data ) {
curData.data = jQuery.extend( {}, curData.data );
}
}
function fixCloneNodeIssues( src, dest ) {
var nodeName, e, data;
// We do not need to do anything for non-Elements
if ( dest.nodeType !== 1 ) {
return;
}
nodeName = dest.nodeName.toLowerCase();
// IE6-8 copies events bound via attachEvent when using cloneNode.
if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
data = jQuery._data( dest );
for ( e in data.events ) {
jQuery.removeEvent( dest, e, data.handle );
}
// Event data gets referenced instead of copied if the expando gets copied too
dest.removeAttribute( jQuery.expando );
}
// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
if ( nodeName === "script" && dest.text !== src.text ) {
disableScript( dest ).text = src.text;
restoreScript( dest );
// IE6-10 improperly clones children of object elements using classid.
// IE10 throws NoModificationAllowedError if parent is null, #12132.
} else if ( nodeName === "object" ) {
if ( dest.parentNode ) {
dest.outerHTML = src.outerHTML;
}
// This path appears unavoidable for IE9. When cloning an object
// element in IE9, the outerHTML strategy above is not sufficient.
// If the src has innerHTML and the destination does not,
// copy the src.innerHTML into the dest.innerHTML. #10324
if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
dest.innerHTML = src.innerHTML;
}
} else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
// IE6-8 fails to persist the checked state of a cloned checkbox
// or radio button. Worse, IE6-7 fail to give the cloned element
// a checked appearance if the defaultChecked value isn't also set
dest.defaultChecked = dest.checked = src.checked;
// IE6-7 get confused and end up setting the value of a cloned
// checkbox/radio button to an empty string instead of "on"
if ( dest.value !== src.value ) {
dest.value = src.value;
}
// IE6-8 fails to return the selected option to the default selected
// state when cloning options
} else if ( nodeName === "option" ) {
dest.defaultSelected = dest.selected = src.defaultSelected;
// IE6-8 fails to set the defaultValue to the correct value when
// cloning other types of input fields
} else if ( nodeName === "input" || nodeName === "textarea" ) {
dest.defaultValue = src.defaultValue;
}
}
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var elems,
i = 0,
ret = [],
insert = jQuery( selector ),
last = insert.length - 1;
for ( ; i <= last; i++ ) {
elems = i === last ? this : this.clone(true);
jQuery( insert[i] )[ original ]( elems );
// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
core_push.apply( ret, elems.get() );
}
return this.pushStack( ret );
};
});
function getAll( context, tag ) {
var elems, elem,
i = 0,
found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
undefined;
if ( !found ) {
for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
if ( !tag || jQuery.nodeName( elem, tag ) ) {
found.push( elem );
} else {
jQuery.merge( found, getAll( elem, tag ) );
}
}
}
return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
jQuery.merge( [ context ], found ) :
found;
}
// Used in buildFragment, fixes the defaultChecked property
function fixDefaultChecked( elem ) {
if ( manipulation_rcheckableType.test( elem.type ) ) {
elem.defaultChecked = elem.checked;
}
}
jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var destElements, node, clone, i, srcElements,
inPage = jQuery.contains( elem.ownerDocument, elem );
if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
clone = elem.cloneNode( true );
// IE<=8 does not properly clone detached, unknown element nodes
} else {
fragmentDiv.innerHTML = elem.outerHTML;
fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
}
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
destElements = getAll( clone );
srcElements = getAll( elem );
// Fix all IE cloning issues
for ( i = 0; (node = srcElements[i]) != null; ++i ) {
// Ensure that the destination node is not null; Fixes #9587
if ( destElements[i] ) {
fixCloneNodeIssues( node, destElements[i] );
}
}
}
// Copy the events from the original to the clone
if ( dataAndEvents ) {
if ( deepDataAndEvents ) {
srcElements = srcElements || getAll( elem );
destElements = destElements || getAll( clone );
for ( i = 0; (node = srcElements[i]) != null; i++ ) {
cloneCopyEvent( node, destElements[i] );
}
} else {
cloneCopyEvent( elem, clone );
}
}
// Preserve script evaluation history
destElements = getAll( clone, "script" );
if ( destElements.length > 0 ) {
setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
}
destElements = srcElements = node = null;
// Return the cloned set
return clone;
},
buildFragment: function( elems, context, scripts, selection ) {
var j, elem, contains,
tmp, tag, tbody, wrap,
l = elems.length,
// Ensure a safe fragment
safe = createSafeFragment( context ),
nodes = [],
i = 0;
for ( ; i < l; i++ ) {
elem = elems[ i ];
if ( elem || elem === 0 ) {
// Add nodes directly
if ( jQuery.type( elem ) === "object" ) {
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
// Convert non-html into a text node
} else if ( !rhtml.test( elem ) ) {
nodes.push( context.createTextNode( elem ) );
// Convert html into DOM nodes
} else {
tmp = tmp || safe.appendChild( context.createElement("div") );
// Deserialize a standard representation
tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
wrap = wrapMap[ tag ] || wrapMap._default;
tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
// Descend through wrappers to the right content
j = wrap[0];
while ( j-- ) {
tmp = tmp.lastChild;
}
// Manually add leading whitespace removed by IE
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
elem = tag === "table" && !rtbody.test( elem ) ?
tmp.firstChild :
// String was a bare <thead> or <tfoot>
wrap[1] === "<table>" && !rtbody.test( elem ) ?
tmp :
0;
j = elem && elem.childNodes.length;
while ( j-- ) {
if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
elem.removeChild( tbody );
}
}
}
jQuery.merge( nodes, tmp.childNodes );
// Fix #12392 for WebKit and IE > 9
tmp.textContent = "";
// Fix #12392 for oldIE
while ( tmp.firstChild ) {
tmp.removeChild( tmp.firstChild );
}
// Remember the top-level container for proper cleanup
tmp = safe.lastChild;
}
}
}
// Fix #11356: Clear elements from fragment
if ( tmp ) {
safe.removeChild( tmp );
}
// Reset defaultChecked for any radios and checkboxes
// about to be appended to the DOM in IE 6/7 (#8060)
if ( !jQuery.support.appendChecked ) {
jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
}
i = 0;
while ( (elem = nodes[ i++ ]) ) {
// #4087 - If origin and destination elements are the same, and this is
// that element, do not do anything
if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
continue;
}
contains = jQuery.contains( elem.ownerDocument, elem );
// Append to fragment
tmp = getAll( safe.appendChild( elem ), "script" );
// Preserve script evaluation history
if ( contains ) {
setGlobalEval( tmp );
}
// Capture executables
if ( scripts ) {
j = 0;
while ( (elem = tmp[ j++ ]) ) {
if ( rscriptType.test( elem.type || "" ) ) {
scripts.push( elem );
}
}
}
}
tmp = null;
return safe;
},
cleanData: function( elems, /* internal */ acceptData ) {
var elem, type, id, data,
i = 0,
internalKey = jQuery.expando,
cache = jQuery.cache,
deleteExpando = jQuery.support.deleteExpando,
special = jQuery.event.special;
for ( ; (elem = elems[i]) != null; i++ ) {
if ( acceptData || jQuery.acceptData( elem ) ) {
id = elem[ internalKey ];
data = id && cache[ id ];
if ( data ) {
if ( data.events ) {
for ( type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
// This is a shortcut to avoid jQuery.event.remove's overhead
} else {
jQuery.removeEvent( elem, type, data.handle );
}
}
}
// Remove cache only if it was not already removed by jQuery.event.remove
if ( cache[ id ] ) {
delete cache[ id ];
// IE does not allow us to delete expando properties from nodes,
// nor does it have a removeAttribute function on Document nodes;
// we must handle all of these cases
if ( deleteExpando ) {
delete elem[ internalKey ];
} else if ( typeof elem.removeAttribute !== core_strundefined ) {
elem.removeAttribute( internalKey );
} else {
elem[ internalKey ] = null;
}
core_deletedIds.push( id );
}
}
}
}
}
});
var iframe, getStyles, curCSS,
ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity\s*=\s*([^)]*)/,
rposition = /^(top|right|bottom|left)$/,
// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
rmargin = /^margin/,
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
elemdisplay = { BODY: "block" },
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
letterSpacing: 0,
fontWeight: 400
},
cssExpand = [ "Top", "Right", "Bottom", "Left" ],
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
// return a css property mapped to a potentially vendor prefixed property
function vendorPropName( style, name ) {
// shortcut for names that are not vendor prefixed
if ( name in style ) {
return name;
}
// check for vendor prefixed names
var capName = name.charAt(0).toUpperCase() + name.slice(1),
origName = name,
i = cssPrefixes.length;
while ( i-- ) {
name = cssPrefixes[ i ] + capName;
if ( name in style ) {
return name;
}
}
return origName;
}
function isHidden( elem, el ) {
// isHidden might be called from jQuery#filter function;
// in that case, element will be second argument
elem = el || elem;
return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
}
function showHide( elements, show ) {
var display, elem, hidden,
values = [],
index = 0,
length = elements.length;
for ( ; index < length; index++ ) {
elem = elements[ index ];
if ( !elem.style ) {
continue;
}
values[ index ] = jQuery._data( elem, "olddisplay" );
display = elem.style.display;
if ( show ) {
// Reset the inline display of this element to learn if it is
// being hidden by cascaded rules or not
if ( !values[ index ] && display === "none" ) {
elem.style.display = "";
}
// Set elements which have been overridden with display: none
// in a stylesheet to whatever the default browser style is
// for such an element
if ( elem.style.display === "" && isHidden( elem ) ) {
values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
}
} else {
if ( !values[ index ] ) {
hidden = isHidden( elem );
if ( display && display !== "none" || !hidden ) {
jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
}
}
}
}
// Set the display of most of the elements in a second loop
// to avoid the constant reflow
for ( index = 0; index < length; index++ ) {
elem = elements[ index ];
if ( !elem.style ) {
continue;
}
if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
elem.style.display = show ? values[ index ] || "" : "none";
}
}
return elements;
}
jQuery.fn.extend({
css: function( name, value ) {
return jQuery.access( this, function( elem, name, value ) {
var len, styles,
map = {},
i = 0;
if ( jQuery.isArray( name ) ) {
styles = getStyles( elem );
len = name.length;
for ( ; i < len; i++ ) {
map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
}
return map;
}
return value !== undefined ?
jQuery.style( elem, name, value ) :
jQuery.css( elem, name );
}, name, value, arguments.length > 1 );
},
show: function() {
return showHide( this, true );
},
hide: function() {
return showHide( this );
},
toggle: function( state ) {
var bool = typeof state === "boolean";
return this.each(function() {
if ( bool ? state : isHidden( this ) ) {
jQuery( this ).show();
} else {
jQuery( this ).hide();
}
});
}
});
jQuery.extend({
// Add in style property hooks for overriding the default
// behavior of getting and setting a style property
cssHooks: {
opacity: {
get: function( elem, computed ) {
if ( computed ) {
// We should always get a number back from opacity
var ret = curCSS( elem, "opacity" );
return ret === "" ? "1" : ret;
}
}
}
},
// Exclude the following css properties to add px
cssNumber: {
"columnCount": true,
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
"opacity": true,
"orphans": true,
"widows": true,
"zIndex": true,
"zoom": true
},
// Add in properties whose names you wish to fix before
// setting or getting the value
cssProps: {
// normalize float css property
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
},
// Get and set the style property on a DOM Node
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
// Make sure that we're working with the right name
var ret, type, hooks,
origName = jQuery.camelCase( name ),
style = elem.style;
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
// gets hook for the prefixed version
// followed by the unprefixed version
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
// Check if we're setting a value
if ( value !== undefined ) {
type = typeof value;
// convert relative number strings (+= or -=) to relative numbers. #7345
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
// Fixes bug #9237
type = "number";
}
// Make sure that NaN and null values aren't set. See: #7116
if ( value == null || type === "number" && isNaN( value ) ) {
return;
}
// If a number was passed in, add 'px' to the (except for certain CSS properties)
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
value += "px";
}
// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
// but it would mean to define eight (for every problematic property) identical functions
if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
style[ name ] = "inherit";
}
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #5509
try {
style[ name ] = value;
} catch(e) {}
}
} else {
// If a hook was provided get the non-computed value from there
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
return ret;
}
// Otherwise just get the value from the style object
return style[ name ];
}
},
css: function( elem, name, extra, styles ) {
var num, val, hooks,
origName = jQuery.camelCase( name );
// Make sure that we're working with the right name
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
// gets hook for the prefixed version
// followed by the unprefixed version
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
// If a hook was provided get the computed value from there
if ( hooks && "get" in hooks ) {
val = hooks.get( elem, true, extra );
}
// Otherwise, if a way to get the computed value exists, use that
if ( val === undefined ) {
val = curCSS( elem, name, styles );
}
//convert "normal" to computed value
if ( val === "normal" && name in cssNormalTransform ) {
val = cssNormalTransform[ name ];
}
// Return, converting to number if forced or a qualifier was provided and val looks numeric
if ( extra === "" || extra ) {
num = parseFloat( val );
return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
}
return val;
},
// A method for quickly swapping in/out CSS properties to get correct calculations
swap: function( elem, options, callback, args ) {
var ret, name,
old = {};
// Remember the old values, and insert the new ones
for ( name in options ) {
old[ name ] = elem.style[ name ];
elem.style[ name ] = options[ name ];
}
ret = callback.apply( elem, args || [] );
// Revert the old values
for ( name in options ) {
elem.style[ name ] = old[ name ];
}
return ret;
}
});
// NOTE: we've included the "window" in window.getComputedStyle
// because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
getStyles = function( elem ) {
return window.getComputedStyle( elem, null );
};
curCSS = function( elem, name, _computed ) {
var width, minWidth, maxWidth,
computed = _computed || getStyles( elem ),
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
style = elem.style;
if ( computed ) {
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
// A tribute to the "awesome hack by Dean Edwards"
// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
// Remember the original values
width = style.width;
minWidth = style.minWidth;
maxWidth = style.maxWidth;
// Put in the new values to get a computed value out
style.minWidth = style.maxWidth = style.width = ret;
ret = computed.width;
// Revert the changed values
style.width = width;
style.minWidth = minWidth;
style.maxWidth = maxWidth;
}
}
return ret;
};
} else if ( document.documentElement.currentStyle ) {
getStyles = function( elem ) {
return elem.currentStyle;
};
curCSS = function( elem, name, _computed ) {
var left, rs, rsLeft,
computed = _computed || getStyles( elem ),
ret = computed ? computed[ name ] : undefined,
style = elem.style;
// Avoid setting ret to empty string here
// so we don't default to auto
if ( ret == null && style && style[ name ] ) {
ret = style[ name ];
}
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
// but not position css attributes, as those are proportional to the parent element instead
// and we can't measure the parent instead because it might trigger a "stacking dolls" problem
if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
// Remember the original values
left = style.left;
rs = elem.runtimeStyle;
rsLeft = rs && rs.left;
// Put in the new values to get a computed value out
if ( rsLeft ) {
rs.left = elem.currentStyle.left;
}
style.left = name === "fontSize" ? "1em" : ret;
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
if ( rsLeft ) {
rs.left = rsLeft;
}
}
return ret === "" ? "auto" : ret;
};
}
function setPositiveNumber( elem, value, subtract ) {
var matches = rnumsplit.exec( value );
return matches ?
// Guard against undefined "subtract", e.g., when used as in cssHooks
Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
value;
}
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
var i = extra === ( isBorderBox ? "border" : "content" ) ?
// If we already have the right measurement, avoid augmentation
4 :
// Otherwise initialize for horizontal or vertical properties
name === "width" ? 1 : 0,
val = 0;
for ( ; i < 4; i += 2 ) {
// both box models exclude margin, so add it if we want it
if ( extra === "margin" ) {
val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
}
if ( isBorderBox ) {
// border-box includes padding, so remove it if we want content
if ( extra === "content" ) {
val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
}
// at this point, extra isn't border nor margin, so remove border
if ( extra !== "margin" ) {
val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
}
} else {
// at this point, extra isn't content, so add padding
val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
// at this point, extra isn't content nor padding, so add border
if ( extra !== "padding" ) {
val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
}
}
}
return val;
}
function getWidthOrHeight( elem, name, extra ) {
// Start with offset property, which is equivalent to the border-box value
var valueIsBorderBox = true,
val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
styles = getStyles( elem ),
isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
// some non-html elements return undefined for offsetWidth, so check for null/undefined
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
if ( val <= 0 || val == null ) {
// Fall back to computed then uncomputed css if necessary
val = curCSS( elem, name, styles );
if ( val < 0 || val == null ) {
val = elem.style[ name ];
}
// Computed unit is not pixels. Stop here and return.
if ( rnumnonpx.test(val) ) {
return val;
}
// we need the check for style in case a browser which returns unreliable values
// for getComputedStyle silently falls back to the reliable elem.style
valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
// Normalize "", auto, and prepare for extra
val = parseFloat( val ) || 0;
}
// use the active box-sizing model to add/subtract irrelevant styles
return ( val +
augmentWidthOrHeight(
elem,
name,
extra || ( isBorderBox ? "border" : "content" ),
valueIsBorderBox,
styles
)
) + "px";
}
// Try to determine the default display value of an element
function css_defaultDisplay( nodeName ) {
var doc = document,
display = elemdisplay[ nodeName ];
if ( !display ) {
display = actualDisplay( nodeName, doc );
// If the simple way fails, read from inside an iframe
if ( display === "none" || !display ) {
// Use the already-created iframe if possible
iframe = ( iframe ||
jQuery("<iframe frameborder='0' width='0' height='0'/>")
.css( "cssText", "display:block !important" )
).appendTo( doc.documentElement );
// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
doc.write("<!doctype html><html><body>");
doc.close();
display = actualDisplay( nodeName, doc );
iframe.detach();
}
// Store the correct default display
elemdisplay[ nodeName ] = display;
}
return display;
}
// Called ONLY from within css_defaultDisplay
function actualDisplay( name, doc ) {
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
display = jQuery.css( elem[0], "display" );
elem.remove();
return display;
}
jQuery.each([ "height", "width" ], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
if ( computed ) {
// certain elements can have dimension info if we invisibly show them
// however, it must have a current display style that would benefit from this
return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
jQuery.swap( elem, cssShow, function() {
return getWidthOrHeight( elem, name, extra );
}) :
getWidthOrHeight( elem, name, extra );
}
},
set: function( elem, value, extra ) {
var styles = extra && getStyles( elem );
return setPositiveNumber( elem, value, extra ?
augmentWidthOrHeight(
elem,
name,
extra,
jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
styles
) : 0
);
}
};
});
if ( !jQuery.support.opacity ) {
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
computed ? "1" : "";
},
set: function( elem, value ) {
var style = elem.style,
currentStyle = elem.currentStyle,
opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
filter = currentStyle && currentStyle.filter || style.filter || "";
// IE has trouble with opacity if it does not have layout
// Force it by setting the zoom level
style.zoom = 1;
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
// if value === "", then remove inline opacity #12685
if ( ( value >= 1 || value === "" ) &&
jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
style.removeAttribute ) {
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
// if "filter:" is present at all, clearType is disabled, we want to avoid this
// style.removeAttribute is IE Only, but so apparently is this code path...
style.removeAttribute( "filter" );
// if there is no filter style applied in a css rule or unset inline opacity, we are done
if ( value === "" || currentStyle && !currentStyle.filter ) {
return;
}
}
// otherwise, set new filter values
style.filter = ralpha.test( filter ) ?
filter.replace( ralpha, opacity ) :
filter + " " + opacity;
}
};
}
// These hooks cannot be added until DOM ready because the support test
// for it is not run until after DOM ready
jQuery(function() {
if ( !jQuery.support.reliableMarginRight ) {
jQuery.cssHooks.marginRight = {
get: function( elem, computed ) {
if ( computed ) {
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block
return jQuery.swap( elem, { "display": "inline-block" },
curCSS, [ elem, "marginRight" ] );
}
}
};
}
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
// getComputedStyle returns percent when specified for top/left/bottom/right
// rather than make the css module depend on the offset module, we just check for it here
if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
jQuery.each( [ "top", "left" ], function( i, prop ) {
jQuery.cssHooks[ prop ] = {
get: function( elem, computed ) {
if ( computed ) {
computed = curCSS( elem, prop );
// if curCSS returns percentage, fallback to offset
return rnumnonpx.test( computed ) ?
jQuery( elem ).position()[ prop ] + "px" :
computed;
}
}
};
});
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
// These hooks are used by animate to expand properties
jQuery.each({
margin: "",
padding: "",
border: "Width"
}, function( prefix, suffix ) {
jQuery.cssHooks[ prefix + suffix ] = {
expand: function( value ) {
var i = 0,
expanded = {},
// assumes a single number if not a string
parts = typeof value === "string" ? value.split(" ") : [ value ];
for ( ; i < 4; i++ ) {
expanded[ prefix + cssExpand[ i ] + suffix ] =
parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
}
return expanded;
}
};
if ( !rmargin.test( prefix ) ) {
jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
}
});
var r20 = /%20/g,
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
rsubmittable = /^(?:input|select|textarea|keygen)/i;
jQuery.fn.extend({
serialize: function() {
return jQuery.param( this.serializeArray() );
},
serializeArray: function() {
return this.map(function(){
// Can add propHook for "elements" to filter or add form elements
var elements = jQuery.prop( this, "elements" );
return elements ? jQuery.makeArray( elements ) : this;
})
.filter(function(){
var type = this.type;
// Use .is(":disabled") so that fieldset[disabled] works
return this.name && !jQuery( this ).is( ":disabled" ) &&
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
( this.checked || !manipulation_rcheckableType.test( type ) );
})
.map(function( i, elem ){
var val = jQuery( this ).val();
return val == null ?
null :
jQuery.isArray( val ) ?
jQuery.map( val, function( val ){
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}) :
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}).get();
}
});
//Serialize an array of form elements or a set of
//key/values into a query string
jQuery.param = function( a, traditional ) {
var prefix,
s = [],
add = function( key, value ) {
// If value is a function, invoke it and return its value
value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
};
// Set traditional to true for jQuery <= 1.3.2 behavior.
if ( traditional === undefined ) {
traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
}
// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
// Serialize the form elements
jQuery.each( a, function() {
add( this.name, this.value );
});
} else {
// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
for ( prefix in a ) {
buildParams( prefix, a[ prefix ], traditional, add );
}
}
// Return the resulting serialization
return s.join( "&" ).replace( r20, "+" );
};
function buildParams( prefix, obj, traditional, add ) {
var name;
if ( jQuery.isArray( obj ) ) {
// Serialize array item.
jQuery.each( obj, function( i, v ) {
if ( traditional || rbracket.test( prefix ) ) {
// Treat each array item as a scalar.
add( prefix, v );
} else {
// Item is non-scalar (array or object), encode its numeric index.
buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
}
});
} else if ( !traditional && jQuery.type( obj ) === "object" ) {
// Serialize object item.
for ( name in obj ) {
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
}
} else {
// Serialize scalar item.
add( prefix, obj );
}
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( data, fn ) {
return arguments.length > 0 ?
this.on( name, null, data, fn ) :
this.trigger( name );
};
});
jQuery.fn.hover = function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
};
var
// Document location
ajaxLocParts,
ajaxLocation,
ajax_nonce = jQuery.now(),
ajax_rquery = /\?/,
rhash = /#.*$/,
rts = /([?&])_=[^&]*/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
// #7653, #8125, #8152: local protocol detection
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//,
rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
// Keep a copy of the old load method
_load = jQuery.fn.load,
/* Prefilters
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
* 2) These are called:
* - BEFORE asking for a transport
* - AFTER param serialization (s.data is a string if s.processData is true)
* 3) key is the dataType
* 4) the catchall symbol "*" can be used
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
*/
prefilters = {},
/* Transports bindings
* 1) key is the dataType
* 2) the catchall symbol "*" can be used
* 3) selection will start with transport dataType and THEN go to "*" if needed
*/
transports = {},
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes = "*/".concat("*");
// #8138, IE may throw an exception when accessing
// a field from window.location if document.domain has been set
try {
ajaxLocation = location.href;
} catch( e ) {
// Use the href attribute of an A element
// since IE will modify it given document.location
ajaxLocation = document.createElement( "a" );
ajaxLocation.href = "";
ajaxLocation = ajaxLocation.href;
}
// Segment location into parts
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function addToPrefiltersOrTransports( structure ) {
// dataTypeExpression is optional and defaults to "*"
return function( dataTypeExpression, func ) {
if ( typeof dataTypeExpression !== "string" ) {
func = dataTypeExpression;
dataTypeExpression = "*";
}
var dataType,
i = 0,
dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
if ( jQuery.isFunction( func ) ) {
// For each dataType in the dataTypeExpression
while ( (dataType = dataTypes[i++]) ) {
// Prepend if requested
if ( dataType[0] === "+" ) {
dataType = dataType.slice( 1 ) || "*";
(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
// Otherwise append
} else {
(structure[ dataType ] = structure[ dataType ] || []).push( func );
}
}
}
};
}
// Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
var inspected = {},
seekingTransport = ( structure === transports );
function inspect( dataType ) {
var selected;
inspected[ dataType ] = true;
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
options.dataTypes.unshift( dataTypeOrTransport );
inspect( dataTypeOrTransport );
return false;
} else if ( seekingTransport ) {
return !( selected = dataTypeOrTransport );
}
});
return selected;
}
return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
}
// A special extend for ajax options
// that takes "flat" options (not to be deep extended)
// Fixes #9887
function ajaxExtend( target, src ) {
var deep, key,
flatOptions = jQuery.ajaxSettings.flatOptions || {};
for ( key in src ) {
if ( src[ key ] !== undefined ) {
( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
}
}
if ( deep ) {
jQuery.extend( true, target, deep );
}
return target;
}
jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
var selector, response, type,
self = this,
off = url.indexOf(" ");
if ( off >= 0 ) {
selector = url.slice( off, url.length );
url = url.slice( 0, off );
}
// If it's a function
if ( jQuery.isFunction( params ) ) {
// We assume that it's the callback
callback = params;
params = undefined;
// Otherwise, build a param string
} else if ( params && typeof params === "object" ) {
type = "POST";
}
// If we have elements to modify, make the request
if ( self.length > 0 ) {
jQuery.ajax({
url: url,
// if "type" variable is undefined, then "GET" method will be used
type: type,
dataType: "html",
data: params
}).done(function( responseText ) {
// Save response for use in complete callback
response = arguments;
self.html( selector ?
// If a selector was specified, locate the right elements in a dummy div
// Exclude scripts to avoid IE 'Permission Denied' errors
jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
// Otherwise use the full result
responseText );
}).complete( callback && function( jqXHR, status ) {
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
});
}
return this;
};
// Attach a bunch of functions for handling common AJAX events
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
jQuery.fn[ type ] = function( fn ){
return this.on( type, fn );
};
});
jQuery.each( [ "get", "post" ], function( i, method ) {
jQuery[ method ] = function( url, data, callback, type ) {
// shift arguments if data argument was omitted
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
data = undefined;
}
return jQuery.ajax({
url: url,
type: method,
dataType: type,
data: data,
success: callback
});
};
});
jQuery.extend({
// Counter for holding the number of active queries
active: 0,
// Last-Modified header cache for next request
lastModified: {},
etag: {},
ajaxSettings: {
url: ajaxLocation,
type: "GET",
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
global: true,
processData: true,
async: true,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
/*
timeout: 0,
data: null,
dataType: null,
username: null,
password: null,
cache: null,
throws: false,
traditional: false,
headers: {},
*/
accepts: {
"*": allTypes,
text: "text/plain",
html: "text/html",
xml: "application/xml, text/xml",
json: "application/json, text/javascript"
},
contents: {
xml: /xml/,
html: /html/,
json: /json/
},
responseFields: {
xml: "responseXML",
text: "responseText"
},
// Data converters
// Keys separate source (or catchall "*") and destination types with a single space
converters: {
// Convert anything to text
"* text": window.String,
// Text to html (true = no transformation)
"text html": true,
// Evaluate text as a json expression
"text json": jQuery.parseJSON,
// Parse text as xml
"text xml": jQuery.parseXML
},
// For options that shouldn't be deep extended:
// you can add your own custom options here if
// and when you create one that shouldn't be
// deep extended (see ajaxExtend)
flatOptions: {
url: true,
context: true
}
},
// Creates a full fledged settings object into target
// with both ajaxSettings and settings fields.
// If target is omitted, writes into ajaxSettings.
ajaxSetup: function( target, settings ) {
return settings ?
// Building a settings object
ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
// Extending ajaxSettings
ajaxExtend( jQuery.ajaxSettings, target );
},
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
ajaxTransport: addToPrefiltersOrTransports( transports ),
// Main method
ajax: function( url, options ) {
// If url is an object, simulate pre-1.5 signature
if ( typeof url === "object" ) {
options = url;
url = undefined;
}
// Force options to be an object
options = options || {};
var // Cross-domain detection vars
parts,
// Loop variable
i,
// URL without anti-cache param
cacheURL,
// Response headers as string
responseHeadersString,
// timeout handle
timeoutTimer,
// To know if global events are to be dispatched
fireGlobals,
transport,
// Response headers
responseHeaders,
// Create the final options object
s = jQuery.ajaxSetup( {}, options ),
// Callbacks context
callbackContext = s.context || s,
// Context for global events is callbackContext if it is a DOM node or jQuery collection
globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
jQuery( callbackContext ) :
jQuery.event,
// Deferreds
deferred = jQuery.Deferred(),
completeDeferred = jQuery.Callbacks("once memory"),
// Status-dependent callbacks
statusCode = s.statusCode || {},
// Headers (they are sent all at once)
requestHeaders = {},
requestHeadersNames = {},
// The jqXHR state
state = 0,
// Default abort message
strAbort = "canceled",
// Fake xhr
jqXHR = {
readyState: 0,
// Builds headers hashtable if needed
getResponseHeader: function( key ) {
var match;
if ( state === 2 ) {
if ( !responseHeaders ) {
responseHeaders = {};
while ( (match = rheaders.exec( responseHeadersString )) ) {
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
}
}
match = responseHeaders[ key.toLowerCase() ];
}
return match == null ? null : match;
},
// Raw string
getAllResponseHeaders: function() {
return state === 2 ? responseHeadersString : null;
},
// Caches the header
setRequestHeader: function( name, value ) {
var lname = name.toLowerCase();
if ( !state ) {
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
requestHeaders[ name ] = value;
}
return this;
},
// Overrides response content-type header
overrideMimeType: function( type ) {
if ( !state ) {
s.mimeType = type;
}
return this;
},
// Status-dependent callbacks
statusCode: function( map ) {
var code;
if ( map ) {
if ( state < 2 ) {
for ( code in map ) {
// Lazy-add the new callback in a way that preserves old ones
statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
}
} else {
// Execute the appropriate callbacks
jqXHR.always( map[ jqXHR.status ] );
}
}
return this;
},
// Cancel the request
abort: function( statusText ) {
var finalText = statusText || strAbort;
if ( transport ) {
transport.abort( finalText );
}
done( 0, finalText );
return this;
}
};
// Attach deferreds
deferred.promise( jqXHR ).complete = completeDeferred.add;
jqXHR.success = jqXHR.done;
jqXHR.error = jqXHR.fail;
// Remove hash character (#7531: and string promotion)
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
// Handle falsy url in the settings object (#10093: consistency with old signature)
// We also use the url parameter if available
s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
// Alias method option to type as per ticket #12004
s.type = options.method || options.type || s.method || s.type;
// Extract dataTypes list
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
// A cross-domain request is in order when we have a protocol:host:port mismatch
if ( s.crossDomain == null ) {
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( parts &&
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
);
}
// Convert data if not already a string
if ( s.data && s.processData && typeof s.data !== "string" ) {
s.data = jQuery.param( s.data, s.traditional );
}
// Apply prefilters
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
// If request was aborted inside a prefilter, stop there
if ( state === 2 ) {
return jqXHR;
}
// We can fire global events as of now if asked to
fireGlobals = s.global;
// Watch for a new set of requests
if ( fireGlobals && jQuery.active++ === 0 ) {
jQuery.event.trigger("ajaxStart");
}
// Uppercase the type
s.type = s.type.toUpperCase();
// Determine if request has content
s.hasContent = !rnoContent.test( s.type );
// Save the URL in case we're toying with the If-Modified-Since
// and/or If-None-Match header later on
cacheURL = s.url;
// More options handling for requests with no content
if ( !s.hasContent ) {
// If data is available, append data to url
if ( s.data ) {
cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
// #9682: remove data so that it's not used in an eventual retry
delete s.data;
}
// Add anti-cache in url if needed
if ( s.cache === false ) {
s.url = rts.test( cacheURL ) ?
// If there is already a '_' parameter, set its value
cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
// Otherwise add one to the end
cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
}
}
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
if ( jQuery.lastModified[ cacheURL ] ) {
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
}
if ( jQuery.etag[ cacheURL ] ) {
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
}
}
// Set the correct header, if data is being sent
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
jqXHR.setRequestHeader( "Content-Type", s.contentType );
}
// Set the Accepts header for the server, depending on the dataType
jqXHR.setRequestHeader(
"Accept",
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
s.accepts[ "*" ]
);
// Check for headers option
for ( i in s.headers ) {
jqXHR.setRequestHeader( i, s.headers[ i ] );
}
// Allow custom headers/mimetypes and early abort
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
// Abort if not done already and return
return jqXHR.abort();
}
// aborting is no longer a cancellation
strAbort = "abort";
// Install callbacks on deferreds
for ( i in { success: 1, error: 1, complete: 1 } ) {
jqXHR[ i ]( s[ i ] );
}
// Get transport
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
// If no transport, we auto-abort
if ( !transport ) {
done( -1, "No Transport" );
} else {
jqXHR.readyState = 1;
// Send global event
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
}
// Timeout
if ( s.async && s.timeout > 0 ) {
timeoutTimer = setTimeout(function() {
jqXHR.abort("timeout");
}, s.timeout );
}
try {
state = 1;
transport.send( requestHeaders, done );
} catch ( e ) {
// Propagate exception as error if not done
if ( state < 2 ) {
done( -1, e );
// Simply rethrow otherwise
} else {
throw e;
}
}
}
// Callback for when everything is done
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
if ( state === 2 ) {
return;
}
// State is "done" now
state = 2;
// Clear timeout if it exists
if ( timeoutTimer ) {
clearTimeout( timeoutTimer );
}
// Dereference transport for early garbage collection
// (no matter how long the jqXHR object will be used)
transport = undefined;
// Cache response headers
responseHeadersString = headers || "";
// Set readyState
jqXHR.readyState = status > 0 ? 4 : 0;
// Get response data
if ( responses ) {
response = ajaxHandleResponses( s, jqXHR, responses );
}
// If successful, handle type chaining
if ( status >= 200 && status < 300 || status === 304 ) {
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
modified = jqXHR.getResponseHeader("Last-Modified");
if ( modified ) {
jQuery.lastModified[ cacheURL ] = modified;
}
modified = jqXHR.getResponseHeader("etag");
if ( modified ) {
jQuery.etag[ cacheURL ] = modified;
}
}
// if no content
if ( status === 204 ) {
isSuccess = true;
statusText = "nocontent";
// if not modified
} else if ( status === 304 ) {
isSuccess = true;
statusText = "notmodified";
// If we have data, let's convert it
} else {
isSuccess = ajaxConvert( s, response );
statusText = isSuccess.state;
success = isSuccess.data;
error = isSuccess.error;
isSuccess = !error;
}
} else {
// We extract error from statusText
// then normalize statusText and status for non-aborts
error = statusText;
if ( status || !statusText ) {
statusText = "error";
if ( status < 0 ) {
status = 0;
}
}
}
// Set data for the fake xhr object
jqXHR.status = status;
jqXHR.statusText = ( nativeStatusText || statusText ) + "";
// Success/Error
if ( isSuccess ) {
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
} else {
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
}
// Status-dependent callbacks
jqXHR.statusCode( statusCode );
statusCode = undefined;
if ( fireGlobals ) {
globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
[ jqXHR, s, isSuccess ? success : error ] );
}
// Complete
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
// Handle the global AJAX counter
if ( !( --jQuery.active ) ) {
jQuery.event.trigger("ajaxStop");
}
}
}
return jqXHR;
},
getScript: function( url, callback ) {
return jQuery.get( url, undefined, callback, "script" );
},
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
}
});
/* Handles responses to an ajax request:
* - sets all responseXXX fields accordingly
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
var firstDataType, ct, finalDataType, type,
contents = s.contents,
dataTypes = s.dataTypes,
responseFields = s.responseFields;
// Fill responseXXX fields
for ( type in responseFields ) {
if ( type in responses ) {
jqXHR[ responseFields[type] ] = responses[ type ];
}
}
// Remove auto dataType and get content-type in the process
while( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
}
}
// Check if we're dealing with a known content-type
if ( ct ) {
for ( type in contents ) {
if ( contents[ type ] && contents[ type ].test( ct ) ) {
dataTypes.unshift( type );
break;
}
}
}
// Check to see if we have a response for the expected dataType
if ( dataTypes[ 0 ] in responses ) {
finalDataType = dataTypes[ 0 ];
} else {
// Try convertible dataTypes
for ( type in responses ) {
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
finalDataType = type;
break;
}
if ( !firstDataType ) {
firstDataType = type;
}
}
// Or just use first one
finalDataType = finalDataType || firstDataType;
}
// If we found a dataType
// We add the dataType to the list if needed
// and return the corresponding response
if ( finalDataType ) {
if ( finalDataType !== dataTypes[ 0 ] ) {
dataTypes.unshift( finalDataType );
}
return responses[ finalDataType ];
}
}
// Chain conversions given the request and the original response
function ajaxConvert( s, response ) {
var conv2, current, conv, tmp,
converters = {},
i = 0,
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice(),
prev = dataTypes[ 0 ];
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
// Create converters map with lowercased keys
if ( dataTypes[ 1 ] ) {
for ( conv in s.converters ) {
converters[ conv.toLowerCase() ] = s.converters[ conv ];
}
}
// Convert to each sequential dataType, tolerating list modification
for ( ; (current = dataTypes[++i]); ) {
// There's only work to do if current dataType is non-auto
if ( current !== "*" ) {
// Convert response if prev dataType is non-auto and differs from current
if ( prev !== "*" && prev !== current ) {
// Seek a direct converter
conv = converters[ prev + " " + current ] || converters[ "* " + current ];
// If none found, seek a pair
if ( !conv ) {
for ( conv2 in converters ) {
// If conv2 outputs current
tmp = conv2.split(" ");
if ( tmp[ 1 ] === current ) {
// If prev can be converted to accepted input
conv = converters[ prev + " " + tmp[ 0 ] ] ||
converters[ "* " + tmp[ 0 ] ];
if ( conv ) {
// Condense equivalence converters
if ( conv === true ) {
conv = converters[ conv2 ];
// Otherwise, insert the intermediate dataType
} else if ( converters[ conv2 ] !== true ) {
current = tmp[ 0 ];
dataTypes.splice( i--, 0, current );
}
break;
}
}
}
}
// Apply converter (if not an equivalence)
if ( conv !== true ) {
// Unless errors are allowed to bubble, catch and return them
if ( conv && s["throws"] ) {
response = conv( response );
} else {
try {
response = conv( response );
} catch ( e ) {
return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
}
}
}
}
// Update prev for next iteration
prev = current;
}
}
return { state: "success", data: response };
}
// Install script dataType
jQuery.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /(?:java|ecma)script/
},
converters: {
"text script": function( text ) {
jQuery.globalEval( text );
return text;
}
}
});
// Handle cache's special case and global
jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) {
s.cache = false;
}
if ( s.crossDomain ) {
s.type = "GET";
s.global = false;
}
});
// Bind script tag hack transport
jQuery.ajaxTransport( "script", function(s) {
// This transport only deals with cross domain requests
if ( s.crossDomain ) {
var script,
head = document.head || jQuery("head")[0] || document.documentElement;
return {
send: function( _, callback ) {
script = document.createElement("script");
script.async = true;
if ( s.scriptCharset ) {
script.charset = s.scriptCharset;
}
script.src = s.url;
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function( _, isAbort ) {
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
// Remove the script
if ( script.parentNode ) {
script.parentNode.removeChild( script );
}
// Dereference the script
script = null;
// Callback if not abort
if ( !isAbort ) {
callback( 200, "success" );
}
}
};
// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
// Use native DOM manipulation to avoid our domManip AJAX trickery
head.insertBefore( script, head.firstChild );
},
abort: function() {
if ( script ) {
script.onload( undefined, true );
}
}
};
}
});
var oldCallbacks = [],
rjsonp = /(=)\?(?=&|$)|\?\?/;
// Default jsonp settings
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
this[ callback ] = true;
return callback;
}
});
// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
var callbackName, overwritten, responseContainer,
jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
"url" :
typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
);
// Handle iff the expected data type is "jsonp" or we have a parameter to set
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
// Get callback name, remembering preexisting value associated with it
callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
s.jsonpCallback() :
s.jsonpCallback;
// Insert callback into url or form data
if ( jsonProp ) {
s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
} else if ( s.jsonp !== false ) {
s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
}
// Use data converter to retrieve json after script execution
s.converters["script json"] = function() {
if ( !responseContainer ) {
jQuery.error( callbackName + " was not called" );
}
return responseContainer[ 0 ];
};
// force json dataType
s.dataTypes[ 0 ] = "json";
// Install callback
overwritten = window[ callbackName ];
window[ callbackName ] = function() {
responseContainer = arguments;
};
// Clean-up function (fires after converters)
jqXHR.always(function() {
// Restore preexisting value
window[ callbackName ] = overwritten;
// Save back as free
if ( s[ callbackName ] ) {
// make sure that re-using the options doesn't screw things around
s.jsonpCallback = originalSettings.jsonpCallback;
// save the callback name for future use
oldCallbacks.push( callbackName );
}
// Call if it was a function and we have a response
if ( responseContainer && jQuery.isFunction( overwritten ) ) {
overwritten( responseContainer[ 0 ] );
}
responseContainer = overwritten = undefined;
});
// Delegate to script
return "script";
}
});
var xhrCallbacks, xhrSupported,
xhrId = 0,
// #5280: Internet Explorer will keep connections alive if we don't abort on unload
xhrOnUnloadAbort = window.ActiveXObject && function() {
// Abort all pending requests
var key;
for ( key in xhrCallbacks ) {
xhrCallbacks[ key ]( undefined, true );
}
};
// Functions to create xhrs
function createStandardXHR() {
try {
return new window.XMLHttpRequest();
} catch( e ) {}
}
function createActiveXHR() {
try {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} catch( e ) {}
}
// Create the request object
// (This is still attached to ajaxSettings for backward compatibility)
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
/* Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
* so we use the ActiveXObject when it is available
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
function() {
return !this.isLocal && createStandardXHR() || createActiveXHR();
} :
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR;
// Determine support properties
xhrSupported = jQuery.ajaxSettings.xhr();
jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
xhrSupported = jQuery.support.ajax = !!xhrSupported;
// Create transport if the browser can provide an xhr
if ( xhrSupported ) {
jQuery.ajaxTransport(function( s ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( !s.crossDomain || jQuery.support.cors ) {
var callback;
return {
send: function( headers, complete ) {
// Get a new xhr
var handle, i,
xhr = s.xhr();
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
xhr.open( s.type, s.url, s.async, s.username, s.password );
} else {
xhr.open( s.type, s.url, s.async );
}
// Apply custom fields if provided
if ( s.xhrFields ) {
for ( i in s.xhrFields ) {
xhr[ i ] = s.xhrFields[ i ];
}
}
// Override mime type if needed
if ( s.mimeType && xhr.overrideMimeType ) {
xhr.overrideMimeType( s.mimeType );
}
// X-Requested-With header
// For cross-domain requests, seeing as conditions for a preflight are
// akin to a jigsaw puzzle, we simply never set it to be sure.
// (it can always be set on a per-request basis or even using ajaxSetup)
// For same-domain requests, won't change header if already provided.
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
headers["X-Requested-With"] = "XMLHttpRequest";
}
// Need an extra try/catch for cross domain requests in Firefox 3
try {
for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
}
} catch( err ) {}
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( ( s.hasContent && s.data ) || null );
// Listener
callback = function( _, isAbort ) {
var status, responseHeaders, statusText, responses;
// Firefox throws exceptions when accessing properties
// of an xhr when a network error occurred
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
try {
// Was never called and is aborted or complete
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// Only called once
callback = undefined;
// Do not keep as active anymore
if ( handle ) {
xhr.onreadystatechange = jQuery.noop;
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
}
// If it's an abort
if ( isAbort ) {
// Abort it manually if needed
if ( xhr.readyState !== 4 ) {
xhr.abort();
}
} else {
responses = {};
status = xhr.status;
responseHeaders = xhr.getAllResponseHeaders();
// When requesting binary data, IE6-9 will throw an exception
// on any attempt to access responseText (#11426)
if ( typeof xhr.responseText === "string" ) {
responses.text = xhr.responseText;
}
// Firefox throws an exception when accessing
// statusText for faulty cross-domain requests
try {
statusText = xhr.statusText;
} catch( e ) {
// We normalize with Webkit giving an empty statusText
statusText = "";
}
// Filter status for non standard behaviors
// If the request is local and we have data: assume a success
// (success with no data won't get notified, that's the best we
// can do given current implementations)
if ( !status && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
}
}
}
} catch( firefoxAccessException ) {
if ( !isAbort ) {
complete( -1, firefoxAccessException );
}
}
// Call complete if needed
if ( responses ) {
complete( status, statusText, responses, responseHeaders );
}
};
if ( !s.async ) {
// if we're in sync mode we fire the callback
callback();
} else if ( xhr.readyState === 4 ) {
// (IE6 & IE7) if it's in cache and has been
// retrieved directly we need to fire the callback
setTimeout( callback );
} else {
handle = ++xhrId;
if ( xhrOnUnloadAbort ) {
// Create the active xhrs callbacks list if needed
// and attach the unload handler
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
// Add to list of active xhrs callbacks
xhrCallbacks[ handle ] = callback;
}
xhr.onreadystatechange = callback;
}
},
abort: function() {
if ( callback ) {
callback( undefined, true );
}
}
};
}
});
}
var fxNow, timerId,
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
rrun = /queueHooks$/,
animationPrefilters = [ defaultPrefilter ],
tweeners = {
"*": [function( prop, value ) {
var end, unit,
tween = this.createTween( prop, value ),
parts = rfxnum.exec( value ),
target = tween.cur(),
start = +target || 0,
scale = 1,
maxIterations = 20;
if ( parts ) {
end = +parts[2];
unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
// We need to compute starting value
if ( unit !== "px" && start ) {
// Iteratively approximate from a nonzero starting point
// Prefer the current property, because this process will be trivial if it uses the same units
// Fallback to end or a simple constant
start = jQuery.css( tween.elem, prop, true ) || end || 1;
do {
// If previous iteration zeroed out, double until we get *something*
// Use a string for doubling factor so we don't accidentally see scale as unchanged below
scale = scale || ".5";
// Adjust and apply
start = start / scale;
jQuery.style( tween.elem, prop, start + unit );
// Update scale, tolerating zero or NaN from tween.cur()
// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
}
tween.unit = unit;
tween.start = start;
// If a +=/-= token was provided, we're doing a relative animation
tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
}
return tween;
}]
};
// Animations created synchronously will run synchronously
function createFxNow() {
setTimeout(function() {
fxNow = undefined;
});
return ( fxNow = jQuery.now() );
}
function createTweens( animation, props ) {
jQuery.each( props, function( prop, value ) {
var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
index = 0,
length = collection.length;
for ( ; index < length; index++ ) {
if ( collection[ index ].call( animation, prop, value ) ) {
// we're done with this property
return;
}
}
});
}
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = animationPrefilters.length,
deferred = jQuery.Deferred().always( function() {
// don't match elem in the :animated selector
delete tick.elem;
}),
tick = function() {
if ( stopped ) {
return false;
}
var currentTime = fxNow || createFxNow(),
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
temp = remaining / animation.duration || 0,
percent = 1 - temp,
index = 0,
length = animation.tweens.length;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( percent );
}
deferred.notifyWith( elem, [ animation, percent, remaining ]);
if ( percent < 1 && length ) {
return remaining;
} else {
deferred.resolveWith( elem, [ animation ] );
return false;
}
},
animation = deferred.promise({
elem: elem,
props: jQuery.extend( {}, properties ),
opts: jQuery.extend( true, { specialEasing: {} }, options ),
originalProperties: properties,
originalOptions: options,
startTime: fxNow || createFxNow(),
duration: options.duration,
tweens: [],
createTween: function( prop, end ) {
var tween = jQuery.Tween( elem, animation.opts, prop, end,
animation.opts.specialEasing[ prop ] || animation.opts.easing );
animation.tweens.push( tween );
return tween;
},
stop: function( gotoEnd ) {
var index = 0,
// if we are going to the end, we want to run all the tweens
// otherwise we skip this part
length = gotoEnd ? animation.tweens.length : 0;
if ( stopped ) {
return this;
}
stopped = true;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( 1 );
}
// resolve when we played the last frame
// otherwise, reject
if ( gotoEnd ) {
deferred.resolveWith( elem, [ animation, gotoEnd ] );
} else {
deferred.rejectWith( elem, [ animation, gotoEnd ] );
}
return this;
}
}),
props = animation.props;
propFilter( props, animation.opts.specialEasing );
for ( ; index < length ; index++ ) {
result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
if ( result ) {
return result;
}
}
createTweens( animation, props );
if ( jQuery.isFunction( animation.opts.start ) ) {
animation.opts.start.call( elem, animation );
}
jQuery.fx.timer(
jQuery.extend( tick, {
elem: elem,
anim: animation,
queue: animation.opts.queue
})
);
// attach callbacks from options
return animation.progress( animation.opts.progress )
.done( animation.opts.done, animation.opts.complete )
.fail( animation.opts.fail )
.always( animation.opts.always );
}
function propFilter( props, specialEasing ) {
var value, name, index, easing, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {
name = jQuery.camelCase( index );
easing = specialEasing[ name ];
value = props[ index ];
if ( jQuery.isArray( value ) ) {
easing = value[ 1 ];
value = props[ index ] = value[ 0 ];
}
if ( index !== name ) {
props[ name ] = value;
delete props[ index ];
}
hooks = jQuery.cssHooks[ name ];
if ( hooks && "expand" in hooks ) {
value = hooks.expand( value );
delete props[ name ];
// not quite $.extend, this wont overwrite keys already present.
// also - reusing 'index' from above because we have the correct "name"
for ( index in value ) {
if ( !( index in props ) ) {
props[ index ] = value[ index ];
specialEasing[ index ] = easing;
}
}
} else {
specialEasing[ name ] = easing;
}
}
}
jQuery.Animation = jQuery.extend( Animation, {
tweener: function( props, callback ) {
if ( jQuery.isFunction( props ) ) {
callback = props;
props = [ "*" ];
} else {
props = props.split(" ");
}
var prop,
index = 0,
length = props.length;
for ( ; index < length ; index++ ) {
prop = props[ index ];
tweeners[ prop ] = tweeners[ prop ] || [];
tweeners[ prop ].unshift( callback );
}
},
prefilter: function( callback, prepend ) {
if ( prepend ) {
animationPrefilters.unshift( callback );
} else {
animationPrefilters.push( callback );
}
}
});
function defaultPrefilter( elem, props, opts ) {
/*jshint validthis:true */
var prop, index, length,
value, dataShow, toggle,
tween, hooks, oldfire,
anim = this,
style = elem.style,
orig = {},
handled = [],
hidden = elem.nodeType && isHidden( elem );
// handle queue: false promises
if ( !opts.queue ) {
hooks = jQuery._queueHooks( elem, "fx" );
if ( hooks.unqueued == null ) {
hooks.unqueued = 0;
oldfire = hooks.empty.fire;
hooks.empty.fire = function() {
if ( !hooks.unqueued ) {
oldfire();
}
};
}
hooks.unqueued++;
anim.always(function() {
// doing this makes sure that the complete handler will be called
// before this completes
anim.always(function() {
hooks.unqueued--;
if ( !jQuery.queue( elem, "fx" ).length ) {
hooks.empty.fire();
}
});
});
}
// height/width overflow pass
if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
// Make sure that nothing sneaks out
// Record all 3 overflow attributes because IE does not
// change the overflow attribute when overflowX and
// overflowY are set to the same value
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
// Set display property to inline-block for height/width
// animations on inline elements that are having width/height animated
if ( jQuery.css( elem, "display" ) === "inline" &&
jQuery.css( elem, "float" ) === "none" ) {
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
style.display = "inline-block";
} else {
style.zoom = 1;
}
}
}
if ( opts.overflow ) {
style.overflow = "hidden";
if ( !jQuery.support.shrinkWrapBlocks ) {
anim.always(function() {
style.overflow = opts.overflow[ 0 ];
style.overflowX = opts.overflow[ 1 ];
style.overflowY = opts.overflow[ 2 ];
});
}
}
// show/hide pass
for ( index in props ) {
value = props[ index ];
if ( rfxtypes.exec( value ) ) {
delete props[ index ];
toggle = toggle || value === "toggle";
if ( value === ( hidden ? "hide" : "show" ) ) {
continue;
}
handled.push( index );
}
}
length = handled.length;
if ( length ) {
dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
if ( "hidden" in dataShow ) {
hidden = dataShow.hidden;
}
// store state if its toggle - enables .stop().toggle() to "reverse"
if ( toggle ) {
dataShow.hidden = !hidden;
}
if ( hidden ) {
jQuery( elem ).show();
} else {
anim.done(function() {
jQuery( elem ).hide();
});
}
anim.done(function() {
var prop;
jQuery._removeData( elem, "fxshow" );
for ( prop in orig ) {
jQuery.style( elem, prop, orig[ prop ] );
}
});
for ( index = 0 ; index < length ; index++ ) {
prop = handled[ index ];
tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
if ( !( prop in dataShow ) ) {
dataShow[ prop ] = tween.start;
if ( hidden ) {
tween.end = tween.start;
tween.start = prop === "width" || prop === "height" ? 1 : 0;
}
}
}
}
}
function Tween( elem, options, prop, end, easing ) {
return new Tween.prototype.init( elem, options, prop, end, easing );
}
jQuery.Tween = Tween;
Tween.prototype = {
constructor: Tween,
init: function( elem, options, prop, end, easing, unit ) {
this.elem = elem;
this.prop = prop;
this.easing = easing || "swing";
this.options = options;
this.start = this.now = this.cur();
this.end = end;
this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
},
cur: function() {
var hooks = Tween.propHooks[ this.prop ];
return hooks && hooks.get ?
hooks.get( this ) :
Tween.propHooks._default.get( this );
},
run: function( percent ) {
var eased,
hooks = Tween.propHooks[ this.prop ];
if ( this.options.duration ) {
this.pos = eased = jQuery.easing[ this.easing ](
percent, this.options.duration * percent, 0, 1, this.options.duration
);
} else {
this.pos = eased = percent;
}
this.now = ( this.end - this.start ) * eased + this.start;
if ( this.options.step ) {
this.options.step.call( this.elem, this.now, this );
}
if ( hooks && hooks.set ) {
hooks.set( this );
} else {
Tween.propHooks._default.set( this );
}
return this;
}
};
Tween.prototype.init.prototype = Tween.prototype;
Tween.propHooks = {
_default: {
get: function( tween ) {
var result;
if ( tween.elem[ tween.prop ] != null &&
(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
return tween.elem[ tween.prop ];
}
// passing an empty string as a 3rd parameter to .css will automatically
// attempt a parseFloat and fallback to a string if the parse fails
// so, simple values such as "10px" are parsed to Float.
// complex values such as "rotate(1rad)" are returned as is.
result = jQuery.css( tween.elem, tween.prop, "" );
// Empty strings, null, undefined and "auto" are converted to 0.
return !result || result === "auto" ? 0 : result;
},
set: function( tween ) {
// use step hook for back compat - use cssHook if its there - use .style if its
// available and use plain properties where available
if ( jQuery.fx.step[ tween.prop ] ) {
jQuery.fx.step[ tween.prop ]( tween );
} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
} else {
tween.elem[ tween.prop ] = tween.now;
}
}
}
};
// Remove in 2.0 - this supports IE8's panic based approach
// to setting things on disconnected nodes
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
set: function( tween ) {
if ( tween.elem.nodeType && tween.elem.parentNode ) {
tween.elem[ tween.prop ] = tween.now;
}
}
};
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
var cssFn = jQuery.fn[ name ];
jQuery.fn[ name ] = function( speed, easing, callback ) {
return speed == null || typeof speed === "boolean" ?
cssFn.apply( this, arguments ) :
this.animate( genFx( name, true ), speed, easing, callback );
};
});
jQuery.fn.extend({
fadeTo: function( speed, to, easing, callback ) {
// show any hidden elements after setting opacity to 0
return this.filter( isHidden ).css( "opacity", 0 ).show()
// animate to the value specified
.end().animate({ opacity: to }, speed, easing, callback );
},
animate: function( prop, speed, easing, callback ) {
var empty = jQuery.isEmptyObject( prop ),
optall = jQuery.speed( speed, easing, callback ),
doAnimation = function() {
// Operate on a copy of prop so per-property easing won't be lost
var anim = Animation( this, jQuery.extend( {}, prop ), optall );
doAnimation.finish = function() {
anim.stop( true );
};
// Empty animations, or finishing resolves immediately
if ( empty || jQuery._data( this, "finish" ) ) {
anim.stop( true );
}
};
doAnimation.finish = doAnimation;
return empty || optall.queue === false ?
this.each( doAnimation ) :
this.queue( optall.queue, doAnimation );
},
stop: function( type, clearQueue, gotoEnd ) {
var stopQueue = function( hooks ) {
var stop = hooks.stop;
delete hooks.stop;
stop( gotoEnd );
};
if ( typeof type !== "string" ) {
gotoEnd = clearQueue;
clearQueue = type;
type = undefined;
}
if ( clearQueue && type !== false ) {
this.queue( type || "fx", [] );
}
return this.each(function() {
var dequeue = true,
index = type != null && type + "queueHooks",
timers = jQuery.timers,
data = jQuery._data( this );
if ( index ) {
if ( data[ index ] && data[ index ].stop ) {
stopQueue( data[ index ] );
}
} else {
for ( index in data ) {
if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
stopQueue( data[ index ] );
}
}
}
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
timers[ index ].anim.stop( gotoEnd );
dequeue = false;
timers.splice( index, 1 );
}
}
// start the next in the queue if the last step wasn't forced
// timers currently will call their complete callbacks, which will dequeue
// but only if they were gotoEnd
if ( dequeue || !gotoEnd ) {
jQuery.dequeue( this, type );
}
});
},
finish: function( type ) {
if ( type !== false ) {
type = type || "fx";
}
return this.each(function() {
var index,
data = jQuery._data( this ),
queue = data[ type + "queue" ],
hooks = data[ type + "queueHooks" ],
timers = jQuery.timers,
length = queue ? queue.length : 0;
// enable finishing flag on private data
data.finish = true;
// empty the queue first
jQuery.queue( this, type, [] );
if ( hooks && hooks.cur && hooks.cur.finish ) {
hooks.cur.finish.call( this );
}
// look for any active animations, and finish them
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
timers[ index ].anim.stop( true );
timers.splice( index, 1 );
}
}
// look for any animations in the old queue and finish them
for ( index = 0; index < length; index++ ) {
if ( queue[ index ] && queue[ index ].finish ) {
queue[ index ].finish.call( this );
}
}
// turn off finishing flag
delete data.finish;
});
}
});
// Generate parameters to create a standard animation
function genFx( type, includeWidth ) {
var which,
attrs = { height: type },
i = 0;
// if we include width, step value is 1 to do all cssExpand values,
// if we don't include width, step value is 2 to skip over Left and Right
includeWidth = includeWidth? 1 : 0;
for( ; i < 4 ; i += 2 - includeWidth ) {
which = cssExpand[ i ];
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
}
if ( includeWidth ) {
attrs.opacity = attrs.width = type;
}
return attrs;
}
// Generate shortcuts for custom animations
jQuery.each({
slideDown: genFx("show"),
slideUp: genFx("hide"),
slideToggle: genFx("toggle"),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" },
fadeToggle: { opacity: "toggle" }
}, function( name, props ) {
jQuery.fn[ name ] = function( speed, easing, callback ) {
return this.animate( props, speed, easing, callback );
};
});
jQuery.speed = function( speed, easing, fn ) {
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
};
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
// normalize opt.queue - true/undefined/null -> "fx"
if ( opt.queue == null || opt.queue === true ) {
opt.queue = "fx";
}
// Queueing
opt.old = opt.complete;
opt.complete = function() {
if ( jQuery.isFunction( opt.old ) ) {
opt.old.call( this );
}
if ( opt.queue ) {
jQuery.dequeue( this, opt.queue );
}
};
return opt;
};
jQuery.easing = {
linear: function( p ) {
return p;
},
swing: function( p ) {
return 0.5 - Math.cos( p*Math.PI ) / 2;
}
};
jQuery.timers = [];
jQuery.fx = Tween.prototype.init;
jQuery.fx.tick = function() {
var timer,
timers = jQuery.timers,
i = 0;
fxNow = jQuery.now();
for ( ; i < timers.length; i++ ) {
timer = timers[ i ];
// Checks the timer has not already been removed
if ( !timer() && timers[ i ] === timer ) {
timers.splice( i--, 1 );
}
}
if ( !timers.length ) {
jQuery.fx.stop();
}
fxNow = undefined;
};
jQuery.fx.timer = function( timer ) {
if ( timer() && jQuery.timers.push( timer ) ) {
jQuery.fx.start();
}
};
jQuery.fx.interval = 13;
jQuery.fx.start = function() {
if ( !timerId ) {
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
}
};
jQuery.fx.stop = function() {
clearInterval( timerId );
timerId = null;
};
jQuery.fx.speeds = {
slow: 600,
fast: 200,
// Default speed
_default: 400
};
// Back Compat <1.8 extension point
jQuery.fx.step = {};
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
jQuery.fn.offset = function( options ) {
if ( arguments.length ) {
return options === undefined ?
this :
this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
var docElem, win,
box = { top: 0, left: 0 },
elem = this[ 0 ],
doc = elem && elem.ownerDocument;
if ( !doc ) {
return;
}
docElem = doc.documentElement;
// Make sure it's not a disconnected DOM node
if ( !jQuery.contains( docElem, elem ) ) {
return box;
}
// If we don't have gBCR, just use 0,0 rather than error
// BlackBerry 5, iOS 3 (original iPhone)
if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
box = elem.getBoundingClientRect();
}
win = getWindow( doc );
return {
top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
};
};
jQuery.offset = {
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
var curElem = jQuery( elem ),
curOffset = curElem.offset(),
curCSSTop = jQuery.css( elem, "top" ),
curCSSLeft = jQuery.css( elem, "left" ),
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
props = {}, curPosition = {}, curTop, curLeft;
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
if ( calculatePosition ) {
curPosition = curElem.position();
curTop = curPosition.top;
curLeft = curPosition.left;
} else {
curTop = parseFloat( curCSSTop ) || 0;
curLeft = parseFloat( curCSSLeft ) || 0;
}
if ( jQuery.isFunction( options ) ) {
options = options.call( elem, i, curOffset );
}
if ( options.top != null ) {
props.top = ( options.top - curOffset.top ) + curTop;
}
if ( options.left != null ) {
props.left = ( options.left - curOffset.left ) + curLeft;
}
if ( "using" in options ) {
options.using.call( elem, props );
} else {
curElem.css( props );
}
}
};
jQuery.fn.extend({
position: function() {
if ( !this[ 0 ] ) {
return;
}
var offsetParent, offset,
parentOffset = { top: 0, left: 0 },
elem = this[ 0 ];
// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
if ( jQuery.css( elem, "position" ) === "fixed" ) {
// we assume that getBoundingClientRect is available when computed position is fixed
offset = elem.getBoundingClientRect();
} else {
// Get *real* offsetParent
offsetParent = this.offsetParent();
// Get correct offsets
offset = this.offset();
if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
parentOffset = offsetParent.offset();
}
// Add offsetParent borders
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
}
// Subtract parent offsets and element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// are the same in Safari causing offset.left to incorrectly be 0
return {
top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
};
},
offsetParent: function() {
return this.map(function() {
var offsetParent = this.offsetParent || document.documentElement;
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent || document.documentElement;
});
}
});
// Create scrollLeft and scrollTop methods
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
var top = /Y/.test( prop );
jQuery.fn[ method ] = function( val ) {
return jQuery.access( this, function( elem, method, val ) {
var win = getWindow( elem );
if ( val === undefined ) {
return win ? (prop in win) ? win[ prop ] :
win.document.documentElement[ method ] :
elem[ method ];
}
if ( win ) {
win.scrollTo(
!top ? val : jQuery( win ).scrollLeft(),
top ? val : jQuery( win ).scrollTop()
);
} else {
elem[ method ] = val;
}
}, method, val, arguments.length, null );
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
// margin is only for outerHeight, outerWidth
jQuery.fn[ funcName ] = function( margin, value ) {
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
return jQuery.access( this, function( elem, type, value ) {
var doc;
if ( jQuery.isWindow( elem ) ) {
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
// isn't a whole lot we can do. See pull request at this URL for discussion:
// https://github.com/jquery/jquery/pull/764
return elem.document.documentElement[ "client" + name ];
}
// Get document width or height
if ( elem.nodeType === 9 ) {
doc = elem.documentElement;
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
return Math.max(
elem.body[ "scroll" + name ], doc[ "scroll" + name ],
elem.body[ "offset" + name ], doc[ "offset" + name ],
doc[ "client" + name ]
);
}
return value === undefined ?
// Get width or height on the element, requesting but not forcing parseFloat
jQuery.css( elem, type, extra ) :
// Set width or height on the element
jQuery.style( elem, type, value, extra );
}, type, chainable ? margin : undefined, chainable, null );
};
});
});
// Limit scope pollution from any deprecated API
// (function() {
// })();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
// in a page that all might call define(). The loader will indicate
// they have special allowances for multiple jQuery versions by
// specifying define.amd.jQuery = true. Register as a named module,
// since jQuery can be concatenated with other files that may use define,
// but not use a proper concatenation script that understands anonymous
// AMD modules. A named AMD is safest and most robust way to register.
// Lowercase jquery is used because AMD module names are derived from
// file names, and jQuery is normally delivered in a lowercase file name.
// Do this after creating the global so that if an AMD module wants to call
// noConflict to hide this version of jQuery, it will work.
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
define( "jquery", [], function () { return jQuery; } );
}
})( window );
|
packages/wix-style-react/src/Themes/editorX/icons/Close.js | wix/wix-style-react | import React from 'react';
export default ({ className }) => (
<svg
xmlns="http://www.w3.org/2000/svg"
fill="currentcolor"
viewBox="0 0 15 15"
width="12"
height="12"
className={className}
>
<polygon points="13.5 2.914 12.086 1.5 7.5 6.086 2.914 1.5 1.5 2.914 6.086 7.5 1.5 12.086 2.914 13.5 7.5 8.914 12.086 13.5 13.5 12.086 8.914 7.5" />
</svg>
);
|
tests/layouts/CoreLayout.spec.js | juanda99/react-redux-material-ui | import React from 'react'
import TestUtils from 'react-addons-test-utils'
import CoreLayout from 'layouts/CoreLayout/CoreLayout'
function shallowRender (component) {
const renderer = TestUtils.createRenderer()
renderer.render(component)
return renderer.getRenderOutput()
}
function shallowRenderWithProps (props = {}) {
return shallowRender(<CoreLayout {...props} />)
}
describe('(Layout) Core', function () {
let _component
let _props
let _child
beforeEach(function () {
_child = <h1 className='child'>Child</h1>
_props = {
children: _child
}
_component = shallowRenderWithProps(_props)
})
it('Should render as a <div>.', function () {
expect(_component.type).to.equal('div')
})
})
|
monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOnIslandButton.js | guardicore/monkey | import React from 'react';
import {Button, Col, Row} from 'react-bootstrap';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {faCheck} from '@fortawesome/free-solid-svg-icons/faCheck';
import {faSync} from '@fortawesome/free-solid-svg-icons/faSync';
import AuthComponent from '../../AuthComponent';
import IslandMonkeyRunErrorModal from '../../ui-components/IslandMonkeyRunErrorModal';
import '../../../styles/components/RunOnIslandButton.scss';
import {faTimes} from '@fortawesome/free-solid-svg-icons';
const MONKEY_STATES = {
RUNNING: 'running',
NOT_RUNNING: 'not_running',
STARTING: 'starting',
FAILED: 'failed'
}
class RunOnIslandButton extends AuthComponent {
constructor(props) {
super(props);
this.state = {
runningOnIslandState: MONKEY_STATES.NOT_RUNNING,
showModal: false,
errorDetails: ''
};
this.closeModal = this.closeModal.bind(this);
}
componentDidMount() {
this.authFetch('/api/local-monkey')
.then(res => res.json())
.then(res => {
if (res['is_running']) {
this.setState({runningOnIslandState: MONKEY_STATES.RUNNING});
} else {
this.setState({runningOnIslandState: MONKEY_STATES.NOT_RUNNING});
}
});
}
runIslandMonkey = () => {
this.setState({runningOnIslandState: MONKEY_STATES.STARTING}, this.sendRunMonkeyRequest)
};
sendRunMonkeyRequest() {
this.authFetch('/api/local-monkey',
{
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({action: 'run'})
})
.then(res => res.json())
.then(async res => {
if (res['is_running']) {
await new Promise(r => setTimeout(r, 1000));
this.setState({
runningOnIslandState: MONKEY_STATES.RUNNING
});
} else {
/* If Monkey binaries are missing, change the state accordingly */
if (res['error_text'] !== '') {
this.setState({
showModal: true,
errorDetails: res['error_text'],
runningOnIslandState: MONKEY_STATES.FAILED
}
);
}
}
});
}
closeModal = () => {
this.setState({
showModal: false
})
};
getMonkeyRunStateIcon = () => {
if (this.state.runningOnIslandState === MONKEY_STATES.RUNNING) {
return (<FontAwesomeIcon icon={faCheck}
className={`monkey-on-island-run-state-icon text-success`}/>)
} else if (this.state.runningOnIslandState === MONKEY_STATES.STARTING) {
return (<FontAwesomeIcon icon={faSync}
className={`monkey-on-island-run-state-icon text-success spinning-icon`}/>)
} else if (this.state.runningOnIslandState === MONKEY_STATES.FAILED) {
return (<FontAwesomeIcon icon={faTimes}
className={`monkey-on-island-run-state-icon text-danger`}/>)
} else {
return '';
}
}
render() {
let description = this.props.description !== undefined ? (<p>{this.props.description}</p>) : ''
let icon = this.props.icon !== undefined ? (<FontAwesomeIcon icon={this.props.icon}/>) : ''
return (
<Row>
<Col>
<IslandMonkeyRunErrorModal
showModal={this.state.showModal}
onClose={this.closeModal}
errorDetails={this.state.errorDetails}/>
<Button variant={'outline-monkey'} size='lg' className={'selection-button'}
onClick={this.runIslandMonkey}>
{icon}
<h1>{this.props.title}</h1>
{description}
{this.getMonkeyRunStateIcon()}
</Button>
</Col>
</Row>
);
}
}
export default RunOnIslandButton;
|
fixtures/fiber-debugger/src/Fibers.js | roth1002/react | import React from 'react';
import {Motion, spring} from 'react-motion';
import dagre from 'dagre';
// import prettyFormat from 'pretty-format';
// import reactElement from 'pretty-format/plugins/ReactElement';
function getFiberColor(fibers, id) {
if (fibers.currentIDs.indexOf(id) > -1) {
return 'lightgreen';
}
if (id === fibers.workInProgressID) {
return 'yellow';
}
return 'lightyellow';
}
function Graph(props) {
const {rankdir, trackActive} = props.settings;
var g = new dagre.graphlib.Graph();
g.setGraph({
width: 1000,
height: 1000,
nodesep: 50,
edgesep: 150,
ranksep: 100,
marginx: 100,
marginy: 100,
rankdir,
});
var edgeLabels = {};
React.Children.forEach(props.children, function(child) {
if (!child) {
return;
}
if (child.type.isVertex) {
g.setNode(child.key, {
label: child,
width: child.props.width,
height: child.props.height,
});
} else if (child.type.isEdge) {
const relationshipKey = child.props.source + ':' + child.props.target;
if (!edgeLabels[relationshipKey]) {
edgeLabels[relationshipKey] = [];
}
edgeLabels[relationshipKey].push(child);
}
});
Object.keys(edgeLabels).forEach(key => {
const children = edgeLabels[key];
const child = children[0];
g.setEdge(child.props.source, child.props.target, {
label: child,
allChildren: children.map(c => c.props.children),
weight: child.props.weight,
});
});
dagre.layout(g);
var activeNode = g
.nodes()
.map(v => g.node(v))
.find(node => node.label.props.isActive);
const [winX, winY] = [window.innerWidth / 2, window.innerHeight / 2];
var focusDx = trackActive && activeNode ? winX - activeNode.x : 0;
var focusDy = trackActive && activeNode ? winY - activeNode.y : 0;
var nodes = g.nodes().map(v => {
var node = g.node(v);
return (
<Motion
style={{
x: props.isDragging ? node.x + focusDx : spring(node.x + focusDx),
y: props.isDragging ? node.y + focusDy : spring(node.y + focusDy),
}}
key={node.label.key}>
{interpolatingStyle =>
React.cloneElement(node.label, {
x: interpolatingStyle.x + props.dx,
y: interpolatingStyle.y + props.dy,
vanillaX: node.x,
vanillaY: node.y,
})
}
</Motion>
);
});
var edges = g.edges().map(e => {
var edge = g.edge(e);
let idx = 0;
return (
<Motion
style={edge.points.reduce((bag, point) => {
bag[idx + ':x'] = props.isDragging
? point.x + focusDx
: spring(point.x + focusDx);
bag[idx + ':y'] = props.isDragging
? point.y + focusDy
: spring(point.y + focusDy);
idx++;
return bag;
}, {})}
key={edge.label.key}>
{interpolatedStyle => {
let points = [];
Object.keys(interpolatedStyle).forEach(key => {
const [idx, prop] = key.split(':');
if (!points[idx]) {
points[idx] = {x: props.dx, y: props.dy};
}
points[idx][prop] += interpolatedStyle[key];
});
return React.cloneElement(edge.label, {
points,
id: edge.label.key,
children: edge.allChildren.join(', '),
});
}}
</Motion>
);
});
return (
<div
style={{
position: 'relative',
height: '100%',
}}>
{edges}
{nodes}
</div>
);
}
function Vertex(props) {
if (Number.isNaN(props.x) || Number.isNaN(props.y)) {
return null;
}
return (
<div
style={{
position: 'absolute',
border: '1px solid black',
left: props.x - props.width / 2,
top: props.y - props.height / 2,
width: props.width,
height: props.height,
overflow: 'hidden',
padding: '4px',
wordWrap: 'break-word',
}}>
{props.children}
</div>
);
}
Vertex.isVertex = true;
const strokes = {
alt: 'blue',
child: 'green',
sibling: 'darkgreen',
return: 'red',
fx: 'purple',
};
function Edge(props) {
var points = props.points;
var path = 'M' + points[0].x + ' ' + points[0].y + ' ';
if (!points[0].x || !points[0].y) {
return null;
}
for (var i = 1; i < points.length; i++) {
path += 'L' + points[i].x + ' ' + points[i].y + ' ';
if (!points[i].x || !points[i].y) {
return null;
}
}
var lineID = props.id;
return (
<svg
width="100%"
height="100%"
style={{
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0,
}}>
<defs>
<path d={path} id={lineID} />
<marker
id="markerCircle"
markerWidth="8"
markerHeight="8"
refX="5"
refY="5">
<circle cx="5" cy="5" r="3" style={{stroke: 'none', fill: 'black'}} />
</marker>
<marker
id="markerArrow"
markerWidth="13"
markerHeight="13"
refX="2"
refY="6"
orient="auto">
<path d="M2,2 L2,11 L10,6 L2,2" style={{fill: 'black'}} />
</marker>
</defs>
<use
xlinkHref={`#${lineID}`}
fill="none"
stroke={strokes[props.kind]}
style={{
markerStart: 'url(#markerCircle)',
markerEnd: 'url(#markerArrow)',
}}
/>
<text>
<textPath xlinkHref={`#${lineID}`}>
{' '}
{props.children}
</textPath>
</text>
</svg>
);
}
Edge.isEdge = true;
function formatPriority(priority) {
switch (priority) {
case 1:
return 'synchronous';
case 2:
return 'task';
case 3:
return 'hi-pri work';
case 4:
return 'lo-pri work';
case 5:
return 'offscreen work';
default:
throw new Error('Unknown priority.');
}
}
export default function Fibers({fibers, show, graphSettings, ...rest}) {
const items = Object.keys(fibers.descriptions).map(
id => fibers.descriptions[id]
);
const isDragging = rest.className.indexOf('dragging') > -1;
const [_, sdx, sdy] =
rest.style.transform.match(/translate\((-?\d+)px,(-?\d+)px\)/) || [];
const dx = Number(sdx);
const dy = Number(sdy);
return (
<div
{...rest}
style={{
width: '100%',
height: '100%',
position: 'absolute',
top: 0,
left: 0,
...rest.style,
transform: null,
}}>
<Graph
className="graph"
dx={dx}
dy={dy}
isDragging={isDragging}
settings={graphSettings}>
{items.map(fiber => [
<Vertex
key={fiber.id}
width={150}
height={100}
isActive={fiber.id === fibers.workInProgressID}>
<div
style={{
width: '100%',
height: '100%',
backgroundColor: getFiberColor(fibers, fiber.id),
}}
title={
/*prettyFormat(fiber, { plugins: [reactElement ]})*/
'todo: this was hanging last time I tried to pretty print'
}>
<small>
{fiber.tag} #{fiber.id}
</small>
<br />
{fiber.type}
<br />
{fibers.currentIDs.indexOf(fiber.id) === -1 ? (
<small>
{fiber.pendingWorkPriority !== 0 && [
<span key="span">
Needs: {formatPriority(fiber.pendingWorkPriority)}
</span>,
<br key="br" />,
]}
{fiber.memoizedProps !== null &&
fiber.pendingProps !== null && [
fiber.memoizedProps === fiber.pendingProps
? 'Can reuse memoized.'
: 'Cannot reuse memoized.',
<br key="br" />,
]}
</small>
) : (
<small>Committed</small>
)}
{fiber.effectTag && [
<br key="br" />,
<small key="small">Effect: {fiber.effectTag}</small>,
]}
</div>
</Vertex>,
fiber.child &&
show.child && (
<Edge
source={fiber.id}
target={fiber.child}
kind="child"
weight={1000}
key={`${fiber.id}-${fiber.child}-child`}>
child
</Edge>
),
fiber.sibling &&
show.sibling && (
<Edge
source={fiber.id}
target={fiber.sibling}
kind="sibling"
weight={2000}
key={`${fiber.id}-${fiber.sibling}-sibling`}>
sibling
</Edge>
),
fiber.return &&
show.return && (
<Edge
source={fiber.id}
target={fiber.return}
kind="return"
weight={1000}
key={`${fiber.id}-${fiber.return}-return`}>
return
</Edge>
),
fiber.nextEffect &&
show.fx && (
<Edge
source={fiber.id}
target={fiber.nextEffect}
kind="fx"
weight={100}
key={`${fiber.id}-${fiber.nextEffect}-nextEffect`}>
nextFx
</Edge>
),
fiber.firstEffect &&
show.fx && (
<Edge
source={fiber.id}
target={fiber.firstEffect}
kind="fx"
weight={100}
key={`${fiber.id}-${fiber.firstEffect}-firstEffect`}>
firstFx
</Edge>
),
fiber.lastEffect &&
show.fx && (
<Edge
source={fiber.id}
target={fiber.lastEffect}
kind="fx"
weight={100}
key={`${fiber.id}-${fiber.lastEffect}-lastEffect`}>
lastFx
</Edge>
),
fiber.alternate &&
show.alt && (
<Edge
source={fiber.id}
target={fiber.alternate}
kind="alt"
weight={10}
key={`${fiber.id}-${fiber.alternate}-alt`}>
alt
</Edge>
),
])}
</Graph>
</div>
);
}
|
ajax/libs/yui/3.9.0pr3/event-focus/event-focus-min.js | WebReflection/cdnjs | YUI.add("event-focus",function(e,t){function u(t,r,u){var a="_"+t+"Notifiers";e.Event.define(t,{_useActivate:o,_attach:function(i,s,o){return e.DOM.isWindow(i)?n._attach([t,function(e){s.fire(e)},i]):n._attach([r,this._proxy,i,this,s,o],{capture:!0})},_proxy:function(t,r,i){var s=t.target,f=t.currentTarget,l=s.getData(a),c=e.stamp(f._node),h=o||s!==f,p;r.currentTarget=i?s:f,r.container=i?f:null,l?h=!0:(l={},s.setData(a,l),h&&(p=n._attach([u,this._notify,s._node]).sub,p.once=!0)),l[c]||(l[c]=[]),l[c].push(r),h||this._notify(t)},_notify:function(t,n){var r=t.currentTarget,i=r.getData(a),o=r.ancestors(),u=r.get("ownerDocument"),f=[],l=i?e.Object.keys(i).length:0,c,h,p,d,v,m,g,y,b,w;r.clearData(a),o.push(r),u&&o.unshift(u),o._nodes.reverse(),l&&(m=l,o.some(function(t){var n=e.stamp(t),r=i[n],s,o;if(r){l--;for(s=0,o=r.length;s<o;++s)r[s].handle.sub.filter&&f.push(r[s])}return!l}),l=m);while(l&&(c=o.shift())){d=e.stamp(c),h=i[d];if(h){for(g=0,y=h.length;g<y;++g){p=h[g],b=p.handle.sub,v=!0,t.currentTarget=c,b.filter&&(v=b.filter.apply(c,[c,t].concat(b.args||[])),f.splice(s(f,p),1)),v&&(t.container=p.container,w=p.fire(t));if(w===!1||t.stopped===2)break}delete h[d],l--}if(t.stopped!==2)for(g=0,y=f.length;g<y;++g){p=f[g],b=p.handle.sub,b.filter.apply(c,[c,t].concat(b.args||[]))&&(t.container=p.container,t.currentTarget=c,w=p.fire(t));if(w===!1||t.stopped===2)break}if(t.stopped)break}},on:function(e,t,n){t.handle=this._attach(e._node,n)},detach:function(e,t){t.handle.detach()},delegate:function(t,n,r,s){i(s)&&(n.filter=function(n){return e.Selector.test(n._node,s,t===n?null:t._node)}),n.handle=this._attach(t._node,r,!0)},detachDelegate:function(e,t){t.handle.detach()}},!0)}var n=e.Event,r=e.Lang,i=r.isString,s=e.Array.indexOf,o=function(){var t=!1,n=e.config.doc,r;return n&&(r=n.createElement("p"),r.setAttribute("onbeforeactivate",";"),t=r.onbeforeactivate!==undefined),t}();o?(u("focus","beforeactivate","focusin"),u("blur","beforedeactivate","focusout")):(u("focus","focus","focus"),u("blur","blur","blur"))},"@VERSION@",{requires:["event-synthetic"]});
|
src/main/webapp/swagger/swagger-ui-standalone-preset.js | systelab/seed-jee | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e():t.SwaggerUIStandalonePreset=e()}(this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist",n(n.s=206)}([function(t,e,n){"use strict";var r=n(52),i=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];t.exports=function(t,e){var n,u;if(e=e||{},Object.keys(e).forEach(function(e){if(-1===i.indexOf(e))throw new r('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(n=e.styleAliases||null,u={},null!==n&&Object.keys(n).forEach(function(t){n[t].forEach(function(e){u[String(e)]=t})}),u),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},function(t,e,n){var r=n(133)("wks"),i=n(98),o=n(5).Symbol,u="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=r},function(t,e){var n=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(5),i=n(19),o=n(17),u=n(30),a=n(60),s=function(t,e,n){var c,f,l,p,h=t&s.F,d=t&s.G,v=t&s.S,y=t&s.P,g=t&s.B,m=d?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,_=d?i:i[e]||(i[e]={}),b=_.prototype||(_.prototype={});for(c in d&&(n=e),n)l=((f=!h&&m&&void 0!==m[c])?m:n)[c],p=g&&f?a(l,r):y&&"function"==typeof l?a(Function.call,l):l,m&&u(m,c,l,t&s.U),_[c]!=l&&o(_,c,p),y&&b[c]!=l&&(b[c]=l)};r.core=i,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,n){var r=n(3),i=n(43),o=n(10),u=/"/g,a=function(t,e,n,r){var i=String(o(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(r).replace(u,""")+'"'),a+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(a),r(r.P+r.F*i(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",n)}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(93)("wks"),i=n(55),o=n(9).Symbol,u="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(169),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,n){var r=n(9),i=n(2),o=n(126),u=n(26),a=n(16),s=function(t,e,n){var c,f,l,p=t&s.F,h=t&s.G,d=t&s.S,v=t&s.P,y=t&s.B,g=t&s.W,m=h?i:i[e]||(i[e]={}),_=m.prototype,b=h?r:d?r[e]:(r[e]||{}).prototype;for(c in h&&(n=e),n)(f=!p&&b&&void 0!==b[c])&&a(m,c)||(l=f?b[c]:n[c],m[c]=h&&"function"!=typeof b[c]?n[c]:y&&f?o(l,r):g&&b[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((m.virtual||(m.virtual={}))[c]=l,t&s.R&&_&&!_[c]&&u(_,c,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,n){var r=n(27),i=n(127),o=n(89),u=Object.defineProperty;e.f=n(15)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(29)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(57),i=n(134);t.exports=n(42)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(31);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";var r=function(t){};t.exports=function(t,e,n,i,o,u,a,s){if(r(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,i,o,u,a,s],l=0;(c=new Error(e.replace(/%s/g,function(){return f[l++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(t,e,n){"use strict";var r=n(79),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=l;var o=n(51);o.inherits=n(35);var u=n(187),a=n(117);o.inherits(l,u);for(var s=i(a.prototype),c=0;c<s.length;c++){var f=s[c];l.prototype[f]||(l.prototype[f]=a.prototype[f])}function l(t){if(!(this instanceof l))return new l(t);u.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",p)}function p(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),l.prototype._destroy=function(t,e){this.push(null),this.end(),r.nextTick(e,t)}},function(t,e,n){"use strict";var r=n(194)();t.exports=function(t){return t!==r&&null!==t}},function(t,e,n){"use strict";var r=n(464),i=Math.max;t.exports=function(t){return i(0,r(t))}},function(t,e,n){"use strict"},function(t,e,n){var r=n(124),i=n(87);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(14),i=n(54);t.exports=n(15)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(28);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(5),i=n(17),o=n(58),u=n(98)("src"),a=Function.toString,s=(""+a).split("toString");n(19).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(c&&(o(n,u)||i(n,u,t[e]?""+t[e]:s.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[u]||a.call(this)})},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";var r=n(46),i=n(162),o=(n(66),n(160),Object.prototype.hasOwnProperty),u=n(163),a={key:!0,ref:!0,__self:!0,__source:!0};function s(t){return void 0!==t.ref}function c(t){return void 0!==t.key}var f=function(t,e,n,r,i,o,a){var s={$$typeof:u,type:t,key:e,ref:n,props:a,_owner:o};return s};f.createElement=function(t,e,n){var r,u={},l=null,p=null;if(null!=e)for(r in s(e)&&(p=e.ref),c(e)&&(l=""+e.key),void 0===e.__self?null:e.__self,void 0===e.__source?null:e.__source,e)o.call(e,r)&&!a.hasOwnProperty(r)&&(u[r]=e[r]);var h=arguments.length-2;if(1===h)u.children=n;else if(h>1){for(var d=Array(h),v=0;v<h;v++)d[v]=arguments[v+2];0,u.children=d}if(t&&t.defaultProps){var y=t.defaultProps;for(r in y)void 0===u[r]&&(u[r]=y[r])}return f(t,l,p,0,0,i.current,u)},f.createFactory=function(t){var e=f.createElement.bind(null,t);return e.type=t,e},f.cloneAndReplaceKey=function(t,e){return f(t.type,e,t.ref,t._self,t._source,t._owner,t.props)},f.cloneElement=function(t,e,n){var u,l,p=r({},t.props),h=t.key,d=t.ref,v=(t._self,t._source,t._owner);if(null!=e)for(u in s(e)&&(d=e.ref,v=i.current),c(e)&&(h=""+e.key),t.type&&t.type.defaultProps&&(l=t.type.defaultProps),e)o.call(e,u)&&!a.hasOwnProperty(u)&&(void 0===e[u]&&void 0!==l?p[u]=l[u]:p[u]=e[u]);var y=arguments.length-2;if(1===y)p.children=n;else if(y>1){for(var g=Array(y),m=0;m<y;m++)g[m]=arguments[m+2];p.children=g}return f(t.type,h,d,0,0,v,p)},f.isValidElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===u},t.exports=f},function(t,e,n){var r=n(365),i=n(368);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var s,c=[],f=!1,l=-1;function p(){f&&s&&(f=!1,s.length?c=s.concat(c):l=-1,c.length&&h())}function h(){if(!f){var t=a(p);f=!0;for(var e=c.length;e;){for(s=c,c=[];++l<e;)s&&s[l].run();l=-1,e=c.length}s=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||f||a(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";var r=n(22);t.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){"use strict";function r(t){return void 0===t||null===t}t.exports.isNothing=r,t.exports.isObject=function(t){return"object"==typeof t&&null!==t},t.exports.toArray=function(t){return Array.isArray(t)?t:r(t)?[]:[t]},t.exports.repeat=function(t,e){var n,r="";for(n=0;n<e;n+=1)r+=t;return r},t.exports.isNegativeZero=function(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t},t.exports.extend=function(t,e){var n,r,i,o;if(e)for(n=0,r=(o=Object.keys(e)).length;n<r;n+=1)t[i=o[n]]=e[i];return t}},function(t,e,n){"use strict";var r=n(37),i=n(52),o=n(0);function u(t,e,n){var r=[];return t.include.forEach(function(t){n=u(t,e,n)}),t[e].forEach(function(t){n.forEach(function(e,n){e.tag===t.tag&&e.kind===t.kind&&r.push(n)}),n.push(t)}),n.filter(function(t,e){return-1===r.indexOf(e)})}function a(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&"scalar"!==t.loadKind)throw new i("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=u(this,"implicit",[]),this.compiledExplicit=u(this,"explicit",[]),this.compiledTypeMap=function(){var t,e,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(t){n[t.kind][t.tag]=n.fallback[t.tag]=t}for(t=0,e=arguments.length;t<e;t+=1)arguments[t].forEach(r);return n}(this.compiledImplicit,this.compiledExplicit)}a.DEFAULT=null,a.create=function(){var t,e;switch(arguments.length){case 1:t=a.DEFAULT,e=arguments[0];break;case 2:t=arguments[0],e=arguments[1];break;default:throw new i("Wrong number of arguments for Schema.create function")}if(t=r.toArray(t),e=r.toArray(e),!t.every(function(t){return t instanceof a}))throw new i("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!e.every(function(t){return t instanceof o}))throw new i("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new a({include:t,explicit:e})},t.exports=a},function(t,e){t.exports={}},function(t,e,n){var r=n(130),i=n(94);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){t.exports=!n(43)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports={}},function(t,e,n){var r=n(59),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,u,a=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),s=1;s<arguments.length;s++){for(var c in n=Object(arguments[s]))i.call(n,c)&&(a[c]=n[c]);if(r){u=r(n);for(var f=0;f<u.length;f++)o.call(n,u[f])&&(a[u[f]]=n[u[f]])}}return a}},function(t,e,n){var r=n(343);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(69),i=n(345),o=n(346),u="[object Null]",a="[object Undefined]",s=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?a:u:s&&s in Object(t)?i(t):o(t)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){(function(t){function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===n(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===n(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===n(t)},e.isError=function(t){return"[object Error]"===n(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(e,n(68).Buffer)},function(t,e,n){"use strict";function r(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(t){var e=this.name+": ";return e+=this.reason||"(unknown reason)",!t&&this.mark&&(e+=" "+this.mark.toString()),e},t.exports=r},function(t,e,n){"use strict";var r=n(38);t.exports=new r({include:[n(202)],implicit:[n(531),n(532)],explicit:[n(533),n(534),n(535),n(536)]})},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(87);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(18),i=n(224),o=n(225),u=Object.defineProperty;e.f=n(42)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(61);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(230),i=n(10);t.exports=function(t){return r(i(t))}},function(t,e,n){"use strict";var r=n(17),i=n(30),o=n(43),u=n(10),a=n(1);t.exports=function(t,e,n){var s=a(t),c=n(u,s,""[t]),f=c[0],l=c[1];o(function(){var e={};return e[s]=function(){return 7},7!=""[t](e)})&&(i(String.prototype,t,f),r(RegExp.prototype,s,2==e?function(t,e){return l.call(t,this,e)}:function(t){return l.call(t,this)}))}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";t.exports=function(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var i=new Error(n);throw i.name="Invariant Violation",i.framesToPop=1,i}},function(t,e,n){"use strict";var r=n(67);t.exports=r},function(t,e,n){"use strict";function r(t){return function(){return t}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(t){return t},t.exports=i},function(t,e,n){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org>
* @license MIT
*/
var r=n(325),i=n(326),o=n(167);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(u()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,n){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=p(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=a(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(s.isBuffer(e)){var n=0|h(e.length);return 0===(t=a(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):p(t,e);if("Buffer"===e.type&&o(e.data))return p(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(f(e),t=a(t,e<0?0:0|h(e)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function p(t,e){var n=e.length<0?0:0|h(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function h(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(t).length;default:if(r)return U(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function y(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=s.from(e,r)),s.isBuffer(e))return 0===e.length?-1:g(t,e,n,r,i);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):g(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,n,r,i){var o,u=1,a=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,n/=2}function c(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(i){var f=-1;for(o=n;o<a;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===s)return f*u}else-1!==f&&(o-=o-f),f=-1}else for(n+s>a&&(n=a-s),o=n;o>=0;o--){for(var l=!0,p=0;p<s;p++)if(c(t,o+p)!==c(e,p)){l=!1;break}if(l)return o}return-1}function m(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var u=0;u<r;++u){var a=parseInt(e.substr(2*u,2),16);if(isNaN(a))return u;t[n+u]=a}return u}function _(t,e,n,r){return q(U(e,t.length-n),t,n,r)}function b(t,e,n,r){return q(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function w(t,e,n,r){return b(t,e,n,r)}function x(t,e,n,r){return q(B(e),t,n,r)}function S(t,e,n,r){return q(function(t,e){for(var n,r,i,o=[],u=0;u<t.length&&!((e-=2)<0);++u)n=t.charCodeAt(u),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function E(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function A(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,u,a,s,c=t[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&c)<<6|63&o)>127&&(f=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&c)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(f=s);break;case 4:o=t[i+1],u=t[i+2],a=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&a)&&(s=(15&c)<<18|(63&o)<<12|(63&u)<<6|63&a)>65535&&s<1114112&&(f=s)}null===f?(f=65533,l=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=l}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=O));return n}(r)}e.Buffer=s,e.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},e.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,n){return c(null,t,e,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,n){return function(t,e,n,r){return f(e),e<=0?a(t,e):void 0!==n?"string"==typeof r?a(t,e).fill(n,r):a(t,e).fill(n):a(t,e)}(null,t,e,n)},s.allocUnsafe=function(t){return l(null,t)},s.allocUnsafeSlow=function(t){return l(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=s.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var u=t[n];if(!s.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(r,i),i+=u.length}return r},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):function(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,n);case"utf8":case"utf-8":return A(this,e,n);case"ascii":return j(this,e,n);case"latin1":case"binary":return k(this,e,n);case"base64":return E(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,n,r,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,u=n-e,a=Math.min(o,u),c=this.slice(r,i),f=t.slice(e,n),l=0;l<a;++l)if(c[l]!==f[l]){o=c[l],u=f[l];break}return o<u?-1:u<o?1:0},s.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},s.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},s.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},s.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return m(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return x(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function j(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function k(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function I(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=F(t[o]);return i}function M(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function T(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,n,r,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function P(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function R(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function N(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,r,o){return o||N(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function D(t,e,n,r,o){return o||N(t,0,n,8),i.write(t,e,n,r,52,8),n+8}s.prototype.slice=function(t,e){var n,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),s.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=s.prototype;else{var i=e-t;n=new s(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},s.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},s.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},s.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},s.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||C(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},s.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||C(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},s.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=0,u=1,a=0;for(this[e]=255&t;++o<n&&(u*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+n},s.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=n-1,u=1,a=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},s.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var u=s.isBuffer(t)?t:U(new s(t,r).toString()),a=u.length;for(o=0;o<n-e;++o)this[o+e]=u[o%a]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function F(t){return t<16?"0"+t.toString(16):t.toString(16)}function U(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],u=0;u<r;++u){if((n=t.charCodeAt(u))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function B(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(e,n(11))},function(t,e,n){var r=n(7).Symbol;t.exports=r},function(t,e,n){var r=n(48),i=n(49),o="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||i(t)&&r(t)==o}},function(t,e,n){var r=n(33)(Object,"create");t.exports=r},function(t,e,n){var r=n(373),i=n(374),o=n(375),u=n(376),a=n(377);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=u,s.prototype.set=a,t.exports=s},function(t,e,n){var r=n(74);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(379);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(408),i=n(415),o=n(77);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e,n){var r=n(173),i=n(113);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){var r=n(70),i=1/0;t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e}},function(t,e,n){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,u,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,i)});default:for(o=new Array(a-1),u=0;u<o.length;)o[u++]=arguments[u];return e.nextTick(function(){t.apply(null,o)})}}}:t.exports=e}).call(e,n(34))},function(t,e,n){var r=n(68),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function u(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=u),o(i,u),u.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},u.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},u.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},u.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,n){"use strict";t.exports=n(469)("forEach")},function(t,e,n){"use strict";var r=n(196),i=n(193),o=n(118),u=n(478);(t.exports=function(t,e){var n,o,a,s,c;return arguments.length<2||"string"!=typeof t?(s=e,e=t,t=null):s=arguments[2],null==t?(n=a=!0,o=!1):(n=u.call(t,"c"),o=u.call(t,"e"),a=u.call(t,"w")),c={value:e,configurable:n,enumerable:o,writable:a},s?r(i(s),c):c}).gs=function(t,e,n){var a,s,c,f;return"string"!=typeof t?(c=n,n=e,e=t,t=null):c=arguments[3],null==e?e=void 0:o(e)?null==n?n=void 0:o(n)||(c=n,n=void 0):(c=e,e=n=void 0),null==t?(a=!0,s=!1):(a=u.call(t,"c"),s=u.call(t,"e")),f={get:e,set:n,configurable:a,enumerable:s},c?r(i(c),f):f}},function(t,e,n){"use strict";var r=n(38);t.exports=r.DEFAULT=new r({include:[n(53)],explicit:[n(537),n(538),n(539)]})},function(t,e,n){t.exports={default:n(208),__esModule:!0}},function(t,e,n){n(209);for(var r=n(9),i=n(26),o=n(39),u=n(6)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s<a.length;s++){var c=a[s],f=r[c],l=f&&f.prototype;l&&!l[u]&&i(l,u,c),o[c]=o.Array}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=!0},function(t,e,n){var r=n(28);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(27),i=n(214),o=n(94),u=n(92)("IE_PROTO"),a=function(){},s=function(){var t,e=n(128)("iframe"),r=o.length;for(e.style.display="none",n(218).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s.prototype[o[r]];return s()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[u]=t):n=s(),void 0===e?n:i(n,e)}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(93)("keys"),i=n(55);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(9),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(14).f,i=n(16),o=n(6)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){"use strict";var r=n(219)(!0);n(125)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var r=n(41),i=n(1)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(u=r(e))&&"function"==typeof e.callee?"Arguments":u}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(31),i=n(5).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){var r=n(133)("keys"),i=n(98);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(57).f,i=n(58),o=n(1)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){"use strict";var r=n(61);t.exports.f=function(t){return new function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)}(t)}},function(t,e,n){var r=n(147),i=n(10);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},function(t,e,n){var r=n(1)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){"use strict";e.__esModule=!0;var r=u(n(286)),i=u(n(288)),o="function"==typeof i.default&&"symbol"==typeof r.default?function(t){return typeof t}:function(t){return t&&"function"==typeof i.default&&t.constructor===i.default&&t!==i.default.prototype?"symbol":typeof t};function u(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof i.default&&"symbol"===o(r.default)?function(t){return void 0===t?"undefined":o(t)}:function(t){return t&&"function"==typeof i.default&&t.constructor===i.default&&t!==i.default.prototype?"symbol":void 0===t?"undefined":o(t)}},function(t,e,n){e.f=n(6)},function(t,e,n){var r=n(9),i=n(2),o=n(88),u=n(106),a=n(14).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:u.f(t)})}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(362),i=n(378),o=n(380),u=n(381),a=n(382);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=u,s.prototype.set=a,t.exports=s},function(t,e,n){var r=n(33)(n(7),"Map");t.exports=r},function(t,e,n){var r=n(385),i=n(425),o=n(432),u=n(8),a=n(433);t.exports=function(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?u(t)?i(t[0],t[1]):r(t):a(t)}},function(t,e){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var i=typeof t;return!!(e=null==e?n:e)&&("number"==i||"symbol"!=i&&r.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){var n=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}},function(t,e,n){var r=n(8),i=n(70),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||u.test(t)||!o.test(t)||null!=e&&t in Object(e)}},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,u,a,s,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var f=new Error('Uncaught, unspecified "error" event. ('+e+")");throw f.context=e,f}if(o(n=this._events[t]))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(i(n))for(a=Array.prototype.slice.call(arguments,1),u=(c=n.slice()).length,s=0;s<u;s++)c[s].apply(this,a);return!0},n.prototype.addListener=function(t,e){var u;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,i(this._events[t])&&!this._events[t].warned&&(u=o(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&u>0&&this._events[t].length>u&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){if(!r(e))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(t,i),n||(n=!0,e.apply(this,arguments))}return i.listener=e,this.on(t,i),this},n.prototype.removeListener=function(t,e){var n,o,u,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(u=(n=this._events[t]).length,o=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(n)){for(a=u;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){o=a;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[t]))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){(e=t.exports=n(187)).Stream=e,e.Readable=e,e.Writable=n(117),e.Duplex=n(21),e.Transform=n(192),e.PassThrough=n(458)},function(t,e,n){"use strict";(function(e,r,i){var o=n(79);function u(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=m;var a,s=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?r:o.nextTick;m.WritableState=g;var c=n(51);c.inherits=n(35);var f={deprecate:n(457)},l=n(188),p=n(80).Buffer,h=i.Uint8Array||function(){};var d,v=n(189);function y(){}function g(t,e){a=a||n(21),t=t||{};var r=e instanceof a;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?(o.nextTick(i,r),o.nextTick(E,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(i(r),t._writableState.errorEmitted=!0,t.emit("error",r),E(t,e))}(t,n,r,e,i);else{var u=x(n);u||n.corked||n.bufferProcessing||!n.bufferedRequest||w(t,n),r?s(b,t,n,u,i):b(t,n,u,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new u(this)}function m(t){if(a=a||n(21),!(d.call(m,this)||this instanceof a))return new m(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function _(t,e,n,r,i,o,u){e.writelen=r,e.writecb=u,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function b(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),E(t,e)}function w(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var a=0,s=!0;n;)i[a]=n,n.isBuf||(s=!1),n=n.next,a+=1;i.allBuffers=s,_(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new u(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,f=n.encoding,l=n.callback;if(_(t,e,!1,e.objectMode?1:c.length,c,f,l),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function x(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),E(t,e)})}function E(t,e){var n=x(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}c.inherits(m,l),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===m&&(t&&t._writableState instanceof g)}})):d=function(t){return t instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(t,e,n){var r,i=this._writableState,u=!1,a=!i.objectMode&&(r=t,p.isBuffer(r)||r instanceof h);return a&&!p.isBuffer(t)&&(t=function(t){return p.from(t)}(t)),"function"==typeof e&&(n=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof n&&(n=y),i.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),o.nextTick(e,n)}(this,n):(a||function(t,e,n,r){var i=!0,u=!1;return null===n?u=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(u=new TypeError("Invalid non-string/buffer chunk")),u&&(t.emit("error",u),o.nextTick(r,u),i=!1),i}(this,i,t,n))&&(i.pendingcb++,u=function(t,e,n,r,i,o){if(!n){var u=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=p.from(e,n));return e}(e,r,i);r!==u&&(n=!0,i="buffer",r=u)}var a=e.objectMode?1:r.length;e.length+=a;var s=e.length<e.highWaterMark;s||(e.needDrain=!0);if(e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else _(t,e,!1,a,r,i,o);return s}(this,i,a,t,e,n)),u},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||w(this,t))},m.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,E(t,e),n&&(e.finished?o.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),m.prototype.destroy=v.destroy,m.prototype._undestroy=v.undestroy,m.prototype._destroy=function(t,e){this.end(),e(t)}}).call(e,n(34),n(190).setImmediate,n(11))},function(t,e,n){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e,n){"use strict";t.exports=n(484)()?Array.from:n(485)},function(t,e,n){"use strict";var r=n(498),i=n(23),o=n(36),u=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,s=Math.abs,c=Math.floor;t.exports=function(t){var e,n,f,l;if(!r(t))return u.apply(this,arguments);for(n=i(o(this).length),f=arguments[1],e=f=isNaN(f)?0:f>=0?c(f):i(this.length)-c(s(f));e<n;++e)if(a.call(this,e)&&(l=this[e],r(l)))return e;return-1}},function(t,e,n){"use strict";(function(e,n){var r,i;r=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t},i=function(t){var e,n,i=document.createTextNode(""),o=0;return new t(function(){var t;if(e)n&&(e=n.concat(e));else{if(!n)return;e=n}if(n=e,e=null,"function"==typeof n)return t=n,n=null,void t();for(i.data=o=++o%2;n;)t=n.shift(),n.length||(n=null),t()}).observe(i,{characterData:!0}),function(t){r(t),e?"function"==typeof e?e=[e,t]:e.push(t):(e=t,i.data=o=++o%2)}},t.exports=function(){if("object"==typeof e&&e&&"function"==typeof e.nextTick)return e.nextTick;if("object"==typeof document&&document){if("function"==typeof MutationObserver)return i(MutationObserver);if("function"==typeof WebKitMutationObserver)return i(WebKitMutationObserver)}return"function"==typeof n?function(t){n(r(t))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(t){setTimeout(r(t),0)}:null}()}).call(e,n(34),n(190).setImmediate)},function(t,e,n){"use strict";var r=n(38);t.exports=new r({explicit:[n(524),n(525),n(526)]})},function(t,e,n){"use strict";var r,i=n(84),o=(r=i)&&r.__esModule?r:{default:r};t.exports=function(){var t={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return t;try{t=window;var e=!0,n=!1,r=void 0;try{for(var i,u=(0,o.default)(["File","Blob","FormData"]);!(e=(i=u.next()).done);e=!0){var a=i.value;a in window&&(t[a]=window[a])}}catch(t){n=!0,r=t}finally{try{!e&&u.return&&u.return()}finally{if(n)throw r}}}catch(t){console.error(t)}return t}()},function(t,e,n){var r=n(86);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){"use strict";var r=n(88),i=n(13),o=n(129),u=n(26),a=n(39),s=n(213),c=n(95),f=n(131),l=n(6)("iterator"),p=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,n,d,v,y,g){s(n,e,d);var m,_,b,w=function(t){if(!p&&t in A)return A[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",S="values"==v,E=!1,A=t.prototype,O=A[l]||A["@@iterator"]||v&&A[v],j=O||w(v),k=v?S?w("entries"):j:void 0,I="Array"==e&&A.entries||O;if(I&&(b=f(I.call(new t)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[l]||u(b,l,h)),S&&O&&"values"!==O.name&&(E=!0,j=function(){return O.call(this)}),r&&!g||!p&&!E&&A[l]||u(A,l,j),a[e]=j,a[x]=h,v)if(m={values:S?j:w("values"),keys:y?j:w("keys"),entries:k},g)for(_ in m)_ in A||o(A,_,m[_]);else i(i.P+i.F*(p||E),e,m);return m}},function(t,e,n){var r=n(212);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){t.exports=!n(15)&&!n(29)(function(){return 7!=Object.defineProperty(n(128)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(28),i=n(9).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){t.exports=n(26)},function(t,e,n){var r=n(16),i=n(25),o=n(215)(!1),u=n(92)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),s=0,c=[];for(n in a)n!=u&&r(a,n)&&c.push(n);for(;e.length>s;)r(a,n=e[s++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(16),i=n(56),o=n(92)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){var r=n(86),i=n(6)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(u=r(e))&&"function"==typeof e.callee?"Arguments":u}},function(t,e,n){var r=n(5),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){"use strict";var r=n(136)(!0);n(137)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var r=n(59),i=n(10);t.exports=function(t){return function(e,n){var o,u,a=String(i(e)),s=r(n),c=a.length;return s<0||s>=c?t?"":void 0:(o=a.charCodeAt(s))<55296||o>56319||s+1===c||(u=a.charCodeAt(s+1))<56320||u>57343?t?a.charAt(s):o:t?a.slice(s,s+2):u-56320+(o-55296<<10)+65536}}},function(t,e,n){"use strict";var r=n(138),i=n(3),o=n(30),u=n(17),a=n(44),s=n(226),c=n(101),f=n(232),l=n(1)("iterator"),p=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,n,d,v,y,g){s(n,e,d);var m,_,b,w=function(t){if(!p&&t in A)return A[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",S="values"==v,E=!1,A=t.prototype,O=A[l]||A["@@iterator"]||v&&A[v],j=O||w(v),k=v?S?w("entries"):j:void 0,I="Array"==e&&A.entries||O;if(I&&(b=f(I.call(new t)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[l]||u(b,l,h)),S&&O&&"values"!==O.name&&(E=!0,j=function(){return O.call(this)}),r&&!g||!p&&!E&&A[l]||u(A,l,j),a[e]=j,a[x]=h,v)if(m={values:S?j:w("values"),keys:y?j:w("keys"),entries:k},g)for(_ in m)_ in A||o(A,_,m[_]);else i(i.P+i.F*(p||E),e,m);return m}},function(t,e){t.exports=!1},function(t,e,n){var r=n(229),i=n(141);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(59),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(5).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(18),i=n(61),o=n(1)("species");t.exports=function(t,e){var n,u=r(t).constructor;return void 0===u||void 0==(n=r(u)[o])?e:i(n)}},function(t,e,n){var r,i,o,u=n(60),a=n(244),s=n(142),c=n(99),f=n(5),l=f.process,p=f.setImmediate,h=f.clearImmediate,d=f.MessageChannel,v=f.Dispatch,y=0,g={},m=function(){var t=+this;if(g.hasOwnProperty(t)){var e=g[t];delete g[t],e()}},_=function(t){m.call(t.data)};p&&h||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return g[++y]=function(){a("function"==typeof t?t:Function(t),e)},r(y),y},h=function(t){delete g[t]},"process"==n(41)(l)?r=function(t){l.nextTick(u(m,t,1))}:v&&v.now?r=function(t){v.now(u(m,t,1))}:d?(o=(i=new d).port2,i.port1.onmessage=_,r=u(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",_,!1)):r="onreadystatechange"in c("script")?function(t){s.appendChild(c("script")).onreadystatechange=function(){s.removeChild(this),m.call(t)}}:function(t){setTimeout(u(m,t,1),0)}),t.exports={set:p,clear:h}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(18),i=n(31),o=n(102);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){var r=n(31),i=n(41),o=n(1)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){t.exports={default:n(282),__esModule:!0}},function(t,e,n){var r=n(13),i=n(2),o=n(29);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],u={};u[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",u)}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var r,i=n(152),o=(r=i)&&r.__esModule?r:{default:r};e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,o.default)(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},function(t,e,n){t.exports={default:n(284),__esModule:!0}},function(t,e,n){"use strict";e.__esModule=!0;var r,i=n(105),o=(r=i)&&r.__esModule?r:{default:r};e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,o.default)(e))&&"function"!=typeof e?t:e}},function(t,e,n){var r=n(130),i=n(94).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){var r=n(64),i=n(54),o=n(25),u=n(89),a=n(16),s=n(127),c=Object.getOwnPropertyDescriptor;e.f=n(15)?c:function(t,e){if(t=o(t),e=u(e,!0),s)try{return c(t,e)}catch(t){}if(a(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){"use strict";e.__esModule=!0;var r=u(n(298)),i=u(n(302)),o=u(n(105));function u(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,o.default)(e)));t.prototype=(0,i.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(r.default?(0,r.default)(t,e):t.__proto__=e)}},function(t,e,n){"use strict";t.exports=n(305)},function(t,e,n){"use strict";var r=n(65),i=n(46),o=n(159),u=(n(160),n(161));n(20),n(306);function a(t,e,n){this.props=t,this.context=e,this.refs=u,this.updater=n||o}function s(t,e,n){this.props=t,this.context=e,this.refs=u,this.updater=n||o}function c(){}a.prototype.isReactComponent={},a.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t&&r("85"),this.updater.enqueueSetState(this,t),e&&this.updater.enqueueCallback(this,e,"setState")},a.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this),t&&this.updater.enqueueCallback(this,t,"forceUpdate")},c.prototype=a.prototype,s.prototype=new c,s.prototype.constructor=s,i(s.prototype,a.prototype),s.prototype.isPureReactComponent=!0,t.exports={Component:a,PureComponent:s}},function(t,e,n){"use strict";n(66);var r={isMounted:function(t){return!1},enqueueCallback:function(t,e){},enqueueForceUpdate:function(t){},enqueueReplaceState:function(t,e){},enqueueSetState:function(t,e){}};t.exports=r},function(t,e,n){"use strict";var r=!1;t.exports=r},function(t,e,n){"use strict";var r={};t.exports=r},function(t,e,n){"use strict";t.exports={current:null}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=r},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){t.exports=n(321)()},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.getCommonExtensions=e.getExtensions=e.escapeDeepLinkPath=e.createDeepLinkPath=e.shallowEqualKeys=e.buildFormData=e.sorters=e.btoa=e.serializeSearch=e.parseSearch=e.getSampleSchema=e.validateParam=e.validatePattern=e.validateMinLength=e.validateMaxLength=e.validateGuid=e.validateDateTime=e.validateString=e.validateBoolean=e.validateFile=e.validateInteger=e.validateNumber=e.validateMinimum=e.validateMaximum=e.propChecker=e.memoize=e.isImmutable=void 0;var r=b(n(327)),i=b(n(329)),o=b(n(84)),u=b(n(333)),a=b(n(337)),s=b(n(105));e.isJSONObject=function(t){try{var e=JSON.parse(t);if(e&&"object"===(void 0===e?"undefined":(0,s.default)(e)))return e}catch(t){}return!1},e.objectify=function(t){return E(t)?x(t)?t.toJS():t:{}},e.arrayify=function(t){return t?t.toArray?t.toArray():S(t):[]},e.fromJSOrdered=function t(e){if(x(e))return e;if(e instanceof m.default.File)return e;return E(e)?Array.isArray(e)?c.default.Seq(e).map(t).toList():c.default.OrderedMap(e).map(t):e},e.bindToState=function(t,e){var n={};return(0,a.default)(t).filter(function(e){return"function"==typeof t[e]}).forEach(function(r){return n[r]=t[r].bind(null,e)}),n},e.normalizeArray=S,e.isFn=function(t){return"function"==typeof t},e.isObject=E,e.isFunc=function(t){return"function"==typeof t},e.isArray=function(t){return Array.isArray(t)},e.objMap=function(t,e){return(0,a.default)(t).reduce(function(n,r){return n[r]=e(t[r],r),n},{})},e.objReduce=function(t,e){return(0,a.default)(t).reduce(function(n,r){var i=e(t[r],r);return i&&"object"===(void 0===i?"undefined":(0,s.default)(i))&&(0,u.default)(n,i),n},{})},e.systemThunkMiddleware=function(t){return function(e){e.dispatch,e.getState;return function(e){return function(n){return"function"==typeof n?n(t()):e(n)}}}},e.defaultStatusCode=function(t){var e=t.keySeq();return e.contains(w)?w:e.filter(function(t){return"2"===(t+"")[0]}).sort().first()},e.getList=function(t,e){if(!c.default.Iterable.isIterable(t))return c.default.List();var n=t.getIn(Array.isArray(e)?e:[e]);return c.default.List.isList(n)?n:c.default.List()},e.highlight=function(t){var e=document;if(!t)return"";if(t.textContent.length>5e3)return t.textContent;return function(t){for(var n,r,i,o,u,a=t.textContent,s=0,c=a[0],f=1,l=t.innerHTML="",p=0;r=n,n=p<7&&"\\"==n?1:f;){if(f=c,c=a[++s],o=l.length>1,!f||p>8&&"\n"==f||[/\S/.test(f),1,1,!/[$\w]/.test(f),("/"==n||"\n"==n)&&o,'"'==n&&o,"'"==n&&o,a[s-4]+r+n=="--\x3e",r+n=="*/"][p])for(l&&(t.appendChild(u=e.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][p?p<3?2:p>6?4:p>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(l):0]),u.appendChild(e.createTextNode(l))),i=p&&p<7?p:i,l="",p=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(f),/[\])]/.test(f),/[$\w]/.test(f),"/"==f&&i<2&&"<"!=n,'"'==f,"'"==f,f+c+a[s+1]+a[s+2]=="\x3c!--",f+c=="/*",f+c=="//","#"==f][--p];);l+=f}}(t)},e.mapToList=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.default.Map();if(!c.default.Map.isMap(e)||!e.size)return c.default.List();Array.isArray(n)||(n=[n]);if(n.length<1)return e.merge(r);var u=c.default.List();var a=n[0];var s=!0;var f=!1;var l=void 0;try{for(var p,h=(0,o.default)(e.entries());!(s=(p=h.next()).done);s=!0){var d=p.value,v=(0,i.default)(d,2),y=v[0],g=v[1],m=t(g,n.slice(1),r.set(a,y));u=c.default.List.isList(m)?u.concat(m):u.push(m)}}catch(t){f=!0,l=t}finally{try{!s&&h.return&&h.return()}finally{if(f)throw l}}return u},e.extractFileNameFromContentDispositionHeader=function(t){var e=/filename="([^;]*);?"/i.exec(t);null===e&&(e=/filename=([^;]*);?/i.exec(t));if(null!==e&&e.length>1)return e[1];return null},e.pascalCase=A,e.pascalCaseFilename=function(t){return A(t.replace(/\.[^./]*$/,""))},e.sanitizeUrl=function(t){if("string"!=typeof t||""===t)return"";return(0,f.sanitizeUrl)(t)},e.getAcceptControllingResponse=function(t){if(!c.default.OrderedMap.isOrderedMap(t))return null;if(!t.size)return null;var e=t.find(function(t,e){return e.startsWith("2")&&(0,a.default)(t.get("content")||{}).length>0}),n=t.get("default")||c.default.OrderedMap(),r=(n.get("content")||c.default.OrderedMap()).keySeq().toJS().length?n:null;return e||r},e.deeplyStripKey=function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==(void 0===e?"undefined":(0,s.default)(e))||Array.isArray(e)||null===e||!n)return e;var i=(0,u.default)({},e);(0,a.default)(i).forEach(function(e){e===n&&r(i[e],e)?delete i[e]:i[e]=t(i[e],n,r)});return i},e.stringify=function(t){if("string"==typeof t)return t;t.toJS&&(t=t.toJS());if("object"===(void 0===t?"undefined":(0,s.default)(t))&&null!==t)try{return(0,r.default)(t,null,2)}catch(e){return String(t)}return t.toString()},e.numberToString=function(t){if("number"==typeof t)return t.toString();return t};var c=b(n(168)),f=n(340),l=b(n(341)),p=b(n(170)),h=b(n(172)),d=b(n(383)),v=b(n(441)),y=b(n(74)),g=n(449),m=b(n(123)),_=b(n(517));function b(t){return t&&t.__esModule?t:{default:t}}var w="default",x=e.isImmutable=function(t){return c.default.Iterable.isIterable(t)};function S(t){return Array.isArray(t)?t:[t]}function E(t){return!!t&&"object"===(void 0===t?"undefined":(0,s.default)(t))}e.memoize=h.default;function A(t){return(0,p.default)((0,l.default)(t))}e.propChecker=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,a.default)(t).length!==(0,a.default)(e).length||((0,v.default)(t,function(t,n){if(r.includes(n))return!1;var i=e[n];return c.default.Iterable.isIterable(t)?!c.default.is(t,i):("object"!==(void 0===t?"undefined":(0,s.default)(t))||"object"!==(void 0===i?"undefined":(0,s.default)(i)))&&t!==i})||n.some(function(n){return!(0,y.default)(t[n],e[n])}))};var O=e.validateMaximum=function(t,e){if(t>e)return"Value must be less than Maximum"},j=e.validateMinimum=function(t,e){if(t<e)return"Value must be greater than Minimum"},k=e.validateNumber=function(t){if(!/^-?\d+(\.?\d+)?$/.test(t))return"Value must be a number"},I=e.validateInteger=function(t){if(!/^-?\d+$/.test(t))return"Value must be an integer"},M=e.validateFile=function(t){if(t&&!(t instanceof m.default.File))return"Value must be a file"},T=e.validateBoolean=function(t){if("true"!==t&&"false"!==t&&!0!==t&&!1!==t)return"Value must be a boolean"},C=e.validateString=function(t){if(t&&"string"!=typeof t)return"Value must be a string"},P=e.validateDateTime=function(t){if(isNaN(Date.parse(t)))return"Value must be a DateTime"},R=e.validateGuid=function(t){if(t=t.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(t))return"Value must be a Guid"},N=e.validateMaxLength=function(t,e){if(t.length>e)return"Value must be less than MaxLength"},L=e.validateMinLength=function(t,e){if(t.length<e)return"Value must be greater than MinLength"},D=e.validatePattern=function(t,e){if(!new RegExp(e).test(t))return"Value must follow pattern "+e};e.validateParam=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=e&&"body"===t.get("in")?t.get("value_xml"):t.get("value"),o=t.get("required"),u=n?t.get("schema"):t;if(!u)return r;var a=u.get("maximum"),f=u.get("minimum"),l=u.get("type"),p=u.get("format"),h=u.get("maxLength"),d=u.get("minLength"),v=u.get("pattern");if(l&&(o||i)){var y="string"===l&&i,g="array"===l&&Array.isArray(i)&&i.length,_="array"===l&&c.default.List.isList(i)&&i.count(),b="file"===l&&i instanceof m.default.File,w="boolean"===l&&(i||!1===i),x="number"===l&&(i||0===i),S="integer"===l&&(i||0===i),E=!1;if(n&&"object"===l)if("object"===(void 0===i?"undefined":(0,s.default)(i)))E=!0;else if("string"==typeof i)try{JSON.parse(i),E=!0}catch(t){return r.push("Parameter string value must be valid JSON"),r}var A=[y,g,_,b,w,x,S,E].some(function(t){return!!t});if(o&&!A)return r.push("Required field is not provided"),r;if(v){var z=D(i,v);z&&r.push(z)}if(h||0===h){var F=N(i,h);F&&r.push(F)}if(d){var U=L(i,d);U&&r.push(U)}if(a||0===a){var B=O(i,a);B&&r.push(B)}if(f||0===f){var q=j(i,f);q&&r.push(q)}if("string"===l){var Y=void 0;if(!(Y="date-time"===p?P(i):"uuid"===p?R(i):C(i)))return r;r.push(Y)}else if("boolean"===l){var W=T(i);if(!W)return r;r.push(W)}else if("number"===l){var V=k(i);if(!V)return r;r.push(V)}else if("integer"===l){var K=I(i);if(!K)return r;r.push(K)}else if("array"===l){var G;if(!_||!i.count())return r;G=u.getIn(["items","type"]),i.forEach(function(t,e){var n=void 0;"number"===G?n=k(t):"integer"===G?n=I(t):"string"===G&&(n=C(t)),n&&r.push({index:e,error:n})})}else if("file"===l){var $=M(i);if(!$)return r;r.push($)}}return r},e.getSampleSchema=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(e)){if(!t.xml||!t.xml.name){if(t.xml=t.xml||{},!t.$$ref)return t.type||t.items||t.properties||t.additionalProperties?'<?xml version="1.0" encoding="UTF-8"?>\n\x3c!-- XML example cannot be generated --\x3e':null;var i=t.$$ref.match(/\S*\/(\S+)$/);t.xml.name=i[1]}return(0,g.memoizedCreateXMLExample)(t,n)}var o=(0,g.memoizedSampleFromSchema)(t,n);return"object"===(void 0===o?"undefined":(0,s.default)(o))?(0,r.default)(o,null,2):o},e.parseSearch=function(){var t={},e=m.default.location.search;if(!e)return{};if(""!=e){var n=e.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),t[decodeURIComponent(r[0])]=r[1]&&decodeURIComponent(r[1])||"")}return t},e.serializeSearch=function(t){return(0,a.default)(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")},e.btoa=function(e){return(e instanceof t?e:new t(e.toString(),"utf-8")).toString("base64")},e.sorters={operationsSorter:{alpha:function(t,e){return t.get("path").localeCompare(e.get("path"))},method:function(t,e){return t.get("method").localeCompare(e.get("method"))}},tagsSorter:{alpha:function(t,e){return t.localeCompare(e)}}},e.buildFormData=function(t){var e=[];for(var n in t){var r=t[n];void 0!==r&&""!==r&&e.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return e.join("&")},e.shallowEqualKeys=function(t,e,n){return!!(0,d.default)(n,function(n){return(0,y.default)(t[n],e[n])})};var z=e.createDeepLinkPath=function(t){return"string"==typeof t||t instanceof String?t.trim().replace(/\s/g,"_"):""};e.escapeDeepLinkPath=function(t){return(0,_.default)(z(t))},e.getExtensions=function(t){return t.filter(function(t,e){return/^x-/.test(e)})},e.getCommonExtensions=function(t){return t.filter(function(t,e){return/^pattern|maxLength|minLength|maximum|minimum/.test(e)})}}).call(e,n(68).Buffer)},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){var r;r=function(){"use strict";var t=Array.prototype.slice;function e(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function n(t){return u(t)?t:K(t)}function r(t){return a(t)?t:G(t)}function i(t){return s(t)?t:$(t)}function o(t){return u(t)&&!c(t)?t:H(t)}function u(t){return!(!t||!t[l])}function a(t){return!(!t||!t[p])}function s(t){return!(!t||!t[h])}function c(t){return a(t)||s(t)}function f(t){return!(!t||!t[d])}e(r,n),e(i,n),e(o,n),n.isIterable=u,n.isKeyed=a,n.isIndexed=s,n.isAssociative=c,n.isOrdered=f,n.Keyed=r,n.Indexed=i,n.Set=o;var l="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",v=5,y=1<<v,g=y-1,m={},_={value:!1},b={value:!1};function w(t){return t.value=!1,t}function x(t){t&&(t.value=!0)}function S(){}function E(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;i<n;i++)r[i]=t[i+e];return r}function A(t){return void 0===t.size&&(t.size=t.__iterate(j)),t.size}function O(t,e){if("number"!=typeof e){var n=e>>>0;if(""+n!==e||4294967295===n)return NaN;e=n}return e<0?A(t)+e:e}function j(){return!0}function k(t,e,n){return(0===t||void 0!==n&&t<=-n)&&(void 0===e||void 0!==n&&e>=n)}function I(t,e){return T(t,e,0)}function M(t,e){return T(t,e,e)}function T(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}var C=0,P=1,R=2,N="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",D=N||L;function z(t){this.next=t}function F(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function U(){return{value:void 0,done:!0}}function B(t){return!!W(t)}function q(t){return t&&"function"==typeof t.next}function Y(t){var e=W(t);return e&&e.call(t)}function W(t){var e=t&&(N&&t[N]||t[L]);if("function"==typeof e)return e}function V(t){return t&&"number"==typeof t.length}function K(t){return null===t||void 0===t?ot():u(t)?t.toSeq():function(t){var e=st(t)||"object"==typeof t&&new et(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}(t)}function G(t){return null===t||void 0===t?ot().toKeyedSeq():u(t)?a(t)?t.toSeq():t.fromEntrySeq():ut(t)}function $(t){return null===t||void 0===t?ot():u(t)?a(t)?t.entrySeq():t.toIndexedSeq():at(t)}function H(t){return(null===t||void 0===t?ot():u(t)?a(t)?t.entrySeq():t:at(t)).toSetSeq()}z.prototype.toString=function(){return"[Iterator]"},z.KEYS=C,z.VALUES=P,z.ENTRIES=R,z.prototype.inspect=z.prototype.toSource=function(){return this.toString()},z.prototype[D]=function(){return this},e(K,n),K.of=function(){return K(arguments)},K.prototype.toSeq=function(){return this},K.prototype.toString=function(){return this.__toString("Seq {","}")},K.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},K.prototype.__iterate=function(t,e){return ct(this,t,e,!0)},K.prototype.__iterator=function(t,e){return ft(this,t,e,!0)},e(G,K),G.prototype.toKeyedSeq=function(){return this},e($,K),$.of=function(){return $(arguments)},$.prototype.toIndexedSeq=function(){return this},$.prototype.toString=function(){return this.__toString("Seq [","]")},$.prototype.__iterate=function(t,e){return ct(this,t,e,!1)},$.prototype.__iterator=function(t,e){return ft(this,t,e,!1)},e(H,K),H.of=function(){return H(arguments)},H.prototype.toSetSeq=function(){return this},K.isSeq=it,K.Keyed=G,K.Set=H,K.Indexed=$;var J,Z,X,Q="@@__IMMUTABLE_SEQ__@@";function tt(t){this._array=t,this.size=t.length}function et(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function nt(t){this._iterable=t,this.size=t.length||t.size}function rt(t){this._iterator=t,this._iteratorCache=[]}function it(t){return!(!t||!t[Q])}function ot(){return J||(J=new tt([]))}function ut(t){var e=Array.isArray(t)?new tt(t).fromEntrySeq():q(t)?new rt(t).fromEntrySeq():B(t)?new nt(t).fromEntrySeq():"object"==typeof t?new et(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function at(t){var e=st(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function st(t){return V(t)?new tt(t):q(t)?new rt(t):B(t)?new nt(t):void 0}function ct(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,u=0;u<=o;u++){var a=i[n?o-u:u];if(!1===e(a[1],r?a[0]:u,t))return u+1}return u}return t.__iterateUncached(e,n)}function ft(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,u=0;return new z(function(){var t=i[n?o-u:u];return u++>o?{value:void 0,done:!0}:F(e,r?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,n)}function lt(t,e){return e?function t(e,n,r,i){if(Array.isArray(n))return e.call(i,r,$(n).map(function(r,i){return t(e,r,i,n)}));if(ht(n))return e.call(i,r,G(n).map(function(r,i){return t(e,r,i,n)}));return n}(e,t,"",{"":t}):pt(t)}function pt(t){return Array.isArray(t)?$(t).map(pt).toList():ht(t)?G(t).map(pt).toMap():t}function ht(t){return t&&(t.constructor===Object||void 0===t.constructor)}function dt(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function vt(t,e){if(t===e)return!0;if(!u(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||a(t)!==a(e)||s(t)!==s(e)||f(t)!==f(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!c(t);if(f(t)){var r=t.entries();return e.every(function(t,e){var i=r.next().value;return i&&dt(i[1],t)&&(n||dt(i[0],e))})&&r.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var l=!0,p=e.__iterate(function(e,r){if(n?!t.has(e):i?!dt(e,t.get(r,m)):!dt(t.get(r,m),e))return l=!1,!1});return l&&t.size===p}function yt(t,e){if(!(this instanceof yt))return new yt(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(Z)return Z;Z=this}}function gt(t,e){if(!t)throw new Error(e)}function mt(t,e,n){if(!(this instanceof mt))return new mt(t,e,n);if(gt(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),n=void 0===n?1:Math.abs(n),e<t&&(n=-n),this._start=t,this._end=e,this._step=n,this.size=Math.max(0,Math.ceil((e-t)/n-1)+1),0===this.size){if(X)return X;X=this}}function _t(){throw TypeError("Abstract")}function bt(){}function wt(){}function xt(){}K.prototype[Q]=!0,e(tt,$),tt.prototype.get=function(t,e){return this.has(t)?this._array[O(this,t)]:e},tt.prototype.__iterate=function(t,e){for(var n=this._array,r=n.length-1,i=0;i<=r;i++)if(!1===t(n[e?r-i:i],i,this))return i+1;return i},tt.prototype.__iterator=function(t,e){var n=this._array,r=n.length-1,i=0;return new z(function(){return i>r?{value:void 0,done:!0}:F(t,i,n[e?r-i++:i++])})},e(et,G),et.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},et.prototype.has=function(t){return this._object.hasOwnProperty(t)},et.prototype.__iterate=function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var u=r[e?i-o:o];if(!1===t(n[u],u,this))return o+1}return o},et.prototype.__iterator=function(t,e){var n=this._object,r=this._keys,i=r.length-1,o=0;return new z(function(){var u=r[e?i-o:o];return o++>i?{value:void 0,done:!0}:F(t,u,n[u])})},et.prototype[d]=!0,e(nt,$),nt.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var n=Y(this._iterable),r=0;if(q(n))for(var i;!(i=n.next()).done&&!1!==t(i.value,r++,this););return r},nt.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=Y(this._iterable);if(!q(n))return new z(U);var r=0;return new z(function(){var e=n.next();return e.done?e:F(t,r++,e.value)})},e(rt,$),rt.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var n,r=this._iterator,i=this._iteratorCache,o=0;o<i.length;)if(!1===t(i[o],o++,this))return o;for(;!(n=r.next()).done;){var u=n.value;if(i[o]=u,!1===t(u,o++,this))break}return o},rt.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterator,r=this._iteratorCache,i=0;return new z(function(){if(i>=r.length){var e=n.next();if(e.done)return e;r[i]=e.value}return F(t,i,r[i++])})},e(yt,$),yt.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},yt.prototype.get=function(t,e){return this.has(t)?this._value:e},yt.prototype.includes=function(t){return dt(this._value,t)},yt.prototype.slice=function(t,e){var n=this.size;return k(t,e,n)?this:new yt(this._value,M(e,n)-I(t,n))},yt.prototype.reverse=function(){return this},yt.prototype.indexOf=function(t){return dt(this._value,t)?0:-1},yt.prototype.lastIndexOf=function(t){return dt(this._value,t)?this.size:-1},yt.prototype.__iterate=function(t,e){for(var n=0;n<this.size;n++)if(!1===t(this._value,n,this))return n+1;return n},yt.prototype.__iterator=function(t,e){var n=this,r=0;return new z(function(){return r<n.size?F(t,r++,n._value):{value:void 0,done:!0}})},yt.prototype.equals=function(t){return t instanceof yt?dt(this._value,t._value):vt(t)},e(mt,$),mt.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},mt.prototype.get=function(t,e){return this.has(t)?this._start+O(this,t)*this._step:e},mt.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},mt.prototype.slice=function(t,e){return k(t,e,this.size)?this:(t=I(t,this.size),(e=M(e,this.size))<=t?new mt(0,0):new mt(this.get(t,this._end),this.get(e,this._end),this._step))},mt.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var n=e/this._step;if(n>=0&&n<this.size)return n}return-1},mt.prototype.lastIndexOf=function(t){return this.indexOf(t)},mt.prototype.__iterate=function(t,e){for(var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;o<=n;o++){if(!1===t(i,o,this))return o+1;i+=e?-r:r}return o},mt.prototype.__iterator=function(t,e){var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;return new z(function(){var u=i;return i+=e?-r:r,o>n?{value:void 0,done:!0}:F(t,o++,u)})},mt.prototype.equals=function(t){return t instanceof mt?this._start===t._start&&this._end===t._end&&this._step===t._step:vt(this,t)},e(_t,n),e(bt,_t),e(wt,_t),e(xt,_t),_t.Keyed=bt,_t.Indexed=wt,_t.Set=xt;var St="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var n=65535&(t|=0),r=65535&(e|=0);return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0};function Et(t){return t>>>1&1073741824|3221225471&t}function At(t){if(!1===t||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(!1===(t=t.valueOf())||null===t||void 0===t))return 0;if(!0===t)return 1;var e=typeof t;if("number"===e){if(t!=t||t===1/0)return 0;var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)n^=t/=4294967295;return Et(n)}if("string"===e)return t.length>Pt?function(t){var e=Lt[t];void 0===e&&(e=Ot(t),Nt===Rt&&(Nt=0,Lt={}),Nt++,Lt[t]=e);return e}(t):Ot(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"===e)return function(t){var e;if(Mt&&void 0!==(e=It.get(t)))return e;if(void 0!==(e=t[Ct]))return e;if(!kt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Ct]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}e=++Tt,1073741824&Tt&&(Tt=0);if(Mt)It.set(t,e);else{if(void 0!==jt&&!1===jt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(kt)Object.defineProperty(t,Ct,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Ct]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Ct]=e}}return e}(t);if("function"==typeof t.toString)return Ot(t.toString());throw new Error("Value type "+e+" cannot be hashed.")}function Ot(t){for(var e=0,n=0;n<t.length;n++)e=31*e+t.charCodeAt(n)|0;return Et(e)}var jt=Object.isExtensible,kt=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();var It,Mt="function"==typeof WeakMap;Mt&&(It=new WeakMap);var Tt=0,Ct="__immutablehash__";"function"==typeof Symbol&&(Ct=Symbol(Ct));var Pt=16,Rt=255,Nt=0,Lt={};function Dt(t){gt(t!==1/0,"Cannot perform this action with an infinite size.")}function zt(t){return null===t||void 0===t?Xt():Ft(t)&&!f(t)?t:Xt().withMutations(function(e){var n=r(t);Dt(n.size),n.forEach(function(t,n){return e.set(n,t)})})}function Ft(t){return!(!t||!t[Bt])}e(zt,bt),zt.of=function(){var e=t.call(arguments,0);return Xt().withMutations(function(t){for(var n=0;n<e.length;n+=2){if(n+1>=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},zt.prototype.toString=function(){return this.__toString("Map {","}")},zt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},zt.prototype.set=function(t,e){return Qt(this,t,e)},zt.prototype.setIn=function(t,e){return this.updateIn(t,m,function(){return e})},zt.prototype.remove=function(t){return Qt(this,t,m)},zt.prototype.deleteIn=function(t){return this.updateIn(t,function(){return m})},zt.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},zt.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=function t(e,n,r,i){var o=e===m;var u=n.next();if(u.done){var a=o?r:e,s=i(a);return s===a?e:s}gt(o||e&&e.set,"invalid keyPath");var c=u.value;var f=o?m:e.get(c,m);var l=t(f,n,r,i);return l===f?e:l===m?e.remove(c):(o?Xt():e).set(c,l)}(this,nn(t),e,n);return r===m?void 0:r},zt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Xt()},zt.prototype.merge=function(){return re(this,void 0,arguments)},zt.prototype.mergeWith=function(e){return re(this,e,t.call(arguments,1))},zt.prototype.mergeIn=function(e){var n=t.call(arguments,1);return this.updateIn(e,Xt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,n):n[n.length-1]})},zt.prototype.mergeDeep=function(){return re(this,ie,arguments)},zt.prototype.mergeDeepWith=function(e){var n=t.call(arguments,1);return re(this,oe(e),n)},zt.prototype.mergeDeepIn=function(e){var n=t.call(arguments,1);return this.updateIn(e,Xt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,n):n[n.length-1]})},zt.prototype.sort=function(t){return Ie(Ve(this,t))},zt.prototype.sortBy=function(t,e){return Ie(Ve(this,e,t))},zt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},zt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new S)},zt.prototype.asImmutable=function(){return this.__ensureOwner()},zt.prototype.wasAltered=function(){return this.__altered},zt.prototype.__iterator=function(t,e){return new $t(this,t,e)},zt.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},zt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Zt(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},zt.isMap=Ft;var Ut,Bt="@@__IMMUTABLE_MAP__@@",qt=zt.prototype;function Yt(t,e){this.ownerID=t,this.entries=e}function Wt(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n}function Vt(t,e,n){this.ownerID=t,this.count=e,this.nodes=n}function Kt(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n}function Gt(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n}function $t(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&Jt(t._root)}function Ht(t,e){return F(t,e[0],e[1])}function Jt(t,e){return{node:t,index:0,__prev:e}}function Zt(t,e,n,r){var i=Object.create(qt);return i.size=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Xt(){return Ut||(Ut=Zt(0))}function Qt(t,e,n){var r,i;if(t._root){var o=w(_),u=w(b);if(r=te(t._root,t.__ownerID,0,void 0,e,n,o,u),!u.value)return t;i=t.size+(o.value?n===m?-1:1:0)}else{if(n===m)return t;i=1,r=new Yt(t.__ownerID,[[e,n]])}return t.__ownerID?(t.size=i,t._root=r,t.__hash=void 0,t.__altered=!0,t):r?Zt(i,r):Xt()}function te(t,e,n,r,i,o,u,a){return t?t.update(e,n,r,i,o,u,a):o===m?t:(x(a),x(u),new Gt(e,r,[i,o]))}function ee(t){return t.constructor===Gt||t.constructor===Kt}function ne(t,e,n,r,i){if(t.keyHash===r)return new Kt(e,r,[t.entry,i]);var o,u=(0===n?t.keyHash:t.keyHash>>>n)&g,a=(0===n?r:r>>>n)&g;return new Wt(e,1<<u|1<<a,u===a?[ne(t,e,n+v,r,i)]:(o=new Gt(e,r,i),u<a?[t,o]:[o,t]))}function re(t,e,n){for(var i=[],o=0;o<n.length;o++){var a=n[o],s=r(a);u(a)||(s=s.map(function(t){return lt(t)})),i.push(s)}return ue(t,e,i)}function ie(t,e,n){return t&&t.mergeDeep&&u(e)?t.mergeDeep(e):dt(t,e)?t:e}function oe(t){return function(e,n,r){if(e&&e.mergeDeepWith&&u(n))return e.mergeDeepWith(t,n);var i=t(e,n,r);return dt(e,i)?e:i}}function ue(t,e,n){return 0===(n=n.filter(function(t){return 0!==t.size})).length?t:0!==t.size||t.__ownerID||1!==n.length?t.withMutations(function(t){for(var r=e?function(n,r){t.update(r,m,function(t){return t===m?n:e(t,n,r)})}:function(e,n){t.set(n,e)},i=0;i<n.length;i++)n[i].forEach(r)}):t.constructor(n[0])}function ae(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function se(t,e,n,r){var i=r?t:E(t);return i[e]=n,i}qt[Bt]=!0,qt.delete=qt.remove,qt.removeIn=qt.deleteIn,Yt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(dt(n,i[o][0]))return i[o][1];return r},Yt.prototype.update=function(t,e,n,r,i,o,u){for(var a=i===m,s=this.entries,c=0,f=s.length;c<f&&!dt(r,s[c][0]);c++);var l=c<f;if(l?s[c][1]===i:a)return this;if(x(u),(a||!l)&&x(o),!a||1!==s.length){if(!l&&!a&&s.length>=ce)return function(t,e,n,r){t||(t=new S);for(var i=new Gt(t,At(n),[n,r]),o=0;o<e.length;o++){var u=e[o];i=i.update(t,0,void 0,u[0],u[1])}return i}(t,s,r,i);var p=t&&t===this.ownerID,h=p?s:E(s);return l?a?c===f-1?h.pop():h[c]=h.pop():h[c]=[r,i]:h.push([r,i]),p?(this.entries=h,this):new Yt(t,h)}},Wt.prototype.get=function(t,e,n,r){void 0===e&&(e=At(n));var i=1<<((0===t?e:e>>>t)&g),o=this.bitmap;return 0==(o&i)?r:this.nodes[ae(o&i-1)].get(t+v,e,n,r)},Wt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=At(r));var a=(0===e?n:n>>>e)&g,s=1<<a,c=this.bitmap,f=0!=(c&s);if(!f&&i===m)return this;var l=ae(c&s-1),p=this.nodes,h=f?p[l]:void 0,d=te(h,t,e+v,n,r,i,o,u);if(d===h)return this;if(!f&&d&&p.length>=fe)return function(t,e,n,r,i){for(var o=0,u=new Array(y),a=0;0!==n;a++,n>>>=1)u[a]=1&n?e[o++]:void 0;return u[r]=i,new Vt(t,o+1,u)}(t,p,c,a,d);if(f&&!d&&2===p.length&&ee(p[1^l]))return p[1^l];if(f&&d&&1===p.length&&ee(d))return d;var _=t&&t===this.ownerID,b=f?d?c:c^s:c|s,w=f?d?se(p,l,d,_):function(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var i=new Array(r),o=0,u=0;u<r;u++)u===e&&(o=1),i[u]=t[u+o];return i}(p,l,_):function(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var o=new Array(i),u=0,a=0;a<i;a++)a===e?(o[a]=n,u=-1):o[a]=t[a+u];return o}(p,l,d,_);return _?(this.bitmap=b,this.nodes=w,this):new Wt(t,b,w)},Vt.prototype.get=function(t,e,n,r){void 0===e&&(e=At(n));var i=(0===t?e:e>>>t)&g,o=this.nodes[i];return o?o.get(t+v,e,n,r):r},Vt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=At(r));var a=(0===e?n:n>>>e)&g,s=i===m,c=this.nodes,f=c[a];if(s&&!f)return this;var l=te(f,t,e+v,n,r,i,o,u);if(l===f)return this;var p=this.count;if(f){if(!l&&--p<le)return function(t,e,n,r){for(var i=0,o=0,u=new Array(n),a=0,s=1,c=e.length;a<c;a++,s<<=1){var f=e[a];void 0!==f&&a!==r&&(i|=s,u[o++]=f)}return new Wt(t,i,u)}(t,c,p,a)}else p++;var h=t&&t===this.ownerID,d=se(c,a,l,h);return h?(this.count=p,this.nodes=d,this):new Vt(t,p,d)},Kt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(dt(n,i[o][0]))return i[o][1];return r},Kt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=At(r));var a=i===m;if(n!==this.keyHash)return a?this:(x(u),x(o),ne(this,t,e,n,[r,i]));for(var s=this.entries,c=0,f=s.length;c<f&&!dt(r,s[c][0]);c++);var l=c<f;if(l?s[c][1]===i:a)return this;if(x(u),(a||!l)&&x(o),a&&2===f)return new Gt(t,this.keyHash,s[1^c]);var p=t&&t===this.ownerID,h=p?s:E(s);return l?a?c===f-1?h.pop():h[c]=h.pop():h[c]=[r,i]:h.push([r,i]),p?(this.entries=h,this):new Kt(t,this.keyHash,h)},Gt.prototype.get=function(t,e,n,r){return dt(n,this.entry[0])?this.entry[1]:r},Gt.prototype.update=function(t,e,n,r,i,o,u){var a=i===m,s=dt(r,this.entry[0]);return(s?i===this.entry[1]:a)?this:(x(u),a?void x(o):s?t&&t===this.ownerID?(this.entry[1]=i,this):new Gt(t,this.keyHash,[r,i]):(x(o),ne(this,t,e,At(r),[r,i])))},Yt.prototype.iterate=Kt.prototype.iterate=function(t,e){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(!1===t(n[e?i-r:r]))return!1},Wt.prototype.iterate=Vt.prototype.iterate=function(t,e){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[e?i-r:r];if(o&&!1===o.iterate(t,e))return!1}},Gt.prototype.iterate=function(t,e){return t(this.entry)},e($t,z),$t.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return Ht(t,r.entry)}else if(r.entries){if(i<=(n=r.entries.length-1))return Ht(t,r.entries[this._reverse?n-i:i])}else if(i<=(n=r.nodes.length-1)){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return Ht(t,o.entry);e=this._stack=Jt(o,e)}continue}e=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var ce=y/4,fe=y/2,le=y/4;function pe(t){var e=xe();if(null===t||void 0===t)return e;if(he(t))return t;var n=i(t),r=n.size;return 0===r?e:(Dt(r),r>0&&r<y?we(0,r,v,null,new ye(n.toArray())):e.withMutations(function(t){t.setSize(r),n.forEach(function(e,n){return t.set(n,e)})}))}function he(t){return!(!t||!t[de])}e(pe,wt),pe.of=function(){return this(arguments)},pe.prototype.toString=function(){return this.__toString("List [","]")},pe.prototype.get=function(t,e){if((t=O(this,t))>=0&&t<this.size){var n=Ae(this,t+=this._origin);return n&&n.array[t&g]}return e},pe.prototype.set=function(t,e){return function(t,e,n){if((e=O(t,e))!=e)return t;if(e>=t.size||e<0)return t.withMutations(function(t){e<0?Oe(t,e).set(0,n):Oe(t,0,e+1).set(e,n)});e+=t._origin;var r=t._tail,i=t._root,o=w(b);e>=ke(t._capacity)?r=Se(r,t.__ownerID,0,e,n,o):i=Se(i,t.__ownerID,t._level,e,n,o);if(!o.value)return t;if(t.__ownerID)return t._root=i,t._tail=r,t.__hash=void 0,t.__altered=!0,t;return we(t._origin,t._capacity,t._level,i,r)}(this,t,e)},pe.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},pe.prototype.insert=function(t,e){return this.splice(t,0,e)},pe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=v,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):xe()},pe.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(n){Oe(n,0,e+t.length);for(var r=0;r<t.length;r++)n.set(e+r,t[r])})},pe.prototype.pop=function(){return Oe(this,0,-1)},pe.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){Oe(e,-t.length);for(var n=0;n<t.length;n++)e.set(n,t[n])})},pe.prototype.shift=function(){return Oe(this,1)},pe.prototype.merge=function(){return je(this,void 0,arguments)},pe.prototype.mergeWith=function(e){return je(this,e,t.call(arguments,1))},pe.prototype.mergeDeep=function(){return je(this,ie,arguments)},pe.prototype.mergeDeepWith=function(e){var n=t.call(arguments,1);return je(this,oe(e),n)},pe.prototype.setSize=function(t){return Oe(this,0,t)},pe.prototype.slice=function(t,e){var n=this.size;return k(t,e,n)?this:Oe(this,I(t,n),M(e,n))},pe.prototype.__iterator=function(t,e){var n=0,r=be(this,e);return new z(function(){var e=r();return e===_e?{value:void 0,done:!0}:F(t,n++,e)})},pe.prototype.__iterate=function(t,e){for(var n,r=0,i=be(this,e);(n=i())!==_e&&!1!==t(n,r++,this););return r},pe.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?we(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},pe.isList=he;var de="@@__IMMUTABLE_LIST__@@",ve=pe.prototype;function ye(t,e){this.array=t,this.ownerID=e}ve[de]=!0,ve.delete=ve.remove,ve.setIn=qt.setIn,ve.deleteIn=ve.removeIn=qt.removeIn,ve.update=qt.update,ve.updateIn=qt.updateIn,ve.mergeIn=qt.mergeIn,ve.mergeDeepIn=qt.mergeDeepIn,ve.withMutations=qt.withMutations,ve.asMutable=qt.asMutable,ve.asImmutable=qt.asImmutable,ve.wasAltered=qt.wasAltered,ye.prototype.removeBefore=function(t,e,n){if(n===e?1<<e:0===this.array.length)return this;var r=n>>>e&g;if(r>=this.array.length)return new ye([],t);var i,o=0===r;if(e>0){var u=this.array[r];if((i=u&&u.removeBefore(t,e-v,n))===u&&o)return this}if(o&&!i)return this;var a=Ee(this,t);if(!o)for(var s=0;s<r;s++)a.array[s]=void 0;return i&&(a.array[r]=i),a},ye.prototype.removeAfter=function(t,e,n){if(n===(e?1<<e:0)||0===this.array.length)return this;var r,i=n-1>>>e&g;if(i>=this.array.length)return this;if(e>0){var o=this.array[i];if((r=o&&o.removeAfter(t,e-v,n))===o&&i===this.array.length-1)return this}var u=Ee(this,t);return u.array.splice(i+1),r&&(u.array[i]=r),u};var ge,me,_e={};function be(t,e){var n=t._origin,r=t._capacity,i=ke(r),o=t._tail;return u(t._root,t._level,0);function u(t,a,s){return 0===a?function(t,u){var a=u===i?o&&o.array:t&&t.array,s=u>n?0:n-u,c=r-u;c>y&&(c=y);return function(){if(s===c)return _e;var t=e?--c:s++;return a&&a[t]}}(t,s):function(t,i,o){var a,s=t&&t.array,c=o>n?0:n-o>>i,f=1+(r-o>>i);f>y&&(f=y);return function(){for(;;){if(a){var t=a();if(t!==_e)return t;a=null}if(c===f)return _e;var n=e?--f:c++;a=u(s&&s[n],i-v,o+(n<<i))}}}(t,a,s)}}function we(t,e,n,r,i,o,u){var a=Object.create(ve);return a.size=e-t,a._origin=t,a._capacity=e,a._level=n,a._root=r,a._tail=i,a.__ownerID=o,a.__hash=u,a.__altered=!1,a}function xe(){return ge||(ge=we(0,0,v))}function Se(t,e,n,r,i,o){var u,a=r>>>n&g,s=t&&a<t.array.length;if(!s&&void 0===i)return t;if(n>0){var c=t&&t.array[a],f=Se(c,e,n-v,r,i,o);return f===c?t:((u=Ee(t,e)).array[a]=f,u)}return s&&t.array[a]===i?t:(x(o),u=Ee(t,e),void 0===i&&a===u.array.length-1?u.array.pop():u.array[a]=i,u)}function Ee(t,e){return e&&t&&e===t.ownerID?t:new ye(t?t.array.slice():[],e)}function Ae(t,e){if(e>=ke(t._capacity))return t._tail;if(e<1<<t._level+v){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&g],r-=v;return n}}function Oe(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var r=t.__ownerID||new S,i=t._origin,o=t._capacity,u=i+e,a=void 0===n?o:n<0?o+n:i+n;if(u===i&&a===o)return t;if(u>=a)return t.clear();for(var s=t._level,c=t._root,f=0;u+f<0;)c=new ye(c&&c.array.length?[void 0,c]:[],r),f+=1<<(s+=v);f&&(u+=f,i+=f,a+=f,o+=f);for(var l=ke(o),p=ke(a);p>=1<<s+v;)c=new ye(c&&c.array.length?[c]:[],r),s+=v;var h=t._tail,d=p<l?Ae(t,a-1):p>l?new ye([],r):h;if(h&&p>l&&u<o&&h.array.length){for(var y=c=Ee(c,r),m=s;m>v;m-=v){var _=l>>>m&g;y=y.array[_]=Ee(y.array[_],r)}y.array[l>>>v&g]=h}if(a<o&&(d=d&&d.removeAfter(r,0,a)),u>=p)u-=p,a-=p,s=v,c=null,d=d&&d.removeBefore(r,0,u);else if(u>i||p<l){for(f=0;c;){var b=u>>>s&g;if(b!==p>>>s&g)break;b&&(f+=(1<<s)*b),s-=v,c=c.array[b]}c&&u>i&&(c=c.removeBefore(r,s,u-f)),c&&p<l&&(c=c.removeAfter(r,s,p-f)),f&&(u-=f,a-=f)}return t.__ownerID?(t.size=a-u,t._origin=u,t._capacity=a,t._level=s,t._root=c,t._tail=d,t.__hash=void 0,t.__altered=!0,t):we(u,a,s,c,d)}function je(t,e,n){for(var r=[],o=0,a=0;a<n.length;a++){var s=n[a],c=i(s);c.size>o&&(o=c.size),u(s)||(c=c.map(function(t){return lt(t)})),r.push(c)}return o>t.size&&(t=t.setSize(o)),ue(t,e,r)}function ke(t){return t<y?0:t-1>>>v<<v}function Ie(t){return null===t||void 0===t?Ce():Me(t)?t:Ce().withMutations(function(e){var n=r(t);Dt(n.size),n.forEach(function(t,n){return e.set(n,t)})})}function Me(t){return Ft(t)&&f(t)}function Te(t,e,n,r){var i=Object.create(Ie.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=n,i.__hash=r,i}function Ce(){return me||(me=Te(Xt(),xe()))}function Pe(t,e,n){var r,i,o=t._map,u=t._list,a=o.get(e),s=void 0!==a;if(n===m){if(!s)return t;u.size>=y&&u.size>=2*o.size?(r=(i=u.filter(function(t,e){return void 0!==t&&a!==e})).toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(r.__ownerID=i.__ownerID=t.__ownerID)):(r=o.remove(e),i=a===u.size-1?u.pop():u.set(a,void 0))}else if(s){if(n===u.get(a)[1])return t;r=o,i=u.set(a,[e,n])}else r=o.set(e,u.size),i=u.set(u.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=i,t.__hash=void 0,t):Te(r,i)}function Re(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function Ne(t){this._iter=t,this.size=t.size}function Le(t){this._iter=t,this.size=t.size}function De(t){this._iter=t,this.size=t.size}function ze(t){var e=Qe(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=tn,e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return!1!==e(n,t,r)},n)},e.__iteratorUncached=function(e,n){if(e===R){var r=t.__iterator(e,n);return new z(function(){var t=r.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===P?C:P,n)},e}function Fe(t,e,n){var r=Qe(t);return r.size=t.size,r.has=function(e){return t.has(e)},r.get=function(r,i){var o=t.get(r,m);return o===m?i:e.call(n,o,r,t)},r.__iterateUncached=function(r,i){var o=this;return t.__iterate(function(t,i,u){return!1!==r(e.call(n,t,i,u),i,o)},i)},r.__iteratorUncached=function(r,i){var o=t.__iterator(R,i);return new z(function(){var i=o.next();if(i.done)return i;var u=i.value,a=u[0];return F(r,a,e.call(n,u[1],a,t),i)})},r}function Ue(t,e){var n=Qe(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=ze(t);return e.reverse=function(){return t.flip()},e}),n.get=function(n,r){return t.get(e?n:-1-n,r)},n.has=function(n){return t.has(e?n:-1-n)},n.includes=function(e){return t.includes(e)},n.cacheResult=tn,n.__iterate=function(e,n){var r=this;return t.__iterate(function(t,n){return e(t,n,r)},!n)},n.__iterator=function(e,n){return t.__iterator(e,!n)},n}function Be(t,e,n,r){var i=Qe(t);return r&&(i.has=function(r){var i=t.get(r,m);return i!==m&&!!e.call(n,i,r,t)},i.get=function(r,i){var o=t.get(r,m);return o!==m&&e.call(n,o,r,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,a=0;return t.__iterate(function(t,o,s){if(e.call(n,t,o,s))return a++,i(t,r?o:a-1,u)},o),a},i.__iteratorUncached=function(i,o){var u=t.__iterator(R,o),a=0;return new z(function(){for(;;){var o=u.next();if(o.done)return o;var s=o.value,c=s[0],f=s[1];if(e.call(n,f,c,t))return F(i,r?c:a++,f,o)}})},i}function qe(t,e,n,r){var i=t.size;if(void 0!==e&&(e|=0),void 0!==n&&(n===1/0?n=i:n|=0),k(e,n,i))return t;var o=I(e,i),u=M(n,i);if(o!=o||u!=u)return qe(t.toSeq().cacheResult(),e,n,r);var a,s=u-o;s==s&&(a=s<0?0:s);var c=Qe(t);return c.size=0===a?a:t.size&&a||void 0,!r&&it(t)&&a>=0&&(c.get=function(e,n){return(e=O(this,e))>=0&&e<a?t.get(e+o,n):n}),c.__iterateUncached=function(e,n){var i=this;if(0===a)return 0;if(n)return this.cacheResult().__iterate(e,n);var u=0,s=!0,c=0;return t.__iterate(function(t,n){if(!s||!(s=u++<o))return c++,!1!==e(t,r?n:c-1,i)&&c!==a}),c},c.__iteratorUncached=function(e,n){if(0!==a&&n)return this.cacheResult().__iterator(e,n);var i=0!==a&&t.__iterator(e,n),u=0,s=0;return new z(function(){for(;u++<o;)i.next();if(++s>a)return{value:void 0,done:!0};var t=i.next();return r||e===P?t:F(e,s-1,e===C?void 0:t.value[1],t)})},c}function Ye(t,e,n,r){var i=Qe(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var a=!0,s=0;return t.__iterate(function(t,o,c){if(!a||!(a=e.call(n,t,o,c)))return s++,i(t,r?o:s-1,u)}),s},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var a=t.__iterator(R,o),s=!0,c=0;return new z(function(){var t,o,f;do{if((t=a.next()).done)return r||i===P?t:F(i,c++,i===C?void 0:t.value[1],t);var l=t.value;o=l[0],f=l[1],s&&(s=e.call(n,f,o,u))}while(s);return i===R?t:F(i,o,f,t)})},i}function We(t,e,n){var r=Qe(t);return r.__iterateUncached=function(r,i){var o=0,a=!1;return function t(s,c){var f=this;s.__iterate(function(i,s){return(!e||c<e)&&u(i)?t(i,c+1):!1===r(i,n?s:o++,f)&&(a=!0),!a},i)}(t,0),o},r.__iteratorUncached=function(r,i){var o=t.__iterator(r,i),a=[],s=0;return new z(function(){for(;o;){var t=o.next();if(!1===t.done){var c=t.value;if(r===R&&(c=c[1]),e&&!(a.length<e)||!u(c))return n?t:F(r,s++,c,t);a.push(o),o=c.__iterator(r,i)}else o=a.pop()}return{value:void 0,done:!0}})},r}function Ve(t,e,n){e||(e=en);var r=a(t),i=0,o=t.toSeq().map(function(e,r){return[r,e,i++,n?n(e,r,t):e]}).toArray();return o.sort(function(t,n){return e(t[3],n[3])||t[2]-n[2]}).forEach(r?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),r?G(o):s(t)?$(o):H(o)}function Ke(t,e,n){if(e||(e=en),n){var r=t.toSeq().map(function(e,r){return[e,n(e,r,t)]}).reduce(function(t,n){return Ge(e,t[1],n[1])?n:t});return r&&r[0]}return t.reduce(function(t,n){return Ge(e,t,n)?n:t})}function Ge(t,e,n){var r=t(n,e);return 0===r&&n!==e&&(void 0===n||null===n||n!=n)||r>0}function $e(t,e,r){var i=Qe(t);return i.size=new tt(r).map(function(t){return t.size}).min(),i.__iterate=function(t,e){for(var n,r=this.__iterator(P,e),i=0;!(n=r.next()).done&&!1!==t(n.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map(function(t){return t=n(t),Y(i?t.reverse():t)}),u=0,a=!1;return new z(function(){var n;return a||(n=o.map(function(t){return t.next()}),a=n.some(function(t){return t.done})),a?{value:void 0,done:!0}:F(t,u++,e.apply(null,n.map(function(t){return t.value})))})},i}function He(t,e){return it(t)?e:t.constructor(e)}function Je(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Ze(t){return Dt(t.size),A(t)}function Xe(t){return a(t)?r:s(t)?i:o}function Qe(t){return Object.create((a(t)?G:s(t)?$:H).prototype)}function tn(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):K.prototype.cacheResult.call(this)}function en(t,e){return t>e?1:t<e?-1:0}function nn(t){var e=Y(t);if(!e){if(!V(t))throw new TypeError("Expected iterable or array-like: "+t);e=Y(n(t))}return e}function rn(t,e){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var u=Object.keys(t);!function(t,e){try{e.forEach(function(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){gt(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}.bind(void 0,t))}catch(t){}}(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=zt(o)},i=r.prototype=Object.create(on);return i.constructor=r,r}e(Ie,zt),Ie.of=function(){return this(arguments)},Ie.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ie.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},Ie.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Ce()},Ie.prototype.set=function(t,e){return Pe(this,t,e)},Ie.prototype.remove=function(t){return Pe(this,t,m)},Ie.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ie.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],n)},e)},Ie.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Ie.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?Te(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},Ie.isOrderedMap=Me,Ie.prototype[d]=!0,Ie.prototype.delete=Ie.prototype.remove,e(Re,G),Re.prototype.get=function(t,e){return this._iter.get(t,e)},Re.prototype.has=function(t){return this._iter.has(t)},Re.prototype.valueSeq=function(){return this._iter.valueSeq()},Re.prototype.reverse=function(){var t=this,e=Ue(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},Re.prototype.map=function(t,e){var n=this,r=Fe(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},Re.prototype.__iterate=function(t,e){var n,r=this;return this._iter.__iterate(this._useKeys?function(e,n){return t(e,n,r)}:(n=e?Ze(this):0,function(i){return t(i,e?--n:n++,r)}),e)},Re.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var n=this._iter.__iterator(P,e),r=e?Ze(this):0;return new z(function(){var i=n.next();return i.done?i:F(t,e?--r:r++,i.value,i)})},Re.prototype[d]=!0,e(Ne,$),Ne.prototype.includes=function(t){return this._iter.includes(t)},Ne.prototype.__iterate=function(t,e){var n=this,r=0;return this._iter.__iterate(function(e){return t(e,r++,n)},e)},Ne.prototype.__iterator=function(t,e){var n=this._iter.__iterator(P,e),r=0;return new z(function(){var e=n.next();return e.done?e:F(t,r++,e.value,e)})},e(Le,H),Le.prototype.has=function(t){return this._iter.includes(t)},Le.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},Le.prototype.__iterator=function(t,e){var n=this._iter.__iterator(P,e);return new z(function(){var e=n.next();return e.done?e:F(t,e.value,e.value,e)})},e(De,G),De.prototype.entrySeq=function(){return this._iter.toSeq()},De.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){Je(e);var r=u(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},De.prototype.__iterator=function(t,e){var n=this._iter.__iterator(P,e);return new z(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){Je(r);var i=u(r);return F(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},Ne.prototype.cacheResult=Re.prototype.cacheResult=Le.prototype.cacheResult=De.prototype.cacheResult=tn,e(rn,bt),rn.prototype.toString=function(){return this.__toString(an(this)+" {","}")},rn.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},rn.prototype.get=function(t,e){if(!this.has(t))return e;var n=this._defaultValues[t];return this._map?this._map.get(t,n):n},rn.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=un(this,Xt()))},rn.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+an(this));if(this._map&&!this._map.has(t)&&e===this._defaultValues[t])return this;var n=this._map&&this._map.set(t,e);return this.__ownerID||n===this._map?this:un(this,n)},rn.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:un(this,e)},rn.prototype.wasAltered=function(){return this._map.wasAltered()},rn.prototype.__iterator=function(t,e){var n=this;return r(this._defaultValues).map(function(t,e){return n.get(e)}).__iterator(t,e)},rn.prototype.__iterate=function(t,e){var n=this;return r(this._defaultValues).map(function(t,e){return n.get(e)}).__iterate(t,e)},rn.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?un(this,e,t):(this.__ownerID=t,this._map=e,this)};var on=rn.prototype;function un(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function an(t){return t._name||t.constructor.name||"Record"}function sn(t){return null===t||void 0===t?vn():cn(t)&&!f(t)?t:vn().withMutations(function(e){var n=o(t);Dt(n.size),n.forEach(function(t){return e.add(t)})})}function cn(t){return!(!t||!t[ln])}on.delete=on.remove,on.deleteIn=on.removeIn=qt.removeIn,on.merge=qt.merge,on.mergeWith=qt.mergeWith,on.mergeIn=qt.mergeIn,on.mergeDeep=qt.mergeDeep,on.mergeDeepWith=qt.mergeDeepWith,on.mergeDeepIn=qt.mergeDeepIn,on.setIn=qt.setIn,on.update=qt.update,on.updateIn=qt.updateIn,on.withMutations=qt.withMutations,on.asMutable=qt.asMutable,on.asImmutable=qt.asImmutable,e(sn,xt),sn.of=function(){return this(arguments)},sn.fromKeys=function(t){return this(r(t).keySeq())},sn.prototype.toString=function(){return this.__toString("Set {","}")},sn.prototype.has=function(t){return this._map.has(t)},sn.prototype.add=function(t){return hn(this,this._map.set(t,!0))},sn.prototype.remove=function(t){return hn(this,this._map.remove(t))},sn.prototype.clear=function(){return hn(this,this._map.clear())},sn.prototype.union=function(){var e=t.call(arguments,0);return 0===(e=e.filter(function(t){return 0!==t.size})).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n<e.length;n++)o(e[n]).forEach(function(e){return t.add(e)})}):this.constructor(e[0])},sn.prototype.intersect=function(){var e=t.call(arguments,0);if(0===e.length)return this;e=e.map(function(t){return o(t)});var n=this;return this.withMutations(function(t){n.forEach(function(n){e.every(function(t){return t.includes(n)})||t.remove(n)})})},sn.prototype.subtract=function(){var e=t.call(arguments,0);if(0===e.length)return this;e=e.map(function(t){return o(t)});var n=this;return this.withMutations(function(t){n.forEach(function(n){e.some(function(t){return t.includes(n)})&&t.remove(n)})})},sn.prototype.merge=function(){return this.union.apply(this,arguments)},sn.prototype.mergeWith=function(e){var n=t.call(arguments,1);return this.union.apply(this,n)},sn.prototype.sort=function(t){return yn(Ve(this,t))},sn.prototype.sortBy=function(t,e){return yn(Ve(this,e,t))},sn.prototype.wasAltered=function(){return this._map.wasAltered()},sn.prototype.__iterate=function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},sn.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},sn.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},sn.isSet=cn;var fn,ln="@@__IMMUTABLE_SET__@@",pn=sn.prototype;function hn(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function dn(t,e){var n=Object.create(pn);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function vn(){return fn||(fn=dn(Xt()))}function yn(t){return null===t||void 0===t?wn():gn(t)?t:wn().withMutations(function(e){var n=o(t);Dt(n.size),n.forEach(function(t){return e.add(t)})})}function gn(t){return cn(t)&&f(t)}pn[ln]=!0,pn.delete=pn.remove,pn.mergeDeep=pn.merge,pn.mergeDeepWith=pn.mergeWith,pn.withMutations=qt.withMutations,pn.asMutable=qt.asMutable,pn.asImmutable=qt.asImmutable,pn.__empty=vn,pn.__make=dn,e(yn,sn),yn.of=function(){return this(arguments)},yn.fromKeys=function(t){return this(r(t).keySeq())},yn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},yn.isOrderedSet=gn;var mn,_n=yn.prototype;function bn(t,e){var n=Object.create(_n);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function wn(){return mn||(mn=bn(Ce()))}function xn(t){return null===t||void 0===t?kn():Sn(t)?t:kn().unshiftAll(t)}function Sn(t){return!(!t||!t[An])}_n[d]=!0,_n.__empty=wn,_n.__make=bn,e(xn,wt),xn.of=function(){return this(arguments)},xn.prototype.toString=function(){return this.__toString("Stack [","]")},xn.prototype.get=function(t,e){var n=this._head;for(t=O(this,t);n&&t--;)n=n.next;return n?n.value:e},xn.prototype.peek=function(){return this._head&&this._head.value},xn.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,n=arguments.length-1;n>=0;n--)e={value:arguments[n],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):jn(t,e)},xn.prototype.pushAll=function(t){if(0===(t=i(t)).size)return this;Dt(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):jn(e,n)},xn.prototype.pop=function(){return this.slice(1)},xn.prototype.unshift=function(){return this.push.apply(this,arguments)},xn.prototype.unshiftAll=function(t){return this.pushAll(t)},xn.prototype.shift=function(){return this.pop.apply(this,arguments)},xn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):kn()},xn.prototype.slice=function(t,e){if(k(t,e,this.size))return this;var n=I(t,this.size);if(M(e,this.size)!==this.size)return wt.prototype.slice.call(this,t,e);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):jn(r,i)},xn.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?jn(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},xn.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var n=0,r=this._head;r&&!1!==t(r.value,n++,this);)r=r.next;return n},xn.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var n=0,r=this._head;return new z(function(){if(r){var e=r.value;return r=r.next,F(t,n++,e)}return{value:void 0,done:!0}})},xn.isStack=Sn;var En,An="@@__IMMUTABLE_STACK__@@",On=xn.prototype;function jn(t,e,n,r){var i=Object.create(On);return i.size=t,i._head=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function kn(){return En||(En=jn(0))}function In(t,e){var n=function(n){t.prototype[n]=e[n]};return Object.keys(e).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(n),t}On[An]=!0,On.withMutations=qt.withMutations,On.asMutable=qt.asMutable,On.asImmutable=qt.asImmutable,On.wasAltered=qt.wasAltered,n.Iterator=z,In(n,{toArray:function(){Dt(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate(function(e,n){t[n]=e}),t},toIndexedSeq:function(){return new Ne(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new Re(this,!0)},toMap:function(){return zt(this.toKeyedSeq())},toObject:function(){Dt(this.size);var t={};return this.__iterate(function(e,n){t[n]=e}),t},toOrderedMap:function(){return Ie(this.toKeyedSeq())},toOrderedSet:function(){return yn(a(this)?this.valueSeq():this)},toSet:function(){return sn(a(this)?this.valueSeq():this)},toSetSeq:function(){return new Le(this)},toSeq:function(){return s(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return xn(a(this)?this.valueSeq():this)},toList:function(){return pe(a(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){return He(this,function(t,e){var n=a(t),i=[t].concat(e).map(function(t){return u(t)?n&&(t=r(t)):t=n?ut(t):at(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===i.length)return t;if(1===i.length){var o=i[0];if(o===t||n&&a(o)||s(t)&&s(o))return o}var c=new tt(i);return n?c=c.toKeyedSeq():s(t)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=i.reduce(function(t,e){if(void 0!==t){var n=e.size;if(void 0!==n)return t+n}},0),c}(this,t.call(arguments,0)))},includes:function(t){return this.some(function(e){return dt(e,t)})},entries:function(){return this.__iterator(R)},every:function(t,e){Dt(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!t.call(e,r,i,o))return n=!1,!1}),n},filter:function(t,e){return He(this,Be(this,t,e,!0))},find:function(t,e,n){var r=this.findEntry(t,e);return r?r[1]:n},forEach:function(t,e){return Dt(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){Dt(this.size),t=void 0!==t?""+t:",";var e="",n=!0;return this.__iterate(function(r){n?n=!1:e+=t,e+=null!==r&&void 0!==r?r.toString():""}),e},keys:function(){return this.__iterator(C)},map:function(t,e){return He(this,Fe(this,t,e))},reduce:function(t,e,n){var r,i;return Dt(this.size),arguments.length<2?i=!0:r=e,this.__iterate(function(e,o,u){i?(i=!1,r=e):r=t.call(n,r,e,o,u)}),r},reduceRight:function(t,e,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return He(this,Ue(this,!0))},slice:function(t,e){return He(this,qe(this,t,e,!0))},some:function(t,e){return!this.every(Rn(t),e)},sort:function(t){return He(this,Ve(this,t))},values:function(){return this.__iterator(P)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return A(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return function(t,e,n){var r=zt().asMutable();return t.__iterate(function(i,o){r.update(e.call(n,i,o,t),0,function(t){return t+1})}),r.asImmutable()}(this,t,e)},equals:function(t){return vt(this,t)},entrySeq:function(){var t=this;if(t._cache)return new tt(t._cache);var e=t.toSeq().map(Pn).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Rn(t),e)},findEntry:function(t,e,n){var r=n;return this.__iterate(function(n,i,o){if(t.call(e,n,i,o))return r=[i,n],!1}),r},findKey:function(t,e){var n=this.findEntry(t,e);return n&&n[0]},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},findLastEntry:function(t,e,n){return this.toKeyedSeq().reverse().findEntry(t,e,n)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(j)},flatMap:function(t,e){return He(this,function(t,e,n){var r=Xe(t);return t.toSeq().map(function(i,o){return r(e.call(n,i,o,t))}).flatten(!0)}(this,t,e))},flatten:function(t){return He(this,We(this,t,!0))},fromEntrySeq:function(){return new De(this)},get:function(t,e){return this.find(function(e,n){return dt(n,t)},void 0,e)},getIn:function(t,e){for(var n,r=this,i=nn(t);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,m):m)===m)return e}return r},groupBy:function(t,e){return function(t,e,n){var r=a(t),i=(f(t)?Ie():zt()).asMutable();t.__iterate(function(o,u){i.update(e.call(n,o,u,t),function(t){return(t=t||[]).push(r?[u,o]:o),t})});var o=Xe(t);return i.map(function(e){return He(t,o(e))})}(this,t,e)},has:function(t){return this.get(t,m)!==m},hasIn:function(t){return this.getIn(t,m)!==m},isSubset:function(t){return t="function"==typeof t.includes?t:n(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:n(t)).isSubset(this)},keyOf:function(t){return this.findKey(function(e){return dt(e,t)})},keySeq:function(){return this.toSeq().map(Cn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Ke(this,t)},maxBy:function(t,e){return Ke(this,e,t)},min:function(t){return Ke(this,t?Nn(t):zn)},minBy:function(t,e){return Ke(this,e?Nn(e):zn,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return He(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return He(this,Ye(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Rn(t),e)},sortBy:function(t,e){return He(this,Ve(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return He(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return He(this,function(t,e,n){var r=Qe(t);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var u=0;return t.__iterate(function(t,i,a){return e.call(n,t,i,a)&&++u&&r(t,i,o)}),u},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var u=t.__iterator(R,i),a=!0;return new z(function(){if(!a)return{value:void 0,done:!0};var t=u.next();if(t.done)return t;var i=t.value,s=i[0],c=i[1];return e.call(n,c,s,o)?r===R?t:F(r,s,c,t):(a=!1,{value:void 0,done:!0})})},r}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Rn(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=f(t),n=a(t),r=e?1:0;return function(t,e){return e=St(e,3432918353),e=St(e<<15|e>>>-15,461845907),e=St(e<<13|e>>>-13,5),e=St((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=Et((e=St(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(n?e?function(t,e){r=31*r+Fn(At(t),At(e))|0}:function(t,e){r=r+Fn(At(t),At(e))|0}:e?function(t){r=31*r+At(t)|0}:function(t){r=r+At(t)|0}),r)}(this))}});var Mn=n.prototype;Mn[l]=!0,Mn[D]=Mn.values,Mn.__toJS=Mn.toArray,Mn.__toStringMapper=Ln,Mn.inspect=Mn.toSource=function(){return this.toString()},Mn.chain=Mn.flatMap,Mn.contains=Mn.includes,In(r,{flip:function(){return He(this,ze(this))},mapEntries:function(t,e){var n=this,r=0;return He(this,this.toSeq().map(function(i,o){return t.call(e,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(t,e){var n=this;return He(this,this.toSeq().flip().map(function(r,i){return t.call(e,r,i,n)}).flip())}});var Tn=r.prototype;function Cn(t,e){return e}function Pn(t,e){return[e,t]}function Rn(t){return function(){return!t.apply(this,arguments)}}function Nn(t){return function(){return-t.apply(this,arguments)}}function Ln(t){return"string"==typeof t?JSON.stringify(t):String(t)}function Dn(){return E(arguments)}function zn(t,e){return t<e?1:t>e?-1:0}function Fn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}return Tn[p]=!0,Tn[D]=Mn.entries,Tn.__toJS=Mn.toObject,Tn.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+Ln(t)},In(i,{toKeyedSeq:function(){return new Re(this,!1)},filter:function(t,e){return He(this,Be(this,t,e,!1))},findIndex:function(t,e){var n=this.findEntry(t,e);return n?n[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return He(this,Ue(this,!1))},slice:function(t,e){return He(this,qe(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=I(t,t<0?this.count():this.size);var r=this.slice(0,t);return He(this,1===n?r:r.concat(E(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var n=this.findLastEntry(t,e);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(t){return He(this,We(this,t,!1))},get:function(t,e){return(t=O(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,n){return n===t},void 0,e)},has:function(t){return(t=O(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return He(this,function(t,e){var n=Qe(t);return n.size=t.size&&2*t.size-1,n.__iterateUncached=function(n,r){var i=this,o=0;return t.__iterate(function(t,r){return(!o||!1!==n(e,o++,i))&&!1!==n(t,o++,i)},r),o},n.__iteratorUncached=function(n,r){var i,o=t.__iterator(P,r),u=0;return new z(function(){return(!i||u%2)&&(i=o.next()).done?i:u%2?F(n,u++,e):F(n,u++,i.value,i)})},n}(this,t))},interleave:function(){var t=[this].concat(E(arguments)),e=$e(this.toSeq(),$.of,t),n=e.flatten(!0);return e.size&&(n.size=e.size*t.length),He(this,n)},keySeq:function(){return mt(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(t,e){return He(this,Ye(this,t,e,!1))},zip:function(){return He(this,$e(this,Dn,[this].concat(E(arguments))))},zipWith:function(t){var e=E(arguments);return e[0]=this,He(this,$e(this,t,e))}}),i.prototype[h]=!0,i.prototype[d]=!0,In(o,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),o.prototype.has=Mn.includes,o.prototype.contains=o.prototype.includes,In(G,r.prototype),In($,i.prototype),In(H,o.prototype),In(bt,r.prototype),In(wt,i.prototype),In(xt,o.prototype),{Iterable:n,Seq:K,Collection:_t,Map:zt,OrderedMap:Ie,List:pe,Stack:xn,Set:sn,OrderedSet:yn,Record:rn,Range:mt,Repeat:yt,is:dt,fromJS:lt}},t.exports=r()},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,n(11))},function(t,e,n){var r=n(347)("toUpperCase");t.exports=r},function(t,e){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return n.test(t)}},function(t,e,n){var r=n(109),i="Expected a function";function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(i);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var u=t.apply(this,r);return n.cache=o.set(i,u)||o,u};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},function(t,e,n){var r=n(48),i=n(50),o="[object AsyncFunction]",u="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";t.exports=function(t){if(!i(t))return!1;var e=r(t);return e==u||e==a||e==o||e==s}},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(72),i=n(387),o=n(388),u=n(389),a=n(390),s=n(391);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=u,c.prototype.has=a,c.prototype.set=s,t.exports=c},function(t,e,n){var r=n(392),i=n(49);t.exports=function t(e,n,o,u,a){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,u,t,a))}},function(t,e,n){var r=n(393),i=n(178),o=n(396),u=1,a=2;t.exports=function(t,e,n,s,c,f){var l=n&u,p=t.length,h=e.length;if(p!=h&&!(l&&h>p))return!1;var d=f.get(t);if(d&&f.get(e))return d==e;var v=-1,y=!0,g=n&a?new r:void 0;for(f.set(t,e),f.set(e,t);++v<p;){var m=t[v],_=e[v];if(s)var b=l?s(_,m,v,e,t,f):s(m,_,v,t,e,f);if(void 0!==b){if(b)continue;y=!1;break}if(g){if(!i(e,function(t,e){if(!o(g,e)&&(m===t||c(m,t,n,s,f)))return g.push(e)})){y=!1;break}}else if(m!==_&&!c(m,_,n,s,f)){y=!1;break}}return f.delete(t),f.delete(e),y}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e,n){var r=n(410),i=n(49),o=Object.prototype,u=o.hasOwnProperty,a=o.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(t){return i(t)&&u.call(t,"callee")&&!a.call(t,"callee")};t.exports=s},function(t,e,n){(function(t){var r=n(7),i=n(411),o="object"==typeof e&&e&&!e.nodeType&&e,u=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=u&&u.exports===o?r.Buffer:void 0,s=(a?a.isBuffer:void 0)||i;t.exports=s}).call(e,n(181)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(412),i=n(413),o=n(414),u=o&&o.isTypedArray,a=u?i(u):r;t.exports=a},function(t,e,n){var r=n(50);t.exports=function(t){return t==t&&!r(t)}},function(t,e){t.exports=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}},function(t,e,n){var r=n(186),i=n(78);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},function(t,e,n){var r=n(8),i=n(114),o=n(427),u=n(47);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(u(t))}},function(t,e,n){"use strict";(function(e,r){var i=n(79);t.exports=_;var o,u=n(167);_.ReadableState=m;n(115).EventEmitter;var a=function(t,e){return t.listeners(e).length},s=n(188),c=n(80).Buffer,f=e.Uint8Array||function(){};var l=n(51);l.inherits=n(35);var p=n(453),h=void 0;h=p&&p.debuglog?p.debuglog("stream"):function(){};var d,v=n(454),y=n(189);l.inherits(_,s);var g=["error","close","destroy","pause","resume"];function m(t,e){o=o||n(21),t=t||{};var r=e instanceof o;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,u=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(u||0===u)?u:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new v,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=n(191).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function _(t){if(o=o||n(21),!(this instanceof _))return new _(t);this._readableState=new m(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function b(t,e,n,r,i){var o,u=t._readableState;null===e?(u.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,E(t)}(t,u)):(i||(o=function(t,e){var n;r=e,c.isBuffer(r)||r instanceof f||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(u,e)),o?t.emit("error",o):u.objectMode||e&&e.length>0?("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),r?u.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,u,e,!0):u.ended?t.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!n?(e=u.decoder.write(e),u.objectMode||0!==e.length?w(t,u,e,!1):O(t,u)):w(t,u,e,!1))):r||(u.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(u)}function w(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&E(t)),O(t,e)}Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),_.prototype.destroy=y.destroy,_.prototype._undestroy=y.undestroy,_.prototype._destroy=function(t,e){this.push(null),e(t)},_.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=c.from(t,e),e=""),n=!0),b(this,t,e,!1,n)},_.prototype.unshift=function(t){return b(this,t,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(t){return d||(d=n(191).StringDecoder),this._readableState.decoder=new d(t),this._readableState.encoding=t,this};var x=8388608;function S(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(A,t):A(t))}function A(t){h("emit readable"),t.emit("readable"),M(t)}function O(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(j,t,e))}function j(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(h("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function k(t){h("readable nexttick read 0"),t.read(0)}function I(t,e){e.reading||(h("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),M(t),e.flowing&&!e.reading&&t.read(0)}function M(t){var e=t._readableState;for(h("flow",e.flowing);e.flowing&&null!==t.read(););}function T(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var r;t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():n?function(t,e){var n=e.head,r=1,i=n.data;t-=i.length;for(;n=n.next;){var o=n.data,u=t>o.length?o.length:t;if(u===o.length?i+=o:i+=o.slice(0,t),0===(t-=u)){u===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(u));break}++r}return e.length-=r,i}(t,e):function(t,e){var n=c.allocUnsafe(t),r=e.head,i=1;r.data.copy(n),t-=r.data.length;for(;r=r.next;){var o=r.data,u=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,u),0===(t-=u)){u===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(u));break}++i}return e.length-=i,n}(t,e);return r}(t,e.buffer,e.decoder),n);var n}function C(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(P,e,t))}function P(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function R(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}_.prototype.read=function(t){h("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?C(this):E(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&C(this),null;var r,i=e.needReadable;return h("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&h("length less than watermark",i=!0),e.ended||e.reading?h("reading or ended",i=!1):i&&(h("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=S(n,e))),null===(r=t>0?T(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&C(this)),null!==r&&this.emit("data",r),r},_.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,h("pipe count=%d opts=%j",o.pipesCount,e);var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?f:_;function c(e,r){h("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),t.removeListener("close",g),t.removeListener("finish",m),t.removeListener("drain",l),t.removeListener("error",y),t.removeListener("unpipe",c),n.removeListener("end",f),n.removeListener("end",_),n.removeListener("data",v),p=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function f(){h("onend"),t.end()}o.endEmitted?i.nextTick(s):n.once("end",s),t.on("unpipe",c);var l=function(t){return function(){var e=t._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,M(t))}}(n);t.on("drain",l);var p=!1;var d=!1;function v(e){h("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==R(o.pipes,t))&&!p&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function y(e){h("onerror",e),_(),t.removeListener("error",y),0===a(t,"error")&&t.emit("error",e)}function g(){t.removeListener("finish",m),_()}function m(){h("onfinish"),t.removeListener("close",g),_()}function _(){h("unpipe"),n.unpipe(t)}return n.on("data",v),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?u(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",y),t.once("close",g),t.once("finish",m),t.emit("pipe",n),o.flowing||(h("pipe resume"),n.resume()),t},_.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var u=R(e.pipes,t);return-1===u?this:(e.pipes.splice(u,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n),this)},_.prototype.on=function(t,e){var n=s.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&E(this):i.nextTick(k,this))}return n},_.prototype.addListener=_.prototype.on,_.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(I,t,e))}(this,t)),this},_.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},_.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",function(){if(h("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){(h("wrapped data"),n.decoder&&(i=n.decoder.write(i)),!n.objectMode||null!==i&&void 0!==i)&&((n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause())))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<g.length;o++)t.on(g[o],this.emit.bind(this,g[o]));return this._read=function(e){h("wrapped _read",e),r&&(r=!1,t.resume())},this},Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),_._fromList=T}).call(e,n(11),n(34))},function(t,e,n){t.exports=n(115).EventEmitter},function(t,e,n){"use strict";var r=n(79);function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,o=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return o||u?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(r.nextTick(i,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(456),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(e,n(11))},function(t,e,n){"use strict";var r=n(80).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=s,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=p,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function u(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function s(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function f(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var i=u(e[r]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=u(e[r]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=u(e[r]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";t.exports=o;var r=n(21),i=n(51);function o(t){if(!(this instanceof o))return new o(t);r.call(this,t),this._transformState={afterTransform:function(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",u)}function u(){var t=this;"function"==typeof this._flush?this._flush(function(e,n){a(t,e,n)}):a(this,null,null)}function a(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=n(35),i.inherits(o,r),o.prototype.push=function(t,e){return this._transformState.needTransform=!1,r.prototype.push.call(this,t,e)},o.prototype._transform=function(t,e,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},o.prototype._destroy=function(t,e){var n=this;r.prototype._destroy.call(this,t,function(t){e(t),n.emit("close")})}},function(t,e,n){"use strict";var r=n(22),i=Array.prototype.forEach,o=Object.create;t.exports=function(t){var e=o(null);return i.call(arguments,function(t){r(t)&&function(t,e){var n;for(n in t)e[n]=t[n]}(Object(t),e)}),e}},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";var r=n(23);t.exports=function(t,e,n){var i;return isNaN(t)?(i=e)>=0?n&&i?i-1:i:1:!1!==t&&r(t)}},function(t,e,n){"use strict";t.exports=n(472)()?Object.assign:n(473)},function(t,e,n){"use strict";var r,i,o,u,a,s=n(23),c=function(t,e){return e};try{Object.defineProperty(c,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(t){}1===c.length?(r={configurable:!0,writable:!1,enumerable:!1},i=Object.defineProperty,t.exports=function(t,e){return e=s(e),t.length===e?t:(r.value=e,i(t,"length",r))}):(u=n(198),a=[],o=function(t){var e,n=0;if(a[t])return a[t];for(e=[];t--;)e.push("a"+(++n).toString(36));return new Function("fn","return function ("+e.join(", ")+") { return fn.apply(this, arguments); };")},t.exports=function(t,e){var n;if(e=s(e),t.length===e)return t;n=o(e)(t);try{u(n,t)}catch(t){}return n})},function(t,e,n){"use strict";var r=n(36),i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols;t.exports=function(t,e){var n,s=Object(r(e));if(t=Object(r(t)),u(s).forEach(function(r){try{i(t,r,o(e,r))}catch(t){n=t}}),"function"==typeof a&&a(s).forEach(function(r){try{i(t,r,o(e,r))}catch(t){n=t}}),void 0!==n)throw n;return t}},function(t,e,n){"use strict";var r=n(12),i=n(81),o=Function.prototype.call;t.exports=function(t,e){var n={},u=arguments[2];return r(e),i(t,function(t,r,i,a){n[r]=o.call(e,u,t,r,i,a)}),n}},function(t,e){t.exports=function(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseYamlConfig=void 0;var r,i=n(520),o=(r=i)&&r.__esModule?r:{default:r};e.parseYamlConfig=function(t,e){try{return o.default.safeLoad(t)}catch(t){return e&&e.errActions.newThrownErr(new Error(t)),{}}}},function(t,e,n){"use strict";var r=n(38);t.exports=new r({include:[n(203)]})},function(t,e,n){"use strict";var r=n(38);t.exports=new r({include:[n(122)],implicit:[n(527),n(528),n(529),n(530)]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.loaded=e.TOGGLE_CONFIGS=e.UPDATE_CONFIGS=void 0;var r,i=n(205),o=(r=i)&&r.__esModule?r:{default:r};e.update=function(t,e){return{type:u,payload:(0,o.default)({},t,e)}},e.toggle=function(t){return{type:a,payload:t}};var u=e.UPDATE_CONFIGS="configs_update",a=e.TOGGLE_CONFIGS="configs_toggle";e.loaded=function(){return function(){}}},function(t,e,n){"use strict";e.__esModule=!0;var r,i=n(152),o=(r=i)&&r.__esModule?r:{default:r};e.default=function(t,e,n){return e in t?(0,o.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){n(207),t.exports=n(280)},function(t,e,n){"use strict";var r,i=n(123);void 0===((r=i)&&r.__esModule?r:{default:r}).default.Promise&&n(222),String.prototype.startsWith||n(251)},function(t,e,n){n(85),n(96),t.exports=n(220)},function(t,e,n){"use strict";var r=n(210),i=n(211),o=n(39),u=n(25);t.exports=n(125)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(90),i=n(54),o=n(95),u={};n(26)(u,n(6)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(14),i=n(27),o=n(40);t.exports=n(15)?Object.defineProperties:function(t,e){i(t);for(var n,u=o(e),a=u.length,s=0;a>s;)r.f(t,n=u[s++],e[n]);return t}},function(t,e,n){var r=n(25),i=n(216),o=n(217);t.exports=function(t){return function(e,n,u){var a,s=r(e),c=i(s.length),f=o(u,c);if(t&&n!=n){for(;c>f;)if((a=s[f++])!=a)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(91),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(91),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(9).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(91),i=n(87);t.exports=function(t){return function(e,n){var o,u,a=String(i(e)),s=r(n),c=a.length;return s<0||s>=c?t?"":void 0:(o=a.charCodeAt(s))<55296||o>56319||s+1===c||(u=a.charCodeAt(s+1))<56320||u>57343?t?a.charAt(s):o:t?a.slice(s,s+2):u-56320+(o-55296<<10)+65536}}},function(t,e,n){var r=n(27),i=n(221);t.exports=n(2).getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return r(e.call(t))}},function(t,e,n){var r=n(132),i=n(6)("iterator"),o=n(39);t.exports=n(2).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){n(223),n(135),n(234),n(238),n(249),n(250),t.exports=n(19).Promise},function(t,e,n){"use strict";var r=n(97),i={};i[n(1)("toStringTag")]="z",i+""!="[object z]"&&n(30)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(t,e,n){t.exports=!n(42)&&!n(43)(function(){return 7!=Object.defineProperty(n(99)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(31);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){"use strict";var r=n(227),i=n(134),o=n(101),u={};n(17)(u,n(1)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(18),i=n(228),o=n(141),u=n(100)("IE_PROTO"),a=function(){},s=function(){var t,e=n(99)("iframe"),r=o.length;for(e.style.display="none",n(142).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s.prototype[o[r]];return s()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[u]=t):n=s(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(57),i=n(18),o=n(139);t.exports=n(42)?Object.defineProperties:function(t,e){i(t);for(var n,u=o(e),a=u.length,s=0;a>s;)r.f(t,n=u[s++],e[n]);return t}},function(t,e,n){var r=n(58),i=n(62),o=n(231)(!1),u=n(100)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),s=0,c=[];for(n in a)n!=u&&r(a,n)&&c.push(n);for(;e.length>s;)r(a,n=e[s++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(41);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(62),i=n(45),o=n(140);t.exports=function(t){return function(e,n,u){var a,s=r(e),c=i(s.length),f=o(u,c);if(t&&n!=n){for(;c>f;)if((a=s[f++])!=a)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(58),i=n(233),o=n(100)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){var r=n(10);t.exports=function(t){return Object(r(t))}},function(t,e,n){for(var r=n(235),i=n(139),o=n(30),u=n(5),a=n(17),s=n(44),c=n(1),f=c("iterator"),l=c("toStringTag"),p=s.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(h),v=0;v<d.length;v++){var y,g=d[v],m=h[g],_=u[g],b=_&&_.prototype;if(b&&(b[f]||a(b,f,p),b[l]||a(b,l,g),s[g]=p,m))for(y in r)b[y]||o(b,y,r[y],!0)}},function(t,e,n){"use strict";var r=n(236),i=n(237),o=n(44),u=n(62);t.exports=n(137)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){var r=n(1)("unscopables"),i=Array.prototype;void 0==i[r]&&n(17)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";var r,i,o,u,a=n(138),s=n(5),c=n(60),f=n(97),l=n(3),p=n(31),h=n(61),d=n(239),v=n(240),y=n(143),g=n(144).set,m=n(245)(),_=n(102),b=n(145),w=n(146),x=s.TypeError,S=s.process,E=s.Promise,A="process"==f(S),O=function(){},j=i=_.f,k=!!function(){try{var t=E.resolve(1),e=(t.constructor={})[n(1)("species")]=function(t){t(O,O)};return(A||"function"==typeof PromiseRejectionEvent)&&t.then(O)instanceof e}catch(t){}}(),I=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},M=function(t,e){if(!t._n){t._n=!0;var n=t._c;m(function(){for(var r=t._v,i=1==t._s,o=0,u=function(e){var n,o,u,a=i?e.ok:e.fail,s=e.resolve,c=e.reject,f=e.domain;try{a?(i||(2==t._h&&P(t),t._h=1),!0===a?n=r:(f&&f.enter(),n=a(r),f&&(f.exit(),u=!0)),n===e.promise?c(x("Promise-chain cycle")):(o=I(n))?o.call(n,s,c):s(n)):c(r)}catch(t){f&&!u&&f.exit(),c(t)}};n.length>o;)u(n[o++]);t._c=[],t._n=!1,e&&!t._h&&T(t)})}},T=function(t){g.call(s,function(){var e,n,r,i=t._v,o=C(t);if(o&&(e=b(function(){A?S.emit("unhandledRejection",i,t):(n=s.onunhandledrejection)?n({promise:t,reason:i}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",i)}),t._h=A||C(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},C=function(t){return 1!==t._h&&0===(t._a||t._c).length},P=function(t){g.call(s,function(){var e;A?S.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})})},R=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),M(e,!0))},N=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw x("Promise can't be resolved itself");(e=I(t))?m(function(){var r={_w:n,_d:!1};try{e.call(t,c(N,r,1),c(R,r,1))}catch(t){R.call(r,t)}}):(n._v=t,n._s=1,M(n,!1))}catch(t){R.call({_w:n,_d:!1},t)}}};k||(E=function(t){d(this,E,"Promise","_h"),h(t),r.call(this);try{t(c(N,this,1),c(R,this,1))}catch(t){R.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(246)(E.prototype,{then:function(t,e){var n=j(y(this,E));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=A?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(N,t,1),this.reject=c(R,t,1)},_.f=j=function(t){return t===E||t===u?new o(t):i(t)}),l(l.G+l.W+l.F*!k,{Promise:E}),n(101)(E,"Promise"),n(247)("Promise"),u=n(19).Promise,l(l.S+l.F*!k,"Promise",{reject:function(t){var e=j(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(a||!k),"Promise",{resolve:function(t){return w(a&&this===u?E:this,t)}}),l(l.S+l.F*!(k&&n(248)(function(t){E.all(t).catch(O)})),"Promise",{all:function(t){var e=this,n=j(e),r=n.resolve,i=n.reject,o=b(function(){var n=[],o=0,u=1;v(t,!1,function(t){var a=o++,s=!1;n.push(void 0),u++,e.resolve(t).then(function(t){s||(s=!0,n[a]=t,--u||r(n))},i)}),--u||r(n)});return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=j(e),r=n.reject,i=b(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(60),i=n(241),o=n(242),u=n(18),a=n(45),s=n(243),c={},f={};(e=t.exports=function(t,e,n,l,p){var h,d,v,y,g=p?function(){return t}:s(t),m=r(n,l,e?2:1),_=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(o(g)){for(h=a(t.length);h>_;_++)if((y=e?m(u(d=t[_])[0],d[1]):m(t[_]))===c||y===f)return y}else for(v=g.call(t);!(d=v.next()).done;)if((y=i(v,m,d.value,e))===c||y===f)return y}).BREAK=c,e.RETURN=f},function(t,e,n){var r=n(18);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(t,e,n){var r=n(44),i=n(1)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){var r=n(97),i=n(1)("iterator"),o=n(44);t.exports=n(19).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(5),i=n(144).set,o=r.MutationObserver||r.WebKitMutationObserver,u=r.process,a=r.Promise,s="process"==n(41)(u);t.exports=function(){var t,e,n,c=function(){var r,i;for(s&&(r=u.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(s)n=function(){u.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(a&&a.resolve){var f=a.resolve();n=function(){f.then(c)}}else n=function(){i.call(r,c)};else{var l=!0,p=document.createTextNode("");new o(c).observe(p,{characterData:!0}),n=function(){p.data=l=!l}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},function(t,e,n){var r=n(30);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},function(t,e,n){"use strict";var r=n(5),i=n(57),o=n(42),u=n(1)("species");t.exports=function(t){var e=r[t];o&&e&&!e[u]&&i.f(e,u,{configurable:!0,get:function(){return this}})}},function(t,e,n){var r=n(1)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],u=o[r]();u.next=function(){return{done:n=!0}},o[r]=function(){return u},t(o)}catch(t){}return n}},function(t,e,n){"use strict";var r=n(3),i=n(19),o=n(5),u=n(143),a=n(146);r(r.P+r.R,"Promise",{finally:function(t){var e=u(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return a(e,t()).then(function(){return n})}:t,n?function(n){return a(e,t()).then(function(){throw n})}:t)}})},function(t,e,n){"use strict";var r=n(3),i=n(102),o=n(145);r(r.S,"Promise",{try:function(t){var e=i.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},function(t,e,n){n(252),n(253),n(254),n(135),n(257),n(258),n(259),n(260),n(262),n(263),n(264),n(265),n(266),n(267),n(268),n(269),n(270),n(271),n(272),n(273),n(274),n(275),n(276),n(277),n(278),n(279),t.exports=n(19).String},function(t,e,n){var r=n(3),i=n(140),o=String.fromCharCode,u=String.fromCodePoint;r(r.S+r.F*(!!u&&1!=u.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,u=0;r>u;){if(e=+arguments[u++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){var r=n(3),i=n(62),o=n(45);r(r.S,"String",{raw:function(t){for(var e=i(t.raw),n=o(e.length),r=arguments.length,u=[],a=0;n>a;)u.push(String(e[a++])),a<r&&u.push(String(arguments[a]));return u.join("")}})},function(t,e,n){"use strict";n(255)("trim",function(t){return function(){return t(this,3)}})},function(t,e,n){var r=n(3),i=n(10),o=n(43),u=n(256),a="["+u+"]",s=RegExp("^"+a+a+"*"),c=RegExp(a+a+"*$"),f=function(t,e,n){var i={},a=o(function(){return!!u[t]()||"
"!="
"[t]()}),s=i[t]=a?e(l):u[t];n&&(i[n]=s),r(r.P+r.F*a,"String",i)},l=f.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(s,"")),2&e&&(t=t.replace(c,"")),t};t.exports=f},function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(t,e,n){"use strict";var r=n(3),i=n(136)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},function(t,e,n){"use strict";var r=n(3),i=n(45),o=n(103),u="".endsWith;r(r.P+r.F*n(104)("endsWith"),"String",{endsWith:function(t){var e=o(this,t,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),a=void 0===n?r:Math.min(i(n),r),s=String(t);return u?u.call(e,s,a):e.slice(a-s.length,a)===s}})},function(t,e,n){"use strict";var r=n(3),i=n(103);r(r.P+r.F*n(104)("includes"),"String",{includes:function(t){return!!~i(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(3);r(r.P,"String",{repeat:n(261)})},function(t,e,n){"use strict";var r=n(59),i=n(10);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e,n){"use strict";var r=n(3),i=n(45),o=n(103),u="".startsWith;r(r.P+r.F*n(104)("startsWith"),"String",{startsWith:function(t){var e=o(this,t,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return u?u.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){"use strict";n(4)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(t,e,n){"use strict";n(4)("big",function(t){return function(){return t(this,"big","","")}})},function(t,e,n){"use strict";n(4)("blink",function(t){return function(){return t(this,"blink","","")}})},function(t,e,n){"use strict";n(4)("bold",function(t){return function(){return t(this,"b","","")}})},function(t,e,n){"use strict";n(4)("fixed",function(t){return function(){return t(this,"tt","","")}})},function(t,e,n){"use strict";n(4)("fontcolor",function(t){return function(e){return t(this,"font","color",e)}})},function(t,e,n){"use strict";n(4)("fontsize",function(t){return function(e){return t(this,"font","size",e)}})},function(t,e,n){"use strict";n(4)("italics",function(t){return function(){return t(this,"i","","")}})},function(t,e,n){"use strict";n(4)("link",function(t){return function(e){return t(this,"a","href",e)}})},function(t,e,n){"use strict";n(4)("small",function(t){return function(){return t(this,"small","","")}})},function(t,e,n){"use strict";n(4)("strike",function(t){return function(){return t(this,"strike","","")}})},function(t,e,n){"use strict";n(4)("sub",function(t){return function(){return t(this,"sub","","")}})},function(t,e,n){"use strict";n(4)("sup",function(t){return function(){return t(this,"sup","","")}})},function(t,e,n){n(63)("match",1,function(t,e,n){return[function(n){"use strict";var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},n]})},function(t,e,n){n(63)("replace",2,function(t,e,n){return[function(r,i){"use strict";var o=t(this),u=void 0==r?void 0:r[e];return void 0!==u?u.call(r,o,i):n.call(String(o),r,i)},n]})},function(t,e,n){n(63)("search",1,function(t,e,n){return[function(n){"use strict";var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},n]})},function(t,e,n){n(63)("split",2,function(t,e,r){"use strict";var i=n(147),o=r,u=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var a=void 0===/()??/.exec("")[1];r=function(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!i(t))return o.call(n,t,e);var r,s,c,f,l,p=[],h=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),d=0,v=void 0===e?4294967295:e>>>0,y=new RegExp(t.source,h+"g");for(a||(r=new RegExp("^"+y.source+"$(?!\\s)",h));(s=y.exec(n))&&!((c=s.index+s[0].length)>d&&(p.push(n.slice(d,s.index)),!a&&s.length>1&&s[0].replace(r,function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(s[l]=void 0)}),s.length>1&&s.index<n.length&&u.apply(p,s.slice(1)),f=s[0].length,d=c,p.length>=v));)y.lastIndex===s.index&&y.lastIndex++;return d===n.length?!f&&y.test("")||p.push(""):p.push(n.slice(d)),p.length>v?p.slice(0,v):p}}else"0".split(void 0,0).length&&(r=function(t,e){return void 0===t&&0===e?[]:o.call(this,t,e)});return[function(n,i){var o=t(this),u=void 0==n?void 0:n[e];return void 0!==u?u.call(n,o,i):r.call(String(o),n,i)},r]})},function(t,e,n){"use strict";var r=u(n(281)),i=u(n(322)),o=u(n(518));function u(t){return t&&t.__esModule?t:{default:t}}var a=[i.default,o.default,function(){return{components:{StandaloneLayout:r.default}}}];t.exports=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=c(n(148)),i=c(n(150)),o=c(n(151)),u=c(n(153)),a=c(n(156)),s=c(n(157));c(n(165));function c(t){return t&&t.__esModule?t:{default:t}}var f=function(t){function e(){return(0,i.default)(this,e),(0,u.default)(this,(e.__proto__||(0,r.default)(e)).apply(this,arguments))}return(0,a.default)(e,t),(0,o.default)(e,[{key:"render",value:function(){var t=this.props,e=t.getComponent,n=t.specSelectors,r=t.errSelectors,i=e("Container"),o=e("Row"),u=e("Col"),a=e("errors",!0),c=e("Topbar",!0),f=e("BaseLayout",!0),l=e("onlineValidatorBadge",!0),p=n.loadingStatus(),h=r.lastError(),d=h?h.get("message"):"";return s.default.createElement(i,{className:"swagger-ui"},c?s.default.createElement(c,null):null,"loading"===p&&s.default.createElement("div",{className:"info"},s.default.createElement("div",{className:"loading-container"},s.default.createElement("div",{className:"loading"}))),"failed"===p&&s.default.createElement("div",{className:"info"},s.default.createElement("div",{className:"loading-container"},s.default.createElement("h4",{className:"title"},"Failed to load API definition."),s.default.createElement(a,null))),"failedConfig"===p&&s.default.createElement("div",{className:"info",style:{maxWidth:"880px",marginLeft:"auto",marginRight:"auto",textAlign:"center"}},s.default.createElement("div",{className:"loading-container"},s.default.createElement("h4",{className:"title"},"Failed to load remote configuration."),s.default.createElement("p",null,d))),!p||"success"===p&&s.default.createElement(f,null),s.default.createElement(o,null,s.default.createElement(u,null,s.default.createElement(l,null))))}}]),e}(s.default.Component);e.default=f},function(t,e,n){n(283),t.exports=n(2).Object.getPrototypeOf},function(t,e,n){var r=n(56),i=n(131);n(149)("getPrototypeOf",function(){return function(t){return i(r(t))}})},function(t,e,n){n(285);var r=n(2).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){var r=n(13);r(r.S+r.F*!n(15),"Object",{defineProperty:n(14).f})},function(t,e,n){t.exports={default:n(287),__esModule:!0}},function(t,e,n){n(96),n(85),t.exports=n(106).f("iterator")},function(t,e,n){t.exports={default:n(289),__esModule:!0}},function(t,e,n){n(290),n(295),n(296),n(297),t.exports=n(2).Symbol},function(t,e,n){"use strict";var r=n(9),i=n(16),o=n(15),u=n(13),a=n(129),s=n(291).KEY,c=n(29),f=n(93),l=n(95),p=n(55),h=n(6),d=n(106),v=n(107),y=n(292),g=n(293),m=n(27),_=n(28),b=n(25),w=n(89),x=n(54),S=n(90),E=n(294),A=n(155),O=n(14),j=n(40),k=A.f,I=O.f,M=E.f,T=r.Symbol,C=r.JSON,P=C&&C.stringify,R=h("_hidden"),N=h("toPrimitive"),L={}.propertyIsEnumerable,D=f("symbol-registry"),z=f("symbols"),F=f("op-symbols"),U=Object.prototype,B="function"==typeof T,q=r.QObject,Y=!q||!q.prototype||!q.prototype.findChild,W=o&&c(function(){return 7!=S(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=k(U,e);r&&delete U[e],I(t,e,n),r&&t!==U&&I(U,e,r)}:I,V=function(t){var e=z[t]=S(T.prototype);return e._k=t,e},K=B&&"symbol"==typeof T.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof T},G=function(t,e,n){return t===U&&G(F,e,n),m(t),e=w(e,!0),m(n),i(z,e)?(n.enumerable?(i(t,R)&&t[R][e]&&(t[R][e]=!1),n=S(n,{enumerable:x(0,!1)})):(i(t,R)||I(t,R,x(1,{})),t[R][e]=!0),W(t,e,n)):I(t,e,n)},$=function(t,e){m(t);for(var n,r=y(e=b(e)),i=0,o=r.length;o>i;)G(t,n=r[i++],e[n]);return t},H=function(t){var e=L.call(this,t=w(t,!0));return!(this===U&&i(z,t)&&!i(F,t))&&(!(e||!i(this,t)||!i(z,t)||i(this,R)&&this[R][t])||e)},J=function(t,e){if(t=b(t),e=w(e,!0),t!==U||!i(z,e)||i(F,e)){var n=k(t,e);return!n||!i(z,e)||i(t,R)&&t[R][e]||(n.enumerable=!0),n}},Z=function(t){for(var e,n=M(b(t)),r=[],o=0;n.length>o;)i(z,e=n[o++])||e==R||e==s||r.push(e);return r},X=function(t){for(var e,n=t===U,r=M(n?F:b(t)),o=[],u=0;r.length>u;)!i(z,e=r[u++])||n&&!i(U,e)||o.push(z[e]);return o};B||(a((T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===U&&e.call(F,n),i(this,R)&&i(this[R],t)&&(this[R][t]=!1),W(this,t,x(1,n))};return o&&Y&&W(U,t,{configurable:!0,set:e}),V(t)}).prototype,"toString",function(){return this._k}),A.f=J,O.f=G,n(154).f=E.f=Z,n(64).f=H,n(108).f=X,o&&!n(88)&&a(U,"propertyIsEnumerable",H,!0),d.f=function(t){return V(h(t))}),u(u.G+u.W+u.F*!B,{Symbol:T});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;Q.length>tt;)h(Q[tt++]);for(var et=j(h.store),nt=0;et.length>nt;)v(et[nt++]);u(u.S+u.F*!B,"Symbol",{for:function(t){return i(D,t+="")?D[t]:D[t]=T(t)},keyFor:function(t){if(!K(t))throw TypeError(t+" is not a symbol!");for(var e in D)if(D[e]===t)return e},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),u(u.S+u.F*!B,"Object",{create:function(t,e){return void 0===e?S(t):$(S(t),e)},defineProperty:G,defineProperties:$,getOwnPropertyDescriptor:J,getOwnPropertyNames:Z,getOwnPropertySymbols:X}),C&&u(u.S+u.F*(!B||c(function(){var t=T();return"[null]"!=P([t])||"{}"!=P({a:t})||"{}"!=P(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(_(e)||void 0!==t)&&!K(t))return g(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!K(e))return e}),r[1]=e,P.apply(C,r)}}),T.prototype[N]||n(26)(T.prototype,N,T.prototype.valueOf),l(T,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){var r=n(55)("meta"),i=n(28),o=n(16),u=n(14).f,a=0,s=Object.isExtensible||function(){return!0},c=!n(29)(function(){return s(Object.preventExtensions({}))}),f=function(t){u(t,r,{value:{i:"O"+ ++a,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!s(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!s(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&s(t)&&!o(t,r)&&f(t),t}}},function(t,e,n){var r=n(40),i=n(108),o=n(64);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var u,a=n(t),s=o.f,c=0;a.length>c;)s.call(t,u=a[c++])&&e.push(u);return e}},function(t,e,n){var r=n(86);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(25),i=n(154).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return u.slice()}}(t):i(r(t))}},function(t,e){},function(t,e,n){n(107)("asyncIterator")},function(t,e,n){n(107)("observable")},function(t,e,n){t.exports={default:n(299),__esModule:!0}},function(t,e,n){n(300),t.exports=n(2).Object.setPrototypeOf},function(t,e,n){var r=n(13);r(r.S,"Object",{setPrototypeOf:n(301).set})},function(t,e,n){var r=n(28),i=n(27),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(126)(Function.call,n(155).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){t.exports={default:n(303),__esModule:!0}},function(t,e,n){n(304);var r=n(2).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){var r=n(13);r(r.S,"Object",{create:n(90)})},function(t,e,n){"use strict";var r=n(46),i=n(158),o=n(307),u=n(312),a=n(32),s=n(313),c=n(317),f=n(318),l=n(320),p=a.createElement,h=a.createFactory,d=a.cloneElement,v=r,y=function(t){return t},g={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:l},Component:i.Component,PureComponent:i.PureComponent,createElement:p,cloneElement:d,isValidElement:a.isValidElement,PropTypes:s,createClass:f,createFactory:h,createMixin:y,DOM:u,version:c,__spread:v};t.exports=g},function(t,e,n){"use strict";var r=function(){};t.exports=r},function(t,e,n){"use strict";var r=n(308),i=n(32),o=n(67),u=n(309),a=r.twoArgumentPooler,s=r.fourArgumentPooler,c=/\/+/g;function f(t){return(""+t).replace(c,"$&/")}function l(t,e){this.func=t,this.context=e,this.count=0}function p(t,e,n){var r=t.func,i=t.context;r.call(i,e,t.count++)}function h(t,e,n,r){this.result=t,this.keyPrefix=e,this.func=n,this.context=r,this.count=0}function d(t,e,n){var r=t.result,u=t.keyPrefix,a=t.func,s=t.context,c=a.call(s,e,t.count++);Array.isArray(c)?v(c,r,n,o.thatReturnsArgument):null!=c&&(i.isValidElement(c)&&(c=i.cloneAndReplaceKey(c,u+(!c.key||e&&e.key===c.key?"":f(c.key)+"/")+n)),r.push(c))}function v(t,e,n,r,i){var o="";null!=n&&(o=f(n)+"/");var a=h.getPooled(e,o,r,i);u(t,d,a),h.release(a)}function y(t,e,n){return null}l.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},r.addPoolingTo(l,a),h.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},r.addPoolingTo(h,s);var g={forEach:function(t,e,n){if(null==t)return t;var r=l.getPooled(e,n);u(t,p,r),l.release(r)},map:function(t,e,n){if(null==t)return t;var r=[];return v(t,r,null,e,n),r},mapIntoWithKeyPrefixInternal:v,count:function(t,e){return u(t,y,null)},toArray:function(t){var e=[];return v(t,e,null,o.thatReturnsArgument),e}};t.exports=g},function(t,e,n){"use strict";var r=n(65),i=(n(20),function(t){if(this.instancePool.length){var e=this.instancePool.pop();return this.call(e,t),e}return new this(t)}),o=function(t){t instanceof this||r("25"),t.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(t)},u=i,a={addPoolingTo:function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||u,n.poolSize||(n.poolSize=10),n.release=o,n},oneArgumentPooler:i,twoArgumentPooler:function(t,e){if(this.instancePool.length){var n=this.instancePool.pop();return this.call(n,t,e),n}return new this(t,e)},threeArgumentPooler:function(t,e,n){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,t,e,n),r}return new this(t,e,n)},fourArgumentPooler:function(t,e,n,r){if(this.instancePool.length){var i=this.instancePool.pop();return this.call(i,t,e,n,r),i}return new this(t,e,n,r)}};t.exports=a},function(t,e,n){"use strict";var r=n(65),i=(n(162),n(163)),o=n(310),u=(n(20),n(311)),a=(n(66),"."),s=":";function c(t,e){return t&&"object"==typeof t&&null!=t.key?u.escape(t.key):e.toString(36)}t.exports=function(t,e,n){return null==t?0:function t(e,n,f,l){var p,h=typeof e;if("undefined"!==h&&"boolean"!==h||(e=null),null===e||"string"===h||"number"===h||"object"===h&&e.$$typeof===i)return f(l,e,""===n?a+c(e,0):n),1;var d=0,v=""===n?a:n+s;if(Array.isArray(e))for(var y=0;y<e.length;y++)d+=t(p=e[y],v+c(p,y),f,l);else{var g=o(e);if(g){var m,_=g.call(e);if(g!==e.entries)for(var b=0;!(m=_.next()).done;)d+=t(p=m.value,v+c(p,b++),f,l);else for(;!(m=_.next()).done;){var w=m.value;w&&(d+=t(p=w[1],v+u.escape(w[0])+s+c(p,0),f,l))}}else if("object"===h){var x="",S=String(e);r("31","[object Object]"===S?"object with keys {"+Object.keys(e).join(", ")+"}":S,x)}}return d}(t,"",e,n)}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";t.exports=function(t){var e=t&&(r&&t[r]||t[i]);if("function"==typeof e)return e}},function(t,e,n){"use strict";var r={escape:function(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,function(t){return e[t]})},unescape:function(t){var e={"=0":"=","=2":":"};return(""+("."===t[0]&&"$"===t[1]?t.substring(2):t.substring(1))).replace(/(=0|=2)/g,function(t){return e[t]})}};t.exports=r},function(t,e,n){"use strict";var r=n(32).createFactory,i={a:r("a"),abbr:r("abbr"),address:r("address"),area:r("area"),article:r("article"),aside:r("aside"),audio:r("audio"),b:r("b"),base:r("base"),bdi:r("bdi"),bdo:r("bdo"),big:r("big"),blockquote:r("blockquote"),body:r("body"),br:r("br"),button:r("button"),canvas:r("canvas"),caption:r("caption"),cite:r("cite"),code:r("code"),col:r("col"),colgroup:r("colgroup"),data:r("data"),datalist:r("datalist"),dd:r("dd"),del:r("del"),details:r("details"),dfn:r("dfn"),dialog:r("dialog"),div:r("div"),dl:r("dl"),dt:r("dt"),em:r("em"),embed:r("embed"),fieldset:r("fieldset"),figcaption:r("figcaption"),figure:r("figure"),footer:r("footer"),form:r("form"),h1:r("h1"),h2:r("h2"),h3:r("h3"),h4:r("h4"),h5:r("h5"),h6:r("h6"),head:r("head"),header:r("header"),hgroup:r("hgroup"),hr:r("hr"),html:r("html"),i:r("i"),iframe:r("iframe"),img:r("img"),input:r("input"),ins:r("ins"),kbd:r("kbd"),keygen:r("keygen"),label:r("label"),legend:r("legend"),li:r("li"),link:r("link"),main:r("main"),map:r("map"),mark:r("mark"),menu:r("menu"),menuitem:r("menuitem"),meta:r("meta"),meter:r("meter"),nav:r("nav"),noscript:r("noscript"),object:r("object"),ol:r("ol"),optgroup:r("optgroup"),option:r("option"),output:r("output"),p:r("p"),param:r("param"),picture:r("picture"),pre:r("pre"),progress:r("progress"),q:r("q"),rp:r("rp"),rt:r("rt"),ruby:r("ruby"),s:r("s"),samp:r("samp"),script:r("script"),section:r("section"),select:r("select"),small:r("small"),source:r("source"),span:r("span"),strong:r("strong"),style:r("style"),sub:r("sub"),summary:r("summary"),sup:r("sup"),table:r("table"),tbody:r("tbody"),td:r("td"),textarea:r("textarea"),tfoot:r("tfoot"),th:r("th"),thead:r("thead"),time:r("time"),title:r("title"),tr:r("tr"),track:r("track"),u:r("u"),ul:r("ul"),var:r("var"),video:r("video"),wbr:r("wbr"),circle:r("circle"),clipPath:r("clipPath"),defs:r("defs"),ellipse:r("ellipse"),g:r("g"),image:r("image"),line:r("line"),linearGradient:r("linearGradient"),mask:r("mask"),path:r("path"),pattern:r("pattern"),polygon:r("polygon"),polyline:r("polyline"),radialGradient:r("radialGradient"),rect:r("rect"),stop:r("stop"),svg:r("svg"),text:r("text"),tspan:r("tspan")};t.exports=i},function(t,e,n){"use strict";var r=n(32).isValidElement,i=n(314);t.exports=i(r)},function(t,e,n){"use strict";var r=n(315);t.exports=function(t){return r(t,!1)}},function(t,e,n){"use strict";var r=n(67),i=n(20),o=n(66),u=n(46),a=n(164),s=n(316);t.exports=function(t,e){var n="function"==typeof Symbol&&Symbol.iterator,c="@@iterator";var f="<<anonymous>>",l={array:v("array"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:d(r.thatReturnsNull),arrayOf:function(t){return d(function(e,n,r,i,o){if("function"!=typeof t)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var u=e[n];if(!Array.isArray(u)){var s=g(u);return new h("Invalid "+i+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected an array.")}for(var c=0;c<u.length;c++){var f=t(u,c,r,i,o+"["+c+"]",a);if(f instanceof Error)return f}return null})},element:function(){return d(function(e,n,r,i,o){var u=e[n];if(!t(u)){var a=g(u);return new h("Invalid "+i+" `"+o+"` of type `"+a+"` supplied to `"+r+"`, expected a single ReactElement.")}return null})}(),instanceOf:function(t){return d(function(e,n,r,i,o){if(!(e[n]instanceof t)){var u=t.name||f,a=function(t){if(!t.constructor||!t.constructor.name)return f;return t.constructor.name}(e[n]);return new h("Invalid "+i+" `"+o+"` of type `"+a+"` supplied to `"+r+"`, expected instance of `"+u+"`.")}return null})},node:function(){return d(function(t,e,n,r,i){if(!y(t[e]))return new h("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.");return null})}(),objectOf:function(t){return d(function(e,n,r,i,o){if("function"!=typeof t)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=e[n],s=g(u);if("object"!==s)return new h("Invalid "+i+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var c in u)if(u.hasOwnProperty(c)){var f=t(u,c,r,i,o+"."+c,a);if(f instanceof Error)return f}return null})},oneOf:function(t){if(!Array.isArray(t))return r.thatReturnsNull;return d(function(e,n,r,i,o){for(var u=e[n],a=0;a<t.length;a++)if(p(u,t[a]))return null;var s=JSON.stringify(t);return new h("Invalid "+i+" `"+o+"` of value `"+u+"` supplied to `"+r+"`, expected one of "+s+".")})},oneOfType:function(t){if(!Array.isArray(t))return r.thatReturnsNull;for(var e=0;e<t.length;e++){var n=t[e];if("function"!=typeof n)return o(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",_(n),e),r.thatReturnsNull}return d(function(e,n,r,i,o){for(var u=0;u<t.length;u++){var s=t[u];if(null==s(e,n,r,i,o,a))return null}return new h("Invalid "+i+" `"+o+"` supplied to `"+r+"`.")})},shape:function(t){return d(function(e,n,r,i,o){var u=e[n],s=g(u);if("object"!==s)return new h("Invalid "+i+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected `object`.");for(var c in t){var f=t[c];if(f){var l=f(u,c,r,i,o+"."+c,a);if(l)return l}}return null})},exact:function(t){return d(function(e,n,r,i,o){var s=e[n],c=g(s);if("object"!==c)return new h("Invalid "+i+" `"+o+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var f=u({},e[n],t);for(var l in f){var p=t[l];if(!p)return new h("Invalid "+i+" `"+o+"` key `"+l+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(e[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var d=p(s,l,r,i,o+"."+l,a);if(d)return d}return null})}};function p(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function h(t){this.message=t,this.stack=""}function d(t){function n(n,r,o,u,s,c,l){(u=u||f,c=c||o,l!==a)&&(e&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"));return null==r[o]?n?null===r[o]?new h("The "+s+" `"+c+"` is marked as required in `"+u+"`, but its value is `null`."):new h("The "+s+" `"+c+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:t(r,o,u,s,c)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function v(t){return d(function(e,n,r,i,o,u){var a=e[n];return g(a)!==t?new h("Invalid "+i+" `"+o+"` of type `"+m(a)+"` supplied to `"+r+"`, expected `"+t+"`."):null})}function y(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(y);if(null===e||t(e))return!0;var r=function(t){var e=t&&(n&&t[n]||t[c]);if("function"==typeof e)return e}(e);if(!r)return!1;var i,o=r.call(e);if(r!==e.entries){for(;!(i=o.next()).done;)if(!y(i.value))return!1}else for(;!(i=o.next()).done;){var u=i.value;if(u&&!y(u[1]))return!1}return!0;default:return!1}}function g(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":function(t,e){return"symbol"===t||"Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol}(e,t)?"symbol":e}function m(t){if(void 0===t||null===t)return""+t;var e=g(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function _(t){var e=m(t);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}return h.prototype=Error.prototype,l.checkPropTypes=s,l.PropTypes=l,l}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i){}},function(t,e,n){"use strict";t.exports="15.6.2"},function(t,e,n){"use strict";var r=n(158).Component,i=n(32).isValidElement,o=n(159),u=n(319);t.exports=u(r,i,o)},function(t,e,n){"use strict";var r=n(46),i=n(161),o=n(20),u="mixins";t.exports=function(t,e,n){var a=[],s={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},c={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},f={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)p(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=r({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=r({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=d(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=r({},t.propTypes,e)},statics:function(t,e){!function(t,e){if(e)for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){var i=n in f;o(!i,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var u=n in t;if(u){var a=c.hasOwnProperty(n)?c[n]:null;return o("DEFINE_MANY_MERGED"===a,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),void(t[n]=d(t[n],r))}t[n]=r}}}(t,e)},autobind:function(){}};function l(t,e){var n=s.hasOwnProperty(e)?s[e]:null;_.hasOwnProperty(e)&&o("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&o("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function p(t,n){if(n){o("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),o(!e(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=t.prototype,i=r.__reactAutoBindPairs;for(var a in n.hasOwnProperty(u)&&f.mixins(t,n.mixins),n)if(n.hasOwnProperty(a)&&a!==u){var c=n[a],p=r.hasOwnProperty(a);if(l(p,a),f.hasOwnProperty(a))f[a](t,c);else{var h=s.hasOwnProperty(a);if("function"!=typeof c||h||p||!1===n.autobind)if(p){var y=s[a];o(h&&("DEFINE_MANY_MERGED"===y||"DEFINE_MANY"===y),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",y,a),"DEFINE_MANY_MERGED"===y?r[a]=d(r[a],c):"DEFINE_MANY"===y&&(r[a]=v(r[a],c))}else r[a]=c;else i.push(a,c),r[a]=c}}}}function h(t,e){for(var n in o(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."),e)e.hasOwnProperty(n)&&(o(void 0===t[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),t[n]=e[n]);return t}function d(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var i={};return h(i,n),h(i,r),i}}function v(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function y(t,e){var n=e.bind(t);return n}var g={componentDidMount:function(){this.__isMounted=!0}},m={componentWillUnmount:function(){this.__isMounted=!1}},_={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e)},isMounted:function(){return!!this.__isMounted}},b=function(){};return r(b.prototype,t.prototype,_),function(t){var e=function(t,r,u){this.__reactAutoBindPairs.length&&function(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t[r]=y(t,i)}}(this),this.props=t,this.context=r,this.refs=i,this.updater=u||n,this.state=null;var a=this.getInitialState?this.getInitialState():null;o("object"==typeof a&&!Array.isArray(a),"%s.getInitialState(): must return an object or null",e.displayName||"ReactCompositeComponent"),this.state=a};for(var r in e.prototype=new b,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],a.forEach(p.bind(null,e)),p(e,g),p(e,t),p(e,m),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),o(e.prototype.render,"createClass(...): Class specification must implement a `render` method."),s)e.prototype[r]||(e.prototype[r]=null);return e}}},function(t,e,n){"use strict";var r=n(65),i=n(32);n(20);t.exports=function(t){return i.isValidElement(t)||r("143"),t}},function(t,e,n){"use strict";var r=n(67),i=n(20),o=n(164);t.exports=function(){function t(t,e,n,r,u,a){a!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return{components:{Topbar:o.default}}};var r,i=n(323),o=(r=i)&&r.__esModule?r:{default:r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(n(148)),i=p(n(150)),o=p(n(151)),u=p(n(153)),a=p(n(156)),s=n(157),c=p(s),f=(p(n(165)),p(n(324))),l=n(166);function p(t){return t&&t.__esModule?t:{default:t}}var h=function(t){function e(t,n){(0,i.default)(this,e);var o=(0,u.default)(this,(e.__proto__||(0,r.default)(e)).call(this,t,n));return o.onUrlChange=function(t){var e=t.target.value;o.setState({url:e})},o.loadSpec=function(t){o.props.specActions.updateUrl(t),o.props.specActions.download(t)},o.onUrlSelect=function(t){var e=t.target.value||t.target.href;o.loadSpec(e),o.setSelectedUrl(e),t.preventDefault()},o.downloadUrl=function(t){o.loadSpec(o.state.url),t.preventDefault()},o.setSearch=function(t){var e=(0,l.parseSearch)();e["urls.primaryName"]=t.name;var n=window.location.protocol+"//"+window.location.host+window.location.pathname;window&&window.history&&window.history.pushState&&window.history.replaceState(null,"",n+"?"+(0,l.serializeSearch)(e))},o.setSelectedUrl=function(t){var e=o.props.getConfigs().urls||[];e&&e.length&&t&&e.forEach(function(e,n){e.url===t&&(o.setState({selectedIndex:n}),o.setSearch(e))})},o.onFilterChange=function(t){var e=t.target.value;o.props.layoutActions.updateFilter(e)},o.state={url:t.specSelectors.url(),selectedIndex:0},o}return(0,a.default)(e,t),(0,o.default)(e,[{key:"componentWillReceiveProps",value:function(t){this.setState({url:t.specSelectors.url()})}},{key:"componentWillMount",value:function(){var t=this,e=this.props.getConfigs(),n=e.urls||[];if(n&&n.length){var r=e["urls.primaryName"];r&&n.forEach(function(e,n){e.name===r&&t.setState({selectedIndex:n})})}}},{key:"componentDidMount",value:function(){var t=this.props.getConfigs().urls||[];t&&t.length&&this.loadSpec(t[this.state.selectedIndex].url)}},{key:"render",value:function(){var t=this.props,e=t.getComponent,n=t.specSelectors,r=t.getConfigs,i=e("Button"),o=e("Link"),u="loading"===n.loadingStatus(),a={};"failed"===n.loadingStatus()&&(a.color="red"),u&&(a.color="#aaa");var l=r().urls,p=[],h=null;if(l){var d=[];l.forEach(function(t,e){d.push(c.default.createElement("option",{key:e,value:t.url},t.name))}),p.push(c.default.createElement("label",{className:"select-label",htmlFor:"select"},c.default.createElement("span",null,"Select a spec"),c.default.createElement("select",{id:"select",disabled:u,onChange:this.onUrlSelect,value:l[this.state.selectedIndex].url},d)))}else h=this.downloadUrl,p.push(c.default.createElement("input",{className:"download-url-input",type:"text",onChange:this.onUrlChange,value:this.state.url,disabled:u,style:a})),p.push(c.default.createElement(i,{className:"download-url-button",onClick:this.downloadUrl},"Explore"));return c.default.createElement("div",{className:"topbar"},c.default.createElement("div",{className:"wrapper"},c.default.createElement("div",{className:"topbar-wrapper"},c.default.createElement(o,null,c.default.createElement("img",{height:"30",width:"30",src:f.default,alt:"Swagger UI"}),c.default.createElement("span",null,"swagger")),c.default.createElement("form",{className:"download-url-wrapper",onSubmit:h},p.map(function(t,e){return(0,s.cloneElement)(t,{key:e})})))))}}]),e}(c.default.Component);e.default=h},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAAYFBMVEUAAABUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwB0lzB/n0BfhxBpjyC0x4////+qv4CJp1D09++ft3C/z5/K16/U379UfwDf58/q79+Ur2D2RCk9AAAAHXRSTlMAEEAwn9//z3Agv4/vYID/////////////////UMeji1kAAAD8SURBVHgBlZMFAoQwDATRxbXB7f+vPKnlXAZn6k2cf3A9z/PfOC8IIYni5FmmABM8FMhwT17c9hnhiZL1CwvEL1tmPD0qSKq6gaStW/kMXanVmAVRDUlH1OvuuTINo6k90Sxf8qsOtF6g4ff1osP3OnMcV7d4pzdIUtu1oA4V0DZoKmxmlEYvtDUjjS3tmKmqB+pYy8pD1VPf7jPE0I40HHcaBwnue6fGzgyS5tXIU96PV7rkDWHNLV0DK4FkoKmFpN5oUnvi8KoeA2/JXsmXQuokx0siR1G8tLkN6eB9sLwJp/yymcyaP/TrP+RPmbMMixcJVgTR1aUZ93oGXsgXQAaG6EwAAAAASUVORK5CYII="},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){for(var e,n=c(t),r=n[0],u=n[1],a=new o(function(t,e,n){return 3*(e+n)/4-n}(0,r,u)),s=0,f=u>0?r-4:r,l=0;l<f;l+=4)e=i[t.charCodeAt(l)]<<18|i[t.charCodeAt(l+1)]<<12|i[t.charCodeAt(l+2)]<<6|i[t.charCodeAt(l+3)],a[s++]=e>>16&255,a[s++]=e>>8&255,a[s++]=255&e;2===u&&(e=i[t.charCodeAt(l)]<<2|i[t.charCodeAt(l+1)]>>4,a[s++]=255&e);1===u&&(e=i[t.charCodeAt(l)]<<10|i[t.charCodeAt(l+1)]<<4|i[t.charCodeAt(l+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e);return a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],u=0,a=n-i;u<a;u+=16383)o.push(f(t,u,u+16383>a?a:u+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=u.length;a<s;++a)r[a]=u[a],i[u.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function f(t,e,n){for(var i,o,u=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),u.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return u.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,u,a=8*i-r-1,s=(1<<a)-1,c=s>>1,f=-7,l=n?i-1:0,p=n?-1:1,h=t[e+l];for(l+=p,o=h&(1<<-f)-1,h>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=p,f-=8);for(u=o&(1<<-f)-1,o>>=-f,f+=r;f>0;u=256*u+t[e+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===s)return u?NaN:1/0*(h?-1:1);u+=Math.pow(2,r),o-=c}return(h?-1:1)*u*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var u,a,s,c=8*o-i-1,f=(1<<c)-1,l=f>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,d=r?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=f):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),(e+=u+l>=1?p/s:p*Math.pow(2,1-l))*s>=2&&(u++,s/=2),u+l>=f?(a=0,u=f):u+l>=1?(a=(e*s-1)*Math.pow(2,i),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),u=0));i>=8;t[n+h]=255&a,h+=d,a/=256,i-=8);for(u=u<<i|a,c+=i;c>0;t[n+h]=255&u,h+=d,u/=256,c-=8);t[n+h-d]|=128*v}},function(t,e,n){t.exports={default:n(328),__esModule:!0}},function(t,e,n){var r=n(2),i=r.JSON||(r.JSON={stringify:JSON.stringify});t.exports=function(t){return i.stringify.apply(i,arguments)}},function(t,e,n){"use strict";e.__esModule=!0;var r=o(n(330)),i=o(n(84));function o(t){return t&&t.__esModule?t:{default:t}}e.default=function(){return function(t,e){if(Array.isArray(t))return t;if((0,r.default)(Object(t)))return function(t,e){var n=[],r=!0,o=!1,u=void 0;try{for(var a,s=(0,i.default)(t);!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,u=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw u}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(t,e,n){t.exports={default:n(331),__esModule:!0}},function(t,e,n){n(85),n(96),t.exports=n(332)},function(t,e,n){var r=n(132),i=n(6)("iterator"),o=n(39);t.exports=n(2).isIterable=function(t){var e=Object(t);return void 0!==e[i]||"@@iterator"in e||o.hasOwnProperty(r(e))}},function(t,e,n){t.exports={default:n(334),__esModule:!0}},function(t,e,n){n(335),t.exports=n(2).Object.assign},function(t,e,n){var r=n(13);r(r.S+r.F,"Object",{assign:n(336)})},function(t,e,n){"use strict";var r=n(40),i=n(108),o=n(64),u=n(56),a=n(124),s=Object.assign;t.exports=!s||n(29)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=s({},t)[n]||Object.keys(s({},e)).join("")!=r})?function(t,e){for(var n=u(t),s=arguments.length,c=1,f=i.f,l=o.f;s>c;)for(var p,h=a(arguments[c++]),d=f?r(h).concat(f(h)):r(h),v=d.length,y=0;v>y;)l.call(h,p=d[y++])&&(n[p]=h[p]);return n}:s},function(t,e,n){t.exports={default:n(338),__esModule:!0}},function(t,e,n){n(339),t.exports=n(2).Object.keys},function(t,e,n){var r=n(56),i=n(40);n(149)("keys",function(){return function(t){return i(r(t))}})},function(t,e,n){"use strict";var r=/^(%20|\s)*(javascript|data)/im,i=/[^\x20-\x7E]/gim,o=/^([^:]+):/gm,u=[".","/"];t.exports={sanitizeUrl:function(t){var e,n,a=t.replace(i,"");return function(t){return u.indexOf(t[0])>-1}(a)?a:(n=a.match(o))?(e=n[0],r.test(e)?"about:blank":a):"about:blank"}}},function(t,e,n){var r=n(342),i=n(353)(function(t,e,n){return e=e.toLowerCase(),t+(n?r(e):e)});t.exports=i},function(t,e,n){var r=n(47),i=n(170);t.exports=function(t){return i(r(t).toLowerCase())}},function(t,e,n){var r=n(69),i=n(344),o=n(8),u=n(70),a=1/0,s=r?r.prototype:void 0,c=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(u(e))return c?c.call(e):"";var n=e+"";return"0"==n&&1/e==-a?"-0":n}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},function(t,e,n){var r=n(69),i=Object.prototype,o=i.hasOwnProperty,u=i.toString,a=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var i=u.call(t);return r&&(e?t[a]=n:delete t[a]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r=n(348),i=n(171),o=n(350),u=n(47);t.exports=function(t){return function(e){e=u(e);var n=i(e)?o(e):void 0,a=n?n[0]:e.charAt(0),s=n?r(n,1).join(""):e.slice(1);return a[t]()+s}}},function(t,e,n){var r=n(349);t.exports=function(t,e,n){var i=t.length;return n=void 0===n?i:n,!e&&n>=i?t:r(t,e,n)}},function(t,e){t.exports=function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}},function(t,e,n){var r=n(351),i=n(171),o=n(352);t.exports=function(t){return i(t)?o(t):r(t)}},function(t,e){t.exports=function(t){return t.split("")}},function(t,e){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+r+"|"+i+")"+"?",c="[\\ufe0e\\ufe0f]?"+s+("(?:\\u200d(?:"+[o,u,a].join("|")+")[\\ufe0e\\ufe0f]?"+s+")*"),f="(?:"+[o+r+"?",r,u,a,n].join("|")+")",l=RegExp(i+"(?="+i+")|"+f+c,"g");t.exports=function(t){return t.match(l)||[]}},function(t,e,n){var r=n(354),i=n(355),o=n(358),u=RegExp("['’]","g");t.exports=function(t){return function(e){return r(o(i(e).replace(u,"")),t,"")}}},function(t,e){t.exports=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}},function(t,e,n){var r=n(356),i=n(47),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,u=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");t.exports=function(t){return(t=i(t))&&t.replace(o,r).replace(u,"")}},function(t,e,n){var r=n(357)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});t.exports=r},function(t,e){t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},function(t,e,n){var r=n(359),i=n(360),o=n(47),u=n(361);t.exports=function(t,e,n){return t=o(t),void 0===(e=n?void 0:e)?i(t)?u(t):r(t):t.match(e)||[]}},function(t,e){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;t.exports=function(t){return t.match(n)||[]}},function(t,e){var n=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;t.exports=function(t){return n.test(t)}},function(t,e){var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",r="["+n+"]",i="\\d+",o="[\\u2700-\\u27bf]",u="[a-z\\xdf-\\xf6\\xf8-\\xff]",a="[^\\ud800-\\udfff"+n+i+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]",f="[A-Z\\xc0-\\xd6\\xd8-\\xde]",l="(?:"+u+"|"+a+")",p="(?:"+f+"|"+a+")",h="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",d="[\\ufe0e\\ufe0f]?"+h+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",s,c].join("|")+")[\\ufe0e\\ufe0f]?"+h+")*"),v="(?:"+[o,s,c].join("|")+")"+d,y=RegExp([f+"?"+u+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[r,f,"$"].join("|")+")",p+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[r,f+l,"$"].join("|")+")",f+"?"+l+"+(?:['’](?:d|ll|m|re|s|t|ve))?",f+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",i,v].join("|"),"g");t.exports=function(t){return t.match(y)||[]}},function(t,e,n){var r=n(363),i=n(72),o=n(110);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(364),i=n(369),o=n(370),u=n(371),a=n(372);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=u,s.prototype.set=a,t.exports=s},function(t,e,n){var r=n(71);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e,n){var r=n(173),i=n(366),o=n(50),u=n(174),a=/^\[object .+?Constructor\]$/,s=Function.prototype,c=Object.prototype,f=s.toString,l=c.hasOwnProperty,p=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?p:a).test(u(t))}},function(t,e,n){var r,i=n(367),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},function(t,e,n){var r=n(7)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(71),i="__lodash_hash_undefined__",o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return n===i?void 0:n}return o.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(71),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},function(t,e,n){var r=n(71),i="__lodash_hash_undefined__";t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?i:e,this}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(73),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():i.call(e,n,1),--this.size,0))}},function(t,e,n){var r=n(73);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(73);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(73);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(75);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(75);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(75);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(75);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},function(t,e,n){var r=n(384)(n(436));t.exports=r},function(t,e,n){var r=n(111),i=n(77),o=n(76);t.exports=function(t){return function(e,n,u){var a=Object(e);if(!i(e)){var s=r(n,3);e=o(e),n=function(t){return s(a[t],t,a)}}var c=t(e,n,u);return c>-1?a[s?e[c]:c]:void 0}}},function(t,e,n){var r=n(386),i=n(424),o=n(184);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(175),i=n(176),o=1,u=2;t.exports=function(t,e,n,a){var s=n.length,c=s,f=!a;if(null==t)return!c;for(t=Object(t);s--;){var l=n[s];if(f&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<c;){var p=(l=n[s])[0],h=t[p],d=l[1];if(f&&l[2]){if(void 0===h&&!(p in t))return!1}else{var v=new r;if(a)var y=a(h,d,p,t,e,v);if(!(void 0===y?i(d,h,o|u,a,v):y))return!1}}return!0}},function(t,e,n){var r=n(72);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(72),i=n(110),o=n(109),u=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<u-1)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(175),i=n(177),o=n(397),u=n(401),a=n(419),s=n(8),c=n(180),f=n(182),l=1,p="[object Arguments]",h="[object Array]",d="[object Object]",v=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,y,g,m){var _=s(t),b=s(e),w=_?h:a(t),x=b?h:a(e),S=(w=w==p?d:w)==d,E=(x=x==p?d:x)==d,A=w==x;if(A&&c(t)){if(!c(e))return!1;_=!0,S=!1}if(A&&!S)return m||(m=new r),_||f(t)?i(t,e,n,y,g,m):o(t,e,w,n,y,g,m);if(!(n&l)){var O=S&&v.call(t,"__wrapped__"),j=E&&v.call(e,"__wrapped__");if(O||j){var k=O?t.value():t,I=j?e.value():e;return m||(m=new r),g(k,I,n,y,m)}}return!!A&&(m||(m=new r),u(t,e,n,y,g,m))}},function(t,e,n){var r=n(109),i=n(394),o=n(395);function u(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}u.prototype.add=u.prototype.push=i,u.prototype.has=o,t.exports=u},function(t,e){var n="__lodash_hash_undefined__";t.exports=function(t){return this.__data__.set(t,n),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(69),i=n(398),o=n(74),u=n(177),a=n(399),s=n(400),c=1,f=2,l="[object Boolean]",p="[object Date]",h="[object Error]",d="[object Map]",v="[object Number]",y="[object RegExp]",g="[object Set]",m="[object String]",_="[object Symbol]",b="[object ArrayBuffer]",w="[object DataView]",x=r?r.prototype:void 0,S=x?x.valueOf:void 0;t.exports=function(t,e,n,r,x,E,A){switch(n){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case b:return!(t.byteLength!=e.byteLength||!E(new i(t),new i(e)));case l:case p:case v:return o(+t,+e);case h:return t.name==e.name&&t.message==e.message;case y:case m:return t==e+"";case d:var O=a;case g:var j=r&c;if(O||(O=s),t.size!=e.size&&!j)return!1;var k=A.get(t);if(k)return k==e;r|=f,A.set(t,e);var I=u(O(t),O(e),r,x,E,A);return A.delete(t),I;case _:if(S)return S.call(t)==S.call(e)}return!1}},function(t,e,n){var r=n(7).Uint8Array;t.exports=r},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}},function(t,e,n){var r=n(402),i=1,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,u,a,s){var c=n&i,f=r(t),l=f.length;if(l!=r(e).length&&!c)return!1;for(var p=l;p--;){var h=f[p];if(!(c?h in e:o.call(e,h)))return!1}var d=s.get(t);if(d&&s.get(e))return d==e;var v=!0;s.set(t,e),s.set(e,t);for(var y=c;++p<l;){var g=t[h=f[p]],m=e[h];if(u)var _=c?u(m,g,h,e,t,s):u(g,m,h,t,e,s);if(!(void 0===_?g===m||a(g,m,n,u,s):_)){v=!1;break}y||(y="constructor"==h)}if(v&&!y){var b=t.constructor,w=e.constructor;b!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(v=!1)}return s.delete(t),s.delete(e),v}},function(t,e,n){var r=n(403),i=n(405),o=n(76);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(404),i=n(8);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},function(t,e,n){var r=n(406),i=n(407),o=Object.prototype.propertyIsEnumerable,u=Object.getOwnPropertySymbols,a=u?function(t){return null==t?[]:(t=Object(t),r(u(t),function(e){return o.call(t,e)}))}:i;t.exports=a},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var u=t[n];e(u,n,t)&&(o[i++]=u)}return o}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(409),i=n(179),o=n(8),u=n(180),a=n(112),s=n(182),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),f=!n&&i(t),l=!n&&!f&&u(t),p=!n&&!f&&!l&&s(t),h=n||f||l||p,d=h?r(t.length,String):[],v=d.length;for(var y in t)!e&&!c.call(t,y)||h&&("length"==y||l&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||a(y,v))||d.push(y);return d}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(48),i=n(49),o="[object Arguments]";t.exports=function(t){return i(t)&&r(t)==o}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(48),i=n(113),o=n(49),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!u[r(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){(function(t){var r=n(169),i="object"==typeof e&&e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,u=o&&o.exports===i&&r.process,a=function(){try{var t=o&&o.require&&o.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}();t.exports=a}).call(e,n(181)(t))},function(t,e,n){var r=n(416),i=n(417),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(418)(Object.keys,Object);t.exports=r},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(420),i=n(110),o=n(421),u=n(422),a=n(423),s=n(48),c=n(174),f=c(r),l=c(i),p=c(o),h=c(u),d=c(a),v=s;(r&&"[object DataView]"!=v(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=v(new i)||o&&"[object Promise]"!=v(o.resolve())||u&&"[object Set]"!=v(new u)||a&&"[object WeakMap]"!=v(new a))&&(v=function(t){var e=s(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case f:return"[object DataView]";case l:return"[object Map]";case p:return"[object Promise]";case h:return"[object Set]";case d:return"[object WeakMap]"}return e}),t.exports=v},function(t,e,n){var r=n(33)(n(7),"DataView");t.exports=r},function(t,e,n){var r=n(33)(n(7),"Promise");t.exports=r},function(t,e,n){var r=n(33)(n(7),"Set");t.exports=r},function(t,e,n){var r=n(33)(n(7),"WeakMap");t.exports=r},function(t,e,n){var r=n(183),i=n(76);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],u=t[o];e[n]=[o,u,r(u)]}return e}},function(t,e,n){var r=n(176),i=n(426),o=n(429),u=n(114),a=n(183),s=n(184),c=n(78),f=1,l=2;t.exports=function(t,e){return u(t)&&a(e)?s(c(t),e):function(n){var u=i(n,t);return void 0===u&&u===e?o(n,t):r(e,u,f|l)}}},function(t,e,n){var r=n(185);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},function(t,e,n){var r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,o=n(428)(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(r,function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)}),e});t.exports=o},function(t,e,n){var r=n(172),i=500;t.exports=function(t){var e=r(t,function(t){return n.size===i&&n.clear(),t}),n=e.cache;return e}},function(t,e,n){var r=n(430),i=n(431);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(186),i=n(179),o=n(8),u=n(112),a=n(113),s=n(78);t.exports=function(t,e,n){for(var c=-1,f=(e=r(e,t)).length,l=!1;++c<f;){var p=s(e[c]);if(!(l=null!=t&&n(t,p)))break;t=t[p]}return l||++c!=f?l:!!(f=null==t?0:t.length)&&a(f)&&u(p,f)&&(o(t)||i(t))}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(434),i=n(435),o=n(114),u=n(78);t.exports=function(t){return o(t)?r(u(t)):i(t)}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(185);t.exports=function(t){return function(e){return r(e,t)}}},function(t,e,n){var r=n(437),i=n(111),o=n(438),u=Math.max;t.exports=function(t,e,n){var a=null==t?0:t.length;if(!a)return-1;var s=null==n?0:o(n);return s<0&&(s=u(a+s,0)),r(t,i(e,3),s)}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},function(t,e,n){var r=n(439);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(440),i=1/0,o=1.7976931348623157e308;t.exports=function(t){return t?(t=r(t))===i||t===-i?(t<0?-1:1)*o:t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(50),i=n(70),o=NaN,u=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return o;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(u,"");var n=s.test(t);return n||c.test(t)?f(t.slice(2),n?2:8):a.test(t)?o:+t}},function(t,e,n){var r=n(178),i=n(111),o=n(442),u=n(8),a=n(448);t.exports=function(t,e,n){var s=u(t)?r:o;return n&&a(t,e,n)&&(e=void 0),s(t,i(e,3))}},function(t,e,n){var r=n(443);t.exports=function(t,e){var n;return r(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}},function(t,e,n){var r=n(444),i=n(447)(r);t.exports=i},function(t,e,n){var r=n(445),i=n(76);t.exports=function(t,e){return t&&r(t,e,i)}},function(t,e,n){var r=n(446)();t.exports=r},function(t,e){t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),u=r(e),a=u.length;a--;){var s=u[t?a:++i];if(!1===n(o[s],s,o))break}return e}}},function(t,e,n){var r=n(77);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,u=e?o:-1,a=Object(n);(e?u--:++u<o)&&!1!==i(a[u],u,a););return n}}},function(t,e,n){var r=n(74),i=n(77),o=n(112),u=n(50);t.exports=function(t,e,n){if(!u(n))return!1;var a=typeof e;return!!("number"==a?i(n)&&o(e,n.length):"string"==a&&e in n)&&r(n[e],t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.memoizedSampleFromSchema=e.memoizedCreateXMLExample=e.sampleXmlFromSchema=e.inferSchema=e.sampleFromSchema=void 0,e.createXMLExample=l;var r=n(166),i=u(n(450)),o=u(n(463));function u(t){return t&&t.__esModule?t:{default:t}}var a={string:function(){return"string"},string_email:function(){return"[email protected]"},"string_date-time":function(){return(new Date).toISOString()},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(t){return"boolean"!=typeof t.default||t.default}},s=function(t){var e=t=(0,r.objectify)(t),n=e.type,i=e.format,o=a[n+"_"+i]||a[n];return(0,r.isFunc)(o)?o(t):"Unknown Type: "+t.type},c=e.sampleFromSchema=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,r.objectify)(e),o=i.type,u=i.example,a=i.properties,c=i.additionalProperties,f=i.items,l=n.includeReadOnly,p=n.includeWriteOnly;if(void 0!==u)return(0,r.deeplyStripKey)(u,"$$ref",function(t){return"string"==typeof t&&t.indexOf("#")>-1});if(!o)if(a)o="object";else{if(!f)return;o="array"}if("object"===o){var h=(0,r.objectify)(a),d={};for(var v in h)h[v]&&h[v].deprecated||h[v]&&h[v].readOnly&&!l||h[v]&&h[v].writeOnly&&!p||(d[v]=t(h[v],n));if(!0===c)d.additionalProp1={};else if(c)for(var y=(0,r.objectify)(c),g=t(y,n),m=1;m<4;m++)d["additionalProp"+m]=g;return d}return"array"===o?Array.isArray(f.anyOf)?f.anyOf.map(function(e){return t(e,n)}):Array.isArray(f.oneOf)?f.oneOf.map(function(e){return t(e,n)}):[t(f,n)]:e.enum?e.default?e.default:(0,r.normalizeArray)(e.enum)[0]:"file"!==o?s(e):void 0},f=(e.inferSchema=function(t){return t.schema&&(t=t.schema),t.properties&&(t.type="object"),t},e.sampleXmlFromSchema=function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=(0,r.objectify)(e),u=o.type,a=o.properties,c=o.additionalProperties,f=o.items,l=o.example,p=i.includeReadOnly,h=i.includeWriteOnly,d=o.default,v={},y={},g=e.xml,m=g.name,_=g.prefix,b=g.namespace,w=o.enum,x=void 0;if(!u)if(a||c)u="object";else{if(!f)return;u="array"}(m=m||"notagname",n=(_?_+":":"")+m,b)&&(y[_?"xmlns:"+_:"xmlns"]=b);if("array"===u&&f){if(f.xml=f.xml||g||{},f.xml.name=f.xml.name||g.name,g.wrapped)return v[n]=[],Array.isArray(l)?l.forEach(function(e){f.example=e,v[n].push(t(f,i))}):Array.isArray(d)?d.forEach(function(e){f.default=e,v[n].push(t(f,i))}):v[n]=[t(f,i)],y&&v[n].push({_attr:y}),v;var S=[];return Array.isArray(l)?(l.forEach(function(e){f.example=e,S.push(t(f,i))}),S):Array.isArray(d)?(d.forEach(function(e){f.default=e,S.push(t(f,i))}),S):t(f,i)}if("object"===u){var E=(0,r.objectify)(a);for(var A in v[n]=[],l=l||{},E)if(E.hasOwnProperty(A)&&(!E[A].readOnly||p)&&(!E[A].writeOnly||h))if(E[A].xml=E[A].xml||{},E[A].xml.attribute){var O=Array.isArray(E[A].enum)&&E[A].enum[0],j=E[A].example,k=E[A].default;y[E[A].xml.name||A]=void 0!==j&&j||void 0!==l[A]&&l[A]||void 0!==k&&k||O||s(E[A])}else{E[A].xml.name=E[A].xml.name||A,void 0===E[A].example&&void 0!==l[A]&&(E[A].example=l[A]);var I=t(E[A]);Array.isArray(I)?v[n]=v[n].concat(I):v[n].push(I)}return!0===c?v[n].push({additionalProp:"Anything can be here"}):c&&v[n].push({additionalProp:s(c)}),y&&v[n].push({_attr:y}),v}return x=void 0!==l?l:void 0!==d?d:Array.isArray(w)?w[0]:s(e),v[n]=y?[{_attr:y},x]:x,v});function l(t,e){var n=f(t,e);if(n)return(0,i.default)(n,{declaration:!0,indent:"\t"})}e.memoizedCreateXMLExample=(0,o.default)(l),e.memoizedSampleFromSchema=(0,o.default)(c)},function(t,e,n){(function(e){var r=n(451),i=n(452).Stream,o=" ";function u(t,e,n){n=n||0;var i,o,a=(i=e,new Array(n||0).join(i||"")),s=t;if("object"==typeof t&&((s=t[o=Object.keys(t)[0]])&&s._elem))return s._elem.name=o,s._elem.icount=n,s._elem.indent=e,s._elem.indents=a,s._elem.interrupt=s,s._elem;var c,f=[],l=[];function p(t){Object.keys(t).forEach(function(e){f.push(function(t,e){return t+'="'+r(e)+'"'}(e,t[e]))})}switch(typeof s){case"object":if(null===s)break;s._attr&&p(s._attr),s._cdata&&l.push(("<![CDATA["+s._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),s.forEach&&(c=!1,l.push(""),s.forEach(function(t){"object"==typeof t?"_attr"==Object.keys(t)[0]?p(t._attr):l.push(u(t,e,n+1)):(l.pop(),c=!0,l.push(r(t)))}),c||l.push(""));break;default:l.push(r(s))}return{name:o,interrupt:!1,attributes:f,content:l,icount:n,indents:a,indent:e}}function a(t,e,n){if("object"!=typeof e)return t(!1,e);var r=e.interrupt?1:e.content.length;function i(){for(;e.content.length;){var i=e.content.shift();if(void 0!==i){if(o(i))return;a(t,i)}}t(!1,(r>1?e.indents:"")+(e.name?"</"+e.name+">":"")+(e.indent&&!n?"\n":"")),n&&n()}function o(e){return!!e.interrupt&&(e.interrupt.append=t,e.interrupt.end=i,e.interrupt=!1,t(!0),!0)}if(t(!1,e.indents+(e.name?"<"+e.name:"")+(e.attributes.length?" "+e.attributes.join(" "):"")+(r?e.name?">":"":e.name?"/>":"")+(e.indent&&r>1?"\n":"")),!r)return t(!1,e.indent?"\n":"");o(e)||i()}t.exports=function(t,n){"object"!=typeof n&&(n={indent:n});var r,s,c=n.stream?new i:null,f="",l=!1,p=n.indent?!0===n.indent?o:n.indent:"",h=!0;function d(t){h?e.nextTick(t):t()}function v(t,e){if(void 0!==e&&(f+=e),t&&!l&&(c=c||new i,l=!0),t&&l){var n=f;d(function(){c.emit("data",n)}),f=""}}function y(t,e){a(v,u(t,p,p?1:0),e)}function g(){if(c){var t=f;d(function(){c.emit("data",t),c.emit("end"),c.readable=!1,c.emit("close")})}}return d(function(){h=!1}),n.declaration&&(r=n.declaration,s={version:"1.0",encoding:r.encoding||"UTF-8"},r.standalone&&(s.standalone=r.standalone),y({"?xml":{_attr:s}}),f=f.replace("/>","?>")),t&&t.forEach?t.forEach(function(e,n){var r;n+1===t.length&&(r=g),y(e,r)}):y(t,g),c?(c.readable=!0,c):f},t.exports.element=t.exports.Element=function(){var t={_elem:u(Array.prototype.slice.call(arguments)),push:function(t){if(!this.append)throw new Error("not assigned to a parent!");var e=this,n=this._elem.indent;a(this.append,u(t,n,this._elem.icount+(n?1:0)),function(){e.append(!0)})},close:function(t){void 0!==t&&this.push(t),this.end&&this.end()}};return t}}).call(e,n(34))},function(t,e){var n={"&":"&",'"':""","'":"'","<":"<",">":">"};t.exports=function(t){return t&&t.replace?t.replace(/([&"<>'])/g,function(t,e){return n[e]}):t}},function(t,e,n){t.exports=i;var r=n(115).EventEmitter;function i(){r.call(this)}n(35)(i,r),i.Readable=n(116),i.Writable=n(459),i.Duplex=n(460),i.Transform=n(461),i.PassThrough=n(462),i.Stream=i,i.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(n.on("end",a),n.on("close",s));var u=!1;function a(){u||(u=!0,t.end())}function s(){u||(u=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(f(),0===r.listenerCount(this,"error"))throw t}function f(){n.removeListener("data",i),t.removeListener("drain",o),n.removeListener("end",a),n.removeListener("close",s),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",f),n.removeListener("close",f),t.removeListener("close",f)}return n.on("error",c),t.on("error",c),n.on("end",f),n.on("close",f),t.on("close",f),t.emit("pipe",n),t}},function(t,e){},function(t,e,n){"use strict";var r=n(80).Buffer,i=n(455);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e,n,i,o=r.allocUnsafe(t>>>0),u=this.head,a=0;u;)e=u.data,n=o,i=a,e.copy(n,i),a+=u.data.length,u=u.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,u,a,s=1,c={},f=!1,l=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){d(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},r=function(t){o.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,r=function(t){var e=l.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(d,0,t)}:(u="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(u)&&d(+e.data.slice(u.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),r=function(e){t.postMessage(u+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var i={callback:t,args:e};return c[s]=i,r(s),s++},p.clearImmediate=h}function h(t){delete c[t]}function d(t){if(f)setTimeout(d,0,t);else{var e=c[t];if(e){f=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}(e)}finally{h(t),f=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(e,n(11),n(34))},function(t,e,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}}).call(e,n(11))},function(t,e,n){"use strict";t.exports=o;var r=n(192),i=n(51);function o(t){if(!(this instanceof o))return new o(t);r.call(this,t)}i.inherits=n(35),i.inherits(o,r),o.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){t.exports=n(117)},function(t,e,n){t.exports=n(21)},function(t,e,n){t.exports=n(116).Transform},function(t,e,n){t.exports=n(116).PassThrough},function(t,e,n){"use strict";var r=n(193),i=n(195),o=n(468);t.exports=function(t){var e,u=r(arguments[1]);return u.normalizer||0!==(e=u.length=i(u.length,t.length,u.async))&&(u.primitive?!1===e?u.normalizer=n(495):e>1&&(u.normalizer=n(496)(e)):u.normalizer=!1===e?n(497)():1===e?n(501)():n(502)(e)),u.async&&n(503),u.promise&&n(504),u.dispose&&n(510),u.maxAge&&n(511),u.max&&n(514),u.refCounter&&n(516),o(t,u)}},function(t,e,n){"use strict";var r=n(465),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?r(t)*o(i(t)):t}},function(t,e,n){"use strict";t.exports=n(466)()?Math.sign:n(467)},function(t,e,n){"use strict";t.exports=function(){var t=Math.sign;return"function"==typeof t&&(1===t(10)&&-1===t(-20))}},function(t,e,n){"use strict";t.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,n){"use strict";var r=n(12),i=n(81),o=n(24),u=n(470),a=n(195);t.exports=function t(e){var n,s,c;if(r(e),(n=Object(arguments[1])).async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(e,"__memoized__")&&!n.force?e:(s=a(n.length,e.length,n.async&&o.async),c=u(e,s,n),i(o,function(t,e){n[e]&&t(n[e],c,n)}),t.__profiler__&&t.__profiler__(c),c.updateEnv(),c.memoized)}},function(t,e,n){"use strict";var r=n(12),i=n(36),o=Function.prototype.bind,u=Function.prototype.call,a=Object.keys,s=Object.prototype.propertyIsEnumerable;t.exports=function(t,e){return function(n,c){var f,l=arguments[2],p=arguments[3];return n=Object(i(n)),r(c),f=a(n),p&&f.sort("function"==typeof p?o.call(p,n):void 0),"function"!=typeof t&&(t=f[t]),u.call(t,f,function(t,r){return s.call(n,t)?u.call(c,l,n[t],t,n,r):e})}}},function(t,e,n){"use strict";var r=n(471),i=n(197),o=n(82),u=n(481).methods,a=n(482),s=n(494),c=Function.prototype.apply,f=Function.prototype.call,l=Object.create,p=Object.defineProperties,h=u.on,d=u.emit;t.exports=function(t,e,n){var u,v,y,g,m,_,b,w,x,S,E,A,O,j,k,I=l(null);return v=!1!==e?e:isNaN(t.length)?1:t.length,n.normalizer&&(S=s(n.normalizer),y=S.get,g=S.set,m=S.delete,_=S.clear),null!=n.resolvers&&(k=a(n.resolvers)),j=y?i(function(e){var n,i,o=arguments;if(k&&(o=k(o)),null!==(n=y(o))&&hasOwnProperty.call(I,n))return E&&u.emit("get",n,o,this),I[n];if(i=1===o.length?f.call(t,this,o[0]):c.call(t,this,o),null===n){if(null!==(n=y(o)))throw r("Circular invocation","CIRCULAR_INVOCATION");n=g(o)}else if(hasOwnProperty.call(I,n))throw r("Circular invocation","CIRCULAR_INVOCATION");return I[n]=i,A&&u.emit("set",n,null,i),i},v):0===e?function(){var e;if(hasOwnProperty.call(I,"data"))return E&&u.emit("get","data",arguments,this),I.data;if(e=arguments.length?c.call(t,this,arguments):f.call(t,this),hasOwnProperty.call(I,"data"))throw r("Circular invocation","CIRCULAR_INVOCATION");return I.data=e,A&&u.emit("set","data",null,e),e}:function(e){var n,i,o=arguments;if(k&&(o=k(arguments)),i=String(o[0]),hasOwnProperty.call(I,i))return E&&u.emit("get",i,o,this),I[i];if(n=1===o.length?f.call(t,this,o[0]):c.call(t,this,o),hasOwnProperty.call(I,i))throw r("Circular invocation","CIRCULAR_INVOCATION");return I[i]=n,A&&u.emit("set",i,null,n),n},u={original:t,memoized:j,profileName:n.profileName,get:function(t){return k&&(t=k(t)),y?y(t):String(t[0])},has:function(t){return hasOwnProperty.call(I,t)},delete:function(t){var e;hasOwnProperty.call(I,t)&&(m&&m(t),e=I[t],delete I[t],O&&u.emit("delete",t,e))},clear:function(){var t=I;_&&_(),I=l(null),u.emit("clear",t)},on:function(t,e){return"get"===t?E=!0:"set"===t?A=!0:"delete"===t&&(O=!0),h.call(this,t,e)},emit:d,updateEnv:function(){t=u.original}},b=y?i(function(t){var e,n=arguments;k&&(n=k(n)),null!==(e=y(n))&&u.delete(e)},v):0===e?function(){return u.delete("data")}:function(t){return k&&(t=k(arguments)[0]),u.delete(t)},w=i(function(){var t,n=arguments;return 0===e?I.data:(k&&(n=k(n)),t=y?y(n):String(n[0]),I[t])}),x=i(function(){var t,n=arguments;return 0===e?u.has("data"):(k&&(n=k(n)),null!==(t=y?y(n):String(n[0]))&&u.has(t))}),p(j,{__memoized__:o(!0),delete:o(b),clear:o(u.clear),_get:o(w),_has:o(x)}),u}},function(t,e,n){"use strict";var r=n(196),i=n(477),o=n(22),u=Error.captureStackTrace;e=t.exports=function(t){var n=new Error(t),a=arguments[1],s=arguments[2];return o(s)||i(a)&&(s=a,a=null),o(s)&&r(n,s),o(a)&&(n.code=a),u&&u(n,e),n}},function(t,e,n){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";var r=n(474),i=n(36),o=Math.max;t.exports=function(t,e){var n,u,a,s=o(arguments.length,2);for(t=Object(i(t)),a=function(r){try{t[r]=e[r]}catch(t){n||(n=t)}},u=1;u<s;++u)e=arguments[u],r(e).forEach(a);if(void 0!==n)throw n;return t}},function(t,e,n){"use strict";t.exports=n(475)()?Object.keys:n(476)},function(t,e,n){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,n){"use strict";var r=n(22),i=Object.keys;t.exports=function(t){return i(r(t)?Object(t):t)}},function(t,e,n){"use strict";var r=n(22),i={function:!0,object:!0};t.exports=function(t){return r(t)&&i[typeof t]||!1}},function(t,e,n){"use strict";t.exports=n(479)()?String.prototype.contains:n(480)},function(t,e,n){"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(t,e,n){"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},function(t,e,n){"use strict";var r,i,o,u,a,s,c,f=n(82),l=n(12),p=Function.prototype.apply,h=Function.prototype.call,d=Object.create,v=Object.defineProperty,y=Object.defineProperties,g=Object.prototype.hasOwnProperty,m={configurable:!0,enumerable:!1,writable:!0};a={on:r=function(t,e){var n;return l(e),g.call(this,"__ee__")?n=this.__ee__:(n=m.value=d(null),v(this,"__ee__",m),m.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:i=function(t,e){var n,i;return l(e),i=this,r.call(this,t,n=function(){o.call(i,t,n),p.call(e,this,arguments)}),n.__eeOnceListener__=e,this},off:o=function(t,e){var n,r,i,o;if(l(e),!g.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:u=function(t){var e,n,r,i,o;if(g.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;r=i[e];++e)p.call(r,this,o)}else switch(arguments.length){case 1:h.call(i,this);break;case 2:h.call(i,this,arguments[1]);break;case 3:h.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];p.call(i,this,o)}}},s={on:f(r),once:f(i),off:f(o),emit:f(u)},c=y({},s),t.exports=e=function(t){return null==t?d(c):y(Object(t),s)},e.methods=a},function(t,e,n){"use strict";var r,i=n(483),o=n(22),u=n(12),a=Array.prototype.slice;r=function(t){return this.map(function(e,n){return e?e(t[n]):t[n]}).concat(a.call(t,this.length))},t.exports=function(t){return(t=i(t)).forEach(function(t){o(t)&&u(t)}),r.bind(t)}},function(t,e,n){"use strict";var r=n(119),i=Array.isArray;t.exports=function(t){return i(t)?t:r(t)}},function(t,e,n){"use strict";t.exports=function(){var t,e,n=Array.from;return"function"==typeof n&&(e=n(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,n){"use strict";var r=n(486).iterator,i=n(491),o=n(492),u=n(23),a=n(12),s=n(36),c=n(22),f=n(493),l=Array.isArray,p=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;t.exports=function(t){var e,n,v,y,g,m,_,b,w,x,S=arguments[1],E=arguments[2];if(t=Object(s(t)),c(S)&&a(S),this&&this!==Array&&o(this))e=this;else{if(!S){if(i(t))return 1!==(g=t.length)?Array.apply(null,t):((y=new Array(1))[0]=t[0],y);if(l(t)){for(y=new Array(g=t.length),n=0;n<g;++n)y[n]=t[n];return y}}y=[]}if(!l(t))if(void 0!==(w=t[r])){for(_=a(w).call(t),e&&(y=new e),b=_.next(),n=0;!b.done;)x=S?p.call(S,E,b.value,n):b.value,e?(h.value=x,d(y,n,h)):y[n]=x,b=_.next(),++n;g=n}else if(f(t)){for(g=t.length,e&&(y=new e),n=0,v=0;n<g;++n)x=t[n],n+1<g&&(m=x.charCodeAt(0))>=55296&&m<=56319&&(x+=t[++n]),x=S?p.call(S,E,x,v):x,e?(h.value=x,d(y,v,h)):y[v]=x,++v;g=v}if(void 0===g)for(g=u(t.length),e&&(y=new e(g)),n=0;n<g;++n)x=S?p.call(S,E,t[n],n):t[n],e?(h.value=x,d(y,n,h)):y[n]=x;return e&&(h.value=null,y.length=g),y}},function(t,e,n){"use strict";t.exports=n(487)()?Symbol:n(488)},function(t,e,n){"use strict";var r={object:!0,symbol:!0};t.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!r[typeof Symbol.iterator]&&(!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag])}},function(t,e,n){"use strict";var r,i,o,u,a=n(82),s=n(489),c=Object.create,f=Object.defineProperties,l=Object.defineProperty,p=Object.prototype,h=c(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),u=!0}catch(t){}}var d,v=(d=c(null),function(t){for(var e,n,r=0;d[t+(r||"")];)++r;return d[t+=r||""]=!0,l(p,e="@@"+t,a.gs(null,function(t){n||(n=!0,l(this,e,a(t)),n=!1)})),e});o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(t)},t.exports=i=function t(e){var n;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return u?r(e):(n=c(o.prototype),e=void 0===e?"":String(e),f(n,{__description__:a("",e),__name__:a("",v(e))}))},f(i,{for:a(function(t){return h[t]?h[t]:h[t]=i(String(t))}),keyFor:a(function(t){var e;for(e in s(t),h)if(h[e]===t)return e}),hasInstance:a("",r&&r.hasInstance||i("hasInstance")),isConcatSpreadable:a("",r&&r.isConcatSpreadable||i("isConcatSpreadable")),iterator:a("",r&&r.iterator||i("iterator")),match:a("",r&&r.match||i("match")),replace:a("",r&&r.replace||i("replace")),search:a("",r&&r.search||i("search")),species:a("",r&&r.species||i("species")),split:a("",r&&r.split||i("split")),toPrimitive:a("",r&&r.toPrimitive||i("toPrimitive")),toStringTag:a("",r&&r.toStringTag||i("toStringTag")),unscopables:a("",r&&r.unscopables||i("unscopables"))}),f(o.prototype,{constructor:a(i),toString:a("",function(){return this.__name__})}),f(i.prototype,{toString:a(function(){return"Symbol ("+s(this).__description__+")"}),valueOf:a(function(){return s(this)})}),l(i.prototype,i.toPrimitive,a("",function(){var t=s(this);return"symbol"==typeof t?t:t.toString()})),l(i.prototype,i.toStringTag,a("c","Symbol")),l(o.prototype,i.toStringTag,a("c",i.prototype[i.toStringTag])),l(o.prototype,i.toPrimitive,a("c",i.prototype[i.toPrimitive]))},function(t,e,n){"use strict";var r=n(490);t.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,n){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());t.exports=function(t){return r.call(t)===i}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call(n(194));t.exports=function(t){return"function"==typeof t&&r.call(t)===i}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||r.call(t)===i)||!1}},function(t,e,n){"use strict";var r=n(12);t.exports=function(t){var e;return"function"==typeof t?{set:t,get:t}:(e={get:r(t.get)},void 0!==t.set?(e.set=r(t.set),t.delete&&(e.delete=r(t.delete)),t.clear&&(e.clear=r(t.clear)),e):(e.set=e.get,e))}},function(t,e,n){"use strict";t.exports=function(t){var e,n,r=t.length;if(!r)return"";for(e=String(t[n=0]);--r;)e+=""+t[++n];return e}},function(t,e,n){"use strict";t.exports=function(t){return t?function(e){for(var n=String(e[0]),r=0,i=t;--i;)n+=""+e[++r];return n}:function(){return""}}},function(t,e,n){"use strict";var r=n(120),i=Object.create;t.exports=function(){var t=0,e=[],n=i(null);return{get:function(t){var n,i=0,o=e,u=t.length;if(0===u)return o[u]||null;if(o=o[u]){for(;i<u-1;){if(-1===(n=r.call(o[0],t[i])))return null;o=o[1][n],++i}return-1===(n=r.call(o[0],t[i]))?null:o[1][n]||null}return null},set:function(i){var o,u=0,a=e,s=i.length;if(0===s)a[s]=++t;else{for(a[s]||(a[s]=[[],[]]),a=a[s];u<s-1;)-1===(o=r.call(a[0],i[u]))&&(o=a[0].push(i[u])-1,a[1].push([[],[]])),a=a[1][o],++u;-1===(o=r.call(a[0],i[u]))&&(o=a[0].push(i[u])-1),a[1][o]=++t}return n[t]=i,t},delete:function(t){var i,o=0,u=e,a=n[t],s=a.length,c=[];if(0===s)delete u[s];else if(u=u[s]){for(;o<s-1;){if(-1===(i=r.call(u[0],a[o])))return;c.push(u,i),u=u[1][i],++o}if(-1===(i=r.call(u[0],a[o])))return;for(t=u[1][i],u[0].splice(i,1),u[1].splice(i,1);!u[0].length&&c.length;)i=c.pop(),(u=c.pop())[0].splice(i,1),u[1].splice(i,1)}delete n[t]},clear:function(){e=[],n=i(null)}}}},function(t,e,n){"use strict";t.exports=n(499)()?Number.isNaN:n(500)},function(t,e,n){"use strict";t.exports=function(){var t=Number.isNaN;return"function"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},function(t,e,n){"use strict";t.exports=function(t){return t!=t}},function(t,e,n){"use strict";var r=n(120);t.exports=function(){var t=0,e=[],n=[];return{get:function(t){var i=r.call(e,t[0]);return-1===i?null:n[i]},set:function(r){return e.push(r[0]),n.push(++t),t},delete:function(t){var i=r.call(n,t);-1!==i&&(e.splice(i,1),n.splice(i,1))},clear:function(){e=[],n=[]}}}},function(t,e,n){"use strict";var r=n(120),i=Object.create;t.exports=function(t){var e=0,n=[[],[]],o=i(null);return{get:function(e){for(var i,o=0,u=n;o<t-1;){if(-1===(i=r.call(u[0],e[o])))return null;u=u[1][i],++o}return-1===(i=r.call(u[0],e[o]))?null:u[1][i]||null},set:function(i){for(var u,a=0,s=n;a<t-1;)-1===(u=r.call(s[0],i[a]))&&(u=s[0].push(i[a])-1,s[1].push([[],[]])),s=s[1][u],++a;return-1===(u=r.call(s[0],i[a]))&&(u=s[0].push(i[a])-1),s[1][u]=++e,o[e]=i,e},delete:function(e){for(var i,u=0,a=n,s=[],c=o[e];u<t-1;){if(-1===(i=r.call(a[0],c[u])))return;s.push(a,i),a=a[1][i],++u}if(-1!==(i=r.call(a[0],c[u]))){for(e=a[1][i],a[0].splice(i,1),a[1].splice(i,1);!a[0].length&&s.length;)i=s.pop(),(a=s.pop())[0].splice(i,1),a[1].splice(i,1);delete o[e]}},clear:function(){n=[[],[]],o=i(null)}}}},function(t,e,n){"use strict";var r=n(119),i=n(199),o=n(198),u=n(197),a=n(121),s=Array.prototype.slice,c=Function.prototype.apply,f=Object.create;n(24).async=function(t,e){var n,l,p,h=f(null),d=f(null),v=e.memoized,y=e.original;e.memoized=u(function(t){var e=arguments,r=e[e.length-1];return"function"==typeof r&&(n=r,e=s.call(e,0,-1)),v.apply(l=this,p=e)},v);try{o(e.memoized,v)}catch(t){}e.on("get",function(t){var r,i,o;if(n){if(h[t])return"function"==typeof h[t]?h[t]=[h[t],n]:h[t].push(n),void(n=null);r=n,i=l,o=p,n=l=p=null,a(function(){var u;hasOwnProperty.call(d,t)?(u=d[t],e.emit("getasync",t,o,i),c.call(r,u.context,u.args)):(n=r,l=i,p=o,v.apply(i,o))})}}),e.original=function(){var t,i,o,u;return n?(t=r(arguments),i=function t(n){var i,o,s=t.id;if(null!=s){if(delete t.id,i=h[s],delete h[s],i)return o=r(arguments),e.has(s)&&(n?e.delete(s):(d[s]={context:this,args:o},e.emit("setasync",s,"function"==typeof i?1:i.length))),"function"==typeof i?u=c.call(i,this,o):i.forEach(function(t){u=c.call(t,this,o)},this),u}else a(c.bind(t,this,arguments))},o=n,n=l=p=null,t.push(i),u=c.call(y,this,t),i.cb=o,n=i,u):c.call(y,this,arguments)},e.on("set",function(t){n?(h[t]?"function"==typeof h[t]?h[t]=[h[t],n.cb]:h[t].push(n.cb):h[t]=n.cb,delete n.cb,n.id=t,n=null):e.delete(t)}),e.on("delete",function(t){var n;hasOwnProperty.call(h,t)||d[t]&&(n=d[t],delete d[t],e.emit("deleteasync",t,s.call(n.args,1)))}),e.on("clear",function(){var t=d;d=f(null),e.emit("clearasync",i(t,function(t){return s.call(t.args,1)}))})}},function(t,e,n){"use strict";var r=n(199),i=n(505),o=n(506),u=n(508),a=n(200),s=n(121),c=Object.create,f=i("then","then:finally","done","done:finally");n(24).promise=function(t,e){var n=c(null),i=c(null),l=c(null);if(!0===t)t=null;else if(t=o(t),!f[t])throw new TypeError("'"+u(t)+"' is not valid promise mode");e.on("set",function(r,o,u){var c=!1;if(!a(u))return i[r]=u,void e.emit("setasync",r,1);n[r]=1,l[r]=u;var f=function(t){var o=n[r];if(c)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");o&&(delete n[r],i[r]=t,e.emit("setasync",r,o))},p=function(){c=!0,n[r]&&(delete n[r],delete l[r],e.delete(r))},h=t;if(h||(h="then"),"then"===h)u.then(function(t){s(f.bind(this,t))},function(){s(p)});else if("done"===h){if("function"!=typeof u.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");u.done(f,p)}else if("done:finally"===h){if("function"!=typeof u.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof u.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");u.done(f),u.finally(p)}}),e.on("get",function(t,r,i){var o;if(n[t])++n[t];else{o=l[t];var u=function(){e.emit("getasync",t,r,i)};a(o)?"function"==typeof o.done?o.done(u):o.then(function(){s(u)}):u()}}),e.on("delete",function(t){if(delete l[t],n[t])delete n[t];else if(hasOwnProperty.call(i,t)){var r=i[t];delete i[t],e.emit("deleteasync",t,[r])}}),e.on("clear",function(){var t=i;i=c(null),n=c(null),l=c(null),e.emit("clearasync",r(t,function(t){return[t]}))})}},function(t,e,n){"use strict";var r=Array.prototype.forEach,i=Object.create;t.exports=function(t){var e=i(null);return r.call(arguments,function(t){e[t]=!0}),e}},function(t,e,n){"use strict";var r=n(36),i=n(507);t.exports=function(t){return i(r(t))}},function(t,e,n){"use strict";var r=n(118);t.exports=function(t){try{return t&&r(t.toString)?t.toString():String(t)}catch(t){throw new TypeError("Passed argument cannot be stringifed")}}},function(t,e,n){"use strict";var r=n(509),i=/[\n\r\u2028\u2029]/g;t.exports=function(t){var e=r(t);return e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(i,function(t){return JSON.stringify(t).slice(1,-1)})}},function(t,e,n){"use strict";var r=n(118);t.exports=function(t){try{return t&&r(t.toString)?t.toString():String(t)}catch(t){return"[Non-coercible (to string) value]"}}},function(t,e,n){"use strict";var r=n(12),i=n(81),o=n(24),u=Function.prototype.apply;o.dispose=function(t,e,n){var a;if(r(t),n.async&&o.async||n.promise&&o.promise)return e.on("deleteasync",a=function(e,n){u.call(t,null,n)}),void e.on("clearasync",function(t){i(t,function(t,e){a(e,t)})});e.on("delete",a=function(e,n){t(n)}),e.on("clear",function(t){i(t,function(t,e){a(e,t)})})}},function(t,e,n){"use strict";var r=n(119),i=n(81),o=n(121),u=n(200),a=n(512),s=n(24),c=Function.prototype,f=Math.max,l=Math.min,p=Object.create;s.maxAge=function(t,e,n){var h,d,v,y;(t=a(t))&&(h=p(null),d=n.async&&s.async||n.promise&&s.promise?"async":"",e.on("set"+d,function(n){h[n]=setTimeout(function(){e.delete(n)},t),"function"==typeof h[n].unref&&h[n].unref(),y&&(y[n]&&"nextTick"!==y[n]&&clearTimeout(y[n]),y[n]=setTimeout(function(){delete y[n]},v),"function"==typeof y[n].unref&&y[n].unref())}),e.on("delete"+d,function(t){clearTimeout(h[t]),delete h[t],y&&("nextTick"!==y[t]&&clearTimeout(y[t]),delete y[t])}),n.preFetch&&(v=!0===n.preFetch||isNaN(n.preFetch)?.333:f(l(Number(n.preFetch),1),0))&&(y={},v=(1-v)*t,e.on("get"+d,function(t,i,a){y[t]||(y[t]="nextTick",o(function(){var o;"nextTick"===y[t]&&(delete y[t],e.delete(t),n.async&&(i=r(i)).push(c),o=e.memoized.apply(a,i),n.promise&&u(o)&&("function"==typeof o.done?o.done(c,c):o.then(c,c)))}))})),e.on("clear"+d,function(){i(h,function(t){clearTimeout(t)}),h={},y&&(i(y,function(t){"nextTick"!==t&&clearTimeout(t)}),y={})}))}},function(t,e,n){"use strict";var r=n(23),i=n(513);t.exports=function(t){if((t=r(t))>i)throw new TypeError(t+" exceeds maximum possible timeout");return t}},function(t,e,n){"use strict";t.exports=2147483647},function(t,e,n){"use strict";var r=n(23),i=n(515),o=n(24);o.max=function(t,e,n){var u,a,s;(t=r(t))&&(a=i(t),u=n.async&&o.async||n.promise&&o.promise?"async":"",e.on("set"+u,s=function(t){void 0!==(t=a.hit(t))&&e.delete(t)}),e.on("get"+u,s),e.on("delete"+u,a.delete),e.on("clear"+u,a.clear))}},function(t,e,n){"use strict";var r=n(23),i=Object.create,o=Object.prototype.hasOwnProperty;t.exports=function(t){var e,n=0,u=1,a=i(null),s=i(null),c=0;return t=r(t),{hit:function(r){var i=s[r],f=++c;if(a[f]=r,s[r]=f,!i){if(++n<=t)return;return r=a[u],e(r),r}if(delete a[i],u===i)for(;!o.call(a,++u);)continue},delete:e=function(t){var e=s[t];if(e&&(delete a[e],delete s[t],--n,u===e)){if(!n)return c=0,void(u=1);for(;!o.call(a,++u);)continue}},clear:function(){n=0,u=1,a=i(null),s=i(null),c=0}}}},function(t,e,n){"use strict";var r=n(82),i=n(24),o=Object.create,u=Object.defineProperties;i.refCounter=function(t,e,n){var a,s;a=o(null),s=n.async&&i.async||n.promise&&i.promise?"async":"",e.on("set"+s,function(t,e){a[t]=e||1}),e.on("get"+s,function(t){++a[t]}),e.on("delete"+s,function(t){delete a[t]}),e.on("clear"+s,function(){a={}}),u(e.memoized,{deleteRef:r(function(){var t=e.get(arguments);return null===t?null:a[t]?!--a[t]&&(e.delete(t),!0):null}),getRefCount:r(function(){var t=e.get(arguments);return null===t?0:a[t]?a[t]:0})})}},function(t,e,n){(function(e){var n,r;n=void 0!==e?e:this,r=function(t){if(t.CSS&&t.CSS.escape)return t.CSS.escape;var e=function(t){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var e,n=String(t),r=n.length,i=-1,o="",u=n.charCodeAt(0);++i<r;)0!=(e=n.charCodeAt(i))?o+=e>=1&&e<=31||127==e||0==i&&e>=48&&e<=57||1==i&&e>=48&&e<=57&&45==u?"\\"+e.toString(16)+" ":(0!=i||1!=r||45!=e)&&(e>=128||45==e||95==e||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)?n.charAt(i):"\\"+n.charAt(i):o+="�";return o};return t.CSS||(t.CSS={}),t.CSS.escape=e,e},t.exports=r(n)}).call(e,n(11))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return{statePlugins:{spec:{actions:u,selectors:l},configs:{reducers:s.default,actions:o,selectors:a}}}};var r=f(n(519)),i=n(201),o=c(n(204)),u=c(n(541)),a=c(n(542)),s=f(n(543));function c(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function f(t){return t&&t.__esModule?t:{default:t}}var l={getLocalConfig:function(){return(0,i.parseYamlConfig)(r.default)}}},function(t,e){t.exports='---\nurl: "https://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://online.swagger.io/validator"\noauth2RedirectUrl: "http://localhost:3200/oauth2-redirect.html"\n'},function(t,e,n){"use strict";var r=n(521);t.exports=r},function(t,e,n){"use strict";var r=n(522),i=n(540);function o(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}t.exports.Type=n(0),t.exports.Schema=n(38),t.exports.FAILSAFE_SCHEMA=n(122),t.exports.JSON_SCHEMA=n(203),t.exports.CORE_SCHEMA=n(202),t.exports.DEFAULT_SAFE_SCHEMA=n(53),t.exports.DEFAULT_FULL_SCHEMA=n(83),t.exports.load=r.load,t.exports.loadAll=r.loadAll,t.exports.safeLoad=r.safeLoad,t.exports.safeLoadAll=r.safeLoadAll,t.exports.dump=i.dump,t.exports.safeDump=i.safeDump,t.exports.YAMLException=n(52),t.exports.MINIMAL_SCHEMA=n(122),t.exports.SAFE_SCHEMA=n(53),t.exports.DEFAULT_SCHEMA=n(83),t.exports.scan=o("scan"),t.exports.parse=o("parse"),t.exports.compose=o("compose"),t.exports.addConstructor=o("addConstructor")},function(t,e,n){"use strict";var r=n(37),i=n(52),o=n(523),u=n(53),a=n(83),s=Object.prototype.hasOwnProperty,c=1,f=2,l=3,p=4,h=1,d=2,v=3,y=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g=/[\x85\u2028\u2029]/,m=/[,\[\]\{\}]/,_=/^(?:!|!!|![a-z\-]+!)$/i,b=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function w(t){return 10===t||13===t}function x(t){return 9===t||32===t}function S(t){return 9===t||32===t||10===t||13===t}function E(t){return 44===t||91===t||93===t||123===t||125===t}function A(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function O(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t?"\t":9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"
":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function j(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var k=new Array(256),I=new Array(256),M=0;M<256;M++)k[M]=O(M)?1:0,I[M]=O(M);function T(t,e){return new i(e,new o(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function C(t,e){throw T(t,e)}function P(t,e){t.onWarning&&t.onWarning.call(null,T(t,e))}var R={YAML:function(t,e,n){var r,i,o;null!==t.version&&C(t,"duplication of %YAML directive"),1!==n.length&&C(t,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&C(t,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&C(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=o<2,1!==o&&2!==o&&P(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var r,i;2!==n.length&&C(t,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],_.test(r)||C(t,"ill-formed tag handle (first argument) of the TAG directive"),s.call(t.tagMap,r)&&C(t,'there is a previously declared suffix for "'+r+'" tag handle'),b.test(i)||C(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[r]=i}};function N(t,e,n,r){var i,o,u,a;if(e<n){if(a=t.input.slice(e,n),r)for(i=0,o=a.length;i<o;i+=1)9===(u=a.charCodeAt(i))||32<=u&&u<=1114111||C(t,"expected valid JSON character");else y.test(a)&&C(t,"the stream contains non-printable characters");t.result+=a}}function L(t,e,n,i){var o,u,a,c;for(r.isObject(n)||C(t,"cannot merge mappings; the provided source object is unacceptable"),a=0,c=(o=Object.keys(n)).length;a<c;a+=1)u=o[a],s.call(e,u)||(e[u]=n[u],i[u]=!0)}function D(t,e,n,r,i,o,u,a){var c,f;if(i=String(i),null===e&&(e={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(c=0,f=o.length;c<f;c+=1)L(t,e,o[c],n);else L(t,e,o,n);else t.json||s.call(n,i)||!s.call(e,i)||(t.line=u||t.line,t.position=a||t.position,C(t,"duplicated mapping key")),e[i]=o,delete n[i];return e}function z(t){var e;10===(e=t.input.charCodeAt(t.position))?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):C(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function F(t,e,n){for(var r=0,i=t.input.charCodeAt(t.position);0!==i;){for(;x(i);)i=t.input.charCodeAt(++t.position);if(e&&35===i)do{i=t.input.charCodeAt(++t.position)}while(10!==i&&13!==i&&0!==i);if(!w(i))break;for(z(t),i=t.input.charCodeAt(t.position),r++,t.lineIndent=0;32===i;)t.lineIndent++,i=t.input.charCodeAt(++t.position)}return-1!==n&&0!==r&&t.lineIndent<n&&P(t,"deficient indentation"),r}function U(t){var e,n=t.position;return!(45!==(e=t.input.charCodeAt(n))&&46!==e||e!==t.input.charCodeAt(n+1)||e!==t.input.charCodeAt(n+2)||(n+=3,0!==(e=t.input.charCodeAt(n))&&!S(e)))}function B(t,e){1===e?t.result+=" ":e>1&&(t.result+=r.repeat("\n",e-1))}function q(t,e){var n,r,i=t.tag,o=t.anchor,u=[],a=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=u),r=t.input.charCodeAt(t.position);0!==r&&45===r&&S(t.input.charCodeAt(t.position+1));)if(a=!0,t.position++,F(t,!0,-1)&&t.lineIndent<=e)u.push(null),r=t.input.charCodeAt(t.position);else if(n=t.line,V(t,e,l,!1,!0),u.push(t.result),F(t,!0,-1),r=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==r)C(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!a&&(t.tag=i,t.anchor=o,t.kind="sequence",t.result=u,!0)}function Y(t){var e,n,r,i,o=!1,u=!1;if(33!==(i=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&C(t,"duplication of a tag property"),60===(i=t.input.charCodeAt(++t.position))?(o=!0,i=t.input.charCodeAt(++t.position)):33===i?(u=!0,n="!!",i=t.input.charCodeAt(++t.position)):n="!",e=t.position,o){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&62!==i);t.position<t.length?(r=t.input.slice(e,t.position),i=t.input.charCodeAt(++t.position)):C(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!S(i);)33===i&&(u?C(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),_.test(n)||C(t,"named tag handle cannot contain such characters"),u=!0,e=t.position+1)),i=t.input.charCodeAt(++t.position);r=t.input.slice(e,t.position),m.test(r)&&C(t,"tag suffix cannot contain flow indicator characters")}return r&&!b.test(r)&&C(t,"tag name cannot contain such characters: "+r),o?t.tag=r:s.call(t.tagMap,n)?t.tag=t.tagMap[n]+r:"!"===n?t.tag="!"+r:"!!"===n?t.tag="tag:yaml.org,2002:"+r:C(t,'undeclared tag handle "'+n+'"'),!0}function W(t){var e,n;if(38!==(n=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&C(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!S(n)&&!E(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&C(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function V(t,e,n,i,o){var u,a,y,g,m,_,b,O,M=1,T=!1,P=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,u=a=y=p===n||l===n,i&&F(t,!0,-1)&&(T=!0,t.lineIndent>e?M=1:t.lineIndent===e?M=0:t.lineIndent<e&&(M=-1)),1===M)for(;Y(t)||W(t);)F(t,!0,-1)?(T=!0,y=u,t.lineIndent>e?M=1:t.lineIndent===e?M=0:t.lineIndent<e&&(M=-1)):y=!1;if(y&&(y=T||o),1!==M&&p!==n||(b=c===n||f===n?e:e+1,O=t.position-t.lineStart,1===M?y&&(q(t,O)||function(t,e,n){var r,i,o,u,a,s=t.tag,c=t.anchor,l={},h={},d=null,v=null,y=null,g=!1,m=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=l),a=t.input.charCodeAt(t.position);0!==a;){if(r=t.input.charCodeAt(t.position+1),o=t.line,u=t.position,63!==a&&58!==a||!S(r)){if(!V(t,n,f,!1,!0))break;if(t.line===o){for(a=t.input.charCodeAt(t.position);x(a);)a=t.input.charCodeAt(++t.position);if(58===a)S(a=t.input.charCodeAt(++t.position))||C(t,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(D(t,l,h,d,v,null),d=v=y=null),m=!0,g=!1,i=!1,d=t.tag,v=t.result;else{if(!m)return t.tag=s,t.anchor=c,!0;C(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!m)return t.tag=s,t.anchor=c,!0;C(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===a?(g&&(D(t,l,h,d,v,null),d=v=y=null),m=!0,g=!0,i=!0):g?(g=!1,i=!0):C(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,a=r;if((t.line===o||t.lineIndent>e)&&(V(t,e,p,!0,i)&&(g?v=t.result:y=t.result),g||(D(t,l,h,d,v,y,o,u),d=v=y=null),F(t,!0,-1),a=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==a)C(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return g&&D(t,l,h,d,v,null),m&&(t.tag=s,t.anchor=c,t.kind="mapping",t.result=l),m}(t,O,b))||function(t,e){var n,r,i,o,u,a,s,f,l,p,h=!0,d=t.tag,v=t.anchor,y={};if(91===(p=t.input.charCodeAt(t.position)))i=93,a=!1,r=[];else{if(123!==p)return!1;i=125,a=!0,r={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=r),p=t.input.charCodeAt(++t.position);0!==p;){if(F(t,!0,e),(p=t.input.charCodeAt(t.position))===i)return t.position++,t.tag=d,t.anchor=v,t.kind=a?"mapping":"sequence",t.result=r,!0;h||C(t,"missed comma between flow collection entries"),f=s=l=null,o=u=!1,63===p&&S(t.input.charCodeAt(t.position+1))&&(o=u=!0,t.position++,F(t,!0,e)),n=t.line,V(t,e,c,!1,!0),f=t.tag,s=t.result,F(t,!0,e),p=t.input.charCodeAt(t.position),!u&&t.line!==n||58!==p||(o=!0,p=t.input.charCodeAt(++t.position),F(t,!0,e),V(t,e,c,!1,!0),l=t.result),a?D(t,r,y,f,s,l):o?r.push(D(t,null,y,f,s,l)):r.push(s),F(t,!0,e),44===(p=t.input.charCodeAt(t.position))?(h=!0,p=t.input.charCodeAt(++t.position)):h=!1}C(t,"unexpected end of the stream within a flow collection")}(t,b)?P=!0:(a&&function(t,e){var n,i,o,u,a,s=h,c=!1,f=!1,l=e,p=0,y=!1;if(124===(u=t.input.charCodeAt(t.position)))i=!1;else{if(62!==u)return!1;i=!0}for(t.kind="scalar",t.result="";0!==u;)if(43===(u=t.input.charCodeAt(++t.position))||45===u)h===s?s=43===u?v:d:C(t,"repeat of a chomping mode identifier");else{if(!((o=48<=(a=u)&&a<=57?a-48:-1)>=0))break;0===o?C(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):f?C(t,"repeat of an indentation width identifier"):(l=e+o-1,f=!0)}if(x(u)){do{u=t.input.charCodeAt(++t.position)}while(x(u));if(35===u)do{u=t.input.charCodeAt(++t.position)}while(!w(u)&&0!==u)}for(;0!==u;){for(z(t),t.lineIndent=0,u=t.input.charCodeAt(t.position);(!f||t.lineIndent<l)&&32===u;)t.lineIndent++,u=t.input.charCodeAt(++t.position);if(!f&&t.lineIndent>l&&(l=t.lineIndent),w(u))p++;else{if(t.lineIndent<l){s===v?t.result+=r.repeat("\n",c?1+p:p):s===h&&c&&(t.result+="\n");break}for(i?x(u)?(y=!0,t.result+=r.repeat("\n",c?1+p:p)):y?(y=!1,t.result+=r.repeat("\n",p+1)):0===p?c&&(t.result+=" "):t.result+=r.repeat("\n",p):t.result+=r.repeat("\n",c?1+p:p),c=!0,f=!0,p=0,n=t.position;!w(u)&&0!==u;)u=t.input.charCodeAt(++t.position);N(t,n,t.position,!1)}}return!0}(t,b)||function(t,e){var n,r,i;if(39!==(n=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;0!==(n=t.input.charCodeAt(t.position));)if(39===n){if(N(t,r,t.position,!0),39!==(n=t.input.charCodeAt(++t.position)))return!0;r=t.position,t.position++,i=t.position}else w(n)?(N(t,r,i,!0),B(t,F(t,!1,e)),r=i=t.position):t.position===t.lineStart&&U(t)?C(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);C(t,"unexpected end of the stream within a single quoted scalar")}(t,b)||function(t,e){var n,r,i,o,u,a,s;if(34!==(a=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;0!==(a=t.input.charCodeAt(t.position));){if(34===a)return N(t,n,t.position,!0),t.position++,!0;if(92===a){if(N(t,n,t.position,!0),w(a=t.input.charCodeAt(++t.position)))F(t,!1,e);else if(a<256&&k[a])t.result+=I[a],t.position++;else if((u=120===(s=a)?2:117===s?4:85===s?8:0)>0){for(i=u,o=0;i>0;i--)(u=A(a=t.input.charCodeAt(++t.position)))>=0?o=(o<<4)+u:C(t,"expected hexadecimal character");t.result+=j(o),t.position++}else C(t,"unknown escape sequence");n=r=t.position}else w(a)?(N(t,n,r,!0),B(t,F(t,!1,e)),n=r=t.position):t.position===t.lineStart&&U(t)?C(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}C(t,"unexpected end of the stream within a double quoted scalar")}(t,b)?P=!0:!function(t){var e,n,r;if(42!==(r=t.input.charCodeAt(t.position)))return!1;for(r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!S(r)&&!E(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&C(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),t.anchorMap.hasOwnProperty(n)||C(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],F(t,!0,-1),!0}(t)?function(t,e,n){var r,i,o,u,a,s,c,f,l=t.kind,p=t.result;if(S(f=t.input.charCodeAt(t.position))||E(f)||35===f||38===f||42===f||33===f||124===f||62===f||39===f||34===f||37===f||64===f||96===f)return!1;if((63===f||45===f)&&(S(r=t.input.charCodeAt(t.position+1))||n&&E(r)))return!1;for(t.kind="scalar",t.result="",i=o=t.position,u=!1;0!==f;){if(58===f){if(S(r=t.input.charCodeAt(t.position+1))||n&&E(r))break}else if(35===f){if(S(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&U(t)||n&&E(f))break;if(w(f)){if(a=t.line,s=t.lineStart,c=t.lineIndent,F(t,!1,-1),t.lineIndent>=e){u=!0,f=t.input.charCodeAt(t.position);continue}t.position=o,t.line=a,t.lineStart=s,t.lineIndent=c;break}}u&&(N(t,i,o,!1),B(t,t.line-a),i=o=t.position,u=!1),x(f)||(o=t.position+1),f=t.input.charCodeAt(++t.position)}return N(t,i,o,!1),!!t.result||(t.kind=l,t.result=p,!1)}(t,b,c===n)&&(P=!0,null===t.tag&&(t.tag="?")):(P=!0,null===t.tag&&null===t.anchor||C(t,"alias node should not have any properties")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===M&&(P=y&&q(t,O))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(g=0,m=t.implicitTypes.length;g<m;g+=1)if((_=t.implicitTypes[g]).resolve(t.result)){t.result=_.construct(t.result),t.tag=_.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else s.call(t.typeMap[t.kind||"fallback"],t.tag)?(_=t.typeMap[t.kind||"fallback"][t.tag],null!==t.result&&_.kind!==t.kind&&C(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+_.kind+'", not "'+t.kind+'"'),_.resolve(t.result)?(t.result=_.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):C(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):C(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||P}function K(t){var e,n,r,i,o=t.position,u=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(i=t.input.charCodeAt(t.position))&&(F(t,!0,-1),i=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==i));){for(u=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!S(i);)i=t.input.charCodeAt(++t.position);for(r=[],(n=t.input.slice(e,t.position)).length<1&&C(t,"directive name must not be less than one character in length");0!==i;){for(;x(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!w(i));break}if(w(i))break;for(e=t.position;0!==i&&!S(i);)i=t.input.charCodeAt(++t.position);r.push(t.input.slice(e,t.position))}0!==i&&z(t),s.call(R,n)?R[n](t,n,r):P(t,'unknown document directive "'+n+'"')}F(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,F(t,!0,-1)):u&&C(t,"directives end mark is expected"),V(t,t.lineIndent-1,p,!1,!0),F(t,!0,-1),t.checkLineBreaks&&g.test(t.input.slice(o,t.position))&&P(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&U(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,F(t,!0,-1)):t.position<t.length-1&&C(t,"end of the stream or a document separator is expected")}function G(t,e){t=String(t),e=e||{},0!==t.length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var n=new function(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||a,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}(t,e);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)K(n);return n.documents}function $(t,e,n){var r,i,o=G(t,n);if("function"!=typeof e)return o;for(r=0,i=o.length;r<i;r+=1)e(o[r])}function H(t,e){var n=G(t,e);if(0!==n.length){if(1===n.length)return n[0];throw new i("expected a single document in the stream, but found more")}}t.exports.loadAll=$,t.exports.load=H,t.exports.safeLoadAll=function(t,e,n){if("function"!=typeof e)return $(t,r.extend({schema:u},n));$(t,e,r.extend({schema:u},n))},t.exports.safeLoad=function(t,e){return H(t,r.extend({schema:u},e))}},function(t,e,n){"use strict";var r=n(37);function i(t,e,n,r,i){this.name=t,this.buffer=e,this.position=n,this.line=r,this.column=i}i.prototype.getSnippet=function(t,e){var n,i,o,u,a;if(!this.buffer)return null;for(t=t||4,e=e||75,n="",i=this.position;i>0&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(i-1));)if(i-=1,this.position-i>e/2-1){n=" ... ",i+=5;break}for(o="",u=this.position;u<this.buffer.length&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(u));)if((u+=1)-this.position>e/2-1){o=" ... ",u-=5;break}return a=this.buffer.slice(i,u),r.repeat(" ",t)+n+a+o+"\n"+r.repeat(" ",t+this.position-i+n.length)+"^"},i.prototype.toString=function(t){var e,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(n+=":\n"+e),n},t.exports=i},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)},construct:function(t){return"true"===t||"True"===t||"TRUE"===t},predicate:function(t){return"[object Boolean]"===Object.prototype.toString.call(t)},represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(37),i=n(0);function o(t){return 48<=t&&t<=55}function u(t){return 48<=t&&t<=57}t.exports=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,r=t.length,i=0,a=!1;if(!r)return!1;if("-"!==(e=t[i])&&"+"!==e||(e=t[++i]),"0"===e){if(i+1===r)return!0;if("b"===(e=t[++i])){for(i++;i<r;i++)if("_"!==(e=t[i])){if("0"!==e&&"1"!==e)return!1;a=!0}return a&&"_"!==e}if("x"===e){for(i++;i<r;i++)if("_"!==(e=t[i])){if(!(48<=(n=t.charCodeAt(i))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;a=!0}return a&&"_"!==e}for(;i<r;i++)if("_"!==(e=t[i])){if(!o(t.charCodeAt(i)))return!1;a=!0}return a&&"_"!==e}if("_"===e)return!1;for(;i<r;i++)if("_"!==(e=t[i])){if(":"===e)break;if(!u(t.charCodeAt(i)))return!1;a=!0}return!(!a||"_"===e)&&(":"!==e||/^(:[0-5]?[0-9])+$/.test(t.slice(i)))},construct:function(t){var e,n,r=t,i=1,o=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(e=r[0])&&"+"!==e||("-"===e&&(i=-1),e=(r=r.slice(1))[0]),"0"===r?0:"0"===e?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(t){o.unshift(parseInt(t,10))}),r=0,n=1,o.forEach(function(t){r+=t*n,n*=60}),i*r):i*parseInt(r,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!r.isNegativeZero(t)},represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(t,e,n){"use strict";var r=n(37),i=n(0),o=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var u=/^[-+]?[0-9]+e/;t.exports=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!o.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n,r,i;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,i=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(t){i.unshift(parseFloat(t,10))}),e=0,r=1,i.forEach(function(t){e+=t*r,r*=60}),n*e):n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||r.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(t))return"-0.0";return n=t.toString(10),u.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(0),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");t.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==i.exec(t)||null!==o.exec(t))},construct:function(t){var e,n,r,u,a,s,c,f,l=0,p=null;if(null===(e=i.exec(t))&&(e=o.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,u=+e[3],!e[4])return new Date(Date.UTC(n,r,u));if(a=+e[4],s=+e[5],c=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(p=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(p=-p)),f=new Date(Date.UTC(n,r,u,a,s,c,l)),p&&f.setTime(f.getTime()-p),f},instanceOf:Date,represent:function(t){return t.toISOString()}})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}})},function(t,e,n){"use strict";var r;try{r=n(68).Buffer}catch(t){}var i=n(0),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,r=0,i=t.length,u=o;for(n=0;n<i;n++)if(!((e=u.indexOf(t.charAt(n)))>64)){if(e<0)return!1;r+=6}return r%8==0},construct:function(t){var e,n,i=t.replace(/[\r\n=]/g,""),u=i.length,a=o,s=0,c=[];for(e=0;e<u;e++)e%4==0&&e&&(c.push(s>>16&255),c.push(s>>8&255),c.push(255&s)),s=s<<6|a.indexOf(i.charAt(e));return 0==(n=u%4*6)?(c.push(s>>16&255),c.push(s>>8&255),c.push(255&s)):18===n?(c.push(s>>10&255),c.push(s>>2&255)):12===n&&c.push(s>>4&255),r?r.from?r.from(c):new r(c):c},predicate:function(t){return r&&r.isBuffer(t)},represent:function(t){var e,n,r="",i=0,u=t.length,a=o;for(e=0;e<u;e++)e%3==0&&e&&(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]),i=(i<<8)+t[e];return 0==(n=u%3)?(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]):2===n?(r+=a[i>>10&63],r+=a[i>>4&63],r+=a[i<<2&63],r+=a[64]):1===n&&(r+=a[i>>2&63],r+=a[i<<4&63],r+=a[64],r+=a[64]),r}})},function(t,e,n){"use strict";var r=n(0),i=Object.prototype.hasOwnProperty,o=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,r,u,a,s=[],c=t;for(e=0,n=c.length;e<n;e+=1){if(r=c[e],a=!1,"[object Object]"!==o.call(r))return!1;for(u in r)if(i.call(r,u)){if(a)return!1;a=!0}if(!a)return!1;if(-1!==s.indexOf(u))return!1;s.push(u)}return!0},construct:function(t){return null!==t?t:[]}})},function(t,e,n){"use strict";var r=n(0),i=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,r,o,u,a=t;for(u=new Array(a.length),e=0,n=a.length;e<n;e+=1){if(r=a[e],"[object Object]"!==i.call(r))return!1;if(1!==(o=Object.keys(r)).length)return!1;u[e]=[o[0],r[o[0]]]}return!0},construct:function(t){if(null===t)return[];var e,n,r,i,o,u=t;for(o=new Array(u.length),e=0,n=u.length;e<n;e+=1)r=u[e],i=Object.keys(r),o[e]=[i[0],r[i[0]]];return o}})},function(t,e,n){"use strict";var r=n(0),i=Object.prototype.hasOwnProperty;t.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(t){if(null===t)return!0;var e,n=t;for(e in n)if(i.call(n,e)&&null!==n[e])return!1;return!0},construct:function(t){return null!==t?t:{}}})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(t){return void 0===t},represent:function(){return""}})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),r="";if("/"===e[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==e[e.length-r.length-1])return!1}return!0},construct:function(t){var e=t,n=/\/([gim]*)$/.exec(t),r="";return"/"===e[0]&&(n&&(r=n[1]),e=e.slice(1,e.length-r.length-1)),new RegExp(e,r)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}})},function(t,e,n){"use strict";var r;"undefined"!=typeof window&&(r=window.esprima);var i=n(0);t.exports=new i("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e="("+t+")",n=r.parse(e,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(t){return!1}},construct:function(t){var e,n="("+t+")",i=r.parse(n,{range:!0}),o=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"ArrowFunctionExpression"!==i.body[0].expression.type&&"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach(function(t){o.push(t.name)}),e=i.body[0].expression.body.range,"BlockStatement"===i.body[0].expression.body.type?new Function(o,n.slice(e[0]+1,e[1]-1)):new Function(o,"return "+n.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}})},function(t,e,n){"use strict";var r=n(37),i=n(52),o=n(83),u=n(53),a=Object.prototype.toString,s=Object.prototype.hasOwnProperty,c=9,f=10,l=32,p=33,h=34,d=35,v=37,y=38,g=39,m=42,_=44,b=45,w=58,x=62,S=63,E=64,A=91,O=93,j=96,k=123,I=124,M=125,T={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},C=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function P(t){var e,n,o;if(e=t.toString(16).toUpperCase(),t<=255)n="x",o=2;else if(t<=65535)n="u",o=4;else{if(!(t<=4294967295))throw new i("code point within a string may not be greater than 0xFFFFFFFF");n="U",o=8}return"\\"+n+r.repeat("0",o-e.length)+e}function R(t){this.schema=t.schema||o,this.indent=Math.max(1,t.indent||2),this.skipInvalid=t.skipInvalid||!1,this.flowLevel=r.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=function(t,e){var n,r,i,o,u,a,c;if(null===e)return{};for(n={},i=0,o=(r=Object.keys(e)).length;i<o;i+=1)u=r[i],a=String(e[u]),"!!"===u.slice(0,2)&&(u="tag:yaml.org,2002:"+u.slice(2)),(c=t.compiledTypeMap.fallback[u])&&s.call(c.styleAliases,a)&&(a=c.styleAliases[a]),n[u]=a;return n}(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function N(t,e){for(var n,i=r.repeat(" ",e),o=0,u=-1,a="",s=t.length;o<s;)-1===(u=t.indexOf("\n",o))?(n=t.slice(o),o=s):(n=t.slice(o,u+1),o=u+1),n.length&&"\n"!==n&&(a+=i),a+=n;return a}function L(t,e){return"\n"+r.repeat(" ",t.indent*e)}function D(t){return t===l||t===c}function z(t){return 32<=t&&t<=126||161<=t&&t<=55295&&8232!==t&&8233!==t||57344<=t&&t<=65533&&65279!==t||65536<=t&&t<=1114111}function F(t){return z(t)&&65279!==t&&t!==_&&t!==A&&t!==O&&t!==k&&t!==M&&t!==w&&t!==d}function U(t){return/^\n* /.test(t)}var B=1,q=2,Y=3,W=4,V=5;function K(t,e,n,r,i){var o,u,a,s=!1,c=!1,l=-1!==r,T=-1,C=z(a=t.charCodeAt(0))&&65279!==a&&!D(a)&&a!==b&&a!==S&&a!==w&&a!==_&&a!==A&&a!==O&&a!==k&&a!==M&&a!==d&&a!==y&&a!==m&&a!==p&&a!==I&&a!==x&&a!==g&&a!==h&&a!==v&&a!==E&&a!==j&&!D(t.charCodeAt(t.length-1));if(e)for(o=0;o<t.length;o++){if(!z(u=t.charCodeAt(o)))return V;C=C&&F(u)}else{for(o=0;o<t.length;o++){if((u=t.charCodeAt(o))===f)s=!0,l&&(c=c||o-T-1>r&&" "!==t[T+1],T=o);else if(!z(u))return V;C=C&&F(u)}c=c||l&&o-T-1>r&&" "!==t[T+1]}return s||c?n>9&&U(t)?V:c?W:Y:C&&!i(t)?B:q}function G(t,e,n,r){t.dump=function(){if(0===e.length)return"''";if(!t.noCompatMode&&-1!==C.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,n),u=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),a=r||t.flowLevel>-1&&n>=t.flowLevel;switch(K(e,a,t.indent,u,function(e){return function(t,e){var n,r;for(n=0,r=t.implicitTypes.length;n<r;n+=1)if(t.implicitTypes[n].resolve(e))return!0;return!1}(t,e)})){case B:return e;case q:return"'"+e.replace(/'/g,"''")+"'";case Y:return"|"+$(e,t.indent)+H(N(e,o));case W:return">"+$(e,t.indent)+H(N(function(t,e){var n,r,i=/(\n+)([^\n]*)/g,o=(a=t.indexOf("\n"),a=-1!==a?a:t.length,i.lastIndex=a,J(t.slice(0,a),e)),u="\n"===t[0]||" "===t[0];var a;for(;r=i.exec(t);){var s=r[1],c=r[2];n=" "===c[0],o+=s+(u||n||""===c?"":"\n")+J(c,e),u=n}return o}(e,u),o));case V:return'"'+function(t){for(var e,n,r,i="",o=0;o<t.length;o++)(e=t.charCodeAt(o))>=55296&&e<=56319&&(n=t.charCodeAt(o+1))>=56320&&n<=57343?(i+=P(1024*(e-55296)+n-56320+65536),o++):(r=T[e],i+=!r&&z(e)?t[o]:r||P(e));return i}(e)+'"';default:throw new i("impossible error: invalid scalar style")}}()}function $(t,e){var n=U(t)?String(e):"",r="\n"===t[t.length-1];return n+(r&&("\n"===t[t.length-2]||"\n"===t)?"+":r?"":"-")+"\n"}function H(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function J(t,e){if(""===t||" "===t[0])return t;for(var n,r,i=/ [^ ]/g,o=0,u=0,a=0,s="";n=i.exec(t);)(a=n.index)-o>e&&(r=u>o?u:a,s+="\n"+t.slice(o,r),o=r+1),u=a;return s+="\n",t.length-o>e&&u>o?s+=t.slice(o,u)+"\n"+t.slice(u+1):s+=t.slice(o),s.slice(1)}function Z(t,e,n){var r,o,u,c,f,l;for(u=0,c=(o=n?t.explicitTypes:t.implicitTypes).length;u<c;u+=1)if(((f=o[u]).instanceOf||f.predicate)&&(!f.instanceOf||"object"==typeof e&&e instanceof f.instanceOf)&&(!f.predicate||f.predicate(e))){if(t.tag=n?f.tag:"?",f.represent){if(l=t.styleMap[f.tag]||f.defaultStyle,"[object Function]"===a.call(f.represent))r=f.represent(e,l);else{if(!s.call(f.represent,l))throw new i("!<"+f.tag+'> tag resolver accepts not "'+l+'" style');r=f.represent[l](e,l)}t.dump=r}return!0}return!1}function X(t,e,n,r,o,u){t.tag=null,t.dump=n,Z(t,n,!1)||Z(t,n,!0);var s=a.call(t.dump);r&&(r=t.flowLevel<0||t.flowLevel>e);var c,l,p="[object Object]"===s||"[object Array]"===s;if(p&&(l=-1!==(c=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||l||2!==t.indent&&e>0)&&(o=!1),l&&t.usedDuplicates[c])t.dump="*ref_"+c;else{if(p&&l&&!t.usedDuplicates[c]&&(t.usedDuplicates[c]=!0),"[object Object]"===s)r&&0!==Object.keys(t.dump).length?(!function(t,e,n,r){var o,u,a,s,c,l,p="",h=t.tag,d=Object.keys(n);if(!0===t.sortKeys)d.sort();else if("function"==typeof t.sortKeys)d.sort(t.sortKeys);else if(t.sortKeys)throw new i("sortKeys must be a boolean or a function");for(o=0,u=d.length;o<u;o+=1)l="",r&&0===o||(l+=L(t,e)),s=n[a=d[o]],X(t,e+1,a,!0,!0,!0)&&((c=null!==t.tag&&"?"!==t.tag||t.dump&&t.dump.length>1024)&&(t.dump&&f===t.dump.charCodeAt(0)?l+="?":l+="? "),l+=t.dump,c&&(l+=L(t,e)),X(t,e+1,s,!0,c)&&(t.dump&&f===t.dump.charCodeAt(0)?l+=":":l+=": ",p+=l+=t.dump));t.tag=h,t.dump=p||"{}"}(t,e,t.dump,o),l&&(t.dump="&ref_"+c+t.dump)):(!function(t,e,n){var r,i,o,u,a,s="",c=t.tag,f=Object.keys(n);for(r=0,i=f.length;r<i;r+=1)a=t.condenseFlow?'"':"",0!==r&&(a+=", "),u=n[o=f[r]],X(t,e,o,!1,!1)&&(t.dump.length>1024&&(a+="? "),a+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),X(t,e,u,!1,!1)&&(s+=a+=t.dump));t.tag=c,t.dump="{"+s+"}"}(t,e,t.dump),l&&(t.dump="&ref_"+c+" "+t.dump));else if("[object Array]"===s)r&&0!==t.dump.length?(!function(t,e,n,r){var i,o,u="",a=t.tag;for(i=0,o=n.length;i<o;i+=1)X(t,e+1,n[i],!0,!0)&&(r&&0===i||(u+=L(t,e)),t.dump&&f===t.dump.charCodeAt(0)?u+="-":u+="- ",u+=t.dump);t.tag=a,t.dump=u||"[]"}(t,e,t.dump,o),l&&(t.dump="&ref_"+c+t.dump)):(!function(t,e,n){var r,i,o="",u=t.tag;for(r=0,i=n.length;r<i;r+=1)X(t,e,n[r],!1,!1)&&(0!==r&&(o+=","+(t.condenseFlow?"":" ")),o+=t.dump);t.tag=u,t.dump="["+o+"]"}(t,e,t.dump),l&&(t.dump="&ref_"+c+" "+t.dump));else{if("[object String]"!==s){if(t.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+s)}"?"!==t.tag&&G(t,t.dump,e,u)}null!==t.tag&&"?"!==t.tag&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function Q(t,e){var n,r,i=[],o=[];for(function t(e,n,r){var i,o,u;if(null!==e&&"object"==typeof e)if(-1!==(o=n.indexOf(e)))-1===r.indexOf(o)&&r.push(o);else if(n.push(e),Array.isArray(e))for(o=0,u=e.length;o<u;o+=1)t(e[o],n,r);else for(i=Object.keys(e),o=0,u=i.length;o<u;o+=1)t(e[i[o]],n,r)}(t,i,o),n=0,r=o.length;n<r;n+=1)e.duplicates.push(i[o[n]]);e.usedDuplicates=new Array(r)}function tt(t,e){var n=new R(e=e||{});return n.noRefs||Q(t,n),X(n,0,t,!0,!0)?n.dump+"\n":""}t.exports.dump=tt,t.exports.safeDump=function(t,e){return tt(t,r.extend({schema:u},e))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getConfigByUrl=e.downloadConfig=void 0;var r=n(201);e.downloadConfig=function(t){return function(e){return(0,e.fn.fetch)(t)}},e.getConfigByUrl=function(t,e){return function(n){var i=n.specActions;if(t)return i.downloadConfig(t).then(o,o);function o(n){n instanceof Error||n.status>=400?(i.updateLoadingStatus("failedConfig"),i.updateLoadingStatus("failedConfig"),i.updateUrl(""),console.error(n.statusText+" "+t.url),e(null)):e((0,r.parseYamlConfig)(n.text))}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.get=function(t,e){return t.getIn(Array.isArray(e)?e:[e])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i,o=n(205),u=(r=o)&&r.__esModule?r:{default:r},a=n(168),s=n(204);e.default=(i={},(0,u.default)(i,s.UPDATE_CONFIGS,function(t,e){return t.merge((0,a.fromJS)(e.payload))}),(0,u.default)(i,s.TOGGLE_CONFIGS,function(t,e){var n=e.payload,r=t.get(n);return t.set(n,!r)}),i)}])});
//# sourceMappingURL=swagger-ui-standalone-preset.js.map |
packages/jsbattle-admin/src/containers/LeagueList.js | jamro/jsbattle | import React, {Component} from "react";
import Container from 'react-bootstrap/Container';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
import Breadcrumb from 'react-bootstrap/Breadcrumb';
import SideMenu from '../components/SideMenu.js';
import SmartTable from '../components/SmartTable.js';
import Loading from '../components/Loading.js';
import {connect} from 'react-redux';
import {getLeagueList} from '../actions';
class LeagueList extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.getLeagueList();
}
render() {
if(this.props.isLoading) {
return<Loading />;
}
return (
<div>
<Container fluid>
<Row>
<Col lg={3} xl={2} style={{backgroundColor: '#f7f7f7', borderRight: '1px solid #ececec'}} >
<SideMenu />
</Col>
<Col lg={9} xl={10} style={{paddingTop: '1em'}}>
<Breadcrumb>
<Breadcrumb.Item href="#/dashboard">Dashboard</Breadcrumb.Item>
<Breadcrumb.Item active>League</Breadcrumb.Item>
</Breadcrumb>
<SmartTable
columns={[
{name: 'Rank', field: 'rank'},
{name: 'Owner', field: 'ownerName'},
{name: 'Script', field: 'scriptName'},
{name: 'Joined', field: 'joinedAt', format: 'datetime'},
{name: 'Fights', field: 'fights_total', format: 'number'},
{name: 'Wins', field: 'fights_win', format: 'number'},
{name: 'Losts', field: 'fights_lose', format: 'number'},
{name: 'Win %', field: 'fights_win', format: (x, row) => {
if(row.fights_total === 0) {
return '-';
}
const ratio = row.fights_win/row.fights_total;
return `${(100*ratio).toFixed(1)}%`;
}},
{name: 'Score', field: 'score', format: 'number'},
{name: 'Error', field: 'fights_error', format: [
(x) => x/0.7,
'scale'
]},
]}
data={this.props.leaguePage}
onPageRequest={(page) => this.props.getLeagueList(page)}
/>
</Col>
</Row>
</Container>
</div>
);
}
}
const mapStateToProps = (state) => ({
leaguePage: state.league.page,
isLoading: state.loading.LEAGUE_LIST
});
const mapDispatchToProps = (dispatch) => ({
getLeagueList: (page, pageSize) => dispatch(getLeagueList(page, pageSize))
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(LeagueList);
|
docs/src/app/components/pages/components/RaisedButton/Page.js | nathanmarks/material-ui | import React from 'react';
import Title from 'react-title-component';
import CodeExample from '../../../CodeExample';
import PropTypeDescription from '../../../PropTypeDescription';
import MarkdownElement from '../../../MarkdownElement';
import raisedButtonReadmeText from './README';
import raisedButtonExampleSimpleCode from '!raw!./ExampleSimple';
import RaisedButtonExampleSimple from './ExampleSimple';
import raisedButtonExampleComplexCode from '!raw!./ExampleComplex';
import RaisedButtonExampleComplex from './ExampleComplex';
import raisedButtonExampleIconCode from '!raw!./ExampleIcon';
import RaisedButtonExampleIcon from './ExampleIcon';
import raisedButtonCode from '!raw!material-ui/RaisedButton/RaisedButton';
const descriptions = {
simple: '`RaisedButton` with default color, `primary`, `secondary` and and `disabled` props applied.',
complex: 'The first example uses an `input` as a child component, ' +
'the next has next has an [SVG Icon](/#/components/svg-icon), with the label positioned after. ' +
'The final example uses a [Font Icon](/#/components/font-icon), and is wrapped in an anchor tag.',
icon: 'Examples of Raised Buttons using an icon without a label. The first example uses an' +
' [SVG Icon](/#/components/svg-icon), and has the default color. The second example shows' +
' how the icon and background color can be changed. The final example uses a' +
' [Font Icon](/#/components/font-icon), and is wrapped in an anchor tag.',
};
const RaisedButtonPage = () => (
<div>
<Title render={(previousTitle) => `Raised Button - ${previousTitle}`} />
<MarkdownElement text={raisedButtonReadmeText} />
<CodeExample
title="Simple examples"
description={descriptions.simple}
code={raisedButtonExampleSimpleCode}
>
<RaisedButtonExampleSimple />
</CodeExample>
<CodeExample
title="Complex examples"
description={descriptions.complex}
code={raisedButtonExampleComplexCode}
>
<RaisedButtonExampleComplex />
</CodeExample>
<CodeExample
title="Icon examples"
description={descriptions.icon}
code={raisedButtonExampleIconCode}
>
<RaisedButtonExampleIcon />
</CodeExample>
<PropTypeDescription code={raisedButtonCode} />
</div>
);
export default RaisedButtonPage;
|
ajax/libs/rxjs/2.4.1/rx.js | hpneo/cdnjs | // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
;(function (undefined) {
var objectTypes = {
'boolean': false,
'function': true,
'object': true,
'number': false,
'string': false,
'undefined': false
};
var root = (objectTypes[typeof window] && window) || this,
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = objectTypes[typeof global] && global;
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
root = freeGlobal;
}
var Rx = {
internals: {},
config: {
Promise: root.Promise
},
helpers: { }
};
// Defaults
var noop = Rx.helpers.noop = function () { },
notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; },
identity = Rx.helpers.identity = function (x) { return x; },
pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
just = Rx.helpers.just = function (value) { return function () { return value; }; },
defaultNow = Rx.helpers.defaultNow = Date.now,
defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); },
defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); },
defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); },
defaultError = Rx.helpers.defaultError = function (err) { throw err; },
isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.then === 'function'; },
asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); },
not = Rx.helpers.not = function (a) { return !a; },
isFunction = Rx.helpers.isFunction = (function () {
var isFn = function (value) {
return typeof value == 'function' || false;
}
// fallback for older versions of Chrome and Safari
if (isFn(/x/)) {
isFn = function(value) {
return typeof value == 'function' && toString.call(value) == '[object Function]';
};
}
return isFn;
}());
function cloneArray(arr) { for(var a = [], i = 0, len = arr.length; i < len; i++) { a.push(arr[i]); } return a;}
Rx.config.longStackSupport = false;
var hasStacks = false;
try {
throw new Error();
} catch (e) {
hasStacks = !!e.stack;
}
// All code after this point will be filtered from stack traces reported by RxJS
var rStartingLine = captureLine(), rFileName;
var STACK_JUMP_SEPARATOR = "From previous event:";
function makeStackTraceLong(error, observable) {
// If possible, transform the error stack trace by removing Node and RxJS
// cruft, then concatenating with the stack trace of `observable`.
if (hasStacks &&
observable.stack &&
typeof error === "object" &&
error !== null &&
error.stack &&
error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
) {
var stacks = [];
for (var o = observable; !!o; o = o.source) {
if (o.stack) {
stacks.unshift(o.stack);
}
}
stacks.unshift(error.stack);
var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
error.stack = filterStackString(concatedStacks);
}
}
function filterStackString(stackString) {
var lines = stackString.split("\n"),
desiredLines = [];
for (var i = 0, len = lines.length; i < len; i++) {
var line = lines[i];
if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
desiredLines.push(line);
}
}
return desiredLines.join("\n");
}
function isInternalFrame(stackLine) {
var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
if (!fileNameAndLineNumber) {
return false;
}
var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1];
return fileName === rFileName &&
lineNumber >= rStartingLine &&
lineNumber <= rEndingLine;
}
function isNodeFrame(stackLine) {
return stackLine.indexOf("(module.js:") !== -1 ||
stackLine.indexOf("(node.js:") !== -1;
}
function captureLine() {
if (!hasStacks) { return; }
try {
throw new Error();
} catch (e) {
var lines = e.stack.split("\n");
var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
if (!fileNameAndLineNumber) { return; }
rFileName = fileNameAndLineNumber[0];
return fileNameAndLineNumber[1];
}
}
function getFileNameAndLineNumber(stackLine) {
// Named functions: "at functionName (filename:lineNumber:columnNumber)"
var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
if (attempt1) { return [attempt1[1], Number(attempt1[2])]; }
// Anonymous functions: "at filename:lineNumber:columnNumber"
var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
if (attempt2) { return [attempt2[1], Number(attempt2[2])]; }
// Firefox style: "function@filename:lineNumber or @filename:lineNumber"
var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
if (attempt3) { return [attempt3[1], Number(attempt3[2])]; }
}
var EmptyError = Rx.EmptyError = function() {
this.message = 'Sequence contains no elements.';
Error.call(this);
};
EmptyError.prototype = Error.prototype;
var ObjectDisposedError = Rx.ObjectDisposedError = function() {
this.message = 'Object has been disposed';
Error.call(this);
};
ObjectDisposedError.prototype = Error.prototype;
var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
this.message = 'Argument out of range';
Error.call(this);
};
ArgumentOutOfRangeError.prototype = Error.prototype;
var NotSupportedError = Rx.NotSupportedError = function (message) {
this.message = message || 'This operation is not supported';
Error.call(this);
};
NotSupportedError.prototype = Error.prototype;
var NotImplementedError = Rx.NotImplementedError = function (message) {
this.message = message || 'This operation is not implemented';
Error.call(this);
};
NotImplementedError.prototype = Error.prototype;
var notImplemented = Rx.helpers.notImplemented = function () {
throw new NotImplementedError();
};
var notSupported = Rx.helpers.notSupported = function () {
throw new NotSupportedError();
};
// Shim in iterator support
var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
'_es6shim_iterator_';
// Bug for mozilla version
if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
$iterator$ = '@@iterator';
}
var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined };
var isIterable = Rx.helpers.isIterable = function (o) {
return o[$iterator$] !== undefined;
}
var isArrayLike = Rx.helpers.isArrayLike = function (o) {
return o && o.length !== undefined;
}
Rx.helpers.iterator = $iterator$;
var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) {
if (typeof thisArg === 'undefined') { return func; }
switch(argCount) {
case 0:
return function() {
return func.call(thisArg)
};
case 1:
return function(arg) {
return func.call(thisArg, arg);
}
case 2:
return function(value, index) {
return func.call(thisArg, value, index);
};
case 3:
return function(value, index, collection) {
return func.call(thisArg, value, index, collection);
};
}
return function() {
return func.apply(thisArg, arguments);
};
};
/** Used to determine if values are of the language type Object */
var dontEnums = ['toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'],
dontEnumsLength = dontEnums.length;
/** `Object#toString` result shortcuts */
var argsClass = '[object Arguments]',
arrayClass = '[object Array]',
boolClass = '[object Boolean]',
dateClass = '[object Date]',
errorClass = '[object Error]',
funcClass = '[object Function]',
numberClass = '[object Number]',
objectClass = '[object Object]',
regexpClass = '[object RegExp]',
stringClass = '[object String]';
var toString = Object.prototype.toString,
hasOwnProperty = Object.prototype.hasOwnProperty,
supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
supportNodeClass,
errorProto = Error.prototype,
objectProto = Object.prototype,
stringProto = String.prototype,
propertyIsEnumerable = objectProto.propertyIsEnumerable;
try {
supportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
} catch (e) {
supportNodeClass = true;
}
var nonEnumProps = {};
nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
nonEnumProps[objectClass] = { 'constructor': true };
var support = {};
(function () {
var ctor = function() { this.x = 1; },
props = [];
ctor.prototype = { 'valueOf': 1, 'y': 1 };
for (var key in new ctor) { props.push(key); }
for (key in arguments) { }
// Detect if `name` or `message` properties of `Error.prototype` are enumerable by default.
support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
// Detect if `prototype` properties are enumerable by default.
support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
// Detect if `arguments` object indexes are non-enumerable
support.nonEnumArgs = key != 0;
// Detect if properties shadowing those on `Object.prototype` are non-enumerable.
support.nonEnumShadows = !/valueOf/.test(props);
}(1));
var isObject = Rx.internals.isObject = function(value) {
var type = typeof value;
return value && (type == 'function' || type == 'object') || false;
};
function keysIn(object) {
var result = [];
if (!isObject(object)) {
return result;
}
if (support.nonEnumArgs && object.length && isArguments(object)) {
object = slice.call(object);
}
var skipProto = support.enumPrototypes && typeof object == 'function',
skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error);
for (var key in object) {
if (!(skipProto && key == 'prototype') &&
!(skipErrorProps && (key == 'message' || key == 'name'))) {
result.push(key);
}
}
if (support.nonEnumShadows && object !== objectProto) {
var ctor = object.constructor,
index = -1,
length = dontEnumsLength;
if (object === (ctor && ctor.prototype)) {
var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
nonEnum = nonEnumProps[className];
}
while (++index < length) {
key = dontEnums[index];
if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) {
result.push(key);
}
}
}
return result;
}
function internalFor(object, callback, keysFunc) {
var index = -1,
props = keysFunc(object),
length = props.length;
while (++index < length) {
var key = props[index];
if (callback(object[key], key, object) === false) {
break;
}
}
return object;
}
function internalForIn(object, callback) {
return internalFor(object, callback, keysIn);
}
function isNode(value) {
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
// methods that are `typeof` "string" and still can coerce nodes to strings
return typeof value.toString != 'function' && typeof (value + '') == 'string';
}
var isArguments = function(value) {
return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
}
// fallback for browsers that can't detect `arguments` objects by [[Class]]
if (!supportsArgsClass) {
isArguments = function(value) {
return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
};
}
var isEqual = Rx.internals.isEqual = function (x, y) {
return deepEquals(x, y, [], []);
};
/** @private
* Used for deep comparison
**/
function deepEquals(a, b, stackA, stackB) {
// exit early for identical values
if (a === b) {
// treat `+0` vs. `-0` as not equal
return a !== 0 || (1 / a == 1 / b);
}
var type = typeof a,
otherType = typeof b;
// exit early for unlike primitive values
if (a === a && (a == null || b == null ||
(type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
return false;
}
// compare [[Class]] names
var className = toString.call(a),
otherClass = toString.call(b);
if (className == argsClass) {
className = objectClass;
}
if (otherClass == argsClass) {
otherClass = objectClass;
}
if (className != otherClass) {
return false;
}
switch (className) {
case boolClass:
case dateClass:
// coerce dates and booleans to numbers, dates to milliseconds and booleans
// to `1` or `0` treating invalid dates coerced to `NaN` as not equal
return +a == +b;
case numberClass:
// treat `NaN` vs. `NaN` as equal
return (a != +a) ?
b != +b :
// but treat `-0` vs. `+0` as not equal
(a == 0 ? (1 / a == 1 / b) : a == +b);
case regexpClass:
case stringClass:
// coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
// treat string primitives and their corresponding object instances as equal
return a == String(b);
}
var isArr = className == arrayClass;
if (!isArr) {
// exit for functions and DOM nodes
if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
return false;
}
// in older versions of Opera, `arguments` objects have `Array` constructors
var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
// non `Object` object instances with different constructors are not equal
if (ctorA != ctorB &&
!(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) &&
!(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
('constructor' in a && 'constructor' in b)
) {
return false;
}
}
// assume cyclic structures are equal
// the algorithm for detecting cyclic structures is adapted from ES 5.1
// section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
var initedStack = !stackA;
stackA || (stackA = []);
stackB || (stackB = []);
var length = stackA.length;
while (length--) {
if (stackA[length] == a) {
return stackB[length] == b;
}
}
var size = 0;
var result = true;
// add `a` and `b` to the stack of traversed objects
stackA.push(a);
stackB.push(b);
// recursively compare objects and arrays (susceptible to call stack limits)
if (isArr) {
// compare lengths to determine if a deep comparison is necessary
length = a.length;
size = b.length;
result = size == length;
if (result) {
// deep compare the contents, ignoring non-numeric properties
while (size--) {
var index = length,
value = b[size];
if (!(result = deepEquals(a[size], value, stackA, stackB))) {
break;
}
}
}
}
else {
// deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
// which, in this case, is more costly
internalForIn(b, function(value, key, b) {
if (hasOwnProperty.call(b, key)) {
// count the number of properties.
size++;
// deep compare each property value.
return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB));
}
});
if (result) {
// ensure both objects have the same number of properties
internalForIn(a, function(value, key, a) {
if (hasOwnProperty.call(a, key)) {
// `size` will be `-1` if `a` has more properties than `b`
return (result = --size > -1);
}
});
}
}
stackA.pop();
stackB.pop();
return result;
}
var hasProp = {}.hasOwnProperty,
slice = Array.prototype.slice;
var inherits = this.inherits = Rx.internals.inherits = function (child, parent) {
function __() { this.constructor = child; }
__.prototype = parent.prototype;
child.prototype = new __();
};
var addProperties = Rx.internals.addProperties = function (obj) {
for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
for (var idx = 0, ln = sources.length; idx < ln; idx++) {
var source = sources[idx];
for (var prop in source) {
obj[prop] = source[prop];
}
}
};
// Rx Utils
var addRef = Rx.internals.addRef = function (xs, r) {
return new AnonymousObservable(function (observer) {
return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
});
};
function arrayInitialize(count, factory) {
var a = new Array(count);
for (var i = 0; i < count; i++) {
a[i] = factory();
}
return a;
}
var errorObj = {e: {}};
var tryCatchTarget;
function tryCatcher() {
try {
return tryCatchTarget.apply(this, arguments);
} catch (e) {
errorObj.e = e;
return errorObj;
}
}
function tryCatch(fn) {
if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
tryCatchTarget = fn;
return tryCatcher;
}
function thrower(e) {
throw e;
}
// Collections
function IndexedItem(id, value) {
this.id = id;
this.value = value;
}
IndexedItem.prototype.compareTo = function (other) {
var c = this.value.compareTo(other.value);
c === 0 && (c = this.id - other.id);
return c;
};
// Priority Queue for Scheduling
var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
this.items = new Array(capacity);
this.length = 0;
};
var priorityProto = PriorityQueue.prototype;
priorityProto.isHigherPriority = function (left, right) {
return this.items[left].compareTo(this.items[right]) < 0;
};
priorityProto.percolate = function (index) {
if (index >= this.length || index < 0) { return; }
var parent = index - 1 >> 1;
if (parent < 0 || parent === index) { return; }
if (this.isHigherPriority(index, parent)) {
var temp = this.items[index];
this.items[index] = this.items[parent];
this.items[parent] = temp;
this.percolate(parent);
}
};
priorityProto.heapify = function (index) {
+index || (index = 0);
if (index >= this.length || index < 0) { return; }
var left = 2 * index + 1,
right = 2 * index + 2,
first = index;
if (left < this.length && this.isHigherPriority(left, first)) {
first = left;
}
if (right < this.length && this.isHigherPriority(right, first)) {
first = right;
}
if (first !== index) {
var temp = this.items[index];
this.items[index] = this.items[first];
this.items[first] = temp;
this.heapify(first);
}
};
priorityProto.peek = function () { return this.items[0].value; };
priorityProto.removeAt = function (index) {
this.items[index] = this.items[--this.length];
this.items[this.length] = undefined;
this.heapify();
};
priorityProto.dequeue = function () {
var result = this.peek();
this.removeAt(0);
return result;
};
priorityProto.enqueue = function (item) {
var index = this.length++;
this.items[index] = new IndexedItem(PriorityQueue.count++, item);
this.percolate(index);
};
priorityProto.remove = function (item) {
for (var i = 0; i < this.length; i++) {
if (this.items[i].value === item) {
this.removeAt(i);
return true;
}
}
return false;
};
PriorityQueue.count = 0;
/**
* Represents a group of disposable resources that are disposed together.
* @constructor
*/
var CompositeDisposable = Rx.CompositeDisposable = function () {
var args = [], i, len;
if (Array.isArray(arguments[0])) {
args = arguments[0];
len = args.length;
} else {
len = arguments.length;
args = new Array(len);
for(i = 0; i < len; i++) { args[i] = arguments[i]; }
}
for(i = 0; i < len; i++) {
if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); }
}
this.disposables = args;
this.isDisposed = false;
this.length = args.length;
};
var CompositeDisposablePrototype = CompositeDisposable.prototype;
/**
* Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
* @param {Mixed} item Disposable to add.
*/
CompositeDisposablePrototype.add = function (item) {
if (this.isDisposed) {
item.dispose();
} else {
this.disposables.push(item);
this.length++;
}
};
/**
* Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
* @param {Mixed} item Disposable to remove.
* @returns {Boolean} true if found; false otherwise.
*/
CompositeDisposablePrototype.remove = function (item) {
var shouldDispose = false;
if (!this.isDisposed) {
var idx = this.disposables.indexOf(item);
if (idx !== -1) {
shouldDispose = true;
this.disposables.splice(idx, 1);
this.length--;
item.dispose();
}
}
return shouldDispose;
};
/**
* Disposes all disposables in the group and removes them from the group.
*/
CompositeDisposablePrototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var len = this.disposables.length, currentDisposables = new Array(len);
for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; }
this.disposables = [];
this.length = 0;
for (i = 0; i < len; i++) {
currentDisposables[i].dispose();
}
}
};
/**
* Provides a set of static methods for creating Disposables.
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
*/
var Disposable = Rx.Disposable = function (action) {
this.isDisposed = false;
this.action = action || noop;
};
/** Performs the task of cleaning up resources. */
Disposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.action();
this.isDisposed = true;
}
};
/**
* Creates a disposable object that invokes the specified action when disposed.
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
* @return {Disposable} The disposable object that runs the given action upon disposal.
*/
var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
/**
* Gets the disposable that does nothing when disposed.
*/
var disposableEmpty = Disposable.empty = { dispose: noop };
/**
* Validates whether the given object is a disposable
* @param {Object} Object to test whether it has a dispose method
* @returns {Boolean} true if a disposable object, else false.
*/
var isDisposable = Disposable.isDisposable = function (d) {
return d && isFunction(d.dispose);
};
var checkDisposed = Disposable.checkDisposed = function (disposable) {
if (disposable.isDisposed) { throw new ObjectDisposedError(); }
};
var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = (function () {
function BooleanDisposable () {
this.isDisposed = false;
this.current = null;
}
var booleanDisposablePrototype = BooleanDisposable.prototype;
/**
* Gets the underlying disposable.
* @return The underlying disposable.
*/
booleanDisposablePrototype.getDisposable = function () {
return this.current;
};
/**
* Sets the underlying disposable.
* @param {Disposable} value The new underlying disposable.
*/
booleanDisposablePrototype.setDisposable = function (value) {
var shouldDispose = this.isDisposed;
if (!shouldDispose) {
var old = this.current;
this.current = value;
}
old && old.dispose();
shouldDispose && value && value.dispose();
};
/**
* Disposes the underlying disposable as well as all future replacements.
*/
booleanDisposablePrototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var old = this.current;
this.current = null;
}
old && old.dispose();
};
return BooleanDisposable;
}());
var SerialDisposable = Rx.SerialDisposable = SingleAssignmentDisposable;
/**
* Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
*/
var RefCountDisposable = Rx.RefCountDisposable = (function () {
function InnerDisposable(disposable) {
this.disposable = disposable;
this.disposable.count++;
this.isInnerDisposed = false;
}
InnerDisposable.prototype.dispose = function () {
if (!this.disposable.isDisposed && !this.isInnerDisposed) {
this.isInnerDisposed = true;
this.disposable.count--;
if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
this.disposable.isDisposed = true;
this.disposable.underlyingDisposable.dispose();
}
}
};
/**
* Initializes a new instance of the RefCountDisposable with the specified disposable.
* @constructor
* @param {Disposable} disposable Underlying disposable.
*/
function RefCountDisposable(disposable) {
this.underlyingDisposable = disposable;
this.isDisposed = false;
this.isPrimaryDisposed = false;
this.count = 0;
}
/**
* Disposes the underlying disposable only when all dependent disposables have been disposed
*/
RefCountDisposable.prototype.dispose = function () {
if (!this.isDisposed && !this.isPrimaryDisposed) {
this.isPrimaryDisposed = true;
if (this.count === 0) {
this.isDisposed = true;
this.underlyingDisposable.dispose();
}
}
};
/**
* Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
* @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
*/
RefCountDisposable.prototype.getDisposable = function () {
return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
};
return RefCountDisposable;
})();
function ScheduledDisposable(scheduler, disposable) {
this.scheduler = scheduler;
this.disposable = disposable;
this.isDisposed = false;
}
function scheduleItem(s, self) {
if (!self.isDisposed) {
self.isDisposed = true;
self.disposable.dispose();
}
}
ScheduledDisposable.prototype.dispose = function () {
this.scheduler.scheduleWithState(this, scheduleItem);
};
var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
this.scheduler = scheduler;
this.state = state;
this.action = action;
this.dueTime = dueTime;
this.comparer = comparer || defaultSubComparer;
this.disposable = new SingleAssignmentDisposable();
}
ScheduledItem.prototype.invoke = function () {
this.disposable.setDisposable(this.invokeCore());
};
ScheduledItem.prototype.compareTo = function (other) {
return this.comparer(this.dueTime, other.dueTime);
};
ScheduledItem.prototype.isCancelled = function () {
return this.disposable.isDisposed;
};
ScheduledItem.prototype.invokeCore = function () {
return this.action(this.scheduler, this.state);
};
/** Provides a set of static properties to access commonly used schedulers. */
var Scheduler = Rx.Scheduler = (function () {
function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
this.now = now;
this._schedule = schedule;
this._scheduleRelative = scheduleRelative;
this._scheduleAbsolute = scheduleAbsolute;
}
function invokeAction(scheduler, action) {
action();
return disposableEmpty;
}
var schedulerProto = Scheduler.prototype;
/**
* Schedules an action to be executed.
* @param {Function} action Action to execute.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.schedule = function (action) {
return this._schedule(action, invokeAction);
};
/**
* Schedules an action to be executed.
* @param state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithState = function (state, action) {
return this._schedule(state, action);
};
/**
* Schedules an action to be executed after the specified relative due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelative = function (dueTime, action) {
return this._scheduleRelative(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed after dueTime.
* @param state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative(state, dueTime, action);
};
/**
* Schedules an action to be executed at the specified absolute due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
return this._scheduleAbsolute(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed at dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number}dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute(state, dueTime, action);
};
/** Gets the current time according to the local machine's system clock. */
Scheduler.now = defaultNow;
/**
* Normalizes the specified TimeSpan value to a positive value.
* @param {Number} timeSpan The time span value to normalize.
* @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
*/
Scheduler.normalize = function (timeSpan) {
timeSpan < 0 && (timeSpan = 0);
return timeSpan;
};
return Scheduler;
}());
var normalizeTime = Scheduler.normalize;
(function (schedulerProto) {
function invokeRecImmediate(scheduler, pair) {
var state = pair.first, action = pair.second, group = new CompositeDisposable(),
recursiveAction = function (state1) {
action(state1, function (state2) {
var isAdded = false, isDone = false,
d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
};
recursiveAction(state);
return group;
}
function invokeRecDate(scheduler, pair, method) {
var state = pair.first, action = pair.second, group = new CompositeDisposable(),
recursiveAction = function (state1) {
action(state1, function (state2, dueTime1) {
var isAdded = false, isDone = false,
d = scheduler[method](state2, dueTime1, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
};
recursiveAction(state);
return group;
}
function scheduleInnerRecursive(action, self) {
action(function(dt) { self(action, dt); });
}
/**
* Schedules an action to be executed recursively.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursive = function (action) {
return this.scheduleRecursiveWithState(action, function (_action, self) {
_action(function () { self(_action); }); });
};
/**
* Schedules an action to be executed recursively.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithState = function (state, action) {
return this.scheduleWithState({ first: state, second: action }, invokeRecImmediate);
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive);
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
});
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive);
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
});
};
}(Scheduler.prototype));
(function (schedulerProto) {
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
Scheduler.prototype.schedulePeriodic = function (period, action) {
return this.schedulePeriodicWithState(null, period, action);
};
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Mixed} state Initial state passed to the action upon the first iteration.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed, potentially updating the state.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) {
if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); }
var s = state;
var id = root.setInterval(function () {
s = action(s);
}, period);
return disposableCreate(function () {
root.clearInterval(id);
});
};
}(Scheduler.prototype));
(function (schedulerProto) {
/**
* Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions.
* @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false.
* @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling.
*/
schedulerProto.catchError = schedulerProto['catch'] = function (handler) {
return new CatchScheduler(this, handler);
};
}(Scheduler.prototype));
var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
function tick(command, recurse) {
recurse(0, this._period);
try {
this._state = this._action(this._state);
} catch (e) {
this._cancel.dispose();
throw e;
}
}
function SchedulePeriodicRecursive(scheduler, state, period, action) {
this._scheduler = scheduler;
this._state = state;
this._period = period;
this._action = action;
}
SchedulePeriodicRecursive.prototype.start = function () {
var d = new SingleAssignmentDisposable();
this._cancel = d;
d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
return d;
};
return SchedulePeriodicRecursive;
}());
/** Gets a scheduler that schedules work immediately on the current thread. */
var immediateScheduler = Scheduler.immediate = (function () {
function scheduleNow(state, action) { return action(this, state); }
return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
}());
/**
* Gets a scheduler that schedules work as soon as possible on the current thread.
*/
var currentThreadScheduler = Scheduler.currentThread = (function () {
var queue;
function runTrampoline () {
while (queue.length > 0) {
var item = queue.dequeue();
if (!item.isCancelled()) {
!item.isCancelled() && item.invoke();
}
}
}
function scheduleNow(state, action) {
var si = new ScheduledItem(this, state, action, this.now());
if (!queue) {
queue = new PriorityQueue(4);
queue.enqueue(si);
var result = tryCatch(runTrampoline)();
queue = null;
if (result === errorObj) { return thrower(result.e); }
} else {
queue.enqueue(si);
}
return si.disposable;
}
var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
currentScheduler.scheduleRequired = function () { return !queue; };
currentScheduler.ensureTrampoline = function (action) {
if (!queue) { this.schedule(action); } else { action(); }
};
return currentScheduler;
}());
var scheduleMethod, clearMethod = noop;
var localTimer = (function () {
var localSetTimeout, localClearTimeout = noop;
if ('WScript' in this) {
localSetTimeout = function (fn, time) {
WScript.Sleep(time);
fn();
};
} else if (!!root.setTimeout) {
localSetTimeout = root.setTimeout;
localClearTimeout = root.clearTimeout;
} else {
throw new NotSupportedError();
}
return {
setTimeout: localSetTimeout,
clearTimeout: localClearTimeout
};
}());
var localSetTimeout = localTimer.setTimeout,
localClearTimeout = localTimer.clearTimeout;
(function () {
var reNative = RegExp('^' +
String(toString)
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
.replace(/toString| for [^\]]+/g, '.*?') + '$'
);
var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
!reNative.test(setImmediate) && setImmediate,
clearImmediate = typeof (clearImmediate = freeGlobal && moduleExports && freeGlobal.clearImmediate) == 'function' &&
!reNative.test(clearImmediate) && clearImmediate;
function postMessageSupported () {
// Ensure not in a worker
if (!root.postMessage || root.importScripts) { return false; }
var isAsync = false,
oldHandler = root.onmessage;
// Test for async
root.onmessage = function () { isAsync = true; };
root.postMessage('', '*');
root.onmessage = oldHandler;
return isAsync;
}
// Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout
if (typeof setImmediate === 'function') {
scheduleMethod = setImmediate;
clearMethod = clearImmediate;
} else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
scheduleMethod = process.nextTick;
} else if (postMessageSupported()) {
var MSG_PREFIX = 'ms.rx.schedule' + Math.random(),
tasks = {},
taskId = 0;
var onGlobalPostMessage = function (event) {
// Only if we're a match to avoid any other global events
if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
var handleId = event.data.substring(MSG_PREFIX.length),
action = tasks[handleId];
action();
delete tasks[handleId];
}
}
if (root.addEventListener) {
root.addEventListener('message', onGlobalPostMessage, false);
} else {
root.attachEvent('onmessage', onGlobalPostMessage, false);
}
scheduleMethod = function (action) {
var currentId = taskId++;
tasks[currentId] = action;
root.postMessage(MSG_PREFIX + currentId, '*');
};
} else if (!!root.MessageChannel) {
var channel = new root.MessageChannel(),
channelTasks = {},
channelTaskId = 0;
channel.port1.onmessage = function (event) {
var id = event.data,
action = channelTasks[id];
action();
delete channelTasks[id];
};
scheduleMethod = function (action) {
var id = channelTaskId++;
channelTasks[id] = action;
channel.port2.postMessage(id);
};
} else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
scheduleMethod = function (action) {
var scriptElement = root.document.createElement('script');
scriptElement.onreadystatechange = function () {
action();
scriptElement.onreadystatechange = null;
scriptElement.parentNode.removeChild(scriptElement);
scriptElement = null;
};
root.document.documentElement.appendChild(scriptElement);
};
} else {
scheduleMethod = function (action) { return localSetTimeout(action, 0); };
clearMethod = localClearTimeout;
}
}());
/**
* Gets a scheduler that schedules work via a timed callback based upon platform.
*/
var timeoutScheduler = Scheduler.timeout = (function () {
function scheduleNow(state, action) {
var scheduler = this,
disposable = new SingleAssignmentDisposable();
var id = scheduleMethod(function () {
if (!disposable.isDisposed) {
disposable.setDisposable(action(scheduler, state));
}
});
return new CompositeDisposable(disposable, disposableCreate(function () {
clearMethod(id);
}));
}
function scheduleRelative(state, dueTime, action) {
var scheduler = this,
dt = Scheduler.normalize(dueTime);
if (dt === 0) {
return scheduler.scheduleWithState(state, action);
}
var disposable = new SingleAssignmentDisposable();
var id = localSetTimeout(function () {
if (!disposable.isDisposed) {
disposable.setDisposable(action(scheduler, state));
}
}, dt);
return new CompositeDisposable(disposable, disposableCreate(function () {
localClearTimeout(id);
}));
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
})();
var CatchScheduler = (function (__super__) {
function scheduleNow(state, action) {
return this._scheduler.scheduleWithState(state, this._wrap(action));
}
function scheduleRelative(state, dueTime, action) {
return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action));
}
function scheduleAbsolute(state, dueTime, action) {
return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action));
}
inherits(CatchScheduler, __super__);
function CatchScheduler(scheduler, handler) {
this._scheduler = scheduler;
this._handler = handler;
this._recursiveOriginal = null;
this._recursiveWrapper = null;
__super__.call(this, this._scheduler.now.bind(this._scheduler), scheduleNow, scheduleRelative, scheduleAbsolute);
}
CatchScheduler.prototype._clone = function (scheduler) {
return new CatchScheduler(scheduler, this._handler);
};
CatchScheduler.prototype._wrap = function (action) {
var parent = this;
return function (self, state) {
try {
return action(parent._getRecursiveWrapper(self), state);
} catch (e) {
if (!parent._handler(e)) { throw e; }
return disposableEmpty;
}
};
};
CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) {
if (this._recursiveOriginal !== scheduler) {
this._recursiveOriginal = scheduler;
var wrapper = this._clone(scheduler);
wrapper._recursiveOriginal = scheduler;
wrapper._recursiveWrapper = wrapper;
this._recursiveWrapper = wrapper;
}
return this._recursiveWrapper;
};
CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) {
var self = this, failed = false, d = new SingleAssignmentDisposable();
d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) {
if (failed) { return null; }
try {
return action(state1);
} catch (e) {
failed = true;
if (!self._handler(e)) { throw e; }
d.dispose();
return null;
}
}));
return d;
};
return CatchScheduler;
}(Scheduler));
/**
* Represents a notification to an observer.
*/
var Notification = Rx.Notification = (function () {
function Notification(kind, value, exception, accept, acceptObservable, toString) {
this.kind = kind;
this.value = value;
this.exception = exception;
this._accept = accept;
this._acceptObservable = acceptObservable;
this.toString = toString;
}
/**
* Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
*
* @memberOf Notification
* @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
* @param {Function} onError Delegate to invoke for an OnError notification.
* @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
* @returns {Any} Result produced by the observation.
*/
Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
return observerOrOnNext && typeof observerOrOnNext === 'object' ?
this._acceptObservable(observerOrOnNext) :
this._accept(observerOrOnNext, onError, onCompleted);
};
/**
* Returns an observable sequence with a single notification.
*
* @memberOf Notifications
* @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
* @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
*/
Notification.prototype.toObservable = function (scheduler) {
var self = this;
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.scheduleWithState(self, function (_, notification) {
notification._acceptObservable(observer);
notification.kind === 'N' && observer.onCompleted();
});
});
};
return Notification;
})();
/**
* Creates an object that represents an OnNext notification to an observer.
* @param {Any} value The value contained in the notification.
* @returns {Notification} The OnNext notification containing the value.
*/
var notificationCreateOnNext = Notification.createOnNext = (function () {
function _accept(onNext) { return onNext(this.value); }
function _acceptObservable(observer) { return observer.onNext(this.value); }
function toString() { return 'OnNext(' + this.value + ')'; }
return function (value) {
return new Notification('N', value, null, _accept, _acceptObservable, toString);
};
}());
/**
* Creates an object that represents an OnError notification to an observer.
* @param {Any} error The exception contained in the notification.
* @returns {Notification} The OnError notification containing the exception.
*/
var notificationCreateOnError = Notification.createOnError = (function () {
function _accept (onNext, onError) { return onError(this.exception); }
function _acceptObservable(observer) { return observer.onError(this.exception); }
function toString () { return 'OnError(' + this.exception + ')'; }
return function (e) {
return new Notification('E', null, e, _accept, _acceptObservable, toString);
};
}());
/**
* Creates an object that represents an OnCompleted notification to an observer.
* @returns {Notification} The OnCompleted notification.
*/
var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }
return function () {
return new Notification('C', null, null, _accept, _acceptObservable, toString);
};
}());
var Enumerator = Rx.internals.Enumerator = function (next) {
this._next = next;
};
Enumerator.prototype.next = function () {
return this._next();
};
Enumerator.prototype[$iterator$] = function () { return this; }
var Enumerable = Rx.internals.Enumerable = function (iterator) {
this._iterator = iterator;
};
Enumerable.prototype[$iterator$] = function () {
return this._iterator();
};
Enumerable.prototype.concat = function () {
var sources = this;
return new AnonymousObservable(function (o) {
var e = sources[$iterator$]();
var isDisposed, subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
if (isDisposed) { return; }
try {
var currentItem = e.next();
} catch (ex) {
return o.onError(ex);
}
if (currentItem.done) {
return o.onCompleted();
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(
function(x) { o.onNext(x); },
function(err) { o.onError(err); },
self)
);
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
});
};
Enumerable.prototype.catchError = function () {
var sources = this;
return new AnonymousObservable(function (o) {
var e = sources[$iterator$]();
var isDisposed, subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursiveWithState(null, function (lastException, self) {
if (isDisposed) { return; }
try {
var currentItem = e.next();
} catch (ex) {
return observer.onError(ex);
}
if (currentItem.done) {
if (lastException !== null) {
o.onError(lastException);
} else {
o.onCompleted();
}
return;
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(
function(x) { o.onNext(x); },
self,
function() { o.onCompleted(); }));
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
});
};
Enumerable.prototype.catchErrorWhen = function (notificationHandler) {
var sources = this;
return new AnonymousObservable(function (o) {
var exceptions = new Subject(),
notifier = new Subject(),
handled = notificationHandler(exceptions),
notificationDisposable = handled.subscribe(notifier);
var e = sources[$iterator$]();
var isDisposed,
lastException,
subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
if (isDisposed) { return; }
try {
var currentItem = e.next();
} catch (ex) {
return o.onError(ex);
}
if (currentItem.done) {
if (lastException) {
o.onError(lastException);
} else {
o.onCompleted();
}
return;
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var outer = new SingleAssignmentDisposable();
var inner = new SingleAssignmentDisposable();
subscription.setDisposable(new CompositeDisposable(inner, outer));
outer.setDisposable(currentValue.subscribe(
function(x) { o.onNext(x); },
function (exn) {
inner.setDisposable(notifier.subscribe(self, function(ex) {
o.onError(ex);
}, function() {
o.onCompleted();
}));
exceptions.onNext(exn);
},
function() { o.onCompleted(); }));
});
return new CompositeDisposable(notificationDisposable, subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
});
};
var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
if (repeatCount == null) { repeatCount = -1; }
return new Enumerable(function () {
var left = repeatCount;
return new Enumerator(function () {
if (left === 0) { return doneEnumerator; }
if (left > 0) { left--; }
return { done: false, value: value };
});
});
};
var enumerableOf = Enumerable.of = function (source, selector, thisArg) {
if (selector) {
var selectorFn = bindCallback(selector, thisArg, 3);
}
return new Enumerable(function () {
var index = -1;
return new Enumerator(
function () {
return ++index < source.length ?
{ done: false, value: !selector ? source[index] : selectorFn(source[index], index, source) } :
doneEnumerator;
});
});
};
/**
* Supports push-style iteration over an observable sequence.
*/
var Observer = Rx.Observer = function () { };
/**
* Creates a notification callback from an observer.
* @returns The action that forwards its input notification to the underlying observer.
*/
Observer.prototype.toNotifier = function () {
var observer = this;
return function (n) { return n.accept(observer); };
};
/**
* Hides the identity of an observer.
* @returns An observer that hides the identity of the specified observer.
*/
Observer.prototype.asObserver = function () {
return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this));
};
/**
* Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods.
* If a violation is detected, an Error is thrown from the offending observer method call.
* @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.
*/
Observer.prototype.checked = function () { return new CheckedObserver(this); };
/**
* Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
* @param {Function} [onNext] Observer's OnNext action implementation.
* @param {Function} [onError] Observer's OnError action implementation.
* @param {Function} [onCompleted] Observer's OnCompleted action implementation.
* @returns {Observer} The observer object implemented using the given actions.
*/
var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
onNext || (onNext = noop);
onError || (onError = defaultError);
onCompleted || (onCompleted = noop);
return new AnonymousObserver(onNext, onError, onCompleted);
};
/**
* Creates an observer from a notification callback.
*
* @static
* @memberOf Observer
* @param {Function} handler Action that handles a notification.
* @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
*/
Observer.fromNotifier = function (handler, thisArg) {
return new AnonymousObserver(function (x) {
return handler.call(thisArg, notificationCreateOnNext(x));
}, function (e) {
return handler.call(thisArg, notificationCreateOnError(e));
}, function () {
return handler.call(thisArg, notificationCreateOnCompleted());
});
};
/**
* Schedules the invocation of observer methods on the given scheduler.
* @param {Scheduler} scheduler Scheduler to schedule observer messages on.
* @returns {Observer} Observer whose messages are scheduled on the given scheduler.
*/
Observer.prototype.notifyOn = function (scheduler) {
return new ObserveOnObserver(scheduler, this);
};
Observer.prototype.makeSafe = function(disposable) {
return new AnonymousSafeObserver(this._onNext, this._onError, this._onCompleted, disposable);
};
/**
* Abstract base class for implementations of the Observer class.
* This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
*/
var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
inherits(AbstractObserver, __super__);
/**
* Creates a new observer in a non-stopped state.
*/
function AbstractObserver() {
this.isStopped = false;
__super__.call(this);
}
// Must be implemented by other observers
AbstractObserver.prototype.next = notImplemented;
AbstractObserver.prototype.error = notImplemented;
AbstractObserver.prototype.completed = notImplemented;
/**
* Notifies the observer of a new element in the sequence.
* @param {Any} value Next element in the sequence.
*/
AbstractObserver.prototype.onNext = function (value) {
if (!this.isStopped) { this.next(value); }
};
/**
* Notifies the observer that an exception has occurred.
* @param {Any} error The error that has occurred.
*/
AbstractObserver.prototype.onError = function (error) {
if (!this.isStopped) {
this.isStopped = true;
this.error(error);
}
};
/**
* Notifies the observer of the end of the sequence.
*/
AbstractObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.completed();
}
};
/**
* Disposes the observer, causing it to transition to the stopped state.
*/
AbstractObserver.prototype.dispose = function () {
this.isStopped = true;
};
AbstractObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.error(e);
return true;
}
return false;
};
return AbstractObserver;
}(Observer));
/**
* Class to create an Observer instance from delegate-based implementations of the on* methods.
*/
var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) {
inherits(AnonymousObserver, __super__);
/**
* Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
* @param {Any} onNext Observer's OnNext action implementation.
* @param {Any} onError Observer's OnError action implementation.
* @param {Any} onCompleted Observer's OnCompleted action implementation.
*/
function AnonymousObserver(onNext, onError, onCompleted) {
__super__.call(this);
this._onNext = onNext;
this._onError = onError;
this._onCompleted = onCompleted;
}
/**
* Calls the onNext action.
* @param {Any} value Next element in the sequence.
*/
AnonymousObserver.prototype.next = function (value) {
this._onNext(value);
};
/**
* Calls the onError action.
* @param {Any} error The error that has occurred.
*/
AnonymousObserver.prototype.error = function (error) {
this._onError(error);
};
/**
* Calls the onCompleted action.
*/
AnonymousObserver.prototype.completed = function () {
this._onCompleted();
};
return AnonymousObserver;
}(AbstractObserver));
var CheckedObserver = (function (__super__) {
inherits(CheckedObserver, __super__);
function CheckedObserver(observer) {
__super__.call(this);
this._observer = observer;
this._state = 0; // 0 - idle, 1 - busy, 2 - done
}
var CheckedObserverPrototype = CheckedObserver.prototype;
CheckedObserverPrototype.onNext = function (value) {
this.checkAccess();
var res = tryCatch(this._observer.onNext).call(this._observer, value);
this._state = 0;
res === errorObj && thrower(res.e);
};
CheckedObserverPrototype.onError = function (err) {
this.checkAccess();
var res = tryCatch(this._observer.onError).call(this._observer, err);
this._state = 2;
res === errorObj && thrower(res.e);
};
CheckedObserverPrototype.onCompleted = function () {
this.checkAccess();
var res = tryCatch(this._observer.onCompleted).call(this._observer);
this._state = 2;
res === errorObj && thrower(res.e);
};
CheckedObserverPrototype.checkAccess = function () {
if (this._state === 1) { throw new Error('Re-entrancy detected'); }
if (this._state === 2) { throw new Error('Observer completed'); }
if (this._state === 0) { this._state = 1; }
};
return CheckedObserver;
}(Observer));
var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
inherits(ScheduledObserver, __super__);
function ScheduledObserver(scheduler, observer) {
__super__.call(this);
this.scheduler = scheduler;
this.observer = observer;
this.isAcquired = false;
this.hasFaulted = false;
this.queue = [];
this.disposable = new SerialDisposable();
}
ScheduledObserver.prototype.next = function (value) {
var self = this;
this.queue.push(function () { self.observer.onNext(value); });
};
ScheduledObserver.prototype.error = function (e) {
var self = this;
this.queue.push(function () { self.observer.onError(e); });
};
ScheduledObserver.prototype.completed = function () {
var self = this;
this.queue.push(function () { self.observer.onCompleted(); });
};
ScheduledObserver.prototype.ensureActive = function () {
var isOwner = false, parent = this;
if (!this.hasFaulted && this.queue.length > 0) {
isOwner = !this.isAcquired;
this.isAcquired = true;
}
if (isOwner) {
this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
var work;
if (parent.queue.length > 0) {
work = parent.queue.shift();
} else {
parent.isAcquired = false;
return;
}
try {
work();
} catch (ex) {
parent.queue = [];
parent.hasFaulted = true;
throw ex;
}
self();
}));
}
};
ScheduledObserver.prototype.dispose = function () {
__super__.prototype.dispose.call(this);
this.disposable.dispose();
};
return ScheduledObserver;
}(AbstractObserver));
var ObserveOnObserver = (function (__super__) {
inherits(ObserveOnObserver, __super__);
function ObserveOnObserver(scheduler, observer, cancel) {
__super__.call(this, scheduler, observer);
this._cancel = cancel;
}
ObserveOnObserver.prototype.next = function (value) {
__super__.prototype.next.call(this, value);
this.ensureActive();
};
ObserveOnObserver.prototype.error = function (e) {
__super__.prototype.error.call(this, e);
this.ensureActive();
};
ObserveOnObserver.prototype.completed = function () {
__super__.prototype.completed.call(this);
this.ensureActive();
};
ObserveOnObserver.prototype.dispose = function () {
__super__.prototype.dispose.call(this);
this._cancel && this._cancel.dispose();
this._cancel = null;
};
return ObserveOnObserver;
})(ScheduledObserver);
var observableProto;
/**
* Represents a push-style collection.
*/
var Observable = Rx.Observable = (function () {
function Observable(subscribe) {
if (Rx.config.longStackSupport && hasStacks) {
try {
throw new Error();
} catch (e) {
this.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
}
var self = this;
this._subscribe = function (observer) {
var oldOnError = observer.onError.bind(observer);
observer.onError = function (err) {
makeStackTraceLong(err, self);
oldOnError(err);
};
return subscribe.call(self, observer);
};
} else {
this._subscribe = subscribe;
}
}
observableProto = Observable.prototype;
/**
* Subscribes an observer to the observable sequence.
* @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
* @returns {Diposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
return this._subscribe(typeof observerOrOnNext === 'object' ?
observerOrOnNext :
observerCreate(observerOrOnNext, onError, onCompleted));
};
/**
* Subscribes to the next value in the sequence with an optional "this" argument.
* @param {Function} onNext The function to invoke on each element in the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribeOnNext = function (onNext, thisArg) {
return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext));
};
/**
* Subscribes to an exceptional condition in the sequence with an optional "this" argument.
* @param {Function} onError The function to invoke upon exceptional termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribeOnError = function (onError, thisArg) {
return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError));
};
/**
* Subscribes to the next value in the sequence with an optional "this" argument.
* @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribeOnCompleted = function (onCompleted, thisArg) {
return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted));
};
return Observable;
})();
var ObservableBase = Rx.ObservableBase = (function (__super__) {
inherits(ObservableBase, __super__);
function fixSubscriber(subscriber) {
return subscriber && isFunction(subscriber.dispose) ? subscriber :
isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
}
function setDisposable(s, state) {
var ado = state[0], self = state[1];
var sub = tryCatch(self.subscribeCore).call(self, ado);
if (sub === errorObj) {
if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
}
ado.setDisposable(fixSubscriber(sub));
}
function subscribe(observer) {
var ado = new AutoDetachObserver(observer), state = [ado, this];
if (currentThreadScheduler.scheduleRequired()) {
currentThreadScheduler.scheduleWithState(state, setDisposable);
} else {
setDisposable(null, state);
}
return ado;
}
function ObservableBase() {
__super__.call(this, subscribe);
}
ObservableBase.prototype.subscribeCore = notImplemented;
return ObservableBase;
}(Observable));
/**
* Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
*
* This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects
* that require to be run on a scheduler, use subscribeOn.
*
* @param {Scheduler} scheduler Scheduler to notify observers on.
* @returns {Observable} The source sequence whose observations happen on the specified scheduler.
*/
observableProto.observeOn = function (scheduler) {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(new ObserveOnObserver(scheduler, observer));
}, source);
};
/**
* Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used;
* see the remarks section for more information on the distinction between subscribeOn and observeOn.
* This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer
* callbacks on a scheduler, use observeOn.
* @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on.
* @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
*/
observableProto.subscribeOn = function (scheduler) {
var source = this;
return new AnonymousObservable(function (observer) {
var m = new SingleAssignmentDisposable(), d = new SerialDisposable();
d.setDisposable(m);
m.setDisposable(scheduler.schedule(function () {
d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer)));
}));
return d;
}, source);
};
/**
* Converts a Promise to an Observable sequence
* @param {Promise} An ES6 Compliant promise.
* @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
*/
var observableFromPromise = Observable.fromPromise = function (promise) {
return observableDefer(function () {
var subject = new Rx.AsyncSubject();
promise.then(
function (value) {
subject.onNext(value);
subject.onCompleted();
},
subject.onError.bind(subject));
return subject;
});
};
/*
* Converts an existing observable sequence to an ES6 Compatible Promise
* @example
* var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
*
* // With config
* Rx.config.Promise = RSVP.Promise;
* var promise = Rx.Observable.return(42).toPromise();
* @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
* @returns {Promise} An ES6 compatible promise with the last value from the observable sequence.
*/
observableProto.toPromise = function (promiseCtor) {
promiseCtor || (promiseCtor = Rx.config.Promise);
if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); }
var source = this;
return new promiseCtor(function (resolve, reject) {
// No cancellation can be done
var value, hasValue = false;
source.subscribe(function (v) {
value = v;
hasValue = true;
}, reject, function () {
hasValue && resolve(value);
});
});
};
var ToArrayObservable = (function(__super__) {
inherits(ToArrayObservable, __super__);
function ToArrayObservable(source) {
this.source = source;
__super__.call(this);
}
ToArrayObservable.prototype.subscribeCore = function(observer) {
return this.source.subscribe(new ToArrayObserver(observer));
};
return ToArrayObservable;
}(ObservableBase));
function ToArrayObserver(observer) {
this.observer = observer;
this.a = [];
this.isStopped = false;
}
ToArrayObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.a.push(x); } };
ToArrayObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.observer.onError(e);
}
};
ToArrayObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.observer.onNext(this.a);
this.observer.onCompleted();
}
};
ToArrayObserver.prototype.dispose = function () { this.isStopped = true; }
ToArrayObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.observer.onError(e);
return true;
}
return false;
};
/**
* Creates an array from an observable sequence.
* @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence.
*/
observableProto.toArray = function () {
return new ToArrayObservable(this);
};
/**
* Creates an observable sequence from a specified subscribe method implementation.
* @example
* var res = Rx.Observable.create(function (observer) { return function () { } );
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
* var res = Rx.Observable.create(function (observer) { } );
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
*/
Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
return new AnonymousObservable(subscribe, parent);
};
/**
* Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
*
* @example
* var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
* @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
* @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
*/
var observableDefer = Observable.defer = function (observableFactory) {
return new AnonymousObservable(function (observer) {
var result;
try {
result = observableFactory();
} catch (e) {
return observableThrow(e).subscribe(observer);
}
isPromise(result) && (result = observableFromPromise(result));
return result.subscribe(observer);
});
};
/**
* Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
*
* @example
* var res = Rx.Observable.empty();
* var res = Rx.Observable.empty(Rx.Scheduler.timeout);
* @param {Scheduler} [scheduler] Scheduler to send the termination call on.
* @returns {Observable} An observable sequence with no elements.
*/
var observableEmpty = Observable.empty = function (scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onCompleted();
});
});
};
var FromObservable = (function(__super__) {
inherits(FromObservable, __super__);
function FromObservable(iterable, mapper, scheduler) {
this.iterable = iterable;
this.mapper = mapper;
this.scheduler = scheduler;
__super__.call(this);
}
FromObservable.prototype.subscribeCore = function (observer) {
var sink = new FromSink(observer, this);
return sink.run();
};
return FromObservable;
}(ObservableBase));
var FromSink = (function () {
function FromSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
FromSink.prototype.run = function () {
var list = Object(this.parent.iterable),
it = getIterable(list),
observer = this.observer,
mapper = this.parent.mapper;
function loopRecursive(i, recurse) {
try {
var next = it.next();
} catch (e) {
return observer.onError(e);
}
if (next.done) {
return observer.onCompleted();
}
var result = next.value;
if (mapper) {
try {
result = mapper(result, i);
} catch (e) {
return observer.onError(e);
}
}
observer.onNext(result);
recurse(i + 1);
}
return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
};
return FromSink;
}());
var maxSafeInteger = Math.pow(2, 53) - 1;
function StringIterable(str) {
this._s = s;
}
StringIterable.prototype[$iterator$] = function () {
return new StringIterator(this._s);
};
function StringIterator(str) {
this._s = s;
this._l = s.length;
this._i = 0;
}
StringIterator.prototype[$iterator$] = function () {
return this;
};
StringIterator.prototype.next = function () {
return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator;
};
function ArrayIterable(a) {
this._a = a;
}
ArrayIterable.prototype[$iterator$] = function () {
return new ArrayIterator(this._a);
};
function ArrayIterator(a) {
this._a = a;
this._l = toLength(a);
this._i = 0;
}
ArrayIterator.prototype[$iterator$] = function () {
return this;
};
ArrayIterator.prototype.next = function () {
return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator;
};
function numberIsFinite(value) {
return typeof value === 'number' && root.isFinite(value);
}
function isNan(n) {
return n !== n;
}
function getIterable(o) {
var i = o[$iterator$], it;
if (!i && typeof o === 'string') {
it = new StringIterable(o);
return it[$iterator$]();
}
if (!i && o.length !== undefined) {
it = new ArrayIterable(o);
return it[$iterator$]();
}
if (!i) { throw new TypeError('Object is not iterable'); }
return o[$iterator$]();
}
function sign(value) {
var number = +value;
if (number === 0) { return number; }
if (isNaN(number)) { return number; }
return number < 0 ? -1 : 1;
}
function toLength(o) {
var len = +o.length;
if (isNaN(len)) { return 0; }
if (len === 0 || !numberIsFinite(len)) { return len; }
len = sign(len) * Math.floor(Math.abs(len));
if (len <= 0) { return 0; }
if (len > maxSafeInteger) { return maxSafeInteger; }
return len;
}
/**
* This method creates a new Observable sequence from an array-like or iterable object.
* @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
* @param {Function} [mapFn] Map function to call on every element of the array.
* @param {Any} [thisArg] The context to use calling the mapFn if provided.
* @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
*/
var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) {
if (iterable == null) {
throw new Error('iterable cannot be null.')
}
if (mapFn && !isFunction(mapFn)) {
throw new Error('mapFn when provided must be a function');
}
if (mapFn) {
var mapper = bindCallback(mapFn, thisArg, 2);
}
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new FromObservable(iterable, mapper, scheduler);
}
var FromArrayObservable = (function(__super__) {
inherits(FromArrayObservable, __super__);
function FromArrayObservable(args, scheduler) {
this.args = args;
this.scheduler = scheduler;
__super__.call(this);
}
FromArrayObservable.prototype.subscribeCore = function (observer) {
var sink = new FromArraySink(observer, this);
return sink.run();
};
return FromArrayObservable;
}(ObservableBase));
function FromArraySink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
FromArraySink.prototype.run = function () {
var observer = this.observer, args = this.parent.args, len = args.length;
function loopRecursive(i, recurse) {
if (i < len) {
observer.onNext(args[i]);
recurse(i + 1);
} else {
observer.onCompleted();
}
}
return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
};
/**
* Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
* @deprecated use Observable.from or Observable.of
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
* @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
*/
var observableFromArray = Observable.fromArray = function (array, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new FromArrayObservable(array, scheduler)
};
/**
* Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
* @param {Mixed} initialState Initial state.
* @param {Function} condition Condition to terminate generation (upon returning false).
* @param {Function} iterate Iteration step function.
* @param {Function} resultSelector Selector function for results produced in the sequence.
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
* @returns {Observable} The generated sequence.
*/
Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (observer) {
var first = true, state = initialState;
return scheduler.scheduleRecursive(function (self) {
var hasResult, result;
try {
if (first) {
first = false;
} else {
state = iterate(state);
}
hasResult = condition(state);
if (hasResult) {
result = resultSelector(state);
}
} catch (exception) {
observer.onError(exception);
return;
}
if (hasResult) {
observer.onNext(result);
self();
} else {
observer.onCompleted();
}
});
});
};
/**
* Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
* @returns {Observable} An observable sequence whose observers will never get called.
*/
var observableNever = Observable.never = function () {
return new AnonymousObservable(function () {
return disposableEmpty;
});
};
function observableOf (scheduler, array) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new FromArrayObservable(array, scheduler);
}
/**
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
*/
Observable.of = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return new FromArrayObservable(args, currentThreadScheduler);
};
/**
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
* @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
*/
Observable.ofWithScheduler = function (scheduler) {
var len = arguments.length, args = new Array(len - 1);
for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; }
return new FromArrayObservable(args, scheduler);
};
/**
* Convert an object into an observable sequence of [key, value] pairs.
* @param {Object} obj The object to inspect.
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
* @returns {Observable} An observable sequence of [key, value] pairs from the object.
*/
Observable.pairs = function (obj, scheduler) {
scheduler || (scheduler = Rx.Scheduler.currentThread);
return new AnonymousObservable(function (observer) {
var keys = Object.keys(obj), len = keys.length;
return scheduler.scheduleRecursiveWithState(0, function (idx, self) {
if (idx < len) {
var key = keys[idx];
observer.onNext([key, obj[key]]);
self(idx + 1);
} else {
observer.onCompleted();
}
});
});
};
var RangeObservable = (function(__super__) {
inherits(RangeObservable, __super__);
function RangeObservable(start, count, scheduler) {
this.start = start;
this.count = count;
this.scheduler = scheduler;
__super__.call(this);
}
RangeObservable.prototype.subscribeCore = function (observer) {
var sink = new RangeSink(observer, this);
return sink.run();
};
return RangeObservable;
}(ObservableBase));
var RangeSink = (function () {
function RangeSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
RangeSink.prototype.run = function () {
var start = this.parent.start, count = this.parent.count, observer = this.observer;
function loopRecursive(i, recurse) {
if (i < count) {
observer.onNext(start + i);
recurse(i + 1);
} else {
observer.onCompleted();
}
}
return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
};
return RangeSink;
}());
/**
* Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
* @param {Number} start The value of the first integer in the sequence.
* @param {Number} count The number of sequential integers to generate.
* @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
* @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
*/
Observable.range = function (start, count, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new RangeObservable(start, count, scheduler);
};
/**
* Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.repeat(42);
* var res = Rx.Observable.repeat(42, 4);
* 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout);
* 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout);
* @param {Mixed} value Element to repeat.
* @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
* @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence that repeats the given element the specified number of times.
*/
Observable.repeat = function (value, repeatCount, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return observableReturn(value, scheduler).repeat(repeatCount == null ? -1 : repeatCount);
};
/**
* Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
* There is an alias called 'just', and 'returnValue' for browsers <IE9.
* @param {Mixed} value Single element in the resulting observable sequence.
* @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence containing the single specified element.
*/
var observableReturn = Observable['return'] = Observable.just = function (value, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onNext(value);
observer.onCompleted();
});
});
};
/** @deprecated use return or just */
Observable.returnValue = function () {
//deprecate('returnValue', 'return or just');
return observableReturn.apply(null, arguments);
};
/**
* Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
* There is an alias to this method called 'throwError' for browsers <IE9.
* @param {Mixed} error An object used for the sequence's termination.
* @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
*/
var observableThrow = Observable['throw'] = Observable.throwError = function (error, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onError(error);
});
});
};
/** @deprecated use #some instead */
Observable.throwException = function () {
//deprecate('throwException', 'throwError');
return Observable.throwError.apply(null, arguments);
};
/**
* Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
* @param {Function} resourceFactory Factory function to obtain a resource object.
* @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource.
* @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object.
*/
Observable.using = function (resourceFactory, observableFactory) {
return new AnonymousObservable(function (observer) {
var disposable = disposableEmpty, resource, source;
try {
resource = resourceFactory();
resource && (disposable = resource);
source = observableFactory(resource);
} catch (exception) {
return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable);
}
return new CompositeDisposable(source.subscribe(observer), disposable);
});
};
/**
* Propagates the observable sequence or Promise that reacts first.
* @param {Observable} rightSource Second observable sequence or Promise.
* @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first.
*/
observableProto.amb = function (rightSource) {
var leftSource = this;
return new AnonymousObservable(function (observer) {
var choice,
leftChoice = 'L', rightChoice = 'R',
leftSubscription = new SingleAssignmentDisposable(),
rightSubscription = new SingleAssignmentDisposable();
isPromise(rightSource) && (rightSource = observableFromPromise(rightSource));
function choiceL() {
if (!choice) {
choice = leftChoice;
rightSubscription.dispose();
}
}
function choiceR() {
if (!choice) {
choice = rightChoice;
leftSubscription.dispose();
}
}
leftSubscription.setDisposable(leftSource.subscribe(function (left) {
choiceL();
if (choice === leftChoice) {
observer.onNext(left);
}
}, function (err) {
choiceL();
if (choice === leftChoice) {
observer.onError(err);
}
}, function () {
choiceL();
if (choice === leftChoice) {
observer.onCompleted();
}
}));
rightSubscription.setDisposable(rightSource.subscribe(function (right) {
choiceR();
if (choice === rightChoice) {
observer.onNext(right);
}
}, function (err) {
choiceR();
if (choice === rightChoice) {
observer.onError(err);
}
}, function () {
choiceR();
if (choice === rightChoice) {
observer.onCompleted();
}
}));
return new CompositeDisposable(leftSubscription, rightSubscription);
});
};
/**
* Propagates the observable sequence or Promise that reacts first.
*
* @example
* var = Rx.Observable.amb(xs, ys, zs);
* @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
*/
Observable.amb = function () {
var acc = observableNever(), items = [];
if (Array.isArray(arguments[0])) {
items = arguments[0];
} else {
for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
}
function func(previous, current) {
return previous.amb(current);
}
for (var i = 0, len = items.length; i < len; i++) {
acc = func(acc, items[i]);
}
return acc;
};
function observableCatchHandler(source, handler) {
return new AnonymousObservable(function (o) {
var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
subscription.setDisposable(d1);
d1.setDisposable(source.subscribe(function (x) { o.onNext(x); }, function (e) {
try {
var result = handler(e);
} catch (ex) {
return o.onError(ex);
}
isPromise(result) && (result = observableFromPromise(result));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(result.subscribe(o));
}, function (x) { o.onCompleted(x); }));
return subscription;
}, source);
}
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
* @example
* 1 - xs.catchException(ys)
* 2 - xs.catchException(function (ex) { return ys(ex); })
* @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
* @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
*/
observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) {
return typeof handlerOrSecond === 'function' ?
observableCatchHandler(this, handlerOrSecond) :
observableCatch([this, handlerOrSecond]);
};
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
* @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs.
* @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
*/
var observableCatch = Observable.catchError = Observable['catch'] = Observable.catchException = function () {
var items = [];
if (Array.isArray(arguments[0])) {
items = arguments[0];
} else {
for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
}
return enumerableOf(items).catchError();
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
* This can be in the form of an argument list of observables or an array.
*
* @example
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.combineLatest = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
if (Array.isArray(args[0])) {
args[0].unshift(this);
} else {
args.unshift(this);
}
return combineLatest.apply(this, args);
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
*
* @example
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
var combineLatest = Observable.combineLatest = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var resultSelector = args.pop();
Array.isArray(args[0]) && (args = args[0]);
return new AnonymousObservable(function (o) {
var n = args.length,
falseFactory = function () { return false; },
hasValue = arrayInitialize(n, falseFactory),
hasValueAll = false,
isDone = arrayInitialize(n, falseFactory),
values = new Array(n);
function next(i) {
hasValue[i] = true;
if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
try {
var res = resultSelector.apply(null, values);
} catch (e) {
return o.onError(e);
}
o.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
o.onCompleted();
}
}
function done (i) {
isDone[i] = true;
isDone.every(identity) && o.onCompleted();
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var source = args[i], sad = new SingleAssignmentDisposable();
isPromise(source) && (source = observableFromPromise(source));
sad.setDisposable(source.subscribe(function (x) {
values[i] = x;
next(i);
},
function(e) { o.onError(e); },
function () { done(i); }
));
subscriptions[i] = sad;
}(idx));
}
return new CompositeDisposable(subscriptions);
}, this);
};
/**
* Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
observableProto.concat = function () {
for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
args.unshift(this);
return observableConcat.apply(null, args);
};
/**
* Concatenates all the observable sequences.
* @param {Array | Arguments} args Arguments or an array to concat to the observable sequence.
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
var observableConcat = Observable.concat = function () {
var args;
if (Array.isArray(arguments[0])) {
args = arguments[0];
} else {
args = new Array(arguments.length);
for(var i = 0, len = arguments.length; i < len; i++) { args[i] = arguments[i]; }
}
return enumerableOf(args).concat();
};
/**
* Concatenates an observable sequence of observable sequences.
* @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
*/
observableProto.concatAll = observableProto.concatObservable = function () {
return this.merge(1);
};
var MergeObservable = (function (__super__) {
inherits(MergeObservable, __super__);
function MergeObservable(source, maxConcurrent) {
this.source = source;
this.maxConcurrent = maxConcurrent;
__super__.call(this);
}
MergeObservable.prototype.subscribeCore = function(observer) {
var g = new CompositeDisposable();
g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g)));
return g;
};
return MergeObservable;
}(ObservableBase));
var MergeObserver = (function () {
function MergeObserver(o, max, g) {
this.o = o;
this.max = max;
this.g = g;
this.done = false;
this.q = [];
this.activeCount = 0;
this.isStopped = false;
}
MergeObserver.prototype.handleSubscribe = function (xs) {
var sad = new SingleAssignmentDisposable();
this.g.add(sad);
isPromise(xs) && (xs = observableFromPromise(xs));
sad.setDisposable(xs.subscribe(new InnerObserver(this, sad)));
};
MergeObserver.prototype.onNext = function (innerSource) {
if (this.isStopped) { return; }
if(this.activeCount < this.max) {
this.activeCount++;
this.handleSubscribe(innerSource);
} else {
this.q.push(innerSource);
}
};
MergeObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
}
};
MergeObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.done = true;
this.activeCount === 0 && this.o.onCompleted();
}
};
MergeObserver.prototype.dispose = function() { this.isStopped = true; };
MergeObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
function InnerObserver(parent, sad) {
this.parent = parent;
this.sad = sad;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } };
InnerObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
}
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) {
var parent = this.parent;
parent.g.remove(this.sad);
if (parent.q.length > 0) {
parent.handleSubscribe(parent.q.shift());
} else {
parent.activeCount--;
parent.done && parent.activeCount === 0 && parent.o.onCompleted();
}
}
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
return true;
}
return false;
};
return MergeObserver;
}());
/**
* Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
* Or merges two observable sequences into a single observable sequence.
*
* @example
* 1 - merged = sources.merge(1);
* 2 - merged = source.merge(otherSource);
* @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.merge = function (maxConcurrentOrOther) {
return typeof maxConcurrentOrOther !== 'number' ?
observableMerge(this, maxConcurrentOrOther) :
new MergeObservable(this, maxConcurrentOrOther);
};
/**
* Merges all the observable sequences into a single observable sequence.
* The scheduler is optional and if not specified, the immediate scheduler is used.
* @returns {Observable} The observable sequence that merges the elements of the observable sequences.
*/
var observableMerge = Observable.merge = function () {
var scheduler, sources = [], i, len = arguments.length;
if (!arguments[0]) {
scheduler = immediateScheduler;
for(i = 1; i < len; i++) { sources.push(arguments[i]); }
} else if (isScheduler(arguments[0])) {
scheduler = arguments[0];
for(i = 1; i < len; i++) { sources.push(arguments[i]); }
} else {
scheduler = immediateScheduler;
for(i = 0; i < len; i++) { sources.push(arguments[i]); }
}
if (Array.isArray(sources[0])) {
sources = sources[0];
}
return observableOf(scheduler, sources).mergeAll();
};
var CompositeError = Rx.CompositeError = function(errors) {
this.name = "NotImplementedError";
this.innerErrors = errors;
this.message = 'This contains multiple errors. Check the innerErrors';
Error.call(this);
}
CompositeError.prototype = Error.prototype;
/**
* Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
* receive all successfully emitted items from all of the source Observables without being interrupted by
* an error notification from one of them.
*
* This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
* error via the Observer's onError, mergeDelayError will refrain from propagating that
* error notification until all of the merged Observables have finished emitting items.
* @param {Array | Arguments} args Arguments or an array to merge.
* @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
*/
Observable.mergeDelayError = function() {
var args;
if (Array.isArray(arguments[0])) {
args = arguments[0];
} else {
var len = arguments.length;
args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
}
var source = observableOf(null, args);
return new AnonymousObservable(function (o) {
var group = new CompositeDisposable(),
m = new SingleAssignmentDisposable(),
isStopped = false,
errors = [];
function setCompletion() {
if (errors.length === 0) {
o.onCompleted();
} else if (errors.length === 1) {
o.onError(errors[0]);
} else {
o.onError(new CompositeError(errors));
}
}
group.add(m);
m.setDisposable(source.subscribe(
function (innerSource) {
var innerSubscription = new SingleAssignmentDisposable();
group.add(innerSubscription);
// Check for promises support
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
innerSubscription.setDisposable(innerSource.subscribe(
function (x) { o.onNext(x); },
function (e) {
errors.push(e);
group.remove(innerSubscription);
isStopped && group.length === 1 && setCompletion();
},
function () {
group.remove(innerSubscription);
isStopped && group.length === 1 && setCompletion();
}));
},
function (e) {
errors.push(e);
isStopped = true;
group.length === 1 && setCompletion();
},
function () {
isStopped = true;
group.length === 1 && setCompletion();
}));
return group;
});
};
var MergeAllObservable = (function (__super__) {
inherits(MergeAllObservable, __super__);
function MergeAllObservable(source) {
this.source = source;
__super__.call(this);
}
MergeAllObservable.prototype.subscribeCore = function (observer) {
var g = new CompositeDisposable(), m = new SingleAssignmentDisposable();
g.add(m);
m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g)));
return g;
};
return MergeAllObservable;
}(ObservableBase));
var MergeAllObserver = (function() {
function MergeAllObserver(o, g) {
this.o = o;
this.g = g;
this.isStopped = false;
this.done = false;
}
MergeAllObserver.prototype.onNext = function(innerSource) {
if(this.isStopped) { return; }
var sad = new SingleAssignmentDisposable();
this.g.add(sad);
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad)));
};
MergeAllObserver.prototype.onError = function (e) {
if(!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
}
};
MergeAllObserver.prototype.onCompleted = function () {
if(!this.isStopped) {
this.isStopped = true;
this.done = true;
this.g.length === 1 && this.o.onCompleted();
}
};
MergeAllObserver.prototype.dispose = function() { this.isStopped = true; };
MergeAllObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
function InnerObserver(parent, g, sad) {
this.parent = parent;
this.g = g;
this.sad = sad;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } };
InnerObserver.prototype.onError = function (e) {
if(!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
}
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) {
var parent = this.parent;
this.isStopped = true;
parent.g.remove(this.sad);
parent.done && parent.g.length === 1 && parent.o.onCompleted();
}
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
return true;
}
return false;
};
return MergeAllObserver;
}());
/**
* Merges an observable sequence of observable sequences into an observable sequence.
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.mergeAll = observableProto.mergeObservable = function () {
return new MergeAllObservable(this);
};
/**
* Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
* @param {Observable} second Second observable sequence used to produce results after the first sequence terminates.
* @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally.
*/
observableProto.onErrorResumeNext = function (second) {
if (!second) { throw new Error('Second observable is required'); }
return onErrorResumeNext([this, second]);
};
/**
* Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
*
* @example
* 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
* 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
* @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
*/
var onErrorResumeNext = Observable.onErrorResumeNext = function () {
var sources = [];
if (Array.isArray(arguments[0])) {
sources = arguments[0];
} else {
for(var i = 0, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
}
return new AnonymousObservable(function (observer) {
var pos = 0, subscription = new SerialDisposable(),
cancelable = immediateScheduler.scheduleRecursive(function (self) {
var current, d;
if (pos < sources.length) {
current = sources[pos++];
isPromise(current) && (current = observableFromPromise(current));
d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self));
} else {
observer.onCompleted();
}
});
return new CompositeDisposable(subscription, cancelable);
});
};
/**
* Returns the values from the source observable sequence only after the other observable sequence produces a value.
* @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
*/
observableProto.skipUntil = function (other) {
var source = this;
return new AnonymousObservable(function (o) {
var isOpen = false;
var disposables = new CompositeDisposable(source.subscribe(function (left) {
isOpen && o.onNext(left);
}, function (e) { o.onError(e); }, function () {
isOpen && o.onCompleted();
}));
isPromise(other) && (other = observableFromPromise(other));
var rightSubscription = new SingleAssignmentDisposable();
disposables.add(rightSubscription);
rightSubscription.setDisposable(other.subscribe(function () {
isOpen = true;
rightSubscription.dispose();
}, function (e) { o.onError(e); }, function () {
rightSubscription.dispose();
}));
return disposables;
}, source);
};
/**
* Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
* @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto['switch'] = observableProto.switchLatest = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var hasLatest = false,
innerSubscription = new SerialDisposable(),
isStopped = false,
latest = 0,
subscription = sources.subscribe(
function (innerSource) {
var d = new SingleAssignmentDisposable(), id = ++latest;
hasLatest = true;
innerSubscription.setDisposable(d);
// Check if Promise or Observable
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
d.setDisposable(innerSource.subscribe(
function (x) { latest === id && observer.onNext(x); },
function (e) { latest === id && observer.onError(e); },
function () {
if (latest === id) {
hasLatest = false;
isStopped && observer.onCompleted();
}
}));
},
function (e) { observer.onError(e); },
function () {
isStopped = true;
!hasLatest && observer.onCompleted();
});
return new CompositeDisposable(subscription, innerSubscription);
}, sources);
};
/**
* Returns the values from the source observable sequence until the other observable sequence produces a value.
* @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
*/
observableProto.takeUntil = function (other) {
var source = this;
return new AnonymousObservable(function (o) {
isPromise(other) && (other = observableFromPromise(other));
return new CompositeDisposable(
source.subscribe(o),
other.subscribe(function () { o.onCompleted(); }, function (e) { o.onError(e); }, noop)
);
}, source);
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element.
*
* @example
* 1 - obs = obs1.withLatestFrom(obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = obs1.withLatestFrom([obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.withLatestFrom = function () {
var len = arguments.length, args = new Array(len)
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var resultSelector = args.pop(), source = this;
if (typeof source === 'undefined') {
throw new Error('Source observable not found for withLatestFrom().');
}
if (typeof resultSelector !== 'function') {
throw new Error('withLatestFrom() expects a resultSelector function.');
}
if (Array.isArray(args[0])) {
args = args[0];
}
return new AnonymousObservable(function (observer) {
var falseFactory = function () { return false; },
n = args.length,
hasValue = arrayInitialize(n, falseFactory),
hasValueAll = false,
values = new Array(n);
var subscriptions = new Array(n + 1);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var other = args[i], sad = new SingleAssignmentDisposable();
isPromise(other) && (other = observableFromPromise(other));
sad.setDisposable(other.subscribe(function (x) {
values[i] = x;
hasValue[i] = true;
hasValueAll = hasValue.every(identity);
}, observer.onError.bind(observer), function () {}));
subscriptions[i] = sad;
}(idx));
}
var sad = new SingleAssignmentDisposable();
sad.setDisposable(source.subscribe(function (x) {
var res;
var allValues = [x].concat(values);
if (!hasValueAll) return;
try {
res = resultSelector.apply(null, allValues);
} catch (ex) {
observer.onError(ex);
return;
}
observer.onNext(res);
}, observer.onError.bind(observer), function () {
observer.onCompleted();
}));
subscriptions[n] = sad;
return new CompositeDisposable(subscriptions);
}, this);
};
function zipArray(second, resultSelector) {
var first = this;
return new AnonymousObservable(function (observer) {
var index = 0, len = second.length;
return first.subscribe(function (left) {
if (index < len) {
var right = second[index++], result;
try {
result = resultSelector(left, right);
} catch (e) {
return observer.onError(e);
}
observer.onNext(result);
} else {
observer.onCompleted();
}
}, function (e) { observer.onError(e); }, function () { observer.onCompleted(); });
}, first);
}
function falseFactory() { return false; }
function emptyArrayFactory() { return []; }
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
* The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args.
*
* @example
* 1 - res = obs1.zip(obs2, fn);
* 1 - res = x1.zip([1,2,3], fn);
* @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function.
*/
observableProto.zip = function () {
if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); }
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var parent = this, resultSelector = args.pop();
args.unshift(parent);
return new AnonymousObservable(function (observer) {
var n = args.length,
queues = arrayInitialize(n, emptyArrayFactory),
isDone = arrayInitialize(n, falseFactory);
function next(i) {
var res, queuedValues;
if (queues.every(function (x) { return x.length > 0; })) {
try {
queuedValues = queues.map(function (x) { return x.shift(); });
res = resultSelector.apply(parent, queuedValues);
} catch (ex) {
observer.onError(ex);
return;
}
observer.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
observer.onCompleted();
}
};
function done(i) {
isDone[i] = true;
if (isDone.every(function (x) { return x; })) {
observer.onCompleted();
}
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var source = args[i], sad = new SingleAssignmentDisposable();
isPromise(source) && (source = observableFromPromise(source));
sad.setDisposable(source.subscribe(function (x) {
queues[i].push(x);
next(i);
}, function (e) { observer.onError(e); }, function () {
done(i);
}));
subscriptions[i] = sad;
})(idx);
}
return new CompositeDisposable(subscriptions);
}, parent);
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
* @param arguments Observable sources.
* @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
Observable.zip = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var first = args.shift();
return first.zip.apply(first, args);
};
/**
* Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
* @param arguments Observable sources.
* @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
*/
Observable.zipArray = function () {
var sources;
if (Array.isArray(arguments[0])) {
sources = arguments[0];
} else {
var len = arguments.length;
sources = new Array(len);
for(var i = 0; i < len; i++) { sources[i] = arguments[i]; }
}
return new AnonymousObservable(function (observer) {
var n = sources.length,
queues = arrayInitialize(n, function () { return []; }),
isDone = arrayInitialize(n, function () { return false; });
function next(i) {
if (queues.every(function (x) { return x.length > 0; })) {
var res = queues.map(function (x) { return x.shift(); });
observer.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
observer.onCompleted();
return;
}
};
function done(i) {
isDone[i] = true;
if (isDone.every(identity)) {
observer.onCompleted();
return;
}
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
subscriptions[i] = new SingleAssignmentDisposable();
subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
queues[i].push(x);
next(i);
}, function (e) { observer.onError(e); }, function () {
done(i);
}));
})(idx);
}
return new CompositeDisposable(subscriptions);
});
};
/**
* Hides the identity of an observable sequence.
* @returns {Observable} An observable sequence that hides the identity of the source sequence.
*/
observableProto.asObservable = function () {
var source = this;
return new AnonymousObservable(function (o) { return source.subscribe(o); }, this);
};
/**
* Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
*
* @example
* var res = xs.bufferWithCount(10);
* var res = xs.bufferWithCount(10, 1);
* @param {Number} count Length of each buffer.
* @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count.
* @returns {Observable} An observable sequence of buffers.
*/
observableProto.bufferWithCount = function (count, skip) {
if (typeof skip !== 'number') {
skip = count;
}
return this.windowWithCount(count, skip).selectMany(function (x) {
return x.toArray();
}).where(function (x) {
return x.length > 0;
});
};
/**
* Dematerializes the explicit notification values of an observable sequence as implicit notifications.
* @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
*/
observableProto.dematerialize = function () {
var source = this;
return new AnonymousObservable(function (o) {
return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); });
}, this);
};
/**
* Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
*
* var obs = observable.distinctUntilChanged();
* var obs = observable.distinctUntilChanged(function (x) { return x.id; });
* var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
*
* @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
* @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
* @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
*/
observableProto.distinctUntilChanged = function (keySelector, comparer) {
var source = this;
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (o) {
var hasCurrentKey = false, currentKey;
return source.subscribe(function (value) {
var key = value;
if (keySelector) {
try {
key = keySelector(value);
} catch (e) {
o.onError(e);
return;
}
}
if (hasCurrentKey) {
try {
var comparerEquals = comparer(currentKey, key);
} catch (e) {
o.onError(e);
return;
}
}
if (!hasCurrentKey || !comparerEquals) {
hasCurrentKey = true;
currentKey = key;
o.onNext(value);
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, this);
};
/**
* Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an observer.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
var source = this, tapObserver = typeof observerOrOnNext === 'function' || typeof observerOrOnNext === 'undefined'?
observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
observerOrOnNext;
return new AnonymousObservable(function (observer) {
return source.subscribe(function (x) {
try {
tapObserver.onNext(x);
} catch (e) {
observer.onError(e);
}
observer.onNext(x);
}, function (err) {
try {
tapObserver.onError(err);
} catch (e) {
observer.onError(e);
}
observer.onError(err);
}, function () {
try {
tapObserver.onCompleted();
} catch (e) {
observer.onError(e);
}
observer.onCompleted();
});
}, this);
};
/**
* Invokes an action for each element in the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function} onNext Action to invoke for each element in the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) {
return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext);
};
/**
* Invokes an action upon exceptional termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function} onError Action to invoke upon exceptional termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) {
return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError);
};
/**
* Invokes an action upon graceful termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) {
return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted);
};
/**
* Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
* @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
* @returns {Observable} Source sequence with the action-invoking termination behavior applied.
*/
observableProto['finally'] = observableProto.ensure = function (action) {
var source = this;
return new AnonymousObservable(function (observer) {
var subscription;
try {
subscription = source.subscribe(observer);
} catch (e) {
action();
throw e;
}
return disposableCreate(function () {
try {
subscription.dispose();
} catch (e) {
throw e;
} finally {
action();
}
});
}, this);
};
/**
* @deprecated use #finally or #ensure instead.
*/
observableProto.finallyAction = function (action) {
//deprecate('finallyAction', 'finally or ensure');
return this.ensure(action);
};
/**
* Ignores all elements in an observable sequence leaving only the termination messages.
* @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
*/
observableProto.ignoreElements = function () {
var source = this;
return new AnonymousObservable(function (o) {
return source.subscribe(noop, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
/**
* Materializes the implicit notifications of an observable sequence as explicit notification values.
* @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
*/
observableProto.materialize = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(function (value) {
observer.onNext(notificationCreateOnNext(value));
}, function (e) {
observer.onNext(notificationCreateOnError(e));
observer.onCompleted();
}, function () {
observer.onNext(notificationCreateOnCompleted());
observer.onCompleted();
});
}, source);
};
/**
* Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
* @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
* @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
*/
observableProto.repeat = function (repeatCount) {
return enumerableRepeat(this, repeatCount).concat();
};
/**
* Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
* Note if you encounter an error and want it to retry once, then you must use .retry(2);
*
* @example
* var res = retried = retry.repeat();
* var res = retried = retry.repeat(2);
* @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
* @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
*/
observableProto.retry = function (retryCount) {
return enumerableRepeat(this, retryCount).catchError();
};
/**
* Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates.
* if the notifier completes, the observable sequence completes.
*
* @example
* var timer = Observable.timer(500);
* var source = observable.retryWhen(timer);
* @param {Observable} [notifier] An observable that triggers the retries or completes the observable with onNext or onCompleted respectively.
* @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
*/
observableProto.retryWhen = function (notifier) {
return enumerableRepeat(this).catchErrorWhen(notifier);
};
/**
* Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
* For aggregation behavior with no intermediate results, see Observable.aggregate.
* @example
* var res = source.scan(function (acc, x) { return acc + x; });
* var res = source.scan(0, function (acc, x) { return acc + x; });
* @param {Mixed} [seed] The initial accumulator value.
* @param {Function} accumulator An accumulator function to be invoked on each element.
* @returns {Observable} An observable sequence containing the accumulated values.
*/
observableProto.scan = function () {
var hasSeed = false, seed, accumulator, source = this;
if (arguments.length === 2) {
hasSeed = true;
seed = arguments[0];
accumulator = arguments[1];
} else {
accumulator = arguments[0];
}
return new AnonymousObservable(function (o) {
var hasAccumulation, accumulation, hasValue;
return source.subscribe (
function (x) {
!hasValue && (hasValue = true);
try {
if (hasAccumulation) {
accumulation = accumulator(accumulation, x);
} else {
accumulation = hasSeed ? accumulator(seed, x) : x;
hasAccumulation = true;
}
} catch (e) {
o.onError(e);
return;
}
o.onNext(accumulation);
},
function (e) { o.onError(e); },
function () {
!hasValue && hasSeed && o.onNext(seed);
o.onCompleted();
}
);
}, source);
};
/**
* Bypasses a specified number of elements at the end of an observable sequence.
* @description
* This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
* received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
* @param count Number of elements to bypass at the end of the source sequence.
* @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
*/
observableProto.skipLast = function (count) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
var source = this;
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
q.length > count && o.onNext(q.shift());
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
/**
* Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
* @example
* var res = source.startWith(1, 2, 3);
* var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
* @param {Arguments} args The specified values to prepend to the observable sequence
* @returns {Observable} The source sequence prepended with the specified values.
*/
observableProto.startWith = function () {
var values, scheduler, start = 0;
if (!!arguments.length && isScheduler(arguments[0])) {
scheduler = arguments[0];
start = 1;
} else {
scheduler = immediateScheduler;
}
for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
return enumerableOf([observableFromArray(args, scheduler), this]).concat();
};
/**
* Returns a specified number of contiguous elements from the end of an observable sequence.
* @description
* This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
* the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
* @param {Number} count Number of elements to take from the end of the source sequence.
* @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
*/
observableProto.takeLast = function (count) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
var source = this;
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
q.length > count && q.shift();
}, function (e) { o.onError(e); }, function () {
while (q.length > 0) { o.onNext(q.shift()); }
o.onCompleted();
});
}, source);
};
/**
* Returns an array with the specified number of contiguous elements from the end of an observable sequence.
*
* @description
* This operator accumulates a buffer with a length enough to store count elements. Upon completion of the
* source sequence, this buffer is produced on the result sequence.
* @param {Number} count Number of elements to take from the end of the source sequence.
* @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence.
*/
observableProto.takeLastBuffer = function (count) {
var source = this;
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
q.length > count && q.shift();
}, function (e) { o.onError(e); }, function () {
o.onNext(q);
o.onCompleted();
});
}, source);
};
/**
* Projects each element of an observable sequence into zero or more windows which are produced based on element count information.
*
* var res = xs.windowWithCount(10);
* var res = xs.windowWithCount(10, 1);
* @param {Number} count Length of each window.
* @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.windowWithCount = function (count, skip) {
var source = this;
+count || (count = 0);
Math.abs(count) === Infinity && (count = 0);
if (count <= 0) { throw new ArgumentOutOfRangeError(); }
skip == null && (skip = count);
+skip || (skip = 0);
Math.abs(skip) === Infinity && (skip = 0);
if (skip <= 0) { throw new ArgumentOutOfRangeError(); }
return new AnonymousObservable(function (observer) {
var m = new SingleAssignmentDisposable(),
refCountDisposable = new RefCountDisposable(m),
n = 0,
q = [];
function createWindow () {
var s = new Subject();
q.push(s);
observer.onNext(addRef(s, refCountDisposable));
}
createWindow();
m.setDisposable(source.subscribe(
function (x) {
for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
var c = n - count + 1;
c >= 0 && c % skip === 0 && q.shift().onCompleted();
++n % skip === 0 && createWindow();
},
function (e) {
while (q.length > 0) { q.shift().onError(e); }
observer.onError(e);
},
function () {
while (q.length > 0) { q.shift().onCompleted(); }
observer.onCompleted();
}
));
return refCountDisposable;
}, source);
};
function concatMap(source, selector, thisArg) {
var selectorFunc = bindCallback(selector, thisArg, 3);
return source.map(function (x, i) {
var result = selectorFunc(x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
return result;
}).concatAll();
}
/**
* One of the Following:
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
*
* @example
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
* Or:
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
*
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
* Or:
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
*
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
* source sequence onto which could be either an observable or Promise.
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
if (isFunction(selector) && isFunction(resultSelector)) {
return this.concatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
(isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
return selectorResult.map(function (y, i2) {
return resultSelector(x, y, i, i2);
});
});
}
return isFunction(selector) ?
concatMap(this, selector, thisArg) :
concatMap(this, function () { return selector; });
};
/**
* Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence.
* @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
* @param {Function} onError A transform function to apply when an error occurs in the source sequence.
* @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
* @param {Any} [thisArg] An optional "this" to use to invoke each transform.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
*/
observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) {
var source = this,
onNextFunc = bindCallback(onNext, thisArg, 2),
onErrorFunc = bindCallback(onError, thisArg, 1),
onCompletedFunc = bindCallback(onCompleted, thisArg, 0);
return new AnonymousObservable(function (observer) {
var index = 0;
return source.subscribe(
function (x) {
var result;
try {
result = onNextFunc(x, index++);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
},
function (err) {
var result;
try {
result = onErrorFunc(err);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
},
function () {
var result;
try {
result = onCompletedFunc();
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
});
}, this).concatAll();
};
/**
* Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
*
* var res = obs = xs.defaultIfEmpty();
* 2 - obs = xs.defaultIfEmpty(false);
*
* @memberOf Observable#
* @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null.
* @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
*/
observableProto.defaultIfEmpty = function (defaultValue) {
var source = this;
defaultValue === undefined && (defaultValue = null);
return new AnonymousObservable(function (observer) {
var found = false;
return source.subscribe(function (x) {
found = true;
observer.onNext(x);
},
function (e) { observer.onError(e); },
function () {
!found && observer.onNext(defaultValue);
observer.onCompleted();
});
}, source);
};
// Swap out for Array.findIndex
function arrayIndexOfComparer(array, item, comparer) {
for (var i = 0, len = array.length; i < len; i++) {
if (comparer(array[i], item)) { return i; }
}
return -1;
}
function HashSet(comparer) {
this.comparer = comparer;
this.set = [];
}
HashSet.prototype.push = function(value) {
var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1;
retValue && this.set.push(value);
return retValue;
};
/**
* Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
* Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
*
* @example
* var res = obs = xs.distinct();
* 2 - obs = xs.distinct(function (x) { return x.id; });
* 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; });
* @param {Function} [keySelector] A function to compute the comparison key for each element.
* @param {Function} [comparer] Used to compare items in the collection.
* @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.
*/
observableProto.distinct = function (keySelector, comparer) {
var source = this;
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (o) {
var hashSet = new HashSet(comparer);
return source.subscribe(function (x) {
var key = x;
if (keySelector) {
try {
key = keySelector(x);
} catch (e) {
o.onError(e);
return;
}
}
hashSet.push(key) && o.onNext(x);
},
function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, this);
};
var MapObservable = (function (__super__) {
inherits(MapObservable, __super__);
function MapObservable(source, selector, thisArg) {
this.source = source;
this.selector = bindCallback(selector, thisArg, 3);
__super__.call(this);
}
MapObservable.prototype.internalMap = function (selector, thisArg) {
var self = this;
return new MapObservable(this.source, function (x, i, o) { return selector(self.selector(x, i, o), i, o); }, thisArg)
};
MapObservable.prototype.subscribeCore = function (observer) {
return this.source.subscribe(new MapObserver(observer, this.selector, this));
};
return MapObservable;
}(ObservableBase));
function MapObserver(observer, selector, source) {
this.observer = observer;
this.selector = selector;
this.source = source;
this.i = 0;
this.isStopped = false;
}
MapObserver.prototype.onNext = function(x) {
if (this.isStopped) { return; }
var result = tryCatch(this.selector).call(this, x, this.i++, this.source);
if (result === errorObj) {
return this.observer.onError(result.e);
}
this.observer.onNext(result);
/*try {
var result = this.selector(x, this.i++, this.source);
} catch (e) {
return this.observer.onError(e);
}
this.observer.onNext(result);*/
};
MapObserver.prototype.onError = function (e) {
if(!this.isStopped) { this.isStopped = true; this.observer.onError(e); }
};
MapObserver.prototype.onCompleted = function () {
if(!this.isStopped) { this.isStopped = true; this.observer.onCompleted(); }
};
MapObserver.prototype.dispose = function() { this.isStopped = true; };
MapObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.observer.onError(e);
return true;
}
return false;
};
/**
* Projects each element of an observable sequence into a new form by incorporating the element's index.
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
*/
observableProto.map = observableProto.select = function (selector, thisArg) {
var selectorFn = typeof selector === 'function' ? selector : function () { return selector; };
return this instanceof MapObservable ?
this.internalMap(selectorFn, thisArg) :
new MapObservable(this, selectorFn, thisArg);
};
/**
* Retrieves the value of a specified nested property from all elements in
* the Observable sequence.
* @param {Arguments} arguments The nested properties to pluck.
* @returns {Observable} Returns a new Observable sequence of property values.
*/
observableProto.pluck = function () {
var args = arguments, len = arguments.length;
if (len === 0) { throw new Error('List of properties cannot be empty.'); }
return this.map(function (x) {
var currentProp = x;
for (var i = 0; i < len; i++) {
var p = currentProp[args[i]];
if (typeof p !== 'undefined') {
currentProp = p;
} else {
return undefined;
}
}
return currentProp;
});
};
/**
* Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
* @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
* @param {Function} onError A transform function to apply when an error occurs in the source sequence.
* @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
* @param {Any} [thisArg] An optional "this" to use to invoke each transform.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
*/
observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) {
var source = this;
return new AnonymousObservable(function (observer) {
var index = 0;
return source.subscribe(
function (x) {
var result;
try {
result = onNext.call(thisArg, x, index++);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
},
function (err) {
var result;
try {
result = onError.call(thisArg, err);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
},
function () {
var result;
try {
result = onCompleted.call(thisArg);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
});
}, source).mergeAll();
};
function flatMap(source, selector, thisArg) {
var selectorFunc = bindCallback(selector, thisArg, 3);
return source.map(function (x, i) {
var result = selectorFunc(x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
return result;
}).mergeAll();
}
/**
* One of the Following:
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
*
* @example
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
* Or:
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
*
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
* Or:
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
*
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
if (isFunction(selector) && isFunction(resultSelector)) {
return this.flatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
(isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
return selectorResult.map(function (y, i2) {
return resultSelector(x, y, i, i2);
});
}, thisArg);
}
return isFunction(selector) ?
flatMap(this, selector, thisArg) :
flatMap(this, function () { return selector; });
};
/**
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) {
return this.select(selector, thisArg).switchLatest();
};
/**
* Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
* @param {Number} count The number of elements to skip before returning the remaining elements.
* @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
*/
observableProto.skip = function (count) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
var source = this;
return new AnonymousObservable(function (o) {
var remaining = count;
return source.subscribe(function (x) {
if (remaining <= 0) {
o.onNext(x);
} else {
remaining--;
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
/**
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
* The element's index is used in the logic of the predicate function.
*
* var res = source.skipWhile(function (value) { return value < 10; });
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
*/
observableProto.skipWhile = function (predicate, thisArg) {
var source = this,
callback = bindCallback(predicate, thisArg, 3);
return new AnonymousObservable(function (o) {
var i = 0, running = false;
return source.subscribe(function (x) {
if (!running) {
try {
running = !callback(x, i++, source);
} catch (e) {
o.onError(e);
return;
}
}
running && o.onNext(x);
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
/**
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
*
* var res = source.take(5);
* var res = source.take(0, Rx.Scheduler.timeout);
* @param {Number} count The number of elements to return.
* @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
* @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
*/
observableProto.take = function (count, scheduler) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
if (count === 0) { return observableEmpty(scheduler); }
var source = this;
return new AnonymousObservable(function (o) {
var remaining = count;
return source.subscribe(function (x) {
if (remaining-- > 0) {
o.onNext(x);
remaining === 0 && o.onCompleted();
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
/**
* Returns elements from an observable sequence as long as a specified condition is true.
* The element's index is used in the logic of the predicate function.
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
*/
observableProto.takeWhile = function (predicate, thisArg) {
var source = this,
callback = bindCallback(predicate, thisArg, 3);
return new AnonymousObservable(function (o) {
var i = 0, running = true;
return source.subscribe(function (x) {
if (running) {
try {
running = callback(x, i++, source);
} catch (e) {
o.onError(e);
return;
}
if (running) {
o.onNext(x);
} else {
o.onCompleted();
}
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
var FilterObservable = (function (__super__) {
inherits(FilterObservable, __super__);
function FilterObservable(source, predicate, thisArg) {
this.source = source;
this.predicate = bindCallback(predicate, thisArg, 3);
__super__.call(this);
}
FilterObservable.prototype.subscribeCore = function (observer) {
return this.source.subscribe(new FilterObserver(observer, this.predicate, this));
};
FilterObservable.prototype.internalFilter = function(predicate, thisArg) {
var self = this;
return new FilterObservable(this.source, function(x, i, o) { return self.predicate(x, i, o) && predicate(x, i, o); }, thisArg);
};
return FilterObservable;
}(ObservableBase));
function FilterObserver(observer, predicate, source) {
this.observer = observer;
this.predicate = predicate;
this.source = source;
this.i = 0;
this.isStopped = false;
}
FilterObserver.prototype.onNext = function(x) {
if (this.isStopped) { return; }
var shouldYield = tryCatch(this.predicate).call(this, x, this.i++, this.source);
if (shouldYield === errorObj) {
return this.observer.onError(shouldYield.e);
}
shouldYield && this.observer.onNext(x);
};
FilterObserver.prototype.onError = function (e) {
if(!this.isStopped) { this.isStopped = true; this.observer.onError(e); }
};
FilterObserver.prototype.onCompleted = function () {
if(!this.isStopped) { this.isStopped = true; this.observer.onCompleted(); }
};
FilterObserver.prototype.dispose = function() { this.isStopped = true; };
FilterObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.observer.onError(e);
return true;
}
return false;
};
/**
* Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
* @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
*/
observableProto.filter = observableProto.where = function (predicate, thisArg) {
return this instanceof FilterObservable ? this.internalFilter(predicate, thisArg) :
new FilterObservable(this, predicate, thisArg);
};
/**
* Executes a transducer to transform the observable sequence
* @param {Transducer} transducer A transducer to execute
* @returns {Observable} An Observable sequence containing the results from the transducer.
*/
observableProto.transduce = function(transducer) {
var source = this;
function transformForObserver(observer) {
return {
init: function() {
return observer;
},
step: function(obs, input) {
return obs.onNext(input);
},
result: function(obs) {
return obs.onCompleted();
}
};
}
return new AnonymousObservable(function(observer) {
var xform = transducer(transformForObserver(observer));
return source.subscribe(
function(v) {
try {
xform.step(observer, v);
} catch (e) {
observer.onError(e);
}
},
observer.onError.bind(observer),
function() { xform.result(observer); }
);
}, source);
};
var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
inherits(AnonymousObservable, __super__);
// Fix subscriber to check for undefined or function returned to decorate as Disposable
function fixSubscriber(subscriber) {
return subscriber && isFunction(subscriber.dispose) ? subscriber :
isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
}
function setDisposable(s, state) {
var ado = state[0], subscribe = state[1];
var sub = tryCatch(subscribe)(ado);
if (sub === errorObj) {
if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
}
ado.setDisposable(fixSubscriber(sub));
}
function AnonymousObservable(subscribe, parent) {
this.source = parent;
function s(observer) {
var ado = new AutoDetachObserver(observer), state = [ado, subscribe];
if (currentThreadScheduler.scheduleRequired()) {
currentThreadScheduler.scheduleWithState(state, setDisposable);
} else {
setDisposable(null, state);
}
return ado;
}
__super__.call(this, s);
}
return AnonymousObservable;
}(Observable));
var AutoDetachObserver = (function (__super__) {
inherits(AutoDetachObserver, __super__);
function AutoDetachObserver(observer) {
__super__.call(this);
this.observer = observer;
this.m = new SingleAssignmentDisposable();
}
var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
AutoDetachObserverPrototype.next = function (value) {
var result = tryCatch(this.observer.onNext).call(this.observer, value);
if (result === errorObj) {
this.dispose();
thrower(result.e);
}
};
AutoDetachObserverPrototype.error = function (err) {
var result = tryCatch(this.observer.onError).call(this.observer, err);
this.dispose();
result === errorObj && thrower(result.e);
};
AutoDetachObserverPrototype.completed = function () {
var result = tryCatch(this.observer.onCompleted).call(this.observer);
this.dispose();
result === errorObj && thrower(result.e);
};
AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); };
AutoDetachObserverPrototype.dispose = function () {
__super__.prototype.dispose.call(this);
this.m.dispose();
};
return AutoDetachObserver;
}(AbstractObserver));
var InnerSubscription = function (subject, observer) {
this.subject = subject;
this.observer = observer;
};
InnerSubscription.prototype.dispose = function () {
if (!this.subject.isDisposed && this.observer !== null) {
var idx = this.subject.observers.indexOf(this.observer);
this.subject.observers.splice(idx, 1);
this.observer = null;
}
};
/**
* Represents an object that is both an observable sequence as well as an observer.
* Each notification is broadcasted to all subscribed observers.
*/
var Subject = Rx.Subject = (function (__super__) {
function subscribe(observer) {
checkDisposed(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
if (this.hasError) {
observer.onError(this.error);
return disposableEmpty;
}
observer.onCompleted();
return disposableEmpty;
}
inherits(Subject, __super__);
/**
* Creates a subject.
*/
function Subject() {
__super__.call(this, subscribe);
this.isDisposed = false,
this.isStopped = false,
this.observers = [];
this.hasError = false;
}
addProperties(Subject.prototype, Observer.prototype, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () { return this.observers.length > 0; },
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onCompleted();
}
this.observers.length = 0;
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (error) {
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
this.error = error;
this.hasError = true;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onError(error);
}
this.observers.length = 0;
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed(this);
if (!this.isStopped) {
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onNext(value);
}
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
}
});
/**
* Creates a subject from the specified observer and observable.
* @param {Observer} observer The observer used to send messages to the subject.
* @param {Observable} observable The observable used to subscribe to messages sent from the subject.
* @returns {Subject} Subject implemented using the given observer and observable.
*/
Subject.create = function (observer, observable) {
return new AnonymousSubject(observer, observable);
};
return Subject;
}(Observable));
/**
* Represents the result of an asynchronous operation.
* The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
*/
var AsyncSubject = Rx.AsyncSubject = (function (__super__) {
function subscribe(observer) {
checkDisposed(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
if (this.hasError) {
observer.onError(this.error);
} else if (this.hasValue) {
observer.onNext(this.value);
observer.onCompleted();
} else {
observer.onCompleted();
}
return disposableEmpty;
}
inherits(AsyncSubject, __super__);
/**
* Creates a subject that can only receive one value and that value is cached for all future observations.
* @constructor
*/
function AsyncSubject() {
__super__.call(this, subscribe);
this.isDisposed = false;
this.isStopped = false;
this.hasValue = false;
this.observers = [];
this.hasError = false;
}
addProperties(AsyncSubject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
checkDisposed(this);
return this.observers.length > 0;
},
/**
* Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
*/
onCompleted: function () {
var i, len;
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
var os = cloneArray(this.observers), len = os.length;
if (this.hasValue) {
for (i = 0; i < len; i++) {
var o = os[i];
o.onNext(this.value);
o.onCompleted();
}
} else {
for (i = 0; i < len; i++) {
os[i].onCompleted();
}
}
this.observers.length = 0;
}
},
/**
* Notifies all subscribed observers about the error.
* @param {Mixed} error The Error to send to all observers.
*/
onError: function (error) {
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
this.hasError = true;
this.error = error;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onError(error);
}
this.observers.length = 0;
}
},
/**
* Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
* @param {Mixed} value The value to store in the subject.
*/
onNext: function (value) {
checkDisposed(this);
if (this.isStopped) { return; }
this.value = value;
this.hasValue = true;
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
this.exception = null;
this.value = null;
}
});
return AsyncSubject;
}(Observable));
var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) {
inherits(AnonymousSubject, __super__);
function subscribe(observer) {
return this.observable.subscribe(observer);
}
function AnonymousSubject(observer, observable) {
this.observer = observer;
this.observable = observable;
__super__.call(this, subscribe);
}
addProperties(AnonymousSubject.prototype, Observer.prototype, {
onCompleted: function () {
this.observer.onCompleted();
},
onError: function (error) {
this.observer.onError(error);
},
onNext: function (value) {
this.observer.onNext(value);
}
});
return AnonymousSubject;
}(Observable));
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
root.Rx = Rx;
define(function() {
return Rx;
});
} else if (freeExports && freeModule) {
// in Node.js or RingoJS
if (moduleExports) {
(freeModule.exports = Rx).Rx = Rx;
} else {
freeExports.Rx = Rx;
}
} else {
// in a browser or Rhino
root.Rx = Rx;
}
// All code before this point will be filtered from stack traces.
var rEndingLine = captureLine();
}.call(this));
|
ajax/libs/vuex/2.4.0/vuex.js | cdnjs/cdnjs | /**
* vuex v2.4.0
* (c) 2017 Evan You
* @license MIT
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.Vuex = factory());
}(this, (function () { 'use strict';
var applyMixin = function (Vue) {
var 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.
var _init = Vue.prototype._init;
Vue.prototype._init = function (options) {
if ( options === void 0 ) 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 () {
var 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;
}
}
};
var devtoolHook =
typeof window !== 'undefined' &&
window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
function devtoolPlugin (store) {
if (!devtoolHook) { return }
store._devtoolHook = devtoolHook;
devtoolHook.emit('vuex:init', store);
devtoolHook.on('vuex:travel-to-state', function (targetState) {
store.replaceState(targetState);
});
store.subscribe(function (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 {*}
*/
/**
* Deep copy the given object considering circular structure.
* This function caches all nested objects and its copies.
* If it detects circular structure, use cached copy to avoid infinite loop.
*
* @param {*} obj
* @param {Array<Object>} cache
* @return {*}
*/
/**
* forEach for object
*/
function forEachValue (obj, fn) {
Object.keys(obj).forEach(function (key) { return 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)) }
}
var Module = function Module (rawModule, runtime) {
this.runtime = runtime;
this._children = Object.create(null);
this._rawModule = rawModule;
var rawState = rawModule.state;
this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
};
var prototypeAccessors$1 = { namespaced: {} };
prototypeAccessors$1.namespaced.get = function () {
return !!this._rawModule.namespaced
};
Module.prototype.addChild = function addChild (key, module) {
this._children[key] = module;
};
Module.prototype.removeChild = function removeChild (key) {
delete this._children[key];
};
Module.prototype.getChild = function getChild (key) {
return this._children[key]
};
Module.prototype.update = function 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;
}
};
Module.prototype.forEachChild = function forEachChild (fn) {
forEachValue(this._children, fn);
};
Module.prototype.forEachGetter = function forEachGetter (fn) {
if (this._rawModule.getters) {
forEachValue(this._rawModule.getters, fn);
}
};
Module.prototype.forEachAction = function forEachAction (fn) {
if (this._rawModule.actions) {
forEachValue(this._rawModule.actions, fn);
}
};
Module.prototype.forEachMutation = function forEachMutation (fn) {
if (this._rawModule.mutations) {
forEachValue(this._rawModule.mutations, fn);
}
};
Object.defineProperties( Module.prototype, prototypeAccessors$1 );
var ModuleCollection = function ModuleCollection (rawRootModule) {
// register root module (Vuex.Store options)
this.register([], rawRootModule, false);
};
ModuleCollection.prototype.get = function get (path) {
return path.reduce(function (module, key) {
return module.getChild(key)
}, this.root)
};
ModuleCollection.prototype.getNamespace = function getNamespace (path) {
var module = this.root;
return path.reduce(function (namespace, key) {
module = module.getChild(key);
return namespace + (module.namespaced ? key + '/' : '')
}, '')
};
ModuleCollection.prototype.update = function update$1 (rawRootModule) {
update([], this.root, rawRootModule);
};
ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
var this$1 = this;
if ( runtime === void 0 ) runtime = true;
{
assertRawModule(path, rawModule);
}
var newModule = new Module(rawModule, runtime);
if (path.length === 0) {
this.root = newModule;
} else {
var parent = this.get(path.slice(0, -1));
parent.addChild(path[path.length - 1], newModule);
}
// register nested modules
if (rawModule.modules) {
forEachValue(rawModule.modules, function (rawChildModule, key) {
this$1.register(path.concat(key), rawChildModule, runtime);
});
}
};
ModuleCollection.prototype.unregister = function unregister (path) {
var parent = this.get(path.slice(0, -1));
var 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 (var 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]
);
}
}
}
function assertRawModule (path, rawModule) {
['getters', 'actions', 'mutations'].forEach(function (key) {
if (!rawModule[key]) { return }
forEachValue(rawModule[key], function (value, type) {
assert(
typeof value === 'function',
makeAssertionMessage(path, key, type, value)
);
});
});
}
function makeAssertionMessage (path, key, type, value) {
var buf = key + " should be function but \"" + key + "." + type + "\"";
if (path.length > 0) {
buf += " in module \"" + (path.join('.')) + "\"";
}
buf += " is " + (JSON.stringify(value)) + ".";
return buf
}
var Vue; // bind on install
var Store = function Store (options) {
var this$1 = this;
if ( options === void 0 ) options = {};
{
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.");
}
var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
var strict = options.strict; if ( strict === void 0 ) strict = false;
var state = options.state; if ( state === void 0 ) state = {};
if (typeof state === 'function') {
state = state();
}
// store internal state
this._committing = false;
this._actions = Object.create(null);
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();
// bind commit and dispatch to self
var store = this;
var ref = this;
var dispatch = ref.dispatch;
var commit = ref.commit;
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;
// 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(function (plugin) { return plugin(this$1); });
if (Vue.config.devtools) {
devtoolPlugin(this);
}
};
var prototypeAccessors = { state: {} };
prototypeAccessors.state.get = function () {
return this._vm._data.$$state
};
prototypeAccessors.state.set = function (v) {
{
assert(false, "Use store.replaceState() to explicit replace store state.");
}
};
Store.prototype.commit = function commit (_type, _payload, _options) {
var this$1 = this;
// check object-style commit
var ref = unifyObjectStyle(_type, _payload, _options);
var type = ref.type;
var payload = ref.payload;
var options = ref.options;
var mutation = { type: type, payload: payload };
var entry = this._mutations[type];
if (!entry) {
{
console.error(("[vuex] unknown mutation type: " + type));
}
return
}
this._withCommit(function () {
entry.forEach(function commitIterator (handler) {
handler(payload);
});
});
this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
if (
"development" !== 'production' &&
options && options.silent
) {
console.warn(
"[vuex] mutation type: " + type + ". Silent option has been removed. " +
'Use the filter functionality in the vue-devtools'
);
}
};
Store.prototype.dispatch = function dispatch (_type, _payload) {
// check object-style dispatch
var ref = unifyObjectStyle(_type, _payload);
var type = ref.type;
var payload = ref.payload;
var entry = this._actions[type];
if (!entry) {
{
console.error(("[vuex] unknown action type: " + type));
}
return
}
return entry.length > 1
? Promise.all(entry.map(function (handler) { return handler(payload); }))
: entry[0](payload)
};
Store.prototype.subscribe = function subscribe (fn) {
var subs = this._subscribers;
if (subs.indexOf(fn) < 0) {
subs.push(fn);
}
return function () {
var i = subs.indexOf(fn);
if (i > -1) {
subs.splice(i, 1);
}
}
};
Store.prototype.watch = function watch (getter, cb, options) {
var this$1 = this;
{
assert(typeof getter === 'function', "store.watch only accepts a function.");
}
return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
};
Store.prototype.replaceState = function replaceState (state) {
var this$1 = this;
this._withCommit(function () {
this$1._vm._data.$$state = state;
});
};
Store.prototype.registerModule = function registerModule (path, rawModule) {
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));
// reset store to update getters...
resetStoreVM(this, this.state);
};
Store.prototype.unregisterModule = function unregisterModule (path) {
var this$1 = this;
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(function () {
var parentState = getNestedState(this$1.state, path.slice(0, -1));
Vue.delete(parentState, path[path.length - 1]);
});
resetStore(this);
};
Store.prototype.hotUpdate = function hotUpdate (newOptions) {
this._modules.update(newOptions);
resetStore(this, true);
};
Store.prototype._withCommit = function _withCommit (fn) {
var committing = this._committing;
this._committing = true;
fn();
this._committing = committing;
};
Object.defineProperties( Store.prototype, prototypeAccessors );
function resetStore (store, hot) {
store._actions = Object.create(null);
store._mutations = Object.create(null);
store._wrappedGetters = Object.create(null);
store._modulesNamespaceMap = Object.create(null);
var state = store.state;
// init all modules
installModule(store, state, [], store._modules.root, true);
// reset vm
resetStoreVM(store, state, hot);
}
function resetStoreVM (store, state, hot) {
var oldVm = store._vm;
// bind store public getters
store.getters = {};
var wrappedGetters = store._wrappedGetters;
var computed = {};
forEachValue(wrappedGetters, function (fn, key) {
// use computed to leverage its lazy-caching mechanism
computed[key] = function () { return fn(store); };
Object.defineProperty(store.getters, key, {
get: function () { return 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
var silent = Vue.config.silent;
Vue.config.silent = true;
store._vm = new Vue({
data: {
$$state: state
},
computed: 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(function () {
oldVm._data.$$state = null;
});
}
Vue.nextTick(function () { return oldVm.$destroy(); });
}
}
function installModule (store, rootState, path, module, hot) {
var isRoot = !path.length;
var namespace = store._modules.getNamespace(path);
// register in namespace map
if (module.namespaced) {
store._modulesNamespaceMap[namespace] = module;
}
// set state
if (!isRoot && !hot) {
var parentState = getNestedState(rootState, path.slice(0, -1));
var moduleName = path[path.length - 1];
store._withCommit(function () {
Vue.set(parentState, moduleName, module.state);
});
}
var local = module.context = makeLocalContext(store, namespace, path);
module.forEachMutation(function (mutation, key) {
var namespacedType = namespace + key;
registerMutation(store, namespacedType, mutation, local);
});
module.forEachAction(function (action, key) {
var namespacedType = namespace + key;
registerAction(store, namespacedType, action, local);
});
module.forEachGetter(function (getter, key) {
var namespacedType = namespace + key;
registerGetter(store, namespacedType, getter, local);
});
module.forEachChild(function (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) {
var noNamespace = namespace === '';
var local = {
dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
var args = unifyObjectStyle(_type, _payload, _options);
var payload = args.payload;
var options = args.options;
var type = args.type;
if (!options || !options.root) {
type = namespace + type;
if ("development" !== 'production' && !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 : function (_type, _payload, _options) {
var args = unifyObjectStyle(_type, _payload, _options);
var payload = args.payload;
var options = args.options;
var type = args.type;
if (!options || !options.root) {
type = namespace + type;
if ("development" !== 'production' && !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
? function () { return store.getters; }
: function () { return makeLocalGetters(store, namespace); }
},
state: {
get: function () { return getNestedState(store.state, path); }
}
});
return local
}
function makeLocalGetters (store, namespace) {
var gettersProxy = {};
var splitPos = namespace.length;
Object.keys(store.getters).forEach(function (type) {
// skip if the target getter is not match this namespace
if (type.slice(0, splitPos) !== namespace) { return }
// extract local getter type
var 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: function () { return store.getters[type]; },
enumerable: true
});
});
return gettersProxy
}
function registerMutation (store, type, handler, local) {
var entry = store._mutations[type] || (store._mutations[type] = []);
entry.push(function wrappedMutationHandler (payload) {
handler.call(store, local.state, payload);
});
}
function registerAction (store, type, handler, local) {
var entry = store._actions[type] || (store._actions[type] = []);
entry.push(function wrappedActionHandler (payload, cb) {
var res = handler.call(store, {
dispatch: local.dispatch,
commit: local.commit,
getters: local.getters,
state: local.state,
rootGetters: store.getters,
rootState: store.state
}, payload, cb);
if (!isPromise(res)) {
res = Promise.resolve(res);
}
if (store._devtoolHook) {
return res.catch(function (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 }, function () {
{
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(function (state, key) { return 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: type, payload: payload, options: options }
}
function install (_Vue) {
if (Vue) {
{
console.error(
'[vuex] already installed. Vue.use(Vuex) should be called only once.'
);
}
return
}
Vue = _Vue;
applyMixin(Vue);
}
// auto install in dist mode
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue);
}
var mapState = normalizeNamespace(function (namespace, states) {
var res = {};
normalizeMap(states).forEach(function (ref) {
var key = ref.key;
var val = ref.val;
res[key] = function mappedState () {
var state = this.$store.state;
var getters = this.$store.getters;
if (namespace) {
var 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
});
var mapMutations = normalizeNamespace(function (namespace, mutations) {
var res = {};
normalizeMap(mutations).forEach(function (ref) {
var key = ref.key;
var val = ref.val;
val = namespace + val;
res[key] = function mappedMutation () {
var args = [], len = arguments.length;
while ( len-- ) args[ len ] = arguments[ len ];
if (namespace && !getModuleByNamespace(this.$store, 'mapMutations', namespace)) {
return
}
return this.$store.commit.apply(this.$store, [val].concat(args))
};
});
return res
});
var mapGetters = normalizeNamespace(function (namespace, getters) {
var res = {};
normalizeMap(getters).forEach(function (ref) {
var key = ref.key;
var val = ref.val;
val = namespace + val;
res[key] = function mappedGetter () {
if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
return
}
if ("development" !== 'production' && !(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
});
var mapActions = normalizeNamespace(function (namespace, actions) {
var res = {};
normalizeMap(actions).forEach(function (ref) {
var key = ref.key;
var val = ref.val;
val = namespace + val;
res[key] = function mappedAction () {
var args = [], len = arguments.length;
while ( len-- ) args[ len ] = arguments[ len ];
if (namespace && !getModuleByNamespace(this.$store, 'mapActions', namespace)) {
return
}
return this.$store.dispatch.apply(this.$store, [val].concat(args))
};
});
return res
});
var createNamespacedHelpers = function (namespace) { return ({
mapState: mapState.bind(null, namespace),
mapGetters: mapGetters.bind(null, namespace),
mapMutations: mapMutations.bind(null, namespace),
mapActions: mapActions.bind(null, namespace)
}); };
function normalizeMap (map) {
return Array.isArray(map)
? map.map(function (key) { return ({ key: key, val: key }); })
: Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
}
function normalizeNamespace (fn) {
return function (namespace, map) {
if (typeof namespace !== 'string') {
map = namespace;
namespace = '';
} else if (namespace.charAt(namespace.length - 1) !== '/') {
namespace += '/';
}
return fn(namespace, map)
}
}
function getModuleByNamespace (store, helper, namespace) {
var module = store._modulesNamespaceMap[namespace];
if ("development" !== 'production' && !module) {
console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
}
return module
}
var index = {
Store: Store,
install: install,
version: '2.4.0',
mapState: mapState,
mapMutations: mapMutations,
mapGetters: mapGetters,
mapActions: mapActions,
createNamespacedHelpers: createNamespacedHelpers
};
return index;
})));
|
react/features/chat/components/native/ChatPrivacyDialog.js | gpolitis/jitsi-meet | // @flow
import React from 'react';
import { ConfirmDialog } from '../../../base/dialog';
import { translate } from '../../../base/i18n';
import { connect } from '../../../base/redux';
import { AbstractChatPrivacyDialog, _mapDispatchToProps, _mapStateToProps } from '../AbstractChatPrivacyDialog';
/**
* Implements a component for the dialog displayed to avoid mis-sending private messages.
*/
class ChatPrivacyDialog extends AbstractChatPrivacyDialog {
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
return (
<ConfirmDialog
cancelLabel = 'dialog.sendPrivateMessageCancel'
confirmLabel = 'dialog.sendPrivateMessageOk'
descriptionKey = 'dialog.sendPrivateMessage'
onCancel = { this._onSendGroupMessage }
onSubmit = { this._onSendPrivateMessage } />
);
}
_onSendGroupMessage: () => boolean;
_onSendPrivateMessage: () => boolean;
}
export default translate(connect(_mapStateToProps, _mapDispatchToProps)(ChatPrivacyDialog));
|
src/ui/react/gulp-tasks/test.js | rothanachoun/alloy-editor | 'use strict';
var argv = require('yargs').argv;
var babel = require('gulp-babel');
var gulp = require('gulp');
var KarmaServer = require('karma').Server;
var mkdirp = require('mkdirp');
var path = require('path');
var runSequence = require('run-sequence');
var rootDir = path.join(__dirname, '..', '..', '..', '..');
var reactDir = path.join(rootDir, 'src', 'ui', 'react');
var distFolder = path.join(rootDir, 'dist');
var editorDistFolder = path.join(distFolder, 'alloy-editor');
var srcFiles = require('../_src.js');
var languageFiles = require('../_languages.js');
gulp.task('prepare-files', function(done) {
runSequence(
'clean-dist', 'create-output-dir', [
'build-css', 'copy-ckeditor', 'copy-core-files', 'copy-language-files', 'copy-react', 'copy-test-plugins'
], done);
});
gulp.task('create-output-dir', function(callback) {
mkdirp(editorDistFolder, callback);
});
gulp.task('copy-core-files', function() {
return gulp.src(srcFiles.main.concat(srcFiles.ui), {cwd: 'src', base: 'src'})
.pipe(babel({
presets: ['es2015', 'react']
}))
.pipe(gulp.dest(path.join(editorDistFolder, 'test')));
});
gulp.task('copy-language-files', function() {
return gulp.src(languageFiles, {cwd: 'src', base: 'src'})
.pipe(gulp.dest(path.join(editorDistFolder, 'test')));
});
gulp.task('copy-react', function() {
return gulp.src(path.join(reactDir, 'vendor', 'react-with-addons-all.js'))
.pipe(gulp.dest(editorDistFolder));
});
gulp.task('copy-test-plugins', function() {
return gulp.src(path.join(reactDir, 'test', 'plugins', '/**'))
.pipe(gulp.dest(path.join(editorDistFolder, 'plugins')));
});
gulp.task('test', ['prepare-files'], function (done) {
new KarmaServer({
configFile: path.join(__dirname, '../karma.js'),
singleRun: (argv.debug || argv.d) ? false : true
}, done).start();
}); |
actor-apps/app-web/src/app/components/modals/Preferences.react.js | yaoliyc/actor-platform | import React from 'react';
import Modal from 'react-modal';
import ReactMixin from 'react-mixin';
import { IntlMixin, FormattedMessage } from 'react-intl';
import { Styles, FlatButton, RadioButtonGroup, RadioButton, DropDownMenu } from 'material-ui';
import { KeyCodes } from 'constants/ActorAppConstants';
import ActorTheme from 'constants/ActorTheme';
import PreferencesActionCreators from 'actions/PreferencesActionCreators';
import PreferencesStore from 'stores/PreferencesStore';
const appElement = document.getElementById('actor-web-app');
Modal.setAppElement(appElement);
const ThemeManager = new Styles.ThemeManager();
const getStateFromStores = () => {
return {
isOpen: PreferencesStore.isModalOpen()
};
};
@ReactMixin.decorate(IntlMixin)
class PreferencesModal extends React.Component {
static childContextTypes = {
muiTheme: React.PropTypes.object
};
getChildContext() {
return {
muiTheme: ThemeManager.getCurrentTheme()
};
}
constructor(props) {
super(props);
this.state = getStateFromStores();
ThemeManager.setTheme(ActorTheme);
ThemeManager.setComponentThemes({
button: {
minWidth: 60
}
});
PreferencesStore.addChangeListener(this.onChange);
document.addEventListener('keydown', this.onKeyDown, false);
}
componentWillUnmount() {
PreferencesStore.removeChangeListener(this.onChange);
document.removeEventListener('keydown', this.onKeyDown, false);
}
onChange = () => {
this.setState(getStateFromStores());
};
onClose = () => {
PreferencesActionCreators.hide();
};
onKeyDown = event => {
if (event.keyCode === KeyCodes.ESC) {
event.preventDefault();
this.onClose();
}
};
render() {
let menuItems = [
{ payload: '1', text: 'English' },
{ payload: '2', text: 'Russian' }
];
if (this.state.isOpen === true) {
return (
<Modal className="modal-new modal-new--preferences"
closeTimeoutMS={150}
isOpen={this.state.isOpen}
style={{width: 760}}>
<div className="modal-new__header">
<i className="modal-new__header__icon material-icons">settings</i>
<h3 className="modal-new__header__title">
<FormattedMessage message={this.getIntlMessage('preferencesModalTitle')}/>
</h3>
<div className="pull-right">
<FlatButton hoverColor="rgba(81,145,219,.17)"
label="Done"
labelStyle={{padding: '0 8px'}}
onClick={this.onClose}
secondary={true}
style={{marginTop: -6}}/>
</div>
</div>
<div className="modal-new__body">
<div className="preferences">
<aside className="preferences__tabs">
<a className="preferences__tabs__tab preferences__tabs__tab--active">General</a>
<a className="preferences__tabs__tab">Notifications</a>
<a className="preferences__tabs__tab">Sidebar colors</a>
<a className="preferences__tabs__tab">Security</a>
<a className="preferences__tabs__tab">Other Options</a>
</aside>
<div className="preferences__body">
<div className="preferences__list">
<div className="preferences__list__item preferences__list__item--general">
<ul>
<li>
<i className="icon material-icons">keyboard</i>
<RadioButtonGroup defaultSelected="default" name="send">
<RadioButton label="Enter – send message, Shift + Enter – new line"
style={{marginBottom: 12}}
value="default"/>
<RadioButton label="Cmd + Enter – send message, Enter – new line"
//style={{marginBottom: 16}}
value="alt"/>
</RadioButtonGroup>
</li>
<li className="language">
<i className="icon material-icons">menu</i>
Language: <DropDownMenu labelStyle={{color: '#5191db'}}
menuItemStyle={{height: '40px', lineHeight: '40px'}}
menuItems={menuItems}
style={{verticalAlign: 'top', height: 52}}
underlineStyle={{display: 'none'}}/>
</li>
</ul>
</div>
<div className="preferences__list__item preferences__list__item--notifications">
<ul>
<li>
<i className="icon material-icons">notifications</i>
<RadioButtonGroup defaultSelected="all" name="notifications">
<RadioButton label="Notifications for activity of any kind"
style={{marginBottom: 12}}
value="all"/>
<RadioButton label="Notifications for Highlight Words and direct messages"
style={{marginBottom: 12}}
value="quiet"/>
<RadioButton label="Never send me notifications"
style={{marginBottom: 12}}
value="disable"/>
</RadioButtonGroup>
<p className="hint">
You can override your desktop notification preference on a case-by-case
basis for channels and groups from the channel or group menu.
</p>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</Modal>
);
} else {
return null;
}
}
}
export default PreferencesModal;
|
src/main/webapp/bower_components/es6-shim/es6-shim.min.js | rcassola/DigiCard | /*!
* https://github.com/paulmillr/es6-shim
* @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
* and contributors, MIT License
* es6-shim: v0.35.1
* see https://github.com/paulmillr/es6-shim/blob/0.35.1/LICENSE
* Details and documentation:
* https://github.com/paulmillr/es6-shim/
*/
(function(e,t){if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{e.returnExports=t()}})(this,function(){"use strict";var e=Function.call.bind(Function.apply);var t=Function.call.bind(Function.call);var r=Array.isArray;var n=Object.keys;var o=function notThunker(t){return function notThunk(){return!e(t,this,arguments)}};var i=function(e){try{e();return false}catch(e){return true}};var a=function valueOrFalseIfThrows(e){try{return e()}catch(e){return false}};var u=o(i);var f=function(){return!i(function(){Object.defineProperty({},"x",{get:function(){}})})};var s=!!Object.defineProperty&&f();var c=function foo(){}.name==="foo";var l=Function.call.bind(Array.prototype.forEach);var p=Function.call.bind(Array.prototype.reduce);var v=Function.call.bind(Array.prototype.filter);var y=Function.call.bind(Array.prototype.some);var h=function(e,t,r,n){if(!n&&t in e){return}if(s){Object.defineProperty(e,t,{configurable:true,enumerable:false,writable:true,value:r})}else{e[t]=r}};var b=function(e,t,r){l(n(t),function(n){var o=t[n];h(e,n,o,!!r)})};var g=Function.call.bind(Object.prototype.toString);var d=typeof/abc/==="function"?function IsCallableSlow(e){return typeof e==="function"&&g(e)==="[object Function]"}:function IsCallableFast(e){return typeof e==="function"};var m={getter:function(e,t,r){if(!s){throw new TypeError("getters require true ES5 support")}Object.defineProperty(e,t,{configurable:true,enumerable:false,get:r})},proxy:function(e,t,r){if(!s){throw new TypeError("getters require true ES5 support")}var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,{configurable:n.configurable,enumerable:n.enumerable,get:function getKey(){return e[t]},set:function setKey(r){e[t]=r}})},redefine:function(e,t,r){if(s){var n=Object.getOwnPropertyDescriptor(e,t);n.value=r;Object.defineProperty(e,t,n)}else{e[t]=r}},defineByDescriptor:function(e,t,r){if(s){Object.defineProperty(e,t,r)}else if("value"in r){e[t]=r.value}},preserveToString:function(e,t){if(t&&d(t.toString)){h(e,"toString",t.toString.bind(t),true)}}};var O=Object.create||function(e,t){var r=function Prototype(){};r.prototype=e;var o=new r;if(typeof t!=="undefined"){n(t).forEach(function(e){m.defineByDescriptor(o,e,t[e])})}return o};var w=function(e,t){if(!Object.setPrototypeOf){return false}return a(function(){var r=function Subclass(t){var r=new e(t);Object.setPrototypeOf(r,Subclass.prototype);return r};Object.setPrototypeOf(r,e);r.prototype=O(e.prototype,{constructor:{value:r}});return t(r)})};var j=function(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")};var S=j();var T=S.isFinite;var I=Function.call.bind(String.prototype.indexOf);var E=Function.apply.bind(Array.prototype.indexOf);var P=Function.call.bind(Array.prototype.concat);var C=Function.call.bind(String.prototype.slice);var M=Function.call.bind(Array.prototype.push);var x=Function.apply.bind(Array.prototype.push);var N=Function.call.bind(Array.prototype.shift);var A=Math.max;var R=Math.min;var _=Math.floor;var k=Math.abs;var F=Math.exp;var L=Math.log;var D=Math.sqrt;var z=Function.call.bind(Object.prototype.hasOwnProperty);var q;var W=function(){};var G=S.Map;var H=G&&G.prototype["delete"];var V=G&&G.prototype.get;var B=G&&G.prototype.has;var U=G&&G.prototype.set;var $=S.Symbol||{};var J=$.species||"@@species";var X=Number.isNaN||function isNaN(e){return e!==e};var K=Number.isFinite||function isFinite(e){return typeof e==="number"&&T(e)};var Z=d(Math.sign)?Math.sign:function sign(e){var t=Number(e);if(t===0){return t}if(X(t)){return t}return t<0?-1:1};var Y=function isArguments(e){return g(e)==="[object Arguments]"};var Q=function isArguments(e){return e!==null&&typeof e==="object"&&typeof e.length==="number"&&e.length>=0&&g(e)!=="[object Array]"&&g(e.callee)==="[object Function]"};var ee=Y(arguments)?Y:Q;var te={primitive:function(e){return e===null||typeof e!=="function"&&typeof e!=="object"},string:function(e){return g(e)==="[object String]"},regex:function(e){return g(e)==="[object RegExp]"},symbol:function(e){return typeof S.Symbol==="function"&&typeof e==="symbol"}};var re=function overrideNative(e,t,r){var n=e[t];h(e,t,r,true);m.preserveToString(e[t],n)};var ne=typeof $==="function"&&typeof $["for"]==="function"&&te.symbol($());var oe=te.symbol($.iterator)?$.iterator:"_es6-shim iterator_";if(S.Set&&typeof(new S.Set)["@@iterator"]==="function"){oe="@@iterator"}if(!S.Reflect){h(S,"Reflect",{},true)}var ie=S.Reflect;var ae=String;var ue=typeof document==="undefined"||!document?null:document.all;var fe=ue==null?function isNullOrUndefined(e){return e==null}:function isNullOrUndefinedAndNotDocumentAll(e){return e==null&&e!==ue};var se={Call:function Call(t,r){var n=arguments.length>2?arguments[2]:[];if(!se.IsCallable(t)){throw new TypeError(t+" is not a function")}return e(t,r,n)},RequireObjectCoercible:function(e,t){if(fe(e)){throw new TypeError(t||"Cannot call method on "+e)}return e},TypeIsObject:function(e){if(e===void 0||e===null||e===true||e===false){return false}return typeof e==="function"||typeof e==="object"||e===ue},ToObject:function(e,t){return Object(se.RequireObjectCoercible(e,t))},IsCallable:d,IsConstructor:function(e){return se.IsCallable(e)},ToInt32:function(e){return se.ToNumber(e)>>0},ToUint32:function(e){return se.ToNumber(e)>>>0},ToNumber:function(e){if(g(e)==="[object Symbol]"){throw new TypeError("Cannot convert a Symbol value to a number")}return+e},ToInteger:function(e){var t=se.ToNumber(e);if(X(t)){return 0}if(t===0||!K(t)){return t}return(t>0?1:-1)*_(k(t))},ToLength:function(e){var t=se.ToInteger(e);if(t<=0){return 0}if(t>Number.MAX_SAFE_INTEGER){return Number.MAX_SAFE_INTEGER}return t},SameValue:function(e,t){if(e===t){if(e===0){return 1/e===1/t}return true}return X(e)&&X(t)},SameValueZero:function(e,t){return e===t||X(e)&&X(t)},IsIterable:function(e){return se.TypeIsObject(e)&&(typeof e[oe]!=="undefined"||ee(e))},GetIterator:function(e){if(ee(e)){return new q(e,"value")}var t=se.GetMethod(e,oe);if(!se.IsCallable(t)){throw new TypeError("value is not an iterable")}var r=se.Call(t,e);if(!se.TypeIsObject(r)){throw new TypeError("bad iterator")}return r},GetMethod:function(e,t){var r=se.ToObject(e)[t];if(fe(r)){return void 0}if(!se.IsCallable(r)){throw new TypeError("Method not callable: "+t)}return r},IteratorComplete:function(e){return!!e.done},IteratorClose:function(e,t){var r=se.GetMethod(e,"return");if(r===void 0){return}var n,o;try{n=se.Call(r,e)}catch(e){o=e}if(t){return}if(o){throw o}if(!se.TypeIsObject(n)){throw new TypeError("Iterator's return method returned a non-object.")}},IteratorNext:function(e){var t=arguments.length>1?e.next(arguments[1]):e.next();if(!se.TypeIsObject(t)){throw new TypeError("bad iterator")}return t},IteratorStep:function(e){var t=se.IteratorNext(e);var r=se.IteratorComplete(t);return r?false:t},Construct:function(e,t,r,n){var o=typeof r==="undefined"?e:r;if(!n&&ie.construct){return ie.construct(e,t,o)}var i=o.prototype;if(!se.TypeIsObject(i)){i=Object.prototype}var a=O(i);var u=se.Call(e,a,t);return se.TypeIsObject(u)?u:a},SpeciesConstructor:function(e,t){var r=e.constructor;if(r===void 0){return t}if(!se.TypeIsObject(r)){throw new TypeError("Bad constructor")}var n=r[J];if(fe(n)){return t}if(!se.IsConstructor(n)){throw new TypeError("Bad @@species")}return n},CreateHTML:function(e,t,r,n){var o=se.ToString(e);var i="<"+t;if(r!==""){var a=se.ToString(n);var u=a.replace(/"/g,""");i+=" "+r+'="'+u+'"'}var f=i+">";var s=f+o;return s+"</"+t+">"},IsRegExp:function IsRegExp(e){if(!se.TypeIsObject(e)){return false}var t=e[$.match];if(typeof t!=="undefined"){return!!t}return te.regex(e)},ToString:function ToString(e){return ae(e)}};if(s&&ne){var ce=function defineWellKnownSymbol(e){if(te.symbol($[e])){return $[e]}var t=$["for"]("Symbol."+e);Object.defineProperty($,e,{configurable:false,enumerable:false,writable:false,value:t});return t};if(!te.symbol($.search)){var le=ce("search");var pe=String.prototype.search;h(RegExp.prototype,le,function search(e){return se.Call(pe,e,[this])});var ve=function search(e){var t=se.RequireObjectCoercible(this);if(!fe(e)){var r=se.GetMethod(e,le);if(typeof r!=="undefined"){return se.Call(r,e,[t])}}return se.Call(pe,t,[se.ToString(e)])};re(String.prototype,"search",ve)}if(!te.symbol($.replace)){var ye=ce("replace");var he=String.prototype.replace;h(RegExp.prototype,ye,function replace(e,t){return se.Call(he,e,[this,t])});var be=function replace(e,t){var r=se.RequireObjectCoercible(this);if(!fe(e)){var n=se.GetMethod(e,ye);if(typeof n!=="undefined"){return se.Call(n,e,[r,t])}}return se.Call(he,r,[se.ToString(e),t])};re(String.prototype,"replace",be)}if(!te.symbol($.split)){var ge=ce("split");var de=String.prototype.split;h(RegExp.prototype,ge,function split(e,t){return se.Call(de,e,[this,t])});var me=function split(e,t){var r=se.RequireObjectCoercible(this);if(!fe(e)){var n=se.GetMethod(e,ge);if(typeof n!=="undefined"){return se.Call(n,e,[r,t])}}return se.Call(de,r,[se.ToString(e),t])};re(String.prototype,"split",me)}var Oe=te.symbol($.match);var we=Oe&&function(){var e={};e[$.match]=function(){return 42};return"a".match(e)!==42}();if(!Oe||we){var je=ce("match");var Se=String.prototype.match;h(RegExp.prototype,je,function match(e){return se.Call(Se,e,[this])});var Te=function match(e){var t=se.RequireObjectCoercible(this);if(!fe(e)){var r=se.GetMethod(e,je);if(typeof r!=="undefined"){return se.Call(r,e,[t])}}return se.Call(Se,t,[se.ToString(e)])};re(String.prototype,"match",Te)}}var Ie=function wrapConstructor(e,t,r){m.preserveToString(t,e);if(Object.setPrototypeOf){Object.setPrototypeOf(e,t)}if(s){l(Object.getOwnPropertyNames(e),function(n){if(n in W||r[n]){return}m.proxy(e,n,t)})}else{l(Object.keys(e),function(n){if(n in W||r[n]){return}t[n]=e[n]})}t.prototype=e.prototype;m.redefine(e.prototype,"constructor",t)};var Ee=function(){return this};var Pe=function(e){if(s&&!z(e,J)){m.getter(e,J,Ee)}};var Ce=function(e,t){var r=t||function iterator(){return this};h(e,oe,r);if(!e[oe]&&te.symbol(oe)){e[oe]=r}};var Me=function createDataProperty(e,t,r){if(s){Object.defineProperty(e,t,{configurable:true,enumerable:true,writable:true,value:r})}else{e[t]=r}};var xe=function createDataPropertyOrThrow(e,t,r){Me(e,t,r);if(!se.SameValue(e[t],r)){throw new TypeError("property is nonconfigurable")}};var Ne=function(e,t,r,n){if(!se.TypeIsObject(e)){throw new TypeError("Constructor requires `new`: "+t.name)}var o=t.prototype;if(!se.TypeIsObject(o)){o=r}var i=O(o);for(var a in n){if(z(n,a)){var u=n[a];h(i,a,u,true)}}return i};if(String.fromCodePoint&&String.fromCodePoint.length!==1){var Ae=String.fromCodePoint;re(String,"fromCodePoint",function fromCodePoint(e){return se.Call(Ae,this,arguments)})}var Re={fromCodePoint:function fromCodePoint(e){var t=[];var r;for(var n=0,o=arguments.length;n<o;n++){r=Number(arguments[n]);if(!se.SameValue(r,se.ToInteger(r))||r<0||r>1114111){throw new RangeError("Invalid code point "+r)}if(r<65536){M(t,String.fromCharCode(r))}else{r-=65536;M(t,String.fromCharCode((r>>10)+55296));M(t,String.fromCharCode(r%1024+56320))}}return t.join("")},raw:function raw(e){var t=se.ToObject(e,"bad callSite");var r=se.ToObject(t.raw,"bad raw value");var n=r.length;var o=se.ToLength(n);if(o<=0){return""}var i=[];var a=0;var u,f,s,c;while(a<o){u=se.ToString(a);s=se.ToString(r[u]);M(i,s);if(a+1>=o){break}f=a+1<arguments.length?arguments[a+1]:"";c=se.ToString(f);M(i,c);a+=1}return i.join("")}};if(String.raw&&String.raw({raw:{0:"x",1:"y",length:2}})!=="xy"){re(String,"raw",Re.raw)}b(String,Re);var _e=function repeat(e,t){if(t<1){return""}if(t%2){return repeat(e,t-1)+e}var r=repeat(e,t/2);return r+r};var ke=Infinity;var Fe={repeat:function repeat(e){var t=se.ToString(se.RequireObjectCoercible(this));var r=se.ToInteger(e);if(r<0||r>=ke){throw new RangeError("repeat count must be less than infinity and not overflow maximum string size")}return _e(t,r)},startsWith:function startsWith(e){var t=se.ToString(se.RequireObjectCoercible(this));if(se.IsRegExp(e)){throw new TypeError('Cannot call method "startsWith" with a regex')}var r=se.ToString(e);var n;if(arguments.length>1){n=arguments[1]}var o=A(se.ToInteger(n),0);return C(t,o,o+r.length)===r},endsWith:function endsWith(e){var t=se.ToString(se.RequireObjectCoercible(this));if(se.IsRegExp(e)){throw new TypeError('Cannot call method "endsWith" with a regex')}var r=se.ToString(e);var n=t.length;var o;if(arguments.length>1){o=arguments[1]}var i=typeof o==="undefined"?n:se.ToInteger(o);var a=R(A(i,0),n);return C(t,a-r.length,a)===r},includes:function includes(e){if(se.IsRegExp(e)){throw new TypeError('"includes" does not accept a RegExp')}var t=se.ToString(e);var r;if(arguments.length>1){r=arguments[1]}return I(this,t,r)!==-1},codePointAt:function codePointAt(e){var t=se.ToString(se.RequireObjectCoercible(this));var r=se.ToInteger(e);var n=t.length;if(r>=0&&r<n){var o=t.charCodeAt(r);var i=r+1===n;if(o<55296||o>56319||i){return o}var a=t.charCodeAt(r+1);if(a<56320||a>57343){return o}return(o-55296)*1024+(a-56320)+65536}}};if(String.prototype.includes&&"a".includes("a",Infinity)!==false){re(String.prototype,"includes",Fe.includes)}if(String.prototype.startsWith&&String.prototype.endsWith){var Le=i(function(){"/a/".startsWith(/a/)});var De=a(function(){return"abc".startsWith("a",Infinity)===false});if(!Le||!De){re(String.prototype,"startsWith",Fe.startsWith);re(String.prototype,"endsWith",Fe.endsWith)}}if(ne){var ze=a(function(){var e=/a/;e[$.match]=false;return"/a/".startsWith(e)});if(!ze){re(String.prototype,"startsWith",Fe.startsWith)}var qe=a(function(){var e=/a/;e[$.match]=false;return"/a/".endsWith(e)});if(!qe){re(String.prototype,"endsWith",Fe.endsWith)}var We=a(function(){var e=/a/;e[$.match]=false;return"/a/".includes(e)});if(!We){re(String.prototype,"includes",Fe.includes)}}b(String.prototype,Fe);var Ge=["\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003","\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028","\u2029\ufeff"].join("");var He=new RegExp("(^["+Ge+"]+)|(["+Ge+"]+$)","g");var Ve=function trim(){return se.ToString(se.RequireObjectCoercible(this)).replace(He,"")};var Be=["\x85","\u200b","\ufffe"].join("");var Ue=new RegExp("["+Be+"]","g");var $e=/^[-+]0x[0-9a-f]+$/i;var Je=Be.trim().length!==Be.length;h(String.prototype,"trim",Ve,Je);var Xe=function(e){return{value:e,done:arguments.length===0}};var Ke=function(e){se.RequireObjectCoercible(e);this._s=se.ToString(e);this._i=0};Ke.prototype.next=function(){var e=this._s;var t=this._i;if(typeof e==="undefined"||t>=e.length){this._s=void 0;return Xe()}var r=e.charCodeAt(t);var n,o;if(r<55296||r>56319||t+1===e.length){o=1}else{n=e.charCodeAt(t+1);o=n<56320||n>57343?1:2}this._i=t+o;return Xe(e.substr(t,o))};Ce(Ke.prototype);Ce(String.prototype,function(){return new Ke(this)});var Ze={from:function from(e){var r=this;var n;if(arguments.length>1){n=arguments[1]}var o,i;if(typeof n==="undefined"){o=false}else{if(!se.IsCallable(n)){throw new TypeError("Array.from: when provided, the second argument must be a function")}if(arguments.length>2){i=arguments[2]}o=true}var a=typeof(ee(e)||se.GetMethod(e,oe))!=="undefined";var u,f,s;if(a){f=se.IsConstructor(r)?Object(new r):[];var c=se.GetIterator(e);var l,p;s=0;while(true){l=se.IteratorStep(c);if(l===false){break}p=l.value;try{if(o){p=typeof i==="undefined"?n(p,s):t(n,i,p,s)}f[s]=p}catch(e){se.IteratorClose(c,true);throw e}s+=1}u=s}else{var v=se.ToObject(e);u=se.ToLength(v.length);f=se.IsConstructor(r)?Object(new r(u)):new Array(u);var y;for(s=0;s<u;++s){y=v[s];if(o){y=typeof i==="undefined"?n(y,s):t(n,i,y,s)}xe(f,s,y)}}f.length=u;return f},of:function of(){var e=arguments.length;var t=this;var n=r(t)||!se.IsCallable(t)?new Array(e):se.Construct(t,[e]);for(var o=0;o<e;++o){xe(n,o,arguments[o])}n.length=e;return n}};b(Array,Ze);Pe(Array);q=function(e,t){this.i=0;this.array=e;this.kind=t};b(q.prototype,{next:function(){var e=this.i;var t=this.array;if(!(this instanceof q)){throw new TypeError("Not an ArrayIterator")}if(typeof t!=="undefined"){var r=se.ToLength(t.length);for(;e<r;e++){var n=this.kind;var o;if(n==="key"){o=e}else if(n==="value"){o=t[e]}else if(n==="entry"){o=[e,t[e]]}this.i=e+1;return Xe(o)}}this.array=void 0;return Xe()}});Ce(q.prototype);var Ye=Array.of===Ze.of||function(){var e=function Foo(e){this.length=e};e.prototype=[];var t=Array.of.apply(e,[1,2]);return t instanceof e&&t.length===2}();if(!Ye){re(Array,"of",Ze.of)}var Qe={copyWithin:function copyWithin(e,t){var r=se.ToObject(this);var n=se.ToLength(r.length);var o=se.ToInteger(e);var i=se.ToInteger(t);var a=o<0?A(n+o,0):R(o,n);var u=i<0?A(n+i,0):R(i,n);var f;if(arguments.length>2){f=arguments[2]}var s=typeof f==="undefined"?n:se.ToInteger(f);var c=s<0?A(n+s,0):R(s,n);var l=R(c-u,n-a);var p=1;if(u<a&&a<u+l){p=-1;u+=l-1;a+=l-1}while(l>0){if(u in r){r[a]=r[u]}else{delete r[a]}u+=p;a+=p;l-=1}return r},fill:function fill(e){var t;if(arguments.length>1){t=arguments[1]}var r;if(arguments.length>2){r=arguments[2]}var n=se.ToObject(this);var o=se.ToLength(n.length);t=se.ToInteger(typeof t==="undefined"?0:t);r=se.ToInteger(typeof r==="undefined"?o:r);var i=t<0?A(o+t,0):R(t,o);var a=r<0?o+r:r;for(var u=i;u<o&&u<a;++u){n[u]=e}return n},find:function find(e){var r=se.ToObject(this);var n=se.ToLength(r.length);if(!se.IsCallable(e)){throw new TypeError("Array#find: predicate must be a function")}var o=arguments.length>1?arguments[1]:null;for(var i=0,a;i<n;i++){a=r[i];if(o){if(t(e,o,a,i,r)){return a}}else if(e(a,i,r)){return a}}},findIndex:function findIndex(e){var r=se.ToObject(this);var n=se.ToLength(r.length);if(!se.IsCallable(e)){throw new TypeError("Array#findIndex: predicate must be a function")}var o=arguments.length>1?arguments[1]:null;for(var i=0;i<n;i++){if(o){if(t(e,o,r[i],i,r)){return i}}else if(e(r[i],i,r)){return i}}return-1},keys:function keys(){return new q(this,"key")},values:function values(){return new q(this,"value")},entries:function entries(){return new q(this,"entry")}};if(Array.prototype.keys&&!se.IsCallable([1].keys().next)){delete Array.prototype.keys}if(Array.prototype.entries&&!se.IsCallable([1].entries().next)){delete Array.prototype.entries}if(Array.prototype.keys&&Array.prototype.entries&&!Array.prototype.values&&Array.prototype[oe]){b(Array.prototype,{values:Array.prototype[oe]});if(te.symbol($.unscopables)){Array.prototype[$.unscopables].values=true}}if(c&&Array.prototype.values&&Array.prototype.values.name!=="values"){var et=Array.prototype.values;re(Array.prototype,"values",function values(){return se.Call(et,this,arguments)});h(Array.prototype,oe,Array.prototype.values,true)}b(Array.prototype,Qe);if(1/[true].indexOf(true,-0)<0){h(Array.prototype,"indexOf",function indexOf(e){var t=E(this,arguments);if(t===0&&1/t<0){return 0}return t},true)}Ce(Array.prototype,function(){return this.values()});if(Object.getPrototypeOf){Ce(Object.getPrototypeOf([].values()))}var tt=function(){return a(function(){return Array.from({length:-1}).length===0})}();var rt=function(){var e=Array.from([0].entries());return e.length===1&&r(e[0])&&e[0][0]===0&&e[0][1]===0}();if(!tt||!rt){re(Array,"from",Ze.from)}var nt=function(){return a(function(){return Array.from([0],void 0)})}();if(!nt){var ot=Array.from;re(Array,"from",function from(e){if(arguments.length>1&&typeof arguments[1]!=="undefined"){return se.Call(ot,this,arguments)}else{return t(ot,this,e)}})}var it=-(Math.pow(2,32)-1);var at=function(e,r){var n={length:it};n[r?(n.length>>>0)-1:0]=true;return a(function(){t(e,n,function(){throw new RangeError("should not reach here")},[]);return true})};if(!at(Array.prototype.forEach)){var ut=Array.prototype.forEach;re(Array.prototype,"forEach",function forEach(e){return se.Call(ut,this.length>=0?this:[],arguments)},true)}if(!at(Array.prototype.map)){var ft=Array.prototype.map;re(Array.prototype,"map",function map(e){return se.Call(ft,this.length>=0?this:[],arguments)},true)}if(!at(Array.prototype.filter)){var st=Array.prototype.filter;re(Array.prototype,"filter",function filter(e){return se.Call(st,this.length>=0?this:[],arguments)},true)}if(!at(Array.prototype.some)){var ct=Array.prototype.some;re(Array.prototype,"some",function some(e){return se.Call(ct,this.length>=0?this:[],arguments)},true)}if(!at(Array.prototype.every)){var lt=Array.prototype.every;re(Array.prototype,"every",function every(e){return se.Call(lt,this.length>=0?this:[],arguments)},true)}if(!at(Array.prototype.reduce)){var pt=Array.prototype.reduce;re(Array.prototype,"reduce",function reduce(e){return se.Call(pt,this.length>=0?this:[],arguments)},true)}if(!at(Array.prototype.reduceRight,true)){var vt=Array.prototype.reduceRight;re(Array.prototype,"reduceRight",function reduceRight(e){return se.Call(vt,this.length>=0?this:[],arguments)},true)}var yt=Number("0o10")!==8;var ht=Number("0b10")!==2;var bt=y(Be,function(e){return Number(e+0+e)===0});if(yt||ht||bt){var gt=Number;var dt=/^0b[01]+$/i;var mt=/^0o[0-7]+$/i;var Ot=dt.test.bind(dt);var wt=mt.test.bind(mt);var jt=function(e){var t;if(typeof e.valueOf==="function"){t=e.valueOf();if(te.primitive(t)){return t}}if(typeof e.toString==="function"){t=e.toString();if(te.primitive(t)){return t}}throw new TypeError("No default value")};var St=Ue.test.bind(Ue);var Tt=$e.test.bind($e);var It=function(){var e=function Number(t){var r;if(arguments.length>0){r=te.primitive(t)?t:jt(t,"number")}else{r=0}if(typeof r==="string"){r=se.Call(Ve,r);if(Ot(r)){r=parseInt(C(r,2),2)}else if(wt(r)){r=parseInt(C(r,2),8)}else if(St(r)||Tt(r)){r=NaN}}var n=this;var o=a(function(){gt.prototype.valueOf.call(n);return true});if(n instanceof e&&!o){return new gt(r)}return gt(r)};return e}();Ie(gt,It,{});b(It,{NaN:gt.NaN,MAX_VALUE:gt.MAX_VALUE,MIN_VALUE:gt.MIN_VALUE,NEGATIVE_INFINITY:gt.NEGATIVE_INFINITY,POSITIVE_INFINITY:gt.POSITIVE_INFINITY});Number=It;m.redefine(S,"Number",It)}var Et=Math.pow(2,53)-1;b(Number,{MAX_SAFE_INTEGER:Et,MIN_SAFE_INTEGER:-Et,EPSILON:2.220446049250313e-16,parseInt:S.parseInt,parseFloat:S.parseFloat,isFinite:K,isInteger:function isInteger(e){return K(e)&&se.ToInteger(e)===e},isSafeInteger:function isSafeInteger(e){return Number.isInteger(e)&&k(e)<=Number.MAX_SAFE_INTEGER},isNaN:X});h(Number,"parseInt",S.parseInt,Number.parseInt!==S.parseInt);if([,1].find(function(){return true})===1){re(Array.prototype,"find",Qe.find)}if([,1].findIndex(function(){return true})!==0){re(Array.prototype,"findIndex",Qe.findIndex)}var Pt=Function.bind.call(Function.bind,Object.prototype.propertyIsEnumerable);var Ct=function ensureEnumerable(e,t){if(s&&Pt(e,t)){Object.defineProperty(e,t,{enumerable:false})}};var Mt=function sliceArgs(){var e=Number(this);var t=arguments.length;var r=t-e;var n=new Array(r<0?0:r);for(var o=e;o<t;++o){n[o-e]=arguments[o]}return n};var xt=function assignTo(e){return function assignToSource(t,r){t[r]=e[r];return t}};var Nt=function(e,t){var r=n(Object(t));var o;if(se.IsCallable(Object.getOwnPropertySymbols)){o=v(Object.getOwnPropertySymbols(Object(t)),Pt(t))}return p(P(r,o||[]),xt(t),e)};var At={assign:function(e,t){var r=se.ToObject(e,"Cannot convert undefined or null to object");return p(se.Call(Mt,1,arguments),Nt,r)},is:function is(e,t){return se.SameValue(e,t)}};var Rt=Object.assign&&Object.preventExtensions&&function(){var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return e[1]==="y"}}();if(Rt){re(Object,"assign",At.assign)}b(Object,At);if(s){var _t={setPrototypeOf:function(e,r){var n;var o=function(e,t){if(!se.TypeIsObject(e)){throw new TypeError("cannot set prototype on a non-object")}if(!(t===null||se.TypeIsObject(t))){throw new TypeError("can only set prototype to an object or null"+t)}};var i=function(e,r){o(e,r);t(n,e,r);return e};try{n=e.getOwnPropertyDescriptor(e.prototype,r).set;t(n,{},null)}catch(t){if(e.prototype!=={}[r]){return}n=function(e){this[r]=e};i.polyfill=i(i({},null),e.prototype)instanceof e}return i}(Object,"__proto__")};b(Object,_t)}if(Object.setPrototypeOf&&Object.getPrototypeOf&&Object.getPrototypeOf(Object.setPrototypeOf({},null))!==null&&Object.getPrototypeOf(Object.create(null))===null){(function(){var e=Object.create(null);var t=Object.getPrototypeOf;var r=Object.setPrototypeOf;Object.getPrototypeOf=function(r){var n=t(r);return n===e?null:n};Object.setPrototypeOf=function(t,n){var o=n===null?e:n;return r(t,o)};Object.setPrototypeOf.polyfill=false})()}var kt=!i(function(){Object.keys("foo")});if(!kt){var Ft=Object.keys;re(Object,"keys",function keys(e){return Ft(se.ToObject(e))});n=Object.keys}var Lt=i(function(){Object.keys(/a/g)});if(Lt){var Dt=Object.keys;re(Object,"keys",function keys(e){if(te.regex(e)){var t=[];for(var r in e){if(z(e,r)){M(t,r)}}return t}return Dt(e)});n=Object.keys}if(Object.getOwnPropertyNames){var zt=!i(function(){Object.getOwnPropertyNames("foo")});if(!zt){var qt=typeof window==="object"?Object.getOwnPropertyNames(window):[];var Wt=Object.getOwnPropertyNames;re(Object,"getOwnPropertyNames",function getOwnPropertyNames(e){var t=se.ToObject(e);if(g(t)==="[object Window]"){try{return Wt(t)}catch(e){return P([],qt)}}return Wt(t)})}}if(Object.getOwnPropertyDescriptor){var Gt=!i(function(){Object.getOwnPropertyDescriptor("foo","bar")});if(!Gt){var Ht=Object.getOwnPropertyDescriptor;re(Object,"getOwnPropertyDescriptor",function getOwnPropertyDescriptor(e,t){return Ht(se.ToObject(e),t)})}}if(Object.seal){var Vt=!i(function(){Object.seal("foo")});if(!Vt){var Bt=Object.seal;re(Object,"seal",function seal(e){if(!se.TypeIsObject(e)){return e}return Bt(e)})}}if(Object.isSealed){var Ut=!i(function(){Object.isSealed("foo")});if(!Ut){var $t=Object.isSealed;re(Object,"isSealed",function isSealed(e){if(!se.TypeIsObject(e)){return true}return $t(e)})}}if(Object.freeze){var Jt=!i(function(){Object.freeze("foo")});if(!Jt){var Xt=Object.freeze;re(Object,"freeze",function freeze(e){if(!se.TypeIsObject(e)){return e}return Xt(e)})}}if(Object.isFrozen){var Kt=!i(function(){Object.isFrozen("foo")});if(!Kt){var Zt=Object.isFrozen;re(Object,"isFrozen",function isFrozen(e){if(!se.TypeIsObject(e)){return true}return Zt(e)})}}if(Object.preventExtensions){var Yt=!i(function(){Object.preventExtensions("foo")});if(!Yt){var Qt=Object.preventExtensions;re(Object,"preventExtensions",function preventExtensions(e){if(!se.TypeIsObject(e)){return e}return Qt(e)})}}if(Object.isExtensible){var er=!i(function(){Object.isExtensible("foo")});if(!er){var tr=Object.isExtensible;re(Object,"isExtensible",function isExtensible(e){if(!se.TypeIsObject(e)){return false}return tr(e)})}}if(Object.getPrototypeOf){var rr=!i(function(){Object.getPrototypeOf("foo")});if(!rr){var nr=Object.getPrototypeOf;re(Object,"getPrototypeOf",function getPrototypeOf(e){return nr(se.ToObject(e))})}}var or=s&&function(){var e=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags");return e&&se.IsCallable(e.get)}();if(s&&!or){var ir=function flags(){if(!se.TypeIsObject(this)){throw new TypeError("Method called on incompatible type: must be an object.")}var e="";if(this.global){e+="g"}if(this.ignoreCase){e+="i"}if(this.multiline){e+="m"}if(this.unicode){e+="u"}if(this.sticky){e+="y"}return e};m.getter(RegExp.prototype,"flags",ir)}var ar=s&&a(function(){return String(new RegExp(/a/g,"i"))==="/a/i"});var ur=ne&&s&&function(){var e=/./;e[$.match]=false;return RegExp(e)===e}();var fr=a(function(){return RegExp.prototype.toString.call({source:"abc"})==="/abc/"});var sr=fr&&a(function(){return RegExp.prototype.toString.call({source:"a",flags:"b"})==="/a/b"});if(!fr||!sr){var cr=RegExp.prototype.toString;h(RegExp.prototype,"toString",function toString(){var e=se.RequireObjectCoercible(this);if(te.regex(e)){return t(cr,e)}var r=ae(e.source);var n=ae(e.flags);return"/"+r+"/"+n},true);m.preserveToString(RegExp.prototype.toString,cr)}if(s&&(!ar||ur)){var lr=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get;var pr=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")||{};var vr=function(){return this.source};var yr=se.IsCallable(pr.get)?pr.get:vr;var hr=RegExp;var br=function(){return function RegExp(e,t){var r=se.IsRegExp(e);var n=this instanceof RegExp;if(!n&&r&&typeof t==="undefined"&&e.constructor===RegExp){return e}var o=e;var i=t;if(te.regex(e)){o=se.Call(yr,e);i=typeof t==="undefined"?se.Call(lr,e):t;return new RegExp(o,i)}else if(r){o=e.source;i=typeof t==="undefined"?e.flags:t}return new hr(e,t)}}();Ie(hr,br,{$input:true});RegExp=br;m.redefine(S,"RegExp",br)}if(s){var gr={input:"$_",lastMatch:"$&",lastParen:"$+",leftContext:"$`",rightContext:"$'"};l(n(gr),function(e){if(e in RegExp&&!(gr[e]in RegExp)){m.getter(RegExp,gr[e],function get(){return RegExp[e]})}})}Pe(RegExp);var dr=1/Number.EPSILON;var mr=function roundTiesToEven(e){return e+dr-dr};var Or=Math.pow(2,-23);var wr=Math.pow(2,127)*(2-Or);var jr=Math.pow(2,-126);var Sr=Math.E;var Tr=Math.LOG2E;var Ir=Math.LOG10E;var Er=Number.prototype.clz;delete Number.prototype.clz;var Pr={acosh:function acosh(e){var t=Number(e);if(X(t)||e<1){return NaN}if(t===1){return 0}if(t===Infinity){return t}return L(t/Sr+D(t+1)*D(t-1)/Sr)+1},asinh:function asinh(e){var t=Number(e);if(t===0||!T(t)){return t}return t<0?-asinh(-t):L(t+D(t*t+1))},atanh:function atanh(e){var t=Number(e);if(X(t)||t<-1||t>1){return NaN}if(t===-1){return-Infinity}if(t===1){return Infinity}if(t===0){return t}return.5*L((1+t)/(1-t))},cbrt:function cbrt(e){var t=Number(e);if(t===0){return t}var r=t<0;var n;if(r){t=-t}if(t===Infinity){n=Infinity}else{n=F(L(t)/3);n=(t/(n*n)+2*n)/3}return r?-n:n},clz32:function clz32(e){var t=Number(e);var r=se.ToUint32(t);if(r===0){return 32}return Er?se.Call(Er,r):31-_(L(r+.5)*Tr)},cosh:function cosh(e){var t=Number(e);if(t===0){return 1}if(X(t)){return NaN}if(!T(t)){return Infinity}if(t<0){t=-t}if(t>21){return F(t)/2}return(F(t)+F(-t))/2},expm1:function expm1(e){var t=Number(e);if(t===-Infinity){return-1}if(!T(t)||t===0){return t}if(k(t)>.5){return F(t)-1}var r=t;var n=0;var o=1;while(n+r!==n){n+=r;o+=1;r*=t/o}return n},hypot:function hypot(e,t){var r=0;var n=0;for(var o=0;o<arguments.length;++o){var i=k(Number(arguments[o]));if(n<i){r*=n/i*(n/i);r+=1;n=i}else{r+=i>0?i/n*(i/n):i}}return n===Infinity?Infinity:n*D(r)},log2:function log2(e){return L(e)*Tr},log10:function log10(e){return L(e)*Ir},log1p:function log1p(e){var t=Number(e);if(t<-1||X(t)){return NaN}if(t===0||t===Infinity){return t}if(t===-1){return-Infinity}return 1+t-1===0?t:t*(L(1+t)/(1+t-1))},sign:Z,sinh:function sinh(e){var t=Number(e);if(!T(t)||t===0){return t}if(k(t)<1){return(Math.expm1(t)-Math.expm1(-t))/2}return(F(t-1)-F(-t-1))*Sr/2},tanh:function tanh(e){var t=Number(e);if(X(t)||t===0){return t}if(t>=20){return 1}if(t<=-20){return-1}return(Math.expm1(t)-Math.expm1(-t))/(F(t)+F(-t))},trunc:function trunc(e){var t=Number(e);return t<0?-_(-t):_(t)},imul:function imul(e,t){var r=se.ToUint32(e);var n=se.ToUint32(t);var o=r>>>16&65535;var i=r&65535;var a=n>>>16&65535;var u=n&65535;return i*u+(o*u+i*a<<16>>>0)|0},fround:function fround(e){var t=Number(e);if(t===0||t===Infinity||t===-Infinity||X(t)){return t}var r=Z(t);var n=k(t);if(n<jr){return r*mr(n/jr/Or)*jr*Or}var o=(1+Or/Number.EPSILON)*n;var i=o-(o-n);if(i>wr||X(i)){return r*Infinity}return r*i}};b(Math,Pr);h(Math,"log1p",Pr.log1p,Math.log1p(-1e-17)!==-1e-17);h(Math,"asinh",Pr.asinh,Math.asinh(-1e7)!==-Math.asinh(1e7));h(Math,"tanh",Pr.tanh,Math.tanh(-2e-17)!==-2e-17);h(Math,"acosh",Pr.acosh,Math.acosh(Number.MAX_VALUE)===Infinity);h(Math,"cbrt",Pr.cbrt,Math.abs(1-Math.cbrt(1e-300)/1e-100)/Number.EPSILON>8);h(Math,"sinh",Pr.sinh,Math.sinh(-2e-17)!==-2e-17);var Cr=Math.expm1(10);h(Math,"expm1",Pr.expm1,Cr>22025.465794806718||Cr<22025.465794806718);var Mr=Math.round;var xr=Math.round(.5-Number.EPSILON/4)===0&&Math.round(-.5+Number.EPSILON/3.99)===1;var Nr=dr+1;var Ar=2*dr-1;var Rr=[Nr,Ar].every(function(e){return Math.round(e)===e});h(Math,"round",function round(e){var t=_(e);var r=t===-1?-0:t+1;
return e-t<.5?t:r},!xr||!Rr);m.preserveToString(Math.round,Mr);var _r=Math.imul;if(Math.imul(4294967295,5)!==-5){Math.imul=Pr.imul;m.preserveToString(Math.imul,_r)}if(Math.imul.length!==2){re(Math,"imul",function imul(e,t){return se.Call(_r,Math,arguments)})}var kr=function(){var e=S.setTimeout;if(typeof e!=="function"&&typeof e!=="object"){return}se.IsPromise=function(e){if(!se.TypeIsObject(e)){return false}if(typeof e._promise==="undefined"){return false}return true};var r=function(e){if(!se.IsConstructor(e)){throw new TypeError("Bad promise constructor")}var t=this;var r=function(e,r){if(t.resolve!==void 0||t.reject!==void 0){throw new TypeError("Bad Promise implementation!")}t.resolve=e;t.reject=r};t.resolve=void 0;t.reject=void 0;t.promise=new e(r);if(!(se.IsCallable(t.resolve)&&se.IsCallable(t.reject))){throw new TypeError("Bad promise constructor")}};var n;if(typeof window!=="undefined"&&se.IsCallable(window.postMessage)){n=function(){var e=[];var t="zero-timeout-message";var r=function(r){M(e,r);window.postMessage(t,"*")};var n=function(r){if(r.source===window&&r.data===t){r.stopPropagation();if(e.length===0){return}var n=N(e);n()}};window.addEventListener("message",n,true);return r}}var o=function(){var e=S.Promise;var t=e&&e.resolve&&e.resolve();return t&&function(e){return t.then(e)}};var i=se.IsCallable(S.setImmediate)?S.setImmediate:typeof process==="object"&&process.nextTick?process.nextTick:o()||(se.IsCallable(n)?n():function(t){e(t,0)});var a=function(e){return e};var u=function(e){throw e};var f=0;var s=1;var c=2;var l=0;var p=1;var v=2;var y={};var h=function(e,t,r){i(function(){g(e,t,r)})};var g=function(e,t,r){var n,o;if(t===y){return e(r)}try{n=e(r);o=t.resolve}catch(e){n=e;o=t.reject}o(n)};var d=function(e,t){var r=e._promise;var n=r.reactionLength;if(n>0){h(r.fulfillReactionHandler0,r.reactionCapability0,t);r.fulfillReactionHandler0=void 0;r.rejectReactions0=void 0;r.reactionCapability0=void 0;if(n>1){for(var o=1,i=0;o<n;o++,i+=3){h(r[i+l],r[i+v],t);e[i+l]=void 0;e[i+p]=void 0;e[i+v]=void 0}}}r.result=t;r.state=s;r.reactionLength=0};var m=function(e,t){var r=e._promise;var n=r.reactionLength;if(n>0){h(r.rejectReactionHandler0,r.reactionCapability0,t);r.fulfillReactionHandler0=void 0;r.rejectReactions0=void 0;r.reactionCapability0=void 0;if(n>1){for(var o=1,i=0;o<n;o++,i+=3){h(r[i+p],r[i+v],t);e[i+l]=void 0;e[i+p]=void 0;e[i+v]=void 0}}}r.result=t;r.state=c;r.reactionLength=0};var O=function(e){var t=false;var r=function(r){var n;if(t){return}t=true;if(r===e){return m(e,new TypeError("Self resolution"))}if(!se.TypeIsObject(r)){return d(e,r)}try{n=r.then}catch(t){return m(e,t)}if(!se.IsCallable(n)){return d(e,r)}i(function(){j(e,r,n)})};var n=function(r){if(t){return}t=true;return m(e,r)};return{resolve:r,reject:n}};var w=function(e,r,n,o){if(e===I){t(e,r,n,o,y)}else{t(e,r,n,o)}};var j=function(e,t,r){var n=O(e);var o=n.resolve;var i=n.reject;try{w(r,t,o,i)}catch(e){i(e)}};var T,I;var E=function(){var e=function Promise(t){if(!(this instanceof e)){throw new TypeError('Constructor Promise requires "new"')}if(this&&this._promise){throw new TypeError("Bad construction")}if(!se.IsCallable(t)){throw new TypeError("not a valid resolver")}var r=Ne(this,e,T,{_promise:{result:void 0,state:f,reactionLength:0,fulfillReactionHandler0:void 0,rejectReactionHandler0:void 0,reactionCapability0:void 0}});var n=O(r);var o=n.reject;try{t(n.resolve,o)}catch(e){o(e)}return r};return e}();T=E.prototype;var P=function(e,t,r,n){var o=false;return function(i){if(o){return}o=true;t[e]=i;if(--n.count===0){var a=r.resolve;a(t)}}};var C=function(e,t,r){var n=e.iterator;var o=[];var i={count:1};var a,u;var f=0;while(true){try{a=se.IteratorStep(n);if(a===false){e.done=true;break}u=a.value}catch(t){e.done=true;throw t}o[f]=void 0;var s=t.resolve(u);var c=P(f,o,r,i);i.count+=1;w(s.then,s,c,r.reject);f+=1}if(--i.count===0){var l=r.resolve;l(o)}return r.promise};var x=function(e,t,r){var n=e.iterator;var o,i,a;while(true){try{o=se.IteratorStep(n);if(o===false){e.done=true;break}i=o.value}catch(t){e.done=true;throw t}a=t.resolve(i);w(a.then,a,r.resolve,r.reject)}return r.promise};b(E,{all:function all(e){var t=this;if(!se.TypeIsObject(t)){throw new TypeError("Promise is not object")}var n=new r(t);var o,i;try{o=se.GetIterator(e);i={iterator:o,done:false};return C(i,t,n)}catch(e){var a=e;if(i&&!i.done){try{se.IteratorClose(o,true)}catch(e){a=e}}var u=n.reject;u(a);return n.promise}},race:function race(e){var t=this;if(!se.TypeIsObject(t)){throw new TypeError("Promise is not object")}var n=new r(t);var o,i;try{o=se.GetIterator(e);i={iterator:o,done:false};return x(i,t,n)}catch(e){var a=e;if(i&&!i.done){try{se.IteratorClose(o,true)}catch(e){a=e}}var u=n.reject;u(a);return n.promise}},reject:function reject(e){var t=this;if(!se.TypeIsObject(t)){throw new TypeError("Bad promise constructor")}var n=new r(t);var o=n.reject;o(e);return n.promise},resolve:function resolve(e){var t=this;if(!se.TypeIsObject(t)){throw new TypeError("Bad promise constructor")}if(se.IsPromise(e)){var n=e.constructor;if(n===t){return e}}var o=new r(t);var i=o.resolve;i(e);return o.promise}});b(T,{catch:function(e){return this.then(null,e)},then:function then(e,t){var n=this;if(!se.IsPromise(n)){throw new TypeError("not a promise")}var o=se.SpeciesConstructor(n,E);var i;var b=arguments.length>2&&arguments[2]===y;if(b&&o===E){i=y}else{i=new r(o)}var g=se.IsCallable(e)?e:a;var d=se.IsCallable(t)?t:u;var m=n._promise;var O;if(m.state===f){if(m.reactionLength===0){m.fulfillReactionHandler0=g;m.rejectReactionHandler0=d;m.reactionCapability0=i}else{var w=3*(m.reactionLength-1);m[w+l]=g;m[w+p]=d;m[w+v]=i}m.reactionLength+=1}else if(m.state===s){O=m.result;h(g,i,O)}else if(m.state===c){O=m.result;h(d,i,O)}else{throw new TypeError("unexpected Promise state")}return i.promise}});y=new r(E);I=T.then;return E}();if(S.Promise){delete S.Promise.accept;delete S.Promise.defer;delete S.Promise.prototype.chain}if(typeof kr==="function"){b(S,{Promise:kr});var Fr=w(S.Promise,function(e){return e.resolve(42).then(function(){})instanceof e});var Lr=!i(function(){S.Promise.reject(42).then(null,5).then(null,W)});var Dr=i(function(){S.Promise.call(3,W)});var zr=function(e){var t=e.resolve(5);t.constructor={};var r=e.resolve(t);try{r.then(null,W).then(null,W)}catch(e){return true}return t===r}(S.Promise);var qr=s&&function(){var e=0;var t=Object.defineProperty({},"then",{get:function(){e+=1}});Promise.resolve(t);return e===1}();var Wr=function BadResolverPromise(e){var t=new Promise(e);e(3,function(){});this.then=t.then;this.constructor=BadResolverPromise};Wr.prototype=Promise.prototype;Wr.all=Promise.all;var Gr=a(function(){return!!Wr.all([1,2])});if(!Fr||!Lr||!Dr||zr||!qr||Gr){Promise=kr;re(S,"Promise",kr)}if(Promise.all.length!==1){var Hr=Promise.all;re(Promise,"all",function all(e){return se.Call(Hr,this,arguments)})}if(Promise.race.length!==1){var Vr=Promise.race;re(Promise,"race",function race(e){return se.Call(Vr,this,arguments)})}if(Promise.resolve.length!==1){var Br=Promise.resolve;re(Promise,"resolve",function resolve(e){return se.Call(Br,this,arguments)})}if(Promise.reject.length!==1){var Ur=Promise.reject;re(Promise,"reject",function reject(e){return se.Call(Ur,this,arguments)})}Ct(Promise,"all");Ct(Promise,"race");Ct(Promise,"resolve");Ct(Promise,"reject");Pe(Promise)}var $r=function(e){var t=n(p(e,function(e,t){e[t]=true;return e},{}));return e.join(":")===t.join(":")};var Jr=$r(["z","a","bb"]);var Xr=$r(["z",1,"a","3",2]);if(s){var Kr=function fastkey(e,t){if(!t&&!Jr){return null}if(fe(e)){return"^"+se.ToString(e)}else if(typeof e==="string"){return"$"+e}else if(typeof e==="number"){if(!Xr){return"n"+e}return e}else if(typeof e==="boolean"){return"b"+e}return null};var Zr=function emptyObject(){return Object.create?Object.create(null):{}};var Yr=function addIterableToMap(e,n,o){if(r(o)||te.string(o)){l(o,function(e){if(!se.TypeIsObject(e)){throw new TypeError("Iterator value "+e+" is not an entry object")}n.set(e[0],e[1])})}else if(o instanceof e){t(e.prototype.forEach,o,function(e,t){n.set(t,e)})}else{var i,a;if(!fe(o)){a=n.set;if(!se.IsCallable(a)){throw new TypeError("bad map")}i=se.GetIterator(o)}if(typeof i!=="undefined"){while(true){var u=se.IteratorStep(i);if(u===false){break}var f=u.value;try{if(!se.TypeIsObject(f)){throw new TypeError("Iterator value "+f+" is not an entry object")}t(a,n,f[0],f[1])}catch(e){se.IteratorClose(i,true);throw e}}}}};var Qr=function addIterableToSet(e,n,o){if(r(o)||te.string(o)){l(o,function(e){n.add(e)})}else if(o instanceof e){t(e.prototype.forEach,o,function(e){n.add(e)})}else{var i,a;if(!fe(o)){a=n.add;if(!se.IsCallable(a)){throw new TypeError("bad set")}i=se.GetIterator(o)}if(typeof i!=="undefined"){while(true){var u=se.IteratorStep(i);if(u===false){break}var f=u.value;try{t(a,n,f)}catch(e){se.IteratorClose(i,true);throw e}}}}};var en={Map:function(){var e={};var r=function MapEntry(e,t){this.key=e;this.value=t;this.next=null;this.prev=null};r.prototype.isRemoved=function isRemoved(){return this.key===e};var n=function isMap(e){return!!e._es6map};var o=function requireMapSlot(e,t){if(!se.TypeIsObject(e)||!n(e)){throw new TypeError("Method Map.prototype."+t+" called on incompatible receiver "+se.ToString(e))}};var i=function MapIterator(e,t){o(e,"[[MapIterator]]");this.head=e._head;this.i=this.head;this.kind=t};i.prototype={next:function next(){var e=this.i;var t=this.kind;var r=this.head;if(typeof this.i==="undefined"){return Xe()}while(e.isRemoved()&&e!==r){e=e.prev}var n;while(e.next!==r){e=e.next;if(!e.isRemoved()){if(t==="key"){n=e.key}else if(t==="value"){n=e.value}else{n=[e.key,e.value]}this.i=e;return Xe(n)}}this.i=void 0;return Xe()}};Ce(i.prototype);var a;var u=function Map(){if(!(this instanceof Map)){throw new TypeError('Constructor Map requires "new"')}if(this&&this._es6map){throw new TypeError("Bad construction")}var e=Ne(this,Map,a,{_es6map:true,_head:null,_map:G?new G:null,_size:0,_storage:Zr()});var t=new r(null,null);t.next=t.prev=t;e._head=t;if(arguments.length>0){Yr(Map,e,arguments[0])}return e};a=u.prototype;m.getter(a,"size",function(){if(typeof this._size==="undefined"){throw new TypeError("size method called on incompatible Map")}return this._size});b(a,{get:function get(e){o(this,"get");var t;var r=Kr(e,true);if(r!==null){t=this._storage[r];if(t){return t.value}else{return}}if(this._map){t=V.call(this._map,e);if(t){return t.value}else{return}}var n=this._head;var i=n;while((i=i.next)!==n){if(se.SameValueZero(i.key,e)){return i.value}}},has:function has(e){o(this,"has");var t=Kr(e,true);if(t!==null){return typeof this._storage[t]!=="undefined"}if(this._map){return B.call(this._map,e)}var r=this._head;var n=r;while((n=n.next)!==r){if(se.SameValueZero(n.key,e)){return true}}return false},set:function set(e,t){o(this,"set");var n=this._head;var i=n;var a;var u=Kr(e,true);if(u!==null){if(typeof this._storage[u]!=="undefined"){this._storage[u].value=t;return this}else{a=this._storage[u]=new r(e,t);i=n.prev}}else if(this._map){if(B.call(this._map,e)){V.call(this._map,e).value=t}else{a=new r(e,t);U.call(this._map,e,a);i=n.prev}}while((i=i.next)!==n){if(se.SameValueZero(i.key,e)){i.value=t;return this}}a=a||new r(e,t);if(se.SameValue(-0,e)){a.key=+0}a.next=this._head;a.prev=this._head.prev;a.prev.next=a;a.next.prev=a;this._size+=1;return this},delete:function(t){o(this,"delete");var r=this._head;var n=r;var i=Kr(t,true);if(i!==null){if(typeof this._storage[i]==="undefined"){return false}n=this._storage[i].prev;delete this._storage[i]}else if(this._map){if(!B.call(this._map,t)){return false}n=V.call(this._map,t).prev;H.call(this._map,t)}while((n=n.next)!==r){if(se.SameValueZero(n.key,t)){n.key=e;n.value=e;n.prev.next=n.next;n.next.prev=n.prev;this._size-=1;return true}}return false},clear:function clear(){o(this,"clear");this._map=G?new G:null;this._size=0;this._storage=Zr();var t=this._head;var r=t;var n=r.next;while((r=n)!==t){r.key=e;r.value=e;n=r.next;r.next=r.prev=t}t.next=t.prev=t},keys:function keys(){o(this,"keys");return new i(this,"key")},values:function values(){o(this,"values");return new i(this,"value")},entries:function entries(){o(this,"entries");return new i(this,"key+value")},forEach:function forEach(e){o(this,"forEach");var r=arguments.length>1?arguments[1]:null;var n=this.entries();for(var i=n.next();!i.done;i=n.next()){if(r){t(e,r,i.value[1],i.value[0],this)}else{e(i.value[1],i.value[0],this)}}}});Ce(a,a.entries);return u}(),Set:function(){var e=function isSet(e){return e._es6set&&typeof e._storage!=="undefined"};var r=function requireSetSlot(t,r){if(!se.TypeIsObject(t)||!e(t)){throw new TypeError("Set.prototype."+r+" called on incompatible receiver "+se.ToString(t))}};var o;var i=function Set(){if(!(this instanceof Set)){throw new TypeError('Constructor Set requires "new"')}if(this&&this._es6set){throw new TypeError("Bad construction")}var e=Ne(this,Set,o,{_es6set:true,"[[SetData]]":null,_storage:Zr()});if(!e._es6set){throw new TypeError("bad set")}if(arguments.length>0){Qr(Set,e,arguments[0])}return e};o=i.prototype;var a=function(e){var t=e;if(t==="^null"){return null}else if(t==="^undefined"){return void 0}else{var r=t.charAt(0);if(r==="$"){return C(t,1)}else if(r==="n"){return+C(t,1)}else if(r==="b"){return t==="btrue"}}return+t};var u=function ensureMap(e){if(!e["[[SetData]]"]){var t=new en.Map;e["[[SetData]]"]=t;l(n(e._storage),function(e){var r=a(e);t.set(r,r)});e["[[SetData]]"]=t}e._storage=null};m.getter(i.prototype,"size",function(){r(this,"size");if(this._storage){return n(this._storage).length}u(this);return this["[[SetData]]"].size});b(i.prototype,{has:function has(e){r(this,"has");var t;if(this._storage&&(t=Kr(e))!==null){return!!this._storage[t]}u(this);return this["[[SetData]]"].has(e)},add:function add(e){r(this,"add");var t;if(this._storage&&(t=Kr(e))!==null){this._storage[t]=true;return this}u(this);this["[[SetData]]"].set(e,e);return this},delete:function(e){r(this,"delete");var t;if(this._storage&&(t=Kr(e))!==null){var n=z(this._storage,t);return delete this._storage[t]&&n}u(this);return this["[[SetData]]"]["delete"](e)},clear:function clear(){r(this,"clear");if(this._storage){this._storage=Zr()}if(this["[[SetData]]"]){this["[[SetData]]"].clear()}},values:function values(){r(this,"values");u(this);return this["[[SetData]]"].values()},entries:function entries(){r(this,"entries");u(this);return this["[[SetData]]"].entries()},forEach:function forEach(e){r(this,"forEach");var n=arguments.length>1?arguments[1]:null;var o=this;u(o);this["[[SetData]]"].forEach(function(r,i){if(n){t(e,n,i,i,o)}else{e(i,i,o)}})}});h(i.prototype,"keys",i.prototype.values,true);Ce(i.prototype,i.prototype.values);return i}()};if(S.Map||S.Set){var tn=a(function(){return new Map([[1,2]]).get(1)===2});if(!tn){S.Map=function Map(){if(!(this instanceof Map)){throw new TypeError('Constructor Map requires "new"')}var e=new G;if(arguments.length>0){Yr(Map,e,arguments[0])}delete e.constructor;Object.setPrototypeOf(e,S.Map.prototype);return e};S.Map.prototype=O(G.prototype);h(S.Map.prototype,"constructor",S.Map,true);m.preserveToString(S.Map,G)}var rn=new Map;var nn=function(){var e=new Map([[1,0],[2,0],[3,0],[4,0]]);e.set(-0,e);return e.get(0)===e&&e.get(-0)===e&&e.has(0)&&e.has(-0)}();var on=rn.set(1,2)===rn;if(!nn||!on){re(Map.prototype,"set",function set(e,r){t(U,this,e===0?0:e,r);return this})}if(!nn){b(Map.prototype,{get:function get(e){return t(V,this,e===0?0:e)},has:function has(e){return t(B,this,e===0?0:e)}},true);m.preserveToString(Map.prototype.get,V);m.preserveToString(Map.prototype.has,B)}var an=new Set;var un=function(e){e["delete"](0);e.add(-0);return!e.has(0)}(an);var fn=an.add(1)===an;if(!un||!fn){var sn=Set.prototype.add;Set.prototype.add=function add(e){t(sn,this,e===0?0:e);return this};m.preserveToString(Set.prototype.add,sn)}if(!un){var cn=Set.prototype.has;Set.prototype.has=function has(e){return t(cn,this,e===0?0:e)};m.preserveToString(Set.prototype.has,cn);var ln=Set.prototype["delete"];Set.prototype["delete"]=function SetDelete(e){return t(ln,this,e===0?0:e)};m.preserveToString(Set.prototype["delete"],ln)}var pn=w(S.Map,function(e){var t=new e([]);t.set(42,42);return t instanceof e});var vn=Object.setPrototypeOf&&!pn;var yn=function(){try{return!(S.Map()instanceof S.Map)}catch(e){return e instanceof TypeError}}();if(S.Map.length!==0||vn||!yn){S.Map=function Map(){if(!(this instanceof Map)){throw new TypeError('Constructor Map requires "new"')}var e=new G;if(arguments.length>0){Yr(Map,e,arguments[0])}delete e.constructor;Object.setPrototypeOf(e,Map.prototype);return e};S.Map.prototype=G.prototype;h(S.Map.prototype,"constructor",S.Map,true);m.preserveToString(S.Map,G)}var hn=w(S.Set,function(e){var t=new e([]);t.add(42,42);return t instanceof e});var bn=Object.setPrototypeOf&&!hn;var gn=function(){try{return!(S.Set()instanceof S.Set)}catch(e){return e instanceof TypeError}}();if(S.Set.length!==0||bn||!gn){var dn=S.Set;S.Set=function Set(){if(!(this instanceof Set)){throw new TypeError('Constructor Set requires "new"')}var e=new dn;if(arguments.length>0){Qr(Set,e,arguments[0])}delete e.constructor;Object.setPrototypeOf(e,Set.prototype);return e};S.Set.prototype=dn.prototype;h(S.Set.prototype,"constructor",S.Set,true);m.preserveToString(S.Set,dn)}var mn=new S.Map;var On=!a(function(){return mn.keys().next().done});if(typeof S.Map.prototype.clear!=="function"||(new S.Set).size!==0||mn.size!==0||typeof S.Map.prototype.keys!=="function"||typeof S.Set.prototype.keys!=="function"||typeof S.Map.prototype.forEach!=="function"||typeof S.Set.prototype.forEach!=="function"||u(S.Map)||u(S.Set)||typeof mn.keys().next!=="function"||On||!pn){b(S,{Map:en.Map,Set:en.Set},true)}if(S.Set.prototype.keys!==S.Set.prototype.values){h(S.Set.prototype,"keys",S.Set.prototype.values,true)}Ce(Object.getPrototypeOf((new S.Map).keys()));Ce(Object.getPrototypeOf((new S.Set).keys()));if(c&&S.Set.prototype.has.name!=="has"){var wn=S.Set.prototype.has;re(S.Set.prototype,"has",function has(e){return t(wn,this,e)})}}b(S,en);Pe(S.Map);Pe(S.Set)}var jn=function throwUnlessTargetIsObject(e){if(!se.TypeIsObject(e)){throw new TypeError("target must be an object")}};var Sn={apply:function apply(){return se.Call(se.Call,null,arguments)},construct:function construct(e,t){if(!se.IsConstructor(e)){throw new TypeError("First argument must be a constructor.")}var r=arguments.length>2?arguments[2]:e;if(!se.IsConstructor(r)){throw new TypeError("new.target must be a constructor.")}return se.Construct(e,t,r,"internal")},deleteProperty:function deleteProperty(e,t){jn(e);if(s){var r=Object.getOwnPropertyDescriptor(e,t);if(r&&!r.configurable){return false}}return delete e[t]},has:function has(e,t){jn(e);return t in e}};if(Object.getOwnPropertyNames){Object.assign(Sn,{ownKeys:function ownKeys(e){jn(e);var t=Object.getOwnPropertyNames(e);if(se.IsCallable(Object.getOwnPropertySymbols)){x(t,Object.getOwnPropertySymbols(e))}return t}})}var Tn=function ConvertExceptionToBoolean(e){return!i(e)};if(Object.preventExtensions){Object.assign(Sn,{isExtensible:function isExtensible(e){jn(e);return Object.isExtensible(e)},preventExtensions:function preventExtensions(e){jn(e);return Tn(function(){Object.preventExtensions(e)})}})}if(s){var In=function get(e,t,r){var n=Object.getOwnPropertyDescriptor(e,t);if(!n){var o=Object.getPrototypeOf(e);if(o===null){return void 0}return In(o,t,r)}if("value"in n){return n.value}if(n.get){return se.Call(n.get,r)}return void 0};var En=function set(e,r,n,o){var i=Object.getOwnPropertyDescriptor(e,r);if(!i){var a=Object.getPrototypeOf(e);if(a!==null){return En(a,r,n,o)}i={value:void 0,writable:true,enumerable:true,configurable:true}}if("value"in i){if(!i.writable){return false}if(!se.TypeIsObject(o)){return false}var u=Object.getOwnPropertyDescriptor(o,r);if(u){return ie.defineProperty(o,r,{value:n})}else{return ie.defineProperty(o,r,{value:n,writable:true,enumerable:true,configurable:true})}}if(i.set){t(i.set,o,n);return true}return false};Object.assign(Sn,{defineProperty:function defineProperty(e,t,r){jn(e);return Tn(function(){Object.defineProperty(e,t,r)})},getOwnPropertyDescriptor:function getOwnPropertyDescriptor(e,t){jn(e);return Object.getOwnPropertyDescriptor(e,t)},get:function get(e,t){jn(e);var r=arguments.length>2?arguments[2]:e;return In(e,t,r)},set:function set(e,t,r){jn(e);var n=arguments.length>3?arguments[3]:e;return En(e,t,r,n)}})}if(Object.getPrototypeOf){var Pn=Object.getPrototypeOf;Sn.getPrototypeOf=function getPrototypeOf(e){jn(e);return Pn(e)}}if(Object.setPrototypeOf&&Sn.getPrototypeOf){var Cn=function(e,t){var r=t;while(r){if(e===r){return true}r=Sn.getPrototypeOf(r)}return false};Object.assign(Sn,{setPrototypeOf:function setPrototypeOf(e,t){jn(e);if(t!==null&&!se.TypeIsObject(t)){throw new TypeError("proto must be an object or null")}if(t===ie.getPrototypeOf(e)){return true}if(ie.isExtensible&&!ie.isExtensible(e)){return false}if(Cn(e,t)){return false}Object.setPrototypeOf(e,t);return true}})}var Mn=function(e,t){if(!se.IsCallable(S.Reflect[e])){h(S.Reflect,e,t)}else{var r=a(function(){S.Reflect[e](1);S.Reflect[e](NaN);S.Reflect[e](true);return true});if(r){re(S.Reflect,e,t)}}};Object.keys(Sn).forEach(function(e){Mn(e,Sn[e])});var xn=S.Reflect.getPrototypeOf;if(c&&xn&&xn.name!=="getPrototypeOf"){re(S.Reflect,"getPrototypeOf",function getPrototypeOf(e){return t(xn,S.Reflect,e)})}if(S.Reflect.setPrototypeOf){if(a(function(){S.Reflect.setPrototypeOf(1,{});return true})){re(S.Reflect,"setPrototypeOf",Sn.setPrototypeOf)}}if(S.Reflect.defineProperty){if(!a(function(){var e=!S.Reflect.defineProperty(1,"test",{value:1});var t=typeof Object.preventExtensions!=="function"||!S.Reflect.defineProperty(Object.preventExtensions({}),"test",{});return e&&t})){re(S.Reflect,"defineProperty",Sn.defineProperty)}}if(S.Reflect.construct){if(!a(function(){var e=function F(){};return S.Reflect.construct(function(){},[],e)instanceof e})){re(S.Reflect,"construct",Sn.construct)}}if(String(new Date(NaN))!=="Invalid Date"){var Nn=Date.prototype.toString;var An=function toString(){var e=+this;if(e!==e){return"Invalid Date"}return se.Call(Nn,this)};re(Date.prototype,"toString",An)}var Rn={anchor:function anchor(e){return se.CreateHTML(this,"a","name",e)},big:function big(){return se.CreateHTML(this,"big","","")},blink:function blink(){return se.CreateHTML(this,"blink","","")},bold:function bold(){return se.CreateHTML(this,"b","","")},fixed:function fixed(){return se.CreateHTML(this,"tt","","")},fontcolor:function fontcolor(e){return se.CreateHTML(this,"font","color",e)},fontsize:function fontsize(e){return se.CreateHTML(this,"font","size",e)},italics:function italics(){return se.CreateHTML(this,"i","","")},link:function link(e){return se.CreateHTML(this,"a","href",e)},small:function small(){return se.CreateHTML(this,"small","","")},strike:function strike(){return se.CreateHTML(this,"strike","","")},sub:function sub(){return se.CreateHTML(this,"sub","","")},sup:function sub(){return se.CreateHTML(this,"sup","","")}};l(Object.keys(Rn),function(e){var r=String.prototype[e];var n=false;if(se.IsCallable(r)){var o=t(r,"",' " ');var i=P([],o.match(/"/g)).length;n=o!==o.toLowerCase()||i>2}else{n=true}if(n){re(String.prototype,e,Rn[e])}});var _n=function(){if(!ne){return false}var e=typeof JSON==="object"&&typeof JSON.stringify==="function"?JSON.stringify:null;if(!e){return false}if(typeof e($())!=="undefined"){return true}if(e([$()])!=="[null]"){return true}var t={a:$()};t[$()]=true;if(e(t)!=="{}"){return true}return false}();var kn=a(function(){if(!ne){return true}return JSON.stringify(Object($()))==="{}"&&JSON.stringify([Object($())])==="[{}]"});if(_n||!kn){var Fn=JSON.stringify;re(JSON,"stringify",function stringify(e){if(typeof e==="symbol"){return}var n;if(arguments.length>1){n=arguments[1]}var o=[e];if(!r(n)){var i=se.IsCallable(n)?n:null;var a=function(e,r){var n=i?t(i,this,e,r):r;if(typeof n!=="symbol"){if(te.symbol(n)){return xt({})(n)}else{return n}}};o.push(a)}else{o.push(n)}if(arguments.length>2){o.push(arguments[2])}return Fn.apply(this,o)})}return S});
//# sourceMappingURL=es6-shim.map
|
blueprints/dumb/files/__test__/components/__name__.spec.js | huangc28/palestine | import React from 'react'
import <%= pascalEntityName %> from 'components/<%= pascalEntityName %>/<%= pascalEntityName %>'
describe('(Component) <%= pascalEntityName %>', () => {
it('should exist', () => {
})
})
|
test/spec/FileTreeView-test.js | ficristo/brackets | /*
* Copyright (c) 2014 - present Adobe Systems Incorporated. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
/*global describe, it, expect, jasmine */
/*unittests: FileTreeView*/
define(function (require, exports, module) {
"use strict";
var FileTreeView = require("project/FileTreeView"),
FileTreeViewModel = require("project/FileTreeViewModel"),
Preact = require("thirdparty/preact"),
Immutable = require("thirdparty/immutable"),
PreactTestUtils = require("thirdparty/preact-test-utils"),
_ = require("thirdparty/lodash");
// Preact Test Utils doesn't have findRenderedDOMComponentWithTag method
// So create it
var findRenderedDOMComponentWithTag = function(root, tagName) {
var nodes = [];
if (root.base.tagName.toUpperCase() === tagName.toUpperCase()){
nodes.push(root.base);
} else {
for (var i = 0; i < root.base.childNodes.length; ++i) {
if (root.base.childNodes[i].tagName === tagName.toUpperCase()) {
nodes.push(root.base.childNodes[i]);
}
}
}
if (nodes.length !== 1) {
throw new Error('Did not find exactly one match for tag:' + tagName);
}
return nodes[0];
};
describe("FileTreeView", function () {
describe("_fileNode", function () {
it("should create a component with the right information", function () {
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileNode({
name: "afile.js",
entry: Immutable.Map()
}));
var a = findRenderedDOMComponentWithTag(rendered, "a");
expect(a.children[0].textContent).toBe("");
expect(a.children[1].textContent).toBe(" ");
expect(a.children[2].textContent).toBe("afile");
expect(a.children[3].textContent).toBe(".js");
});
it("should call icon extensions to replace the default icon", function () {
var extensionCalls = 0,
rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileNode({
name: "afile.js",
entry: Immutable.Map(),
parentPath: "/foo/",
extensions: Immutable.fromJS({
icons: [function (data) {
extensionCalls++;
expect(data.name).toBe("afile.js");
expect(data.isFile).toBe(true);
expect(data.fullPath).toBe("/foo/afile.js");
return Preact.DOM.ins({}, "ICON");
}]
})
}));
expect(extensionCalls).toBe(1);
var a = findRenderedDOMComponentWithTag(rendered, "a");
expect(a.children[0].textContent).toBe("");
expect(a.children[1].textContent).toBe("ICON");
expect(a.children[2].textContent).toBe("afile");
expect(a.children[3].textContent).toBe(".js");
});
it("should allow icon extensions to return a string for the icon", function () {
var extensionCalls = 0,
rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileNode({
name: "afile.js",
entry: Immutable.Map(),
parentPath: "/foo/",
extensions: Immutable.fromJS({
icons: [function (data) {
extensionCalls++;
return "<ins>ICON</ins>";
}]
})
}));
expect(extensionCalls).toBe(1);
var a = findRenderedDOMComponentWithTag(rendered, "a");
expect(a.children[0].textContent).toBe("");
expect(a.children[2].textContent).toBe("afile");
expect(a.children[3].textContent).toBe(".js");
var $a = $(Preact.findDOMNode(a)),
$ins = $a.find("ins");
expect($ins.text()).toBe("ICON");
});
it("should set context on a node by right click", function () {
var actions = jasmine.createSpyObj("actions", ["setContext"]);
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileNode({
name: "afile.js",
entry: Immutable.Map(),
actions: actions,
parentPath: "/foo/"
}));
var node = Preact.findDOMNode(rendered);
PreactTestUtils.Simulate.mouseDown(node, {
button: 2
});
expect(actions.setContext).toHaveBeenCalledWith("/foo/afile.js");
});
it("should set context on a node by control click on Mac", function () {
var actions = jasmine.createSpyObj("actions", ["setContext"]);
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileNode({
name: "afile.js",
entry: Immutable.Map(),
actions: actions,
parentPath: "/foo/",
platform: "mac"
}));
var node = Preact.findDOMNode(rendered);
PreactTestUtils.Simulate.mouseDown(node, {
button: 0,
ctrlKey: true
});
expect(actions.setContext).toHaveBeenCalledWith("/foo/afile.js");
});
it("should not set context on a node by control click on Windows", function () {
var actions = jasmine.createSpyObj("actions", ["setContext"]);
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileNode({
name: "afile.js",
entry: Immutable.Map(),
actions: actions,
parentPath: "/foo/",
platform: "win"
}));
var node = Preact.findDOMNode(rendered);
PreactTestUtils.Simulate.mouseDown(node, {
button: 0,
ctrlKey: true
});
expect(actions.setContext).not.toHaveBeenCalled();
});
it("should allow icon extensions to return a jQuery object for the icon", function () {
var extensionCalls = 0,
rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileNode({
name: "afile.js",
entry: Immutable.Map(),
parentPath: "/foo/",
extensions: Immutable.fromJS({
icons: [function (data) {
extensionCalls++;
return $("<ins/>").text("ICON");
}]
})
}));
expect(extensionCalls).toBe(1);
var a = findRenderedDOMComponentWithTag(rendered, "a");
expect(a.children[0].textContent).toBe("");
expect(a.children[2].textContent).toBe("afile");
expect(a.children[3].textContent).toBe(".js");
var $a = $(a),
$ins = $a.find("ins");
expect($ins.text()).toBe("ICON");
});
it("should call addClass extensions", function () {
var extensionCalls = 0,
rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileNode({
name: "afile.js",
entry: Immutable.Map(),
parentPath: "/foo/",
extensions: Immutable.fromJS({
addClass: [function (data) {
extensionCalls++;
expect(data.name).toBe("afile.js");
expect(data.isFile).toBe(true);
expect(data.fullPath).toBe("/foo/afile.js");
return "new";
}, function (data) {
return "classes are cool";
}]
})
}));
expect(extensionCalls).toBe(1);
var li = findRenderedDOMComponentWithTag(rendered, "li");
expect(li.className).toBe("jstree-leaf new classes are cool");
});
it("should render a rename component", function () {
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileNode({
name: "afile.js",
entry: Immutable.Map({
rename: true
})
}));
var input = findRenderedDOMComponentWithTag(rendered, "input");
expect(input.value).toBe("afile.js");
});
it("should re-render as needed", function () {
var props = {
name : "afile.js",
entry : Immutable.Map(),
parentPath: "/foo/",
extensions: Immutable.Map()
};
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileNode(props));
var newProps = _.clone(props);
expect(rendered.shouldComponentUpdate(newProps)).toBe(false);
newProps = _.clone(props);
newProps.entry = Immutable.Map({
selected: true
});
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
newProps = _.clone(props);
newProps.forceRender = true;
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
newProps = _.clone(props);
newProps.extensions = Immutable.Map({
addClasses: Immutable.List()
});
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
});
});
describe("_sortFormattedDirectory", function () {
it("should sort alphabetically", function () {
var formatted = Immutable.fromJS({
"README.md": {},
"afile.js": {},
subdir: {
children: null
}
});
expect(FileTreeView._sortFormattedDirectory(formatted).toJS()).toEqual([
"afile.js", "README.md", "subdir"
]);
});
it("should include the extension in the sort", function () {
var formatted = Immutable.fromJS({
"README.txt": {},
"README.md": {},
"README": {}
});
expect(FileTreeView._sortFormattedDirectory(formatted).toJS()).toEqual([
"README", "README.md", "README.txt"
]);
});
it("can sort by directories first", function () {
var formatted = Immutable.fromJS({
"README.md": {},
"afile.js": {},
subdir: {
children: null
}
});
expect(FileTreeView._sortFormattedDirectory(formatted, true).toJS()).toEqual([
"subdir", "afile.js", "README.md"
]);
});
});
var twoLevel = Immutable.fromJS({
open: true,
children: {
subdir: {
open: true,
children: {
"afile.js": {}
}
}
}
});
describe("_directoryNode and _directoryContents", function () {
it("should format a closed directory", function () {
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._directoryNode({
name: "thedir",
parentPath: "/foo/",
entry: Immutable.fromJS({
children: null
})
}));
var dirLI = Preact.findDOMNode(rendered),
dirA = $(dirLI).find("a")[0];
expect(dirLI.children[1].textContent).toBe(" thedir");
expect(rendered.myPath()).toBe("/foo/thedir/");
});
it("should rerender as needed", function () {
var props = {
name : "thedir",
parentPath : "/foo/",
entry : Immutable.fromJS({
children: null
}),
extensions : Immutable.Map(),
sortDirectoriesFirst: false
};
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._directoryNode(props));
var newProps = _.clone(props);
expect(rendered.shouldComponentUpdate(newProps)).toBe(false);
newProps = _.clone(props);
newProps.entry = Immutable.fromJS({
children: []
});
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
newProps = _.clone(props);
newProps.forceRender = true;
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
newProps = _.clone(props);
newProps.extensions = Immutable.Map({
addClasses: Immutable.List()
});
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
newProps = _.clone(props);
newProps.sortDirectoriesFirst = true;
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
});
it("should call extensions for directories", function () {
var extensionCalled = false,
rendered = PreactTestUtils.renderIntoDocument(FileTreeView._directoryNode({
name: "thedir",
parentPath: "/foo/",
entry: Immutable.fromJS({
children: null
}),
extensions: Immutable.fromJS({
icons: [function (data) {
return Preact.DOM.ins({}, "ICON");
}],
addClass: [function (data) {
extensionCalled = true;
expect(data.name).toBe("thedir");
expect(data.isFile).toBe(false);
expect(data.fullPath).toBe("/foo/thedir/");
return "new";
}, function (data) {
return "classes are cool";
}]
})
}));
expect(extensionCalled).toBe(true);
var dirLI = Preact.findDOMNode(rendered),
dirA = $(dirLI).find("a")[0];
expect(dirLI.className).toBe("jstree-closed new classes are cool");
expect(dirA.children[0].textContent).toBe("");
expect(dirA.children[1].textContent).toBe("ICON");
});
it("should allow renaming a closed directory", function () {
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._directoryNode({
name: "thedir",
entry: Immutable.fromJS({
children: null,
rename: true
})
}));
var input = findRenderedDOMComponentWithTag(rendered, "input");
expect(input.value).toBe("thedir");
});
it("should be able to list files", function () {
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._directoryContents({
contents: Immutable.fromJS({
"afile.js": {}
})
}));
var fileLI = Preact.findDOMNode(rendered),
fileA = $(fileLI).find("a")[0];
expect(fileA.children[2].textContent).toBe("afile");
});
it("should be able to list closed directories", function () {
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._directoryNode({
name: "thedir",
entry: Immutable.fromJS({
open: true,
children: {
"subdir": {
children: null
}
}
})
}));
var subdirLI = Preact.findDOMNode(rendered),
subdirA = $(subdirLI).find(".jstree-closed > a")[0];
expect(subdirA.children[2].textContent).toBe("subdir");
});
it("should be able to list open subdirectories", function () {
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._directoryNode({
name: "twoLevel",
entry: twoLevel
}));
var dirLI = Preact.findDOMNode(rendered);
var subdirLI = $(dirLI).find(".jstree-open"),
aTags = subdirLI.find("a");
expect(aTags.length).toBe(2);
expect(aTags[0].children[2].textContent).toBe("subdir");
expect(aTags[1].children[2].textContent).toBe("afile");
});
it("should sort directory contents according to the flag", function () {
var directory = Immutable.fromJS({
children: {
"afile.js": {},
"subdir": {
children: {}
}
},
open: true
});
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._directoryNode({
name: "hasDirs",
entry: directory,
sortDirectoriesFirst: true
}));
var html = Preact.findDOMNode(rendered).outerHTML;
expect(html.indexOf("subdir")).toBeLessThan(html.indexOf("afile"));
});
it("should rerender contents as needed", function () {
var props = {
parentPath : "/foo/",
contents : Immutable.Map(),
sortDirectoriesFirst: false,
extensions : Immutable.Map()
};
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._directoryContents(props));
var newProps = _.clone(props);
expect(rendered.shouldComponentUpdate(newProps)).toBe(false);
newProps = _.clone(props);
newProps.contents = Immutable.fromJS({
somefile: {}
});
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
newProps = _.clone(props);
newProps.forceRender = true;
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
newProps = _.clone(props);
newProps.extensions = Immutable.Map({
addClasses: Immutable.List()
});
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
newProps = _.clone(props);
newProps.sortDirectoriesFirst = true;
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
});
});
describe("_fileTreeView", function () {
var selectionViewInfo = new Immutable.Map({
hasSelection: true,
width: 100,
hasContext: false,
scrollTop: 0,
scrollLeft: 0,
offsetTop: 0
});
it("should render the directory", function () {
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileTreeView({
projectRoot: {},
treeData: new Immutable.Map({
"subdir": twoLevel.getIn(["children", "subdir"])
}),
selectionViewInfo: selectionViewInfo,
sortDirectoriesFirst: false
}));
var rootNode = Preact.findDOMNode(rendered),
aTags = $(rootNode).find("a");
expect(aTags.length).toBe(2);
expect(aTags[0].children[2].textContent).toBe("subdir");
expect(aTags[1].children[2].textContent).toBe("afile");
});
it("should rerender contents as needed", function () {
var props = {
parentPath : "/foo/",
treeData : Immutable.Map(),
selectionViewInfo : selectionViewInfo,
sortDirectoriesFirst: false,
extensions : Immutable.Map()
};
var rendered = PreactTestUtils.renderIntoDocument(FileTreeView._fileTreeView(props));
var newProps = _.clone(props);
expect(rendered.shouldComponentUpdate(newProps)).toBe(false);
newProps = _.clone(props);
newProps.treeData = Immutable.fromJS({
somefile: {}
});
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
newProps = _.clone(props);
newProps.forceRender = true;
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
newProps = _.clone(props);
newProps.extensions = Immutable.Map({
addClasses: Immutable.List()
});
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
newProps = _.clone(props);
newProps.sortDirectoriesFirst = true;
expect(rendered.shouldComponentUpdate(newProps)).toBe(true);
});
});
describe("render", function () {
it("should render into the given element", function () {
var el = window.document.createElement("div"),
viewModel = new FileTreeViewModel.FileTreeViewModel();
viewModel._treeData = new Immutable.Map({
"subdir": twoLevel.getIn(["children", "subdir"])
});
FileTreeView.render(el, viewModel, {
fullPath: "/foo/"
});
expect($(".jstree-no-dots", el).length).toBe(1);
});
});
});
});
|
test/fixtures/react/rawfunction/actual.js | davesnx/babel-plugin-transform-react-qa-classes | import React, { Component } from 'react';
function SubComponent() {
return <div>Sub</div>;
}
const componentName = () => {
return <div>
<SubCoponent />
</div>;
};
export default componentName;
|
app/containers/RepoListItem/index.js | anneback/react-quiz | /**
* RepoListItem
*
* Lists the name and the issue count of a repository
*/
import React from 'react';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { FormattedNumber } from 'react-intl';
import { makeSelectCurrentUser } from 'containers/App/selectors';
import ListItem from 'components/ListItem';
import IssueIcon from './IssueIcon';
import IssueLink from './IssueLink';
import RepoLink from './RepoLink';
import Wrapper from './Wrapper';
export class RepoListItem extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
render() {
const item = this.props.item;
let nameprefix = '';
// If the repository is owned by a different person than we got the data for
// it's a fork and we should show the name of the owner
if (item.owner.login !== this.props.currentUser) {
nameprefix = `${item.owner.login}/`;
}
// Put together the content of the repository
const content = (
<Wrapper>
<RepoLink href={item.html_url} target="_blank">
{nameprefix + item.name}
</RepoLink>
<IssueLink href={`${item.html_url}/issues`} target="_blank">
<IssueIcon />
<FormattedNumber value={item.open_issues_count} />
</IssueLink>
</Wrapper>
);
// Render the content into a list item
return (
<ListItem key={`repo-list-item-${item.full_name}`} item={content} />
);
}
}
RepoListItem.propTypes = {
item: React.PropTypes.object,
currentUser: React.PropTypes.string,
};
export default connect(createStructuredSelector({
currentUser: makeSelectCurrentUser(),
}))(RepoListItem);
|
ajax/libs/forerunnerdb/1.3.715/fdb-core+views.min.js | Amomo/cdnjs | !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=a("./core");a("../lib/View");"undefined"!=typeof window&&(window.ForerunnerDB=d),b.exports=d},{"../lib/View":33,"./core":2}],2:[function(a,b,c){var d=a("../lib/Core");a("../lib/Shim.IE8");"undefined"!=typeof window&&(window.ForerunnerDB=d),b.exports=d},{"../lib/Core":8,"../lib/Shim.IE8":32}],3:[function(a,b,c){"use strict";var d,e=a("./Shared"),f=a("./Path"),g=function(a){this._primaryKey="_id",this._keyArr=[],this._data=[],this._objLookup={},this._count=0,this._keyArr=d.parse(a,!0)};e.addModule("ActiveBucket",g),e.mixin(g.prototype,"Mixin.Sorting"),d=new f,e.synthesize(g.prototype,"primaryKey"),g.prototype.qs=function(a,b,c,d){if(!b.length)return 0;for(var e,f,g,h=-1,i=0,j=b.length-1;j>=i&&(e=Math.floor((i+j)/2),h!==e);)f=b[e],void 0!==f&&(g=d(this,a,c,f),g>0&&(i=e+1),0>g&&(j=e-1)),h=e;return g>0?e+1:e},g.prototype._sortFunc=function(a,b,c,e){var f,g,h,i=c.split(".:."),j=e.split(".:."),k=a._keyArr,l=k.length;for(f=0;l>f;f++)if(g=k[f],h=typeof d.get(b,g.path),"number"===h&&(i[f]=Number(i[f]),j[f]=Number(j[f])),i[f]!==j[f]){if(1===g.value)return a.sortAsc(i[f],j[f]);if(-1===g.value)return a.sortDesc(i[f],j[f])}},g.prototype.insert=function(a){var b,c;return b=this.documentKey(a),c=this._data.indexOf(b),-1===c?(c=this.qs(a,this._data,b,this._sortFunc),this._data.splice(c,0,b)):this._data.splice(c,0,b),this._objLookup[a[this._primaryKey]]=b,this._count++,c},g.prototype.remove=function(a){var b,c;return b=this._objLookup[a[this._primaryKey]],b?(c=this._data.indexOf(b),c>-1?(this._data.splice(c,1),delete this._objLookup[a[this._primaryKey]],this._count--,!0):!1):!1},g.prototype.index=function(a){var b,c;return b=this.documentKey(a),c=this._data.indexOf(b),-1===c&&(c=this.qs(a,this._data,b,this._sortFunc)),c},g.prototype.documentKey=function(a){var b,c,e="",f=this._keyArr,g=f.length;for(b=0;g>b;b++)c=f[b],e&&(e+=".:."),e+=d.get(a,c.path);return e+=".:."+a[this._primaryKey]},g.prototype.count=function(){return this._count},e.finishModule("ActiveBucket"),b.exports=g},{"./Path":28,"./Shared":31}],4:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=new e,g=function(a,b,c){this.init.apply(this,arguments)};g.prototype.init=function(a,b,c,d,e){this._store=[],this._keys=[],void 0!==c&&this.primaryKey(c),void 0!==b&&this.index(b),void 0!==d&&this.compareFunc(d),void 0!==e&&this.hashFunc(e),void 0!==a&&this.data(a)},d.addModule("BinaryTree",g),d.mixin(g.prototype,"Mixin.ChainReactor"),d.mixin(g.prototype,"Mixin.Sorting"),d.mixin(g.prototype,"Mixin.Common"),d.synthesize(g.prototype,"compareFunc"),d.synthesize(g.prototype,"hashFunc"),d.synthesize(g.prototype,"indexDir"),d.synthesize(g.prototype,"primaryKey"),d.synthesize(g.prototype,"keys"),d.synthesize(g.prototype,"index",function(a){return void 0!==a&&(this.debug()&&console.log("Setting index",a,f.parse(a,!0)),this.keys(f.parse(a,!0))),this.$super.call(this,a)}),g.prototype.clear=function(){delete this._data,delete this._left,delete this._right,this._store=[]},g.prototype.data=function(a){return void 0!==a?(this._data=a,this._hashFunc&&(this._hash=this._hashFunc(a)),this):this._data},g.prototype.push=function(a){return void 0!==a?(this._store.push(a),this):!1},g.prototype.pull=function(a){if(void 0!==a){var b=this._store.indexOf(a);if(b>-1)return this._store.splice(b,1),this}return!1},g.prototype._compareFunc=function(a,b){var c,d,e=0;for(c=0;c<this._keys.length;c++)if(d=this._keys[c],1===d.value?e=this.sortAsc(f.get(a,d.path),f.get(b,d.path)):-1===d.value&&(e=this.sortDesc(f.get(a,d.path),f.get(b,d.path))),this.debug()&&console.log("Compared %s with %s order %d in path %s and result was %d",f.get(a,d.path),f.get(b,d.path),d.value,d.path,e),0!==e)return this.debug()&&console.log("Retuning result %d",e),e;return this.debug()&&console.log("Retuning result %d",e),e},g.prototype._hashFunc=function(a){return a[this._keys[0].path]},g.prototype.removeChildNode=function(a){this._left===a?delete this._left:this._right===a&&delete this._right},g.prototype.nodeBranch=function(a){return this._left===a?"left":this._right===a?"right":void 0},g.prototype.insert=function(a){var b,c,d,e;if(a instanceof Array){for(c=[],d=[],e=0;e<a.length;e++)this.insert(a[e])?c.push(a[e]):d.push(a[e]);return{inserted:c,failed:d}}return this.debug()&&console.log("Inserting",a),this._data?(b=this._compareFunc(this._data,a),0===b?(this.debug()&&console.log("Data is equal (currrent, new)",this._data,a),this._left?this._left.insert(a):(this._left=new g(a,this._index,this._binaryTree,this._compareFunc,this._hashFunc),this._left._parent=this),!0):-1===b?(this.debug()&&console.log("Data is greater (currrent, new)",this._data,a),this._right?this._right.insert(a):(this._right=new g(a,this._index,this._binaryTree,this._compareFunc,this._hashFunc),this._right._parent=this),!0):1===b?(this.debug()&&console.log("Data is less (currrent, new)",this._data,a),this._left?this._left.insert(a):(this._left=new g(a,this._index,this._binaryTree,this._compareFunc,this._hashFunc),this._left._parent=this),!0):!1):(this.debug()&&console.log("Node has no data, setting data",a),this.data(a),!0)},g.prototype.remove=function(a){var b,c,d,e=this.primaryKey();if(a instanceof Array){for(c=[],d=0;d<a.length;d++)this.remove(a[d])&&c.push(a[d]);return c}return this.debug()&&console.log("Removing",a),this._data[e]===a[e]?this._remove(this):(b=this._compareFunc(this._data,a),-1===b&&this._right?this._right.remove(a):1===b&&this._left?this._left.remove(a):!1)},g.prototype._remove=function(a){var b,c;return this._left?(b=this._left,c=this._right,this._left=b._left,this._right=b._right,this._data=b._data,this._store=b._store,c&&(b.rightMost()._right=c)):this._right?(c=this._right,this._left=c._left,this._right=c._right,this._data=c._data,this._store=c._store):this.clear(),!0},g.prototype.leftMost=function(){return this._left?this._left.leftMost():this},g.prototype.rightMost=function(){return this._right?this._right.rightMost():this},g.prototype.lookup=function(a,b,c){var d=this._compareFunc(this._data,a);return c=c||[],0===d&&(this._left&&this._left.lookup(a,b,c),c.push(this._data),this._right&&this._right.lookup(a,b,c)),-1===d&&this._right&&this._right.lookup(a,b,c),1===d&&this._left&&this._left.lookup(a,b,c),c},g.prototype.inOrder=function(a,b){switch(b=b||[],this._left&&this._left.inOrder(a,b),a){case"hash":b.push(this._hash);break;case"data":b.push(this._data);break;default:b.push({key:this._data,arr:this._store})}return this._right&&this._right.inOrder(a,b),b},g.prototype.startsWith=function(a,b,c,d){var e,g,h=f.get(this._data,a),i=h.substr(0,b.length);return c=c||new RegExp("^"+b),d=d||[],void 0===d._visited&&(d._visited=0),d._visited++,g=this.sortAsc(h,b),e=i===b,0===g&&(this._left&&this._left.startsWith(a,b,c,d),e&&d.push(this._data),this._right&&this._right.startsWith(a,b,c,d)),-1===g&&(e&&d.push(this._data),this._right&&this._right.startsWith(a,b,c,d)),1===g&&(this._left&&this._left.startsWith(a,b,c,d),e&&d.push(this._data)),d},g.prototype.findRange=function(a,b,c,d,f,g){f=f||[],g=g||new e(b),this._left&&this._left.findRange(a,b,c,d,f,g);var h=g.value(this._data),i=this.sortAsc(h,c),j=this.sortAsc(h,d);if(!(0!==i&&1!==i||0!==j&&-1!==j))switch(a){case"hash":f.push(this._hash);break;case"data":f.push(this._data);break;default:f.push({key:this._data,arr:this._store})}return this._right&&this._right.findRange(a,b,c,d,f,g),f},g.prototype.match=function(a,b,c){var d,e,g,h=[],i=0;for(d=f.parseArr(this._index,{verbose:!0}),e=f.parseArr(a,c&&c.pathOptions?c.pathOptions:{ignore:/\$/,verbose:!0}),g=0;g<d.length;g++)e[g]===d[g]&&(i++,h.push(e[g]));return{matchedKeys:h,totalKeyCount:e.length,score:i}},d.finishModule("BinaryTree"),b.exports=g},{"./Path":28,"./Shared":31}],5:[function(a,b,c){"use strict";var d,e;d=function(){var a,b,c,d=[];for(b=0;256>b;b++){for(a=b,c=0;8>c;c++)a=1&a?3988292384^a>>>1:a>>>1;d[b]=a}return d}(),e=function(a){var b,c=-1;for(b=0;b<a.length;b++)c=c>>>8^d[255&(c^a.charCodeAt(b))];return(-1^c)>>>0},b.exports=e},{}],6:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m,n;d=a("./Shared");var o=function(a,b){this.init.apply(this,arguments)};o.prototype.init=function(a,b){this.sharedPathSolver=n,this._primaryKey="_id",this._primaryIndex=new g("primary"),this._primaryCrc=new g("primaryCrc"),this._crcLookup=new g("crcLookup"),this._name=a,this._data=[],this._metrics=new f,this._options=b||{changeTimestamp:!1},this._options.db&&this.db(this._options.db),this._metaData={},this._deferQueue={insert:[],update:[],remove:[],upsert:[],async:[]},this._deferThreshold={insert:100,update:100,remove:100,upsert:100},this._deferTime={insert:1,update:1,remove:1,upsert:1},this._deferredCalls=!0,this.subsetOf(this)},d.addModule("Collection",o),d.mixin(o.prototype,"Mixin.Common"),d.mixin(o.prototype,"Mixin.Events"),d.mixin(o.prototype,"Mixin.ChainReactor"),d.mixin(o.prototype,"Mixin.CRUD"),d.mixin(o.prototype,"Mixin.Constants"),d.mixin(o.prototype,"Mixin.Triggers"),d.mixin(o.prototype,"Mixin.Sorting"),d.mixin(o.prototype,"Mixin.Matching"),d.mixin(o.prototype,"Mixin.Updating"),d.mixin(o.prototype,"Mixin.Tags"),f=a("./Metrics"),g=a("./KeyValueStore"),h=a("./Path"),i=a("./IndexHashMap"),j=a("./IndexBinaryTree"),k=a("./Index2d"),e=d.modules.Db,l=a("./Overload"),m=a("./ReactorIO"),n=new h,d.synthesize(o.prototype,"deferredCalls"),d.synthesize(o.prototype,"state"),d.synthesize(o.prototype,"name"),d.synthesize(o.prototype,"metaData"),d.synthesize(o.prototype,"capped"),d.synthesize(o.prototype,"cappedSize"),o.prototype._asyncPending=function(a){this._deferQueue.async.push(a)},o.prototype._asyncComplete=function(a){for(var b=this._deferQueue.async.indexOf(a);b>-1;)this._deferQueue.async.splice(b,1),b=this._deferQueue.async.indexOf(a);0===this._deferQueue.async.length&&this.deferEmit("ready")},o.prototype.data=function(){return this._data},o.prototype.drop=function(a){var b;if(this.isDropped())return a&&a.call(this,!1,!0),!0;if(this._db&&this._db._collection&&this._name){if(this.debug()&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this.emit("drop",this),delete this._db._collection[this._name],this._collate)for(b in this._collate)this._collate.hasOwnProperty(b)&&this.collateRemove(b);return delete this._primaryKey,delete this._primaryIndex,delete this._primaryCrc,delete this._crcLookup,delete this._data,delete this._metrics,delete this._listeners,a&&a.call(this,!1,!0),!0}return a&&a.call(this,!1,!0),!1},o.prototype.primaryKey=function(a){if(void 0!==a){if(this._primaryKey!==a){var b=this._primaryKey;this._primaryKey=a,this._primaryIndex.primaryKey(a),this.rebuildPrimaryKeyIndex(),this.chainSend("primaryKey",{keyName:a,oldData:b})}return this}return this._primaryKey},o.prototype._onInsert=function(a,b){this.emit("insert",a,b)},o.prototype._onUpdate=function(a){this.emit("update",a)},o.prototype._onRemove=function(a){this.emit("remove",a)},o.prototype._onChange=function(){this._options.changeTimestamp&&(this._metaData.lastChange=this.serialiser.convert(new Date))},d.synthesize(o.prototype,"db",function(a){return a&&"_id"===this.primaryKey()&&(this.primaryKey(a.primaryKey()),this.debug(a.debug())),this.$super.apply(this,arguments)}),d.synthesize(o.prototype,"mongoEmulation"),o.prototype.setData=new l("Collection.prototype.setData",{"*":function(a){return this.$main.call(this,a,{})},"*, object":function(a,b){return this.$main.call(this,a,b)},"*, function":function(a,b){return this.$main.call(this,a,{},b)},"*, *, function":function(a,b,c){return this.$main.call(this,a,b,c)},"*, *, *":function(a,b,c){return this.$main.call(this,a,b,c)},$main:function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";if(a){var d=this.deferredCalls(),e=[].concat(this._data);this.deferredCalls(!1),b=this.options(b),b.$decouple&&(a=this.decouple(a)),a instanceof Array||(a=[a]),this.remove({}),this.insert(a),this.deferredCalls(d),this._onChange(),this.emit("setData",this._data,e)}return c&&c.call(this),this}}),o.prototype.rebuildPrimaryKeyIndex=function(a){a=a||{$ensureKeys:void 0,$violationCheck:void 0};var b,c,d,e,f=a&&void 0!==a.$ensureKeys?a.$ensureKeys:!0,g=a&&void 0!==a.$violationCheck?a.$violationCheck:!0,h=this._primaryIndex,i=this._primaryCrc,j=this._crcLookup,k=this._primaryKey;for(h.truncate(),i.truncate(),j.truncate(),b=this._data,c=b.length;c--;){if(d=b[c],f&&this.ensurePrimaryKey(d),g){if(!h.uniqueSet(d[k],d))throw this.logIdentifier()+" Call to setData on collection failed because your data violates the primary key unique constraint. One or more documents are using the same primary key: "+d[this._primaryKey]}else h.set(d[k],d);e=this.hash(d),i.set(d[k],e),j.set(e,d)}},o.prototype.ensurePrimaryKey=function(a){void 0===a[this._primaryKey]&&(a[this._primaryKey]=this.objectId())},o.prototype.truncate=function(){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return this.emit("truncate",this._data),this._data.length=0,this._primaryIndex=new g("primary"),this._primaryCrc=new g("primaryCrc"),this._crcLookup=new g("crcLookup"),this._onChange(),this.emit("immediateChange",{type:"truncate"}),this.deferEmit("change",{type:"truncate"}),this},o.prototype.upsert=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";if(a){var c,d,e=this._deferQueue.upsert,f=this._deferThreshold.upsert,g={};if(a instanceof Array){if(this._deferredCalls&&a.length>f)return this._deferQueue.upsert=e.concat(a),this._asyncPending("upsert"),this.processQueue("upsert",b),{};for(g=[],d=0;d<a.length;d++)g.push(this.upsert(a[d]));return b&&b.call(this),g}switch(a[this._primaryKey]?(c={},c[this._primaryKey]=a[this._primaryKey],this._primaryIndex.lookup(c)[0]?g.op="update":g.op="insert"):g.op="insert",g.op){case"insert":g.result=this.insert(a,b);break;case"update":g.result=this.update(c,a,{},b)}return g}return b&&b.call(this),{}},o.prototype.filter=function(a,b,c){return this.find(a,c).filter(b)},o.prototype.filterUpdate=function(a,b,c){var d,e,f,g,h=this.find(a,c),i=[],j=this.primaryKey();for(g=0;g<h.length;g++)d=h[g],f=b(d),f&&(e={},e[j]=d[j],i.push(this.update(e,f)));return i},o.prototype.update=function(a,b,c,d){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return this.mongoEmulation()?(this.convertToFdb(a),this.convertToFdb(b)):b=this.decouple(b),b=this.transformIn(b),this._handleUpdate(a,b,c,d)},o.prototype._handleUpdate=function(a,b,c,d){var e,f,g=this,h=this._metrics.create("update"),i=function(d){var e,f,i,j=g.decouple(d);return g.willTrigger(g.TYPE_UPDATE,g.PHASE_BEFORE)||g.willTrigger(g.TYPE_UPDATE,g.PHASE_AFTER)?(e=g.decouple(d),f={type:"update",query:g.decouple(a),update:g.decouple(b),options:g.decouple(c),op:h},i=g.updateObject(e,f.update,f.query,f.options,""),g.processTrigger(f,g.TYPE_UPDATE,g.PHASE_BEFORE,d,e)!==!1?(i=g.updateObject(d,e,f.query,f.options,""),g.processTrigger(f,g.TYPE_UPDATE,g.PHASE_AFTER,j,e)):i=!1):i=g.updateObject(d,b,a,c,""),g._updateIndexes(j,d),i};return h.start(),h.time("Retrieve documents to update"),e=this.find(a,{$decouple:!1}),h.time("Retrieve documents to update"),e.length&&(h.time("Update documents"),f=e.filter(i),h.time("Update documents"),f.length&&(this.debug()&&console.log(this.logIdentifier()+" Updated some data"),h.time("Resolve chains"),this.chainWillSend()&&this.chainSend("update",{query:a,update:b,dataSet:this.decouple(f)},c),h.time("Resolve chains"),this._onUpdate(f),this._onChange(),d&&d.call(this),this.emit("immediateChange",{type:"update",data:f}),this.deferEmit("change",{type:"update",data:f}))),h.stop(),f||[]},o.prototype._replaceObj=function(a,b){var c;this._removeFromIndexes(a);for(c in a)a.hasOwnProperty(c)&&delete a[c];for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);if(!this._insertIntoIndexes(a))throw this.logIdentifier()+" Primary key violation in update! Key violated: "+a[this._primaryKey];return this},o.prototype.updateById=function(a,b){var c={};return c[this._primaryKey]=a,this.update(c,b)[0]},o.prototype.updateObject=function(a,b,c,d,e,f){b=this.decouple(b),e=e||"","."===e.substr(0,1)&&(e=e.substr(1,e.length-1));var g,i,j,k,l,m,n,o,p,q,r,s,t=!1,u=!1;for(s in b)if(b.hasOwnProperty(s)){if(g=!1,"$"===s.substr(0,1))switch(s){case"$key":case"$index":case"$data":case"$min":case"$max":g=!0;break;case"$each":for(g=!0,k=b.$each.length,j=0;k>j;j++)u=this.updateObject(a,b.$each[j],c,d,e),u&&(t=!0);t=t||u;break;case"$replace":g=!0,n=b.$replace,o=this.primaryKey();for(m in a)a.hasOwnProperty(m)&&m!==o&&void 0===n[m]&&(this._updateUnset(a,m),t=!0);for(m in n)n.hasOwnProperty(m)&&m!==o&&(this._updateOverwrite(a,m,n[m]),t=!0);break;default:g=!0,u=this.updateObject(a,b[s],c,d,e,s),t=t||u}if(this._isPositionalKey(s)&&(g=!0,s=s.substr(0,s.length-2),p=new h(e+"."+s),a[s]&&a[s]instanceof Array&&a[s].length)){for(i=[],j=0;j<a[s].length;j++)this._match(a[s][j],p.value(c)[0],d,"",{})&&i.push(j);for(j=0;j<i.length;j++)u=this.updateObject(a[s][i[j]],b[s+".$"],c,d,e+"."+s,f),t=t||u}if(!g)if(f||"object"!=typeof b[s])switch(f){case"$inc":var v=!0;b[s]>0?b.$max&&a[s]>=b.$max&&(v=!1):b[s]<0&&b.$min&&a[s]<=b.$min&&(v=!1),v&&(this._updateIncrement(a,s,b[s]),t=!0);break;case"$cast":switch(b[s]){case"array":a[s]instanceof Array||(this._updateProperty(a,s,b.$data||[]),t=!0);break;case"object":(!(a[s]instanceof Object)||a[s]instanceof Array)&&(this._updateProperty(a,s,b.$data||{}),t=!0);break;case"number":"number"!=typeof a[s]&&(this._updateProperty(a,s,Number(a[s])),t=!0);break;case"string":"string"!=typeof a[s]&&(this._updateProperty(a,s,String(a[s])),t=!0);break;default:throw this.logIdentifier()+" Cannot update cast to unknown type: "+b[s]}break;case"$push":if(void 0===a[s]&&this._updateProperty(a,s,[]),!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot push to a key that is not an array! ("+s+")";if(void 0!==b[s].$position&&b[s].$each instanceof Array)for(l=b[s].$position,k=b[s].$each.length,j=0;k>j;j++)this._updateSplicePush(a[s],l+j,b[s].$each[j]);else if(b[s].$each instanceof Array)for(k=b[s].$each.length,j=0;k>j;j++)this._updatePush(a[s],b[s].$each[j]);else this._updatePush(a[s],b[s]);t=!0;break;case"$pull":if(a[s]instanceof Array){for(i=[],j=0;j<a[s].length;j++)this._match(a[s][j],b[s],d,"",{})&&i.push(j);for(k=i.length;k--;)this._updatePull(a[s],i[k]),t=!0}break;case"$pullAll":if(a[s]instanceof Array){if(!(b[s]instanceof Array))throw this.logIdentifier()+" Cannot pullAll without being given an array of values to pull! ("+s+")";if(i=a[s],k=i.length,k>0)for(;k--;){for(l=0;l<b[s].length;l++)i[k]===b[s][l]&&(this._updatePull(a[s],k),k--,t=!0);if(0>k)break}}break;case"$addToSet":if(void 0===a[s]&&this._updateProperty(a,s,[]),!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot addToSet on a key that is not an array! ("+s+")";var w,x,y,z,A=a[s],B=A.length,C=!0,D=d&&d.$addToSet;for(b[s].$key?(y=!1,z=new h(b[s].$key),x=z.value(b[s])[0],delete b[s].$key):D&&D.key?(y=!1,z=new h(D.key),x=z.value(b[s])[0]):(x=this.jStringify(b[s]),y=!0),w=0;B>w;w++)if(y){if(this.jStringify(A[w])===x){C=!1;break}}else if(x===z.value(A[w])[0]){C=!1;break}C&&(this._updatePush(a[s],b[s]),t=!0);break;case"$splicePush":if(void 0===a[s]&&this._updateProperty(a,s,[]),!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot splicePush with a key that is not an array! ("+s+")";if(l=b.$index,void 0===l)throw this.logIdentifier()+" Cannot splicePush without a $index integer value!";delete b.$index,l>a[s].length&&(l=a[s].length),this._updateSplicePush(a[s],l,b[s]),t=!0;break;case"$move":if(!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot move on a key that is not an array! ("+s+")";for(j=0;j<a[s].length;j++)if(this._match(a[s][j],b[s],d,"",{})){var E=b.$index;if(void 0===E)throw this.logIdentifier()+" Cannot move without a $index integer value!";delete b.$index,this._updateSpliceMove(a[s],j,E),t=!0;break}break;case"$mul":this._updateMultiply(a,s,b[s]),t=!0;break;case"$rename":this._updateRename(a,s,b[s]),t=!0;break;case"$overwrite":this._updateOverwrite(a,s,b[s]),t=!0;break;case"$unset":this._updateUnset(a,s),t=!0;break;case"$clear":this._updateClear(a,s),t=!0;break;case"$pop":if(!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot pop from a key that is not an array! ("+s+")";this._updatePop(a[s],b[s])&&(t=!0);break;case"$toggle":this._updateProperty(a,s,!a[s]),t=!0;break;default:a[s]!==b[s]&&(this._updateProperty(a,s,b[s]),t=!0)}else if(null!==a[s]&&"object"==typeof a[s])if(q=a[s]instanceof Array,r=b[s]instanceof Array,q||r)if(!r&&q)for(j=0;j<a[s].length;j++)u=this.updateObject(a[s][j],b[s],c,d,e+"."+s,f),t=t||u;else a[s]!==b[s]&&(this._updateProperty(a,s,b[s]),t=!0);else u=this.updateObject(a[s],b[s],c,d,e+"."+s,f),t=t||u;else a[s]!==b[s]&&(this._updateProperty(a,s,b[s]),t=!0)}return t},o.prototype._isPositionalKey=function(a){return".$"===a.substr(a.length-2,2)},o.prototype.remove=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";var d,e,f,g,h,i,j,k,l=this;if("function"==typeof b&&(c=b,b={}),this.mongoEmulation()&&this.convertToFdb(a),a instanceof Array){for(g=[],f=0;f<a.length;f++)g.push(this.remove(a[f],{noEmit:!0}));return(!b||b&&!b.noEmit)&&this._onRemove(g),c&&c.call(this,!1,g),g}if(g=[],d=this.find(a,{$decouple:!1}),d.length){h=function(a){l._removeFromIndexes(a),e=l._data.indexOf(a),l._dataRemoveAtIndex(e),g.push(a)};for(var m=0;m<d.length;m++)j=d[m],l.willTrigger(l.TYPE_REMOVE,l.PHASE_BEFORE)||l.willTrigger(l.TYPE_REMOVE,l.PHASE_AFTER)?(i={type:"remove"},k=l.decouple(j),l.processTrigger(i,l.TYPE_REMOVE,l.PHASE_BEFORE,k,k)!==!1&&(h(j),l.processTrigger(i,l.TYPE_REMOVE,l.PHASE_AFTER,k,k))):h(j);g.length&&(l.chainSend("remove",{query:a,dataSet:g},b),(!b||b&&!b.noEmit)&&this._onRemove(g),this._onChange(),this.emit("immediateChange",{type:"remove",data:g}),this.deferEmit("change",{type:"remove",data:g}))}return c&&c.call(this,!1,g),g},o.prototype.removeById=function(a){var b={};return b[this._primaryKey]=a,this.remove(b)[0]},o.prototype.processQueue=function(a,b,c){var d,e,f=this,g=this._deferQueue[a],h=this._deferThreshold[a],i=this._deferTime[a];if(c=c||{deferred:!0},g.length){switch(d=g.length>h?g.splice(0,h):g.splice(0,g.length),e=f[a](d),a){case"insert":c.inserted=c.inserted||[],c.failed=c.failed||[],c.inserted=c.inserted.concat(e.inserted),c.failed=c.failed.concat(e.failed)}setTimeout(function(){f.processQueue.call(f,a,b,c)},i)}else b&&b.call(this,c),this._asyncComplete(a);this.isProcessingQueue()||this.deferEmit("queuesComplete")},o.prototype.isProcessingQueue=function(){var a;for(a in this._deferQueue)if(this._deferQueue.hasOwnProperty(a)&&this._deferQueue[a].length)return!0;return!1},o.prototype.insert=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return"function"==typeof b?(c=b,b=this._data.length):void 0===b&&(b=this._data.length),a=this.transformIn(a),this._insertHandle(a,b,c)},o.prototype._insertHandle=function(a,b,c){var d,e,f,g=this._deferQueue.insert,h=this._deferThreshold.insert,i=[],j=[];if(a instanceof Array){if(this._deferredCalls&&a.length>h)return this._deferQueue.insert=g.concat(a),this._asyncPending("insert"),void this.processQueue("insert",c);for(f=0;f<a.length;f++)d=this._insert(a[f],b+f),d===!0?i.push(a[f]):j.push({doc:a[f],reason:d})}else d=this._insert(a,b),d===!0?i.push(a):j.push({doc:a,reason:d});return e={deferred:!1,inserted:i,failed:j},this._onInsert(i,j),c&&c.call(this,e),this._onChange(),this.emit("immediateChange",{type:"insert",data:i}),this.deferEmit("change",{type:"insert",data:i}),e},o.prototype._insert=function(a,b){if(a){var c,d,e,f,g=this,h=this.capped(),i=this.cappedSize();if(this.ensurePrimaryKey(a),c=this.insertIndexViolation(a),e=function(a){g._insertIntoIndexes(a),b>g._data.length&&(b=g._data.length),g._dataInsertAtIndex(b,a),h&&g._data.length>i&&g.removeById(g._data[0][g._primaryKey]),g.chainWillSend()&&g.chainSend("insert",{dataSet:g.decouple([a])},{index:b})},c)return"Index violation in index: "+c;if(g.willTrigger(g.TYPE_INSERT,g.PHASE_BEFORE)||g.willTrigger(g.TYPE_INSERT,g.PHASE_AFTER)){if(d={type:"insert"},g.processTrigger(d,g.TYPE_INSERT,g.PHASE_BEFORE,{},a)===!1)return"Trigger cancelled operation";e(a),g.willTrigger(g.TYPE_INSERT,g.PHASE_AFTER)&&(f=g.decouple(a),g.processTrigger(d,g.TYPE_INSERT,g.PHASE_AFTER,{},f))}else e(a);return!0}return"No document passed to insert"},o.prototype._dataInsertAtIndex=function(a,b){this._data.splice(a,0,b)},o.prototype._dataRemoveAtIndex=function(a){this._data.splice(a,1)},o.prototype._dataReplace=function(a){for(;this._data.length;)this._data.pop();this._data=this._data.concat(a)},o.prototype._insertIntoIndexes=function(a){var b,c,d=this._indexByName,e=this.hash(a),f=this._primaryKey;c=this._primaryIndex.uniqueSet(a[f],a),this._primaryCrc.uniqueSet(a[f],e),this._crcLookup.uniqueSet(e,a);for(b in d)d.hasOwnProperty(b)&&d[b].insert(a);return c},o.prototype._removeFromIndexes=function(a){var b,c=this._indexByName,d=this.hash(a),e=this._primaryKey;this._primaryIndex.unSet(a[e]),this._primaryCrc.unSet(a[e]),this._crcLookup.unSet(d);for(b in c)c.hasOwnProperty(b)&&c[b].remove(a)},o.prototype._updateIndexes=function(a,b){this._removeFromIndexes(a),this._insertIntoIndexes(b)},o.prototype._rebuildIndexes=function(){var a,b=this._indexByName;for(a in b)b.hasOwnProperty(a)&&b[a].rebuild()},o.prototype.subset=function(a,b){var c,d=this.find(a,b);return c=new o,c.db(this._db),c.subsetOf(this).primaryKey(this._primaryKey).setData(d),c},d.synthesize(o.prototype,"subsetOf"),o.prototype.isSubsetOf=function(a){return this._subsetOf===a},o.prototype.distinct=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";var d,e,f=this.find(b,c),g=new h(a),i={},j=[];for(e=0;e<f.length;e++)d=g.value(f[e])[0],d&&!i[d]&&(i[d]=!0,j.push(d));return j},o.prototype.findById=function(a,b){var c={};return c[this._primaryKey]=a,this.find(c,b)[0]},o.prototype.peek=function(a,b){var c,d,e=this._data,f=e.length,g=new o,h=typeof a;if("string"===h){for(c=0;f>c;c++)d=this.jStringify(e[c]),d.indexOf(a)>-1&&g.insert(e[c]);return g.find({},b)}return this.find(a,b)},o.prototype.explain=function(a,b){var c=this.find(a,b);return c.__fdbOp._data},o.prototype.options=function(a){return a=a||{},a.$decouple=void 0!==a.$decouple?a.$decouple:!0,a.$explain=void 0!==a.$explain?a.$explain:!1,a},o.prototype.find=function(a,b,c){return this.mongoEmulation()&&this.convertToFdb(a),c?(c.call(this,"Callbacks for the find() operation are not yet implemented!",[]),[]):this._find.call(this,a,b,c)},o.prototype._find=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";a=a||{};var c,d,e,f,g,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=this._metrics.create("find"),y=this.primaryKey(),z=this,A=!0,B={},C=[],D=[],E=[],F={},G={};if(b instanceof Array||(b=this.options(b)),w=function(c){return z._match(c,a,b,"and",F)},x.start(),a){if(a instanceof Array){for(v=this,n=0;n<a.length;n++)v=v.subset(a[n],b&&b[n]?b[n]:{});return v.find()}if(a.$findSub){if(!a.$findSub.$path)throw"$findSub missing $path property!";return this.findSub(a.$findSub.$query,a.$findSub.$path,a.$findSub.$subQuery,a.$findSub.$subOptions)}if(a.$findSubOne){if(!a.$findSubOne.$path)throw"$findSubOne missing $path property!";return this.findSubOne(a.$findSubOne.$query,a.$findSubOne.$path,a.$findSubOne.$subQuery,a.$findSubOne.$subOptions)}if(x.time("analyseQuery"),c=this._analyseQuery(z.decouple(a),b,x),x.time("analyseQuery"),x.data("analysis",c),c.hasJoin&&c.queriesJoin){for(x.time("joinReferences"),f=0;f<c.joinsOn.length;f++)m=c.joinsOn[f],j=m.key,k=m.type,l=m.id,i=new h(c.joinQueries[j]),g=i.value(a)[0],B[l]=this._db[k](j).subset(g),delete a[c.joinQueries[j]];x.time("joinReferences")}if(c.indexMatch.length&&(!b||b&&!b.$skipIndex)?(x.data("index.potential",c.indexMatch),x.data("index.used",c.indexMatch[0].index),x.time("indexLookup"),e=c.indexMatch[0].lookup||[],x.time("indexLookup"),c.indexMatch[0].keyData.totalKeyCount===c.indexMatch[0].keyData.score&&(A=!1)):x.flag("usedIndex",!1),A&&(e&&e.length?(d=e.length,x.time("tableScan: "+d),e=e.filter(w)):(d=this._data.length,x.time("tableScan: "+d),e=this._data.filter(w)),x.time("tableScan: "+d)),b.$orderBy&&(x.time("sort"),e=this.sort(b.$orderBy,e),x.time("sort")),void 0!==b.$page&&void 0!==b.$limit&&(G.page=b.$page,G.pages=Math.ceil(e.length/b.$limit),G.records=e.length,b.$page&&b.$limit>0&&(x.data("cursor",G),e.splice(0,b.$page*b.$limit))),b.$skip&&(G.skip=b.$skip,e.splice(0,b.$skip),x.data("skip",b.$skip)),b.$limit&&e&&e.length>b.$limit&&(G.limit=b.$limit,e.length=b.$limit,x.data("limit",b.$limit)),b.$decouple&&(x.time("decouple"),e=this.decouple(e),x.time("decouple"),x.data("flag.decouple",!0)),b.$join&&(C=C.concat(this.applyJoin(e,b.$join,B)),x.data("flag.join",!0)),C.length&&(x.time("removalQueue"),this.spliceArrayByIndexList(e,C),x.time("removalQueue")),b.$transform){for(x.time("transform"),n=0;n<e.length;n++)e.splice(n,1,b.$transform(e[n]));x.time("transform"),x.data("flag.transform",!0)}this._transformEnabled&&this._transformOut&&(x.time("transformOut"),e=this.transformOut(e),x.time("transformOut")),x.data("results",e.length)}else e=[];if(!b.$aggregate){x.time("scanFields");for(n in b)b.hasOwnProperty(n)&&0!==n.indexOf("$")&&(1===b[n]?D.push(n):0===b[n]&&E.push(n));if(x.time("scanFields"),D.length||E.length){for(x.data("flag.limitFields",!0),x.data("limitFields.on",D),x.data("limitFields.off",E),x.time("limitFields"),n=0;n<e.length;n++){t=e[n];for(o in t)t.hasOwnProperty(o)&&(D.length&&o!==y&&-1===D.indexOf(o)&&delete t[o],E.length&&E.indexOf(o)>-1&&delete t[o])}x.time("limitFields")}if(b.$elemMatch){x.data("flag.elemMatch",!0),x.time("projection-elemMatch");for(n in b.$elemMatch)if(b.$elemMatch.hasOwnProperty(n))for(q=new h(n),o=0;o<e.length;o++)if(r=q.value(e[o])[0],r&&r.length)for(p=0;p<r.length;p++)if(z._match(r[p],b.$elemMatch[n],b,"",{})){q.set(e[o],n,[r[p]]);break}x.time("projection-elemMatch")}if(b.$elemsMatch){x.data("flag.elemsMatch",!0),x.time("projection-elemsMatch");for(n in b.$elemsMatch)if(b.$elemsMatch.hasOwnProperty(n))for(q=new h(n),o=0;o<e.length;o++)if(r=q.value(e[o])[0],r&&r.length){for(s=[],p=0;p<r.length;p++)z._match(r[p],b.$elemsMatch[n],b,"",{})&&s.push(r[p]);q.set(e[o],n,s)}x.time("projection-elemsMatch")}}return b.$aggregate&&(x.data("flag.aggregate",!0),x.time("aggregate"),u=new h(b.$aggregate),e=u.value(e),x.time("aggregate")),x.stop(),e.__fdbOp=x,e.$cursor=G,e},o.prototype.findOne=function(){return this.find.apply(this,arguments)[0]},o.prototype.indexOf=function(a,b){var c,d=this.find(a,{$decouple:!1})[0];return d?!b||b&&!b.$orderBy?this._data.indexOf(d):(b.$decouple=!1,c=this.find(a,b),c.indexOf(d)):-1},o.prototype.indexOfDocById=function(a,b){var c,d;return c="object"!=typeof a?this._primaryIndex.get(a):this._primaryIndex.get(a[this._primaryKey]),c?!b||b&&!b.$orderBy?this._data.indexOf(c):(b.$decouple=!1,d=this.find({},b),d.indexOf(c)):-1},o.prototype.removeByIndex=function(a){var b,c;return b=this._data[a],void 0!==b?(b=this.decouple(b),c=b[this.primaryKey()],this.removeById(c)):!1},o.prototype.transform=function(a){return void 0!==a?("object"==typeof a?(void 0!==a.enabled&&(this._transformEnabled=a.enabled),void 0!==a.dataIn&&(this._transformIn=a.dataIn),void 0!==a.dataOut&&(this._transformOut=a.dataOut)):this._transformEnabled=a!==!1,this):{enabled:this._transformEnabled,dataIn:this._transformIn,dataOut:this._transformOut}},o.prototype.transformIn=function(a){if(this._transformEnabled&&this._transformIn){if(a instanceof Array){var b,c,d=[];for(c=0;c<a.length;c++)b=this._transformIn(a[c]),
b instanceof Array?d=d.concat(b):d.push(b);return d}return this._transformIn(a)}return a},o.prototype.transformOut=function(a){if(this._transformEnabled&&this._transformOut){if(a instanceof Array){var b,c,d=[];for(c=0;c<a.length;c++)b=this._transformOut(a[c]),b instanceof Array?d=d.concat(b):d.push(b);return d}return this._transformOut(a)}return a},o.prototype.sort=function(a,b){var c=this,d=n.parse(a,!0);return d.length&&b.sort(function(a,b){var e,f,g=0;for(e=0;e<d.length;e++)if(f=d[e],1===f.value?g=c.sortAsc(n.get(a,f.path),n.get(b,f.path)):-1===f.value&&(g=c.sortDesc(n.get(a,f.path),n.get(b,f.path))),0!==g)return g;return g}),b},o.prototype._sort=function(a,b){var c,d=this,e=new h,f=e.parse(a,!0)[0];if(e.path(f.path),1===f.value)c=function(a,b){var c=e.value(a)[0],f=e.value(b)[0];return d.sortAsc(c,f)};else{if(-1!==f.value)throw this.logIdentifier()+" $orderBy clause has invalid direction: "+f.value+", accepted values are 1 or -1 for ascending or descending!";c=function(a,b){var c=e.value(a)[0],f=e.value(b)[0];return d.sortDesc(c,f)}}return b.sort(c)},o.prototype._analyseQuery=function(a,b,c){var d,e,f,g,i,j,k,l,m,n,o,p,q,r,s,t,u={queriesOn:[{id:"$collection."+this._name,type:"colletion",key:this._name}],indexMatch:[],hasJoin:!1,queriesJoin:!1,joinQueries:{},query:a,options:b},v=[],w=[];if(c.time("checkIndexes"),p=new h,q=p.parseArr(a,{ignore:/\$/,verbose:!0}).length){void 0!==a[this._primaryKey]&&(r=typeof a[this._primaryKey],("string"===r||"number"===r||a[this._primaryKey]instanceof Array)&&(c.time("checkIndexMatch: Primary Key"),s=this._primaryIndex.lookup(a,b),u.indexMatch.push({lookup:s,keyData:{matchedKeys:[this._primaryKey],totalKeyCount:q,score:1},index:this._primaryIndex}),c.time("checkIndexMatch: Primary Key")));for(t in this._indexById)if(this._indexById.hasOwnProperty(t)&&(m=this._indexById[t],n=m.name(),c.time("checkIndexMatch: "+n),l=m.match(a,b),l.score>0&&(o=m.lookup(a,b),u.indexMatch.push({lookup:o,keyData:l,index:m})),c.time("checkIndexMatch: "+n),l.score===q))break;c.time("checkIndexes"),u.indexMatch.length>1&&(c.time("findOptimalIndex"),u.indexMatch.sort(function(a,b){return a.keyData.score>b.keyData.score?-1:a.keyData.score<b.keyData.score?1:a.keyData.score===b.keyData.score?a.lookup.length-b.lookup.length:void 0}),c.time("findOptimalIndex"))}if(b.$join){for(u.hasJoin=!0,d=0;d<b.$join.length;d++)for(e in b.$join[d])b.$join[d].hasOwnProperty(e)&&(i=b.$join[d][e],f=i.$sourceType||"collection",g="$"+f+"."+e,v.push({id:g,type:f,key:e}),void 0!==b.$join[d][e].$as?w.push(b.$join[d][e].$as):w.push(e));for(k=0;k<w.length;k++)j=this._queryReferencesSource(a,w[k],""),j&&(u.joinQueries[v[k].key]=j,u.queriesJoin=!0);u.joinsOn=v,u.queriesOn=u.queriesOn.concat(v)}return u},o.prototype._queryReferencesSource=function(a,b,c){var d;for(d in a)if(a.hasOwnProperty(d)){if(d===b)return c&&(c+="."),c+d;if("object"==typeof a[d])return c&&(c+="."),c+=d,this._queryReferencesSource(a[d],b,c)}return!1},o.prototype.count=function(a,b){return a?this.find(a,b).length:this._data.length},o.prototype.findSub=function(a,b,c,d){return this._findSub(this.find(a),b,c,d)},o.prototype._findSub=function(a,b,c,d){var e,f,g,i=new h(b),j=a.length,k=new o("__FDB_temp_"+this.objectId()).db(this._db),l={parents:j,subDocTotal:0,subDocs:[],pathFound:!1,err:""};for(d=d||{},e=0;j>e;e++)if(f=i.value(a[e])[0]){if(k.setData(f),g=k.find(c,d),d.returnFirst&&g.length)return g[0];d.$split?l.subDocs.push(g):l.subDocs=l.subDocs.concat(g),l.subDocTotal+=g.length,l.pathFound=!0}return k.drop(),l.pathFound||(l.err="No objects found in the parent documents with a matching path of: "+b),d.$stats?l:l.subDocs},o.prototype.findSubOne=function(a,b,c,d){return this.findSub(a,b,c,d)[0]},o.prototype.insertIndexViolation=function(a){var b,c,d,e=this._indexByName;if(this._primaryIndex.get(a[this._primaryKey]))b=this._primaryIndex;else for(c in e)if(e.hasOwnProperty(c)&&(d=e[c],d.unique()&&d.violation(a))){b=d;break}return b?b.name():!1},o.prototype.ensureIndex=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";this._indexByName=this._indexByName||{},this._indexById=this._indexById||{};var c,e={start:(new Date).getTime()};if(b)if(b.type){if(!d.index[b.type])throw this.logIdentifier()+' Cannot create index of type "'+b.type+'", type not found in the index type register (Shared.index)';c=new d.index[b.type](a,b,this)}else c=new i(a,b,this);else c=new i(a,b,this);return this._indexByName[c.name()]?{err:"Index with that name already exists"}:(c.rebuild(),this._indexByName[c.name()]=c,this._indexById[c.id()]=c,e.end=(new Date).getTime(),e.total=e.end-e.start,this._lastOp={type:"ensureIndex",stats:{time:e}},{index:c,id:c.id(),name:c.name(),state:c.state()})},o.prototype.index=function(a){return this._indexByName?this._indexByName[a]:void 0},o.prototype.lastOp=function(){return this._metrics.list()},o.prototype.diff=function(a){var b,c,d,e,f={insert:[],update:[],remove:[]},g=this.primaryKey();if(g!==a.primaryKey())throw this.logIdentifier()+" Diffing requires that both collections have the same primary key!";for(b=a._data;b&&!(b instanceof Array);)a=b,b=a._data;for(e=b.length,c=0;e>c;c++)d=b[c],this._primaryIndex.get(d[g])?this._primaryCrc.get(d[g])!==a._primaryCrc.get(d[g])&&f.update.push(d):f.insert.push(d);for(b=this._data,e=b.length,c=0;e>c;c++)d=b[c],a._primaryIndex.get(d[g])||f.remove.push(d);return f},o.prototype.collateAdd=new l("Collection.prototype.collateAdd",{"object, string":function(a,b){var c=this;c.collateAdd(a,function(d){var e,f;switch(d.type){case"insert":b?(e={$push:{}},e.$push[b]=c.decouple(d.data.dataSet),c.update({},e)):c.insert(d.data.dataSet);break;case"update":b?(e={},f={},e[b]=d.data.query,f[b+".$"]=d.data.update,c.update(e,f)):c.update(d.data.query,d.data.update);break;case"remove":b?(e={$pull:{}},e.$pull[b]={},e.$pull[b][c.primaryKey()]=d.data.dataSet[0][a.primaryKey()],c.update({},e)):c.remove(d.data.dataSet)}})},"object, function":function(a,b){if("string"==typeof a&&(a=this._db.collection(a,{autoCreate:!1,throwError:!1})),a)return this._collate=this._collate||{},this._collate[a.name()]=new m(a,this,b),this;throw"Cannot collate from a non-existent collection!"}}),o.prototype.collateRemove=function(a){if("object"==typeof a&&(a=a.name()),a)return this._collate[a].drop(),delete this._collate[a],this;throw"No collection name passed to collateRemove() or collection not found!"},e.prototype.collection=new l("Db.prototype.collection",{"":function(){return this.$main.call(this,{name:this.objectId()})},object:function(a){return a instanceof o?"droppped"!==a.state()?a:this.$main.call(this,{name:a.name()}):this.$main.call(this,a)},string:function(a){return this.$main.call(this,{name:a})},"string, string":function(a,b){return this.$main.call(this,{name:a,primaryKey:b})},"string, object":function(a,b){return b.name=a,this.$main.call(this,b)},"string, string, object":function(a,b,c){return c.name=a,c.primaryKey=b,this.$main.call(this,c)},$main:function(a){var b=this,c=a.name;if(c){if(this._collection[c])return this._collection[c];if(a&&a.autoCreate===!1){if(a&&a.throwError!==!1)throw this.logIdentifier()+" Cannot get collection "+c+" because it does not exist and auto-create has been disabled!";return}if(this.debug()&&console.log(this.logIdentifier()+" Creating collection "+c),this._collection[c]=this._collection[c]||new o(c,a).db(this),this._collection[c].mongoEmulation(this.mongoEmulation()),void 0!==a.primaryKey&&this._collection[c].primaryKey(a.primaryKey),void 0!==a.capped){if(void 0===a.size)throw this.logIdentifier()+" Cannot create a capped collection without specifying a size!";this._collection[c].capped(a.capped),this._collection[c].cappedSize(a.size)}return b._collection[c].on("change",function(){b.emit("change",b._collection[c],"collection",c)}),b.emit("create",b._collection[c],"collection",c),this._collection[c]}if(!a||a&&a.throwError!==!1)throw this.logIdentifier()+" Cannot get collection with undefined name!"}}),e.prototype.collectionExists=function(a){return Boolean(this._collection[a])},e.prototype.collections=function(a){var b,c,d=[],e=this._collection;a&&(a instanceof RegExp||(a=new RegExp(a)));for(c in e)e.hasOwnProperty(c)&&(b=e[c],a?a.exec(c)&&d.push({name:c,count:b.count(),linked:void 0!==b.isLinked?b.isLinked():!1}):d.push({name:c,count:b.count(),linked:void 0!==b.isLinked?b.isLinked():!1}));return d.sort(function(a,b){return a.name.localeCompare(b.name)}),d},d.finishModule("Collection"),b.exports=o},{"./Index2d":11,"./IndexBinaryTree":12,"./IndexHashMap":13,"./KeyValueStore":14,"./Metrics":15,"./Overload":27,"./Path":28,"./ReactorIO":29,"./Shared":31}],7:[function(a,b,c){"use strict";var d,e,f,g;d=a("./Shared");var h=function(){this.init.apply(this,arguments)};h.prototype.init=function(a){var b=this;b._name=a,b._data=new g("__FDB__cg_data_"+b._name),b._collections=[],b._view=[]},d.addModule("CollectionGroup",h),d.mixin(h.prototype,"Mixin.Common"),d.mixin(h.prototype,"Mixin.ChainReactor"),d.mixin(h.prototype,"Mixin.Constants"),d.mixin(h.prototype,"Mixin.Triggers"),d.mixin(h.prototype,"Mixin.Tags"),d.mixin(h.prototype,"Mixin.Events"),g=a("./Collection"),e=d.modules.Db,f=d.modules.Db.prototype.init,h.prototype.on=function(){this._data.on.apply(this._data,arguments)},h.prototype.off=function(){this._data.off.apply(this._data,arguments)},h.prototype.emit=function(){this._data.emit.apply(this._data,arguments)},h.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey=a,this):this._primaryKey},d.synthesize(h.prototype,"state"),d.synthesize(h.prototype,"db"),d.synthesize(h.prototype,"name"),h.prototype.addCollection=function(a){if(a&&-1===this._collections.indexOf(a)){if(this._collections.length){if(this._primaryKey!==a.primaryKey())throw this.logIdentifier()+" All collections in a collection group must have the same primary key!"}else this.primaryKey(a.primaryKey());this._collections.push(a),a._groups=a._groups||[],a._groups.push(this),a.chain(this),a.on("drop",function(){if(a._groups&&a._groups.length){var b,c=[];for(b=0;b<a._groups.length;b++)c.push(a._groups[b]);for(b=0;b<c.length;b++)a._groups[b].removeCollection(a)}delete a._groups}),this._data.insert(a.find())}return this},h.prototype.removeCollection=function(a){if(a){var b,c=this._collections.indexOf(a);-1!==c&&(a.unChain(this),this._collections.splice(c,1),a._groups=a._groups||[],b=a._groups.indexOf(this),-1!==b&&a._groups.splice(b,1),a.off("drop")),0===this._collections.length&&delete this._primaryKey}return this},h.prototype._chainHandler=function(a){switch(a.type){case"setData":a.data.dataSet=this.decouple(a.data.dataSet),this._data.remove(a.data.oldData),this._data.insert(a.data.dataSet);break;case"insert":a.data.dataSet=this.decouple(a.data.dataSet),this._data.insert(a.data.dataSet);break;case"update":this._data.update(a.data.query,a.data.update,a.options);break;case"remove":this._data.remove(a.data.query,a.options)}},h.prototype.insert=function(){this._collectionsRun("insert",arguments)},h.prototype.update=function(){this._collectionsRun("update",arguments)},h.prototype.updateById=function(){this._collectionsRun("updateById",arguments)},h.prototype.remove=function(){this._collectionsRun("remove",arguments)},h.prototype._collectionsRun=function(a,b){for(var c=0;c<this._collections.length;c++)this._collections[c][a].apply(this._collections[c],b)},h.prototype.find=function(a,b){return this._data.find(a,b)},h.prototype.removeById=function(a){for(var b=0;b<this._collections.length;b++)this._collections[b].removeById(a)},h.prototype.subset=function(a,b){var c=this.find(a,b);return(new g).subsetOf(this).primaryKey(this._primaryKey).setData(c)},h.prototype.drop=function(a){if(!this.isDropped()){var b,c,d;if(this._debug&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this._collections&&this._collections.length)for(c=[].concat(this._collections),b=0;b<c.length;b++)this.removeCollection(c[b]);if(this._view&&this._view.length)for(d=[].concat(this._view),b=0;b<d.length;b++)this._removeView(d[b]);this.emit("drop",this),delete this._listeners,a&&a(!1,!0)}return!0},e.prototype.init=function(){this._collectionGroup={},f.apply(this,arguments)},e.prototype.collectionGroup=function(a){var b=this;return a?a instanceof h?a:this._collectionGroup&&this._collectionGroup[a]?this._collectionGroup[a]:(this._collectionGroup[a]=new h(a).db(this),b.emit("create",b._collectionGroup[a],"collectionGroup",a),this._collectionGroup[a]):this._collectionGroup},e.prototype.collectionGroups=function(){var a,b=[];for(a in this._collectionGroup)this._collectionGroup.hasOwnProperty(a)&&b.push({name:a});return b},b.exports=h},{"./Collection":6,"./Shared":31}],8:[function(a,b,c){"use strict";var d,e,f,g,h=[];d=a("./Shared"),g=a("./Overload");var i=function(a){this.init.apply(this,arguments)};i.prototype.init=function(a){this._db={},this._debug={},this._name=a||"ForerunnerDB",h.push(this)},i.prototype.instantiatedCount=function(){return h.length},i.prototype.instances=function(a){return void 0!==a?h[a]:h},i.prototype.namedInstances=function(a){var b,c;{if(void 0===a){for(c=[],b=0;b<h.length;b++)c.push(h[b].name);return c}for(b=0;b<h.length;b++)if(h[b].name===a)return h[b]}},i.prototype.moduleLoaded=new g({string:function(a){if(void 0!==a){a=a.replace(/ /g,"");var b,c=a.split(",");for(b=0;b<c.length;b++)if(!d.modules[c[b]])return!1;return!0}return!1},"string, function":function(a,b){if(void 0!==a){a=a.replace(/ /g,"");var c,e=a.split(",");for(c=0;c<e.length;c++)if(!d.modules[e[c]])return!1;b&&b()}},"array, function":function(a,b){var c,e;for(e=0;e<a.length;e++)if(c=a[e],void 0!==c){c=c.replace(/ /g,"");var f,g=c.split(",");for(f=0;f<g.length;f++)if(!d.modules[g[f]])return!1}b&&b()},"string, function, function":function(a,b,c){if(void 0!==a){a=a.replace(/ /g,"");var e,f=a.split(",");for(e=0;e<f.length;e++)if(!d.modules[f[e]])return c(),!1;b()}}}),i.prototype.version=function(a,b){return void 0!==a?0===d.version.indexOf(a)?(b&&b(),!0):!1:d.version},i.moduleLoaded=i.prototype.moduleLoaded,i.version=i.prototype.version,i.instances=i.prototype.instances,i.instantiatedCount=i.prototype.instantiatedCount,i.shared=d,i.prototype.shared=d,d.addModule("Core",i),d.mixin(i.prototype,"Mixin.Common"),d.mixin(i.prototype,"Mixin.Constants"),e=a("./Db.js"),f=a("./Metrics.js"),d.synthesize(i.prototype,"name"),d.synthesize(i.prototype,"mongoEmulation"),i.prototype._isServer=!1,i.prototype.isClient=function(){return!this._isServer},i.prototype.isServer=function(){return this._isServer},i.prototype.collection=function(){throw"ForerunnerDB's instantiation has changed since version 1.3.36 to support multiple database instances. Please see the readme.md file for the minor change you have to make to get your project back up and running, or see the issue related to this change at https://github.com/Irrelon/ForerunnerDB/issues/44"},b.exports=i},{"./Db.js":9,"./Metrics.js":15,"./Overload":27,"./Shared":31}],9:[function(a,b,c){"use strict";var d,e,f,g,h,i;d=a("./Shared"),i=a("./Overload");var j=function(a,b){this.init.apply(this,arguments)};j.prototype.init=function(a,b){this.core(b),this._primaryKey="_id",this._name=a,this._collection={},this._debug={}},d.addModule("Db",j),j.prototype.moduleLoaded=new i({string:function(a){if(void 0!==a){a=a.replace(/ /g,"");var b,c=a.split(",");for(b=0;b<c.length;b++)if(!d.modules[c[b]])return!1;return!0}return!1},"string, function":function(a,b){if(void 0!==a){a=a.replace(/ /g,"");var c,e=a.split(",");for(c=0;c<e.length;c++)if(!d.modules[e[c]])return!1;b&&b()}},"string, function, function":function(a,b,c){if(void 0!==a){a=a.replace(/ /g,"");var e,f=a.split(",");for(e=0;e<f.length;e++)if(!d.modules[f[e]])return c(),!1;b()}}}),j.prototype.version=function(a,b){return void 0!==a?0===d.version.indexOf(a)?(b&&b(),!0):!1:d.version},j.moduleLoaded=j.prototype.moduleLoaded,j.version=j.prototype.version,j.shared=d,j.prototype.shared=d,d.addModule("Db",j),d.mixin(j.prototype,"Mixin.Common"),d.mixin(j.prototype,"Mixin.ChainReactor"),d.mixin(j.prototype,"Mixin.Constants"),d.mixin(j.prototype,"Mixin.Tags"),e=d.modules.Core,f=a("./Collection.js"),g=a("./Metrics.js"),h=a("./Checksum.js"),j.prototype._isServer=!1,d.synthesize(j.prototype,"core"),d.synthesize(j.prototype,"primaryKey"),d.synthesize(j.prototype,"state"),d.synthesize(j.prototype,"name"),d.synthesize(j.prototype,"mongoEmulation"),j.prototype.isClient=function(){return!this._isServer},j.prototype.isServer=function(){return this._isServer},j.prototype.Checksum=h,j.prototype.isClient=function(){return!this._isServer},j.prototype.isServer=function(){return this._isServer},j.prototype.arrayToCollection=function(a){return(new f).setData(a)},j.prototype.on=function(a,b){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||[],this._listeners[a].push(b),this},j.prototype.off=function(a,b){if(a in this._listeners){var c=this._listeners[a],d=c.indexOf(b);d>-1&&c.splice(d,1)}return this},j.prototype.emit=function(a,b){if(this._listeners=this._listeners||{},a in this._listeners){var c,d=this._listeners[a],e=d.length;for(c=0;e>c;c++)d[c].apply(this,Array.prototype.slice.call(arguments,1))}return this},j.prototype.peek=function(a){var b,c,d=[],e=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],d="string"===e?d.concat(c.peek(a)):d.concat(c.find(a)));return d},j.prototype.peek=function(a){var b,c,d=[],e=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],d="string"===e?d.concat(c.peek(a)):d.concat(c.find(a)));return d},j.prototype.peekCat=function(a){var b,c,d,e={},f=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],"string"===f?(d=c.peek(a),d&&d.length&&(e[c.name()]=d)):(d=c.find(a),d&&d.length&&(e[c.name()]=d)));return e},j.prototype.drop=new i({"":function(){if(!this.isDropped()){var a,b=this.collections(),c=b.length;for(this._state="dropped",a=0;c>a;a++)this.collection(b[a].name).drop(),delete this._collection[b[a].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0},"function":function(a){if(!this.isDropped()){var b,c=this.collections(),d=c.length,e=0,f=function(){e++,e===d&&a&&a()};for(this._state="dropped",b=0;d>b;b++)this.collection(c[b].name).drop(f),delete this._collection[c[b].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0},"boolean":function(a){if(!this.isDropped()){var b,c=this.collections(),d=c.length;for(this._state="dropped",b=0;d>b;b++)this.collection(c[b].name).drop(a),delete this._collection[c[b].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0},"boolean, function":function(a,b){if(!this.isDropped()){var c,d=this.collections(),e=d.length,f=0,g=function(){f++,f===e&&b&&b()};for(this._state="dropped",c=0;e>c;c++)this.collection(d[c].name).drop(a,g),delete this._collection[d[c].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0}}),e.prototype.db=function(a){return a instanceof j?a:(a||(a=this.objectId()),this._db[a]=this._db[a]||new j(a,this),this._db[a].mongoEmulation(this.mongoEmulation()),this._db[a])},e.prototype.databases=function(a){var b,c,d,e=[];a&&(a instanceof RegExp||(a=new RegExp(a)));for(d in this._db)this._db.hasOwnProperty(d)&&(c=!0,a&&(a.exec(d)||(c=!1)),c&&(b={name:d,children:[]},this.shared.moduleExists("Collection")&&b.children.push({module:"collection",moduleName:"Collections",count:this._db[d].collections().length}),this.shared.moduleExists("CollectionGroup")&&b.children.push({module:"collectionGroup",moduleName:"Collection Groups",count:this._db[d].collectionGroups().length}),this.shared.moduleExists("Document")&&b.children.push({module:"document",moduleName:"Documents",count:this._db[d].documents().length}),this.shared.moduleExists("Grid")&&b.children.push({module:"grid",moduleName:"Grids",count:this._db[d].grids().length}),this.shared.moduleExists("Overview")&&b.children.push({module:"overview",moduleName:"Overviews",count:this._db[d].overviews().length}),this.shared.moduleExists("View")&&b.children.push({module:"view",moduleName:"Views",count:this._db[d].views().length}),e.push(b)));return e.sort(function(a,b){return a.name.localeCompare(b.name)}),e},d.finishModule("Db"),b.exports=j},{"./Checksum.js":5,"./Collection.js":6,"./Metrics.js":15,"./Overload":27,"./Shared":31}],10:[function(a,b,c){"use strict";var d,e,f,g;d=[16,8,4,2,1],e="0123456789bcdefghjkmnpqrstuvwxyz",f={right:{even:"bc01fg45238967deuvhjyznpkmstqrwx"},left:{even:"238967debc01fg45kmstqrwxuvhjyznp"},top:{even:"p0r21436x8zb9dcf5h7kjnmqesgutwvy"},bottom:{even:"14365h7k9dcfesgujnmqp0r2twvyx8zb"}},g={right:{even:"bcfguvyz"},left:{even:"0145hjnp"},top:{even:"prxz"},bottom:{even:"028b"}},f.bottom.odd=f.left.even,f.top.odd=f.right.even,f.left.odd=f.bottom.even,f.right.odd=f.top.even,g.bottom.odd=g.left.even,g.top.odd=g.right.even,g.left.odd=g.bottom.even,g.right.odd=g.top.even;var h=function(){};h.prototype.refineInterval=function(a,b,c){b&c?a[0]=(a[0]+a[1])/2:a[1]=(a[0]+a[1])/2},h.prototype.calculateNeighbours=function(a,b){var c;return b&&"object"!==b.type?(c=[],c[4]=a,c[3]=this.calculateAdjacent(a,"left"),c[5]=this.calculateAdjacent(a,"right"),c[1]=this.calculateAdjacent(a,"top"),c[7]=this.calculateAdjacent(a,"bottom"),c[0]=this.calculateAdjacent(c[3],"top"),c[2]=this.calculateAdjacent(c[5],"top"),c[6]=this.calculateAdjacent(c[3],"bottom"),c[8]=this.calculateAdjacent(c[5],"bottom")):(c={center:a,left:this.calculateAdjacent(a,"left"),right:this.calculateAdjacent(a,"right"),top:this.calculateAdjacent(a,"top"),bottom:this.calculateAdjacent(a,"bottom")},c.topLeft=this.calculateAdjacent(c.left,"top"),c.topRight=this.calculateAdjacent(c.right,"top"),c.bottomLeft=this.calculateAdjacent(c.left,"bottom"),c.bottomRight=this.calculateAdjacent(c.right,"bottom")),c},h.prototype.calculateAdjacent=function(a,b){a=a.toLowerCase();var c=a.charAt(a.length-1),d=a.length%2?"odd":"even",h=a.substring(0,a.length-1);return-1!==g[b][d].indexOf(c)&&(h=this.calculateAdjacent(h,b)),h+e[f[b][d].indexOf(c)]},h.prototype.decode=function(a){var b,c,f,g,h,i,j,k=1,l=[],m=[];for(l[0]=-90,l[1]=90,m[0]=-180,m[1]=180,i=90,j=180,b=0;b<a.length;b++)for(c=a[b],f=e.indexOf(c),g=0;5>g;g++)h=d[g],k?(j/=2,this.refineInterval(m,f,h)):(i/=2,this.refineInterval(l,f,h)),k=!k;return l[2]=(l[0]+l[1])/2,m[2]=(m[0]+m[1])/2,{latitude:l,longitude:m}},h.prototype.encode=function(a,b,c){var f,g=1,h=[],i=[],j=0,k=0,l="";for(c||(c=12),h[0]=-90,h[1]=90,i[0]=-180,i[1]=180;l.length<c;)g?(f=(i[0]+i[1])/2,b>f?(k|=d[j],i[0]=f):i[1]=f):(f=(h[0]+h[1])/2,a>f?(k|=d[j],h[0]=f):h[1]=f),g=!g,4>j?j++:(l+=e[k],j=0,k=0);return l},b.exports=h},{}],11:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=a("./BinaryTree"),g=a("./GeoHash"),h=new e,i=new g,j=[5e3,1250,156,39.1,4.89,1.22,.153,.0382,.00477,.00119,149e-6,372e-7],k=function(){this.init.apply(this,arguments)};k.prototype.init=function(a,b,c){this._btree=new f,this._btree.index(a),this._size=0,this._id=this._itemKeyHash(a,a),this._debug=b&&b.debug?b.debug:!1,this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&(this.collection(c),this._btree.primaryKey(c.primaryKey())),this.name(b&&b.name?b.name:this._id),this._btree.debug(this._debug)},d.addModule("Index2d",k),d.mixin(k.prototype,"Mixin.Common"),d.mixin(k.prototype,"Mixin.ChainReactor"),d.mixin(k.prototype,"Mixin.Sorting"),k.prototype.id=function(){return this._id},k.prototype.state=function(){return this._state},k.prototype.size=function(){return this._size},d.synthesize(k.prototype,"data"),d.synthesize(k.prototype,"name"),d.synthesize(k.prototype,"collection"),d.synthesize(k.prototype,"type"),d.synthesize(k.prototype,"unique"),k.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=h.parse(this._keys).length,this):this._keys},k.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._btree.clear(),this._size=0,this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},k.prototype.insert=function(a,b){var c,d=this._unique;a=this.decouple(a),d&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a);var e,f,g,j,k,l=this._btree.keys();for(k=0;k<l.length;k++)e=h.get(a,l[k].path),e instanceof Array&&(g=e[0],j=e[1],f=i.encode(g,j),h.set(a,l[k].path,f));return this._btree.insert(a)?(this._size++,!0):!1},k.prototype.remove=function(a,b){var c,d=this._unique;return d&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),this._btree.remove(a)?(this._size--,!0):!1},k.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},k.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},k.prototype.lookup=function(a,b){var c,d,e,f,g=this._btree.keys();for(f=0;f<g.length;f++)if(c=g[f].path,d=h.get(a,c),"object"==typeof d)return d.$near&&(e=[],e=e.concat(this.near(c,d.$near,b))),d.$geoWithin&&(e=[],e=e.concat(this.geoWithin(c,d.$geoWithin,b))),e;return this._btree.lookup(a,b)},k.prototype.near=function(a,b,c){var d,e,f,g,k,l,m,n,o,p,q,r=this,s=[],t=this._collection.primaryKey();if("km"===b.$distanceUnits){for(m=b.$maxDistance,q=0;q<j.length;q++)if(m>j[q]){l=q;break}0===l&&(l=1)}else if("miles"===b.$distanceUnits){for(m=1.60934*b.$maxDistance,q=0;q<j.length;q++)if(m>j[q]){l=q;break}0===l&&(l=1)}for(d=i.encode(b.$point[0],b.$point[1],l),e=i.calculateNeighbours(d,{type:"array"}),k=[],f=0,q=0;9>q;q++)g=this._btree.startsWith(a,e[q]),f+=g._visited,k=k.concat(g);if(k=this._collection._primaryIndex.lookup(k),k.length){for(n={},q=0;q<k.length;q++)p=h.get(k[q],a),o=n[k[q][t]]=this.distanceBetweenPoints(b.$point[0],b.$point[1],p[0],p[1]),m>=o&&s.push(k[q]);s.sort(function(a,b){return r.sortAsc(n[a[t]],n[b[t]])})}return s},k.prototype.geoWithin=function(a,b,c){return[]},k.prototype.distanceBetweenPoints=function(a,b,c,d){var e=6371,f=this.toRadians(a),g=this.toRadians(c),h=this.toRadians(c-a),i=this.toRadians(d-b),j=Math.sin(h/2)*Math.sin(h/2)+Math.cos(f)*Math.cos(g)*Math.sin(i/2)*Math.sin(i/2),k=2*Math.atan2(Math.sqrt(j),Math.sqrt(1-j));return e*k},k.prototype.toRadians=function(a){return.01747722222222*a},k.prototype.match=function(a,b){return this._btree.match(a,b)},k.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},k.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},k.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.index["2d"]=k,d.finishModule("Index2d"),b.exports=k},{"./BinaryTree":4,"./GeoHash":10,"./Path":28,"./Shared":31}],12:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=a("./BinaryTree"),g=function(){this.init.apply(this,arguments)};g.prototype.init=function(a,b,c){this._btree=new f,this._btree.index(a),this._size=0,this._id=this._itemKeyHash(a,a),this._debug=b&&b.debug?b.debug:!1,this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&(this.collection(c),this._btree.primaryKey(c.primaryKey())),this.name(b&&b.name?b.name:this._id),this._btree.debug(this._debug)},d.addModule("IndexBinaryTree",g),d.mixin(g.prototype,"Mixin.ChainReactor"),d.mixin(g.prototype,"Mixin.Sorting"),g.prototype.id=function(){return this._id},g.prototype.state=function(){return this._state},g.prototype.size=function(){return this._size},d.synthesize(g.prototype,"data"),d.synthesize(g.prototype,"name"),d.synthesize(g.prototype,"collection"),d.synthesize(g.prototype,"type"),d.synthesize(g.prototype,"unique"),g.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=(new e).parse(this._keys).length,this):this._keys},g.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._btree.clear(),this._size=0,this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},g.prototype.insert=function(a,b){var c,d=this._unique;return d&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a),this._btree.insert(a)?(this._size++,!0):!1},g.prototype.remove=function(a,b){var c,d=this._unique;return d&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),this._btree.remove(a)?(this._size--,!0):!1},g.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},g.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},g.prototype.lookup=function(a,b){return this._btree.lookup(a,b)},g.prototype.match=function(a,b){return this._btree.match(a,b)},g.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},g.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},g.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.index.btree=g,d.finishModule("IndexBinaryTree"),b.exports=g},{"./BinaryTree":4,"./Path":28,"./Shared":31}],13:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(a,b,c){this._crossRef={},this._size=0,this._id=this._itemKeyHash(a,a),this.data({}),this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&this.collection(c),this.name(b&&b.name?b.name:this._id)},d.addModule("IndexHashMap",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.id=function(){return this._id},f.prototype.state=function(){return this._state},f.prototype.size=function(){return this._size},d.synthesize(f.prototype,"data"),d.synthesize(f.prototype,"name"),d.synthesize(f.prototype,"collection"),d.synthesize(f.prototype,"type"),d.synthesize(f.prototype,"unique"),f.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=(new e).parse(this._keys).length,this):this._keys},f.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._data={},this._size=0,this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},f.prototype.insert=function(a,b){var c,d,e,f=this._unique;for(f&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a),d=this._itemHashArr(a,this._keys),e=0;e<d.length;e++)this.pushToPathValue(d[e],a)},f.prototype.update=function(a,b){},f.prototype.remove=function(a,b){var c,d,e,f=this._unique;for(f&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),d=this._itemHashArr(a,this._keys),e=0;e<d.length;e++)this.pullFromPathValue(d[e],a)},f.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},f.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},f.prototype.pushToPathValue=function(a,b){var c=this._data[a]=this._data[a]||[];-1===c.indexOf(b)&&(c.push(b),this._size++,this.pushToCrossRef(b,c))},f.prototype.pullFromPathValue=function(a,b){var c,d=this._data[a];c=d.indexOf(b),c>-1&&(d.splice(c,1),this._size--,this.pullFromCrossRef(b,d)),d.length||delete this._data[a]},f.prototype.pull=function(a){var b,c,d=a[this._collection.primaryKey()],e=this._crossRef[d],f=e.length;
for(b=0;f>b;b++)c=e[b],this._pullFromArray(c,a);this._size--,delete this._crossRef[d]},f.prototype._pullFromArray=function(a,b){for(var c=a.length;c--;)a[c]===b&&a.splice(c,1)},f.prototype.pushToCrossRef=function(a,b){var c,d=a[this._collection.primaryKey()];this._crossRef[d]=this._crossRef[d]||[],c=this._crossRef[d],-1===c.indexOf(b)&&c.push(b)},f.prototype.pullFromCrossRef=function(a,b){var c=a[this._collection.primaryKey()];delete this._crossRef[c]},f.prototype.lookup=function(a){return this._data[this._itemHash(a,this._keys)]||[]},f.prototype.match=function(a,b){var c,d=new e,f=d.parseArr(this._keys),g=d.parseArr(a),h=[],i=0;for(c=0;c<f.length;c++){if(g[c]!==f[c])return{matchedKeys:[],totalKeyCount:g.length,score:0};i++,h.push(g[c])}return{matchedKeys:h,totalKeyCount:g.length,score:i}},f.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},f.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},f.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.index.hashed=f,d.finishModule("IndexHashMap"),b.exports=f},{"./Path":28,"./Shared":31}],14:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a){this.init.apply(this,arguments)};e.prototype.init=function(a){this._name=a,this._data={},this._primaryKey="_id"},d.addModule("KeyValueStore",e),d.mixin(e.prototype,"Mixin.ChainReactor"),d.synthesize(e.prototype,"name"),e.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey=a,this):this._primaryKey},e.prototype.truncate=function(){return this._data={},this},e.prototype.set=function(a,b){return this._data[a]=b?b:!0,this},e.prototype.get=function(a){return this._data[a]},e.prototype.lookup=function(a){var b,c,d,e=this._primaryKey,f=typeof a,g=[];if("string"===f||"number"===f)return d=this.get(a),void 0!==d?[d]:[];if("object"===f){if(a instanceof Array){for(c=a.length,g=[],b=0;c>b;b++)d=this.lookup(a[b]),d&&(d instanceof Array?g=g.concat(d):g.push(d));return g}if(a[e])return this.lookup(a[e])}},e.prototype.unSet=function(a){return delete this._data[a],this},e.prototype.uniqueSet=function(a,b){return void 0===this._data[a]?(this._data[a]=b,!0):!1},d.finishModule("KeyValueStore"),b.exports=e},{"./Shared":31}],15:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Operation"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(){this._data=[]},d.addModule("Metrics",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.create=function(a){var b=new e(a);return this._enabled&&this._data.push(b),b},f.prototype.start=function(){return this._enabled=!0,this},f.prototype.stop=function(){return this._enabled=!1,this},f.prototype.clear=function(){return this._data=[],this},f.prototype.list=function(){return this._data},d.finishModule("Metrics"),b.exports=f},{"./Operation":26,"./Shared":31}],16:[function(a,b,c){"use strict";var d={preSetData:function(){},postSetData:function(){}};b.exports=d},{}],17:[function(a,b,c){"use strict";var d={chain:function(a){this.debug&&this.debug()&&(a._reactorIn&&a._reactorOut?console.log(a._reactorIn.logIdentifier()+' Adding target "'+a._reactorOut.instanceIdentifier()+'" to the chain reactor target list'):console.log(this.logIdentifier()+' Adding target "'+a.instanceIdentifier()+'" to the chain reactor target list')),this._chain=this._chain||[];var b=this._chain.indexOf(a);-1===b&&this._chain.push(a)},unChain:function(a){if(this.debug&&this.debug()&&(a._reactorIn&&a._reactorOut?console.log(a._reactorIn.logIdentifier()+' Removing target "'+a._reactorOut.instanceIdentifier()+'" from the chain reactor target list'):console.log(this.logIdentifier()+' Removing target "'+a.instanceIdentifier()+'" from the chain reactor target list')),this._chain){var b=this._chain.indexOf(a);b>-1&&this._chain.splice(b,1)}},chainWillSend:function(){return Boolean(this._chain)},chainSend:function(a,b,c){if(this._chain){var d,e,f=this._chain,g=f.length,h=this.decouple(b,g);for(e=0;g>e;e++){if(d=f[e],d._state&&(!d._state||d.isDropped()))throw console.log("Reactor Data:",a,b,c),console.log("Reactor Node:",d),"Chain reactor attempting to send data to target reactor node that is in a dropped state!";this.debug&&this.debug()&&(d._reactorIn&&d._reactorOut?console.log(d._reactorIn.logIdentifier()+' Sending data down the chain reactor pipe to "'+d._reactorOut.instanceIdentifier()+'"'):console.log(this.logIdentifier()+' Sending data down the chain reactor pipe to "'+d.instanceIdentifier()+'"')),d.chainReceive&&d.chainReceive(this,a,h[e],c)}}},chainReceive:function(a,b,c,d){var e={sender:a,type:b,data:c,options:d},f=!1;this.debug&&this.debug()&&console.log(this.logIdentifier()+" Received data from parent reactor node"),this._chainHandler&&(f=this._chainHandler(e)),f||this.chainSend(e.type,e.data,e.options)}};b.exports=d},{}],18:[function(a,b,c){"use strict";var d,e=0,f=a("./Overload"),g=a("./Serialiser"),h=new g;d={serialiser:h,make:function(a){return h.convert(a)},store:function(a,b){if(void 0!==a){if(void 0!==b)return this._store=this._store||{},this._store[a]=b,this;if(this._store)return this._store[a]}},unStore:function(a){return void 0!==a&&delete this._store[a],this},decouple:function(a,b){if(void 0!==a&&""!==a){if(b){var c,d=this.jStringify(a),e=[];for(c=0;b>c;c++)e.push(this.jParse(d));return e}return this.jParse(this.jStringify(a))}},jParse:function(a){return JSON.parse(a,h.reviver())},jStringify:function(a){return JSON.stringify(a)},objectId:function(a){var b,c=Math.pow(10,17);if(a){var d,f=0,g=a.length;for(d=0;g>d;d++)f+=a.charCodeAt(d)*c;b=f.toString(16)}else e++,b=(e+(Math.random()*c+Math.random()*c+Math.random()*c+Math.random()*c)).toString(16);return b},hash:function(a){return JSON.stringify(a)},debug:new f([function(){return this._debug&&this._debug.all},function(a){return void 0!==a?"boolean"==typeof a?(this._debug=this._debug||{},this._debug.all=a,this.chainSend("debug",this._debug),this):this._debug&&this._debug[a]||this._db&&this._db._debug&&this._db._debug[a]||this._debug&&this._debug.all:this._debug&&this._debug.all},function(a,b){return void 0!==a?void 0!==b?(this._debug=this._debug||{},this._debug[a]=b,this.chainSend("debug",this._debug),this):this._debug&&this._debug[b]||this._db&&this._db._debug&&this._db._debug[a]:this._debug&&this._debug.all}]),classIdentifier:function(){return"ForerunnerDB."+this.className},instanceIdentifier:function(){return"["+this.className+"]"+this.name()},logIdentifier:function(){return"ForerunnerDB "+this.instanceIdentifier()},convertToFdb:function(a){var b,c,d,e;for(e in a)if(a.hasOwnProperty(e)&&(d=a,e.indexOf(".")>-1)){for(e=e.replace(".$","[|$|]"),c=e.split(".");b=c.shift();)b=b.replace("[|$|]",".$"),c.length?d[b]={}:d[b]=a[e],d=d[b];delete a[e]}},isDropped:function(){return"dropped"===this._state},debounce:function(a,b,c){var d,e=this;e._debounce=e._debounce||{},e._debounce[a]&&clearTimeout(e._debounce[a].timeout),d={callback:b,timeout:setTimeout(function(){delete e._debounce[a],b()},c)},e._debounce[a]=d}},b.exports=d},{"./Overload":27,"./Serialiser":30}],19:[function(a,b,c){"use strict";var d={TYPE_INSERT:0,TYPE_UPDATE:1,TYPE_REMOVE:2,PHASE_BEFORE:0,PHASE_AFTER:1};b.exports=d},{}],20:[function(a,b,c){"use strict";var d=a("./Overload"),e={on:new d({"string, function":function(a,b){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||{},this._listeners[a]["*"]=this._listeners[a]["*"]||[],this._listeners[a]["*"].push(b),this},"string, *, function":function(a,b,c){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||{},this._listeners[a][b]=this._listeners[a][b]||[],this._listeners[a][b].push(c),this}}),once:new d({"string, function":function(a,b){var c=this,d=function(){c.off(a,d),b.apply(c,arguments)};return this.on(a,d)},"string, *, function":function(a,b,c){var d=this,e=function(){d.off(a,b,e),c.apply(d,arguments)};return this.on(a,b,e)}}),off:new d({string:function(a){return this._listeners&&this._listeners[a]&&a in this._listeners&&delete this._listeners[a],this},"string, function":function(a,b){var c,d;return"string"==typeof b?this._listeners&&this._listeners[a]&&this._listeners[a][b]&&delete this._listeners[a][b]:this._listeners&&a in this._listeners&&(c=this._listeners[a]["*"],d=c.indexOf(b),d>-1&&c.splice(d,1)),this},"string, *, function":function(a,b,c){if(this._listeners&&a in this._listeners&&b in this.listeners[a]){var d=this._listeners[a][b],e=d.indexOf(c);e>-1&&d.splice(e,1)}},"string, *":function(a,b){this._listeners&&a in this._listeners&&b in this._listeners[a]&&delete this._listeners[a][b]}}),emit:function(a,b){if(this._listeners=this._listeners||{},a in this._listeners){var c,d,e,f,g,h,i;if(this._listeners[a]["*"])for(f=this._listeners[a]["*"],d=f.length,c=0;d>c;c++)e=f[c],"function"==typeof e&&e.apply(this,Array.prototype.slice.call(arguments,1));if(b instanceof Array&&b[0]&&b[0][this._primaryKey])for(g=this._listeners[a],d=b.length,c=0;d>c;c++)if(g[b[c][this._primaryKey]])for(h=g[b[c][this._primaryKey]].length,i=0;h>i;i++)e=g[b[c][this._primaryKey]][i],"function"==typeof e&&g[b[c][this._primaryKey]][i].apply(this,Array.prototype.slice.call(arguments,1))}return this},deferEmit:function(a,b){var c,d=this;return this._noEmitDefer||this._db&&(!this._db||this._db._noEmitDefer)?this.emit.apply(this,arguments):(c=arguments,this._deferTimeout=this._deferTimeout||{},this._deferTimeout[a]&&clearTimeout(this._deferTimeout[a]),this._deferTimeout[a]=setTimeout(function(){d.debug()&&console.log(d.logIdentifier()+" Emitting "+c[0]),d.emit.apply(d,c)},1)),this}};b.exports=e},{"./Overload":27}],21:[function(a,b,c){"use strict";var d={_match:function(a,b,c,d,e){var f,g,h,i,j,k,l=d,m=typeof a,n=typeof b,o=!0;if(e=e||{},c=c||{},e.$rootQuery||(e.$rootQuery=b),e.$rootSource||(e.$rootSource=a),e.$currentQuery=b,e.$rootData=e.$rootData||{},"string"!==m&&"number"!==m||"string"!==n&&"number"!==n){if(("string"===m||"number"===m)&&"object"===n&&b instanceof RegExp)b.test(a)||(o=!1);else for(k in b)if(b.hasOwnProperty(k)){if(e.$previousQuery=e.$parent,e.$parent={query:b[k],key:k,parent:e.$previousQuery},f=!1,j=k.substr(0,2),"//"===j)continue;if(0===j.indexOf("$")&&(i=this._matchOp(k,a,b[k],c,e),i>-1)){if(i){if("or"===d)return!0}else o=i;f=!0}if(!f&&b[k]instanceof RegExp)if(f=!0,"object"===m&&void 0!==a[k]&&b[k].test(a[k])){if("or"===d)return!0}else o=!1;if(!f)if("object"==typeof b[k])if(void 0!==a[k])if(a[k]instanceof Array&&!(b[k]instanceof Array)){for(g=!1,h=0;h<a[k].length&&!(g=this._match(a[k][h],b[k],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else if(!(a[k]instanceof Array)&&b[k]instanceof Array){for(g=!1,h=0;h<b[k].length&&!(g=this._match(a[k],b[k][h],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else if("object"==typeof a)if(g=this._match(a[k],b[k],c,l,e)){if("or"===d)return!0}else o=!1;else if(g=this._match(void 0,b[k],c,l,e)){if("or"===d)return!0}else o=!1;else if(b[k]&&void 0!==b[k].$exists)if(g=this._match(void 0,b[k],c,l,e)){if("or"===d)return!0}else o=!1;else o=!1;else if(a&&a[k]===b[k]){if("or"===d)return!0}else if(a&&a[k]&&a[k]instanceof Array&&b[k]&&"object"!=typeof b[k]){for(g=!1,h=0;h<a[k].length&&!(g=this._match(a[k][h],b[k],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else o=!1;if("and"===d&&!o)return!1}}else"number"===m?a!==b&&(o=!1):a.localeCompare(b)&&(o=!1);return o},_matchOp:function(a,b,c,d,e){switch(a){case"$gt":return b>c;case"$gte":return b>=c;case"$lt":return c>b;case"$lte":return c>=b;case"$exists":return void 0===b!==c;case"$eq":return b==c;case"$eeq":return b===c;case"$ne":return b!=c;case"$nee":return b!==c;case"$or":for(var f=0;f<c.length;f++)if(this._match(b,c[f],d,"and",e))return!0;return!1;case"$and":for(var g=0;g<c.length;g++)if(!this._match(b,c[g],d,"and",e))return!1;return!0;case"$in":if(c instanceof Array){var h,i=c,j=i.length;for(h=0;j>h;h++)if(this._match(b,i[h],d,"and",e))return!0;return!1}return"object"==typeof c?this._match(b,c,d,"and",e):(console.log(this.logIdentifier()+" Cannot use an $in operator on a non-array key: "+a,e.$rootQuery),!1);case"$nin":if(c instanceof Array){var k,l=c,m=l.length;for(k=0;m>k;k++)if(this._match(b,l[k],d,"and",e))return!1;return!0}return"object"==typeof c?this._match(b,c,d,"and",e):(console.log(this.logIdentifier()+" Cannot use a $nin operator on a non-array key: "+a,e.$rootQuery),!1);case"$distinct":e.$rootData["//distinctLookup"]=e.$rootData["//distinctLookup"]||{};for(var n in c)if(c.hasOwnProperty(n))return e.$rootData["//distinctLookup"][n]=e.$rootData["//distinctLookup"][n]||{},e.$rootData["//distinctLookup"][n][b[n]]?!1:(e.$rootData["//distinctLookup"][n][b[n]]=!0,!0);break;case"$count":var o,p,q;for(o in c)if(c.hasOwnProperty(o)&&(p=b[o],q="object"==typeof p&&p instanceof Array?p.length:0,!this._match(q,c[o],d,"and",e)))return!1;return!0;case"$find":case"$findOne":case"$findSub":var r,s,t,u,v,w,x="collection",y={};if(!c.$from)throw a+" missing $from property!";if(c.$fromType&&(x=c.$fromType,!this.db()[x]||"function"!=typeof this.db()[x]))throw a+' cannot operate against $fromType "'+x+'" because the database does not recognise this type of object!';if(r=c.$query||{},s=c.$options||{},"$findSub"===a){if(!c.$path)throw a+" missing $path property!";if(v=c.$path,t=c.$subQuery||{},u=c.$subOptions||{},!(e.$parent&&e.$parent.parent&&e.$parent.parent.key))return this._match(b,r,{},"and",e)&&(w=this._findSub([b],v,t,u)),w&&w.length>0;w=this.db()[x](c.$from).findSub(r,v,t,u)}else w=this.db()[x](c.$from)[a.substr(1)](r,s);return y[e.$parent.parent.key]=w,this._match(b,y,d,"and",e)}return-1},applyJoin:function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=this,y=[];for(a instanceof Array||(a=[a]),e=0;e<b.length;e++)for(f in b[e])if(b[e].hasOwnProperty(f))for(g=b[e][f],h=g.$sourceType||"collection",i="$"+h+"."+f,j=f,c[i]?k=c[i]:this._db[h]&&"function"==typeof this._db[h]&&(k=this._db[h](f)),l=0;l<a.length;l++){m={},n=!1,o=!1,p="";for(q in g)if(g.hasOwnProperty(q))if(r=g[q],"$"===q.substr(0,1))switch(q){case"$where":if(!r.$query&&!r.$options)throw'$join $where clause requires "$query" and / or "$options" keys to work!';r.$query&&(m=x.resolveDynamicQuery(r.$query,a[l])),r.$options&&(s=r.$options);break;case"$as":j=r;break;case"$multi":n=r;break;case"$require":o=r;break;case"$prefix":p=r}else m[q]=x.resolveDynamicQuery(r,a[l]);if(t=k.find(m,s),!o||o&&t[0])if("$root"===j){if(n!==!1)throw this.logIdentifier()+' Cannot combine [$as: "$root"] with [$multi: true] in $join clause!';u=t[0],v=a[l];for(w in u)u.hasOwnProperty(w)&&void 0===v[p+w]&&(v[p+w]=u[w])}else a[l][j]=n===!1?t[0]:t;else y.push(l)}return y},resolveDynamicQuery:function(a,b){var c,d,e,f,g,h=this;if("string"==typeof a)return f="$$."===a.substr(0,3)?this.sharedPathSolver.value(b,a.substr(3,a.length-3)):this.sharedPathSolver.value(b,a),f.length>1?{$in:f}:f[0];c={};for(g in a)if(a.hasOwnProperty(g))switch(d=typeof a[g],e=a[g],d){case"string":"$$."===e.substr(0,3)?c[g]=this.sharedPathSolver.value(b,e.substr(3,e.length-3))[0]:c[g]=e;break;case"object":c[g]=h.resolveDynamicQuery(e,b);break;default:c[g]=e}return c},spliceArrayByIndexList:function(a,b){var c;for(c=b.length-1;c>=0;c--)a.splice(b[c],1)}};b.exports=d},{}],22:[function(a,b,c){"use strict";var d={sortAsc:function(a,b){return"string"==typeof a&&"string"==typeof b?a.localeCompare(b):a>b?1:b>a?-1:0},sortDesc:function(a,b){return"string"==typeof a&&"string"==typeof b?b.localeCompare(a):a>b?-1:b>a?1:0}};b.exports=d},{}],23:[function(a,b,c){"use strict";var d,e={};d={tagAdd:function(a){var b,c=this,d=e[a]=e[a]||[];for(b=0;b<d.length;b++)if(d[b]===c)return!0;return d.push(c),c.on&&c.on("drop",function(){c.tagRemove(a)}),!0},tagRemove:function(a){var b,c=e[a];if(c)for(b=0;b<c.length;b++)if(c[b]===this)return c.splice(b,1),!0;return!1},tagLookup:function(a){return e[a]||[]},tagDrop:function(a,b){var c,d,e,f=this.tagLookup(a);if(c=function(){d--,b&&0===d&&b(!1)},f.length)for(d=f.length,e=f.length-1;e>=0;e--)f[e].drop(c);return!0}},b.exports=d},{}],24:[function(a,b,c){"use strict";var d=a("./Overload"),e={addTrigger:function(a,b,c,d){var e,f=this;return e=f._triggerIndexOf(a,b,c),-1===e?(f._trigger=f._trigger||{},f._trigger[b]=f._trigger[b]||{},f._trigger[b][c]=f._trigger[b][c]||[],f._trigger[b][c].push({id:a,method:d,enabled:!0}),!0):!1},removeTrigger:function(a,b,c){var d,e=this;return d=e._triggerIndexOf(a,b,c),d>-1&&e._trigger[b][c].splice(d,1),!1},enableTrigger:new d({string:function(a){var b,c,d,e,f,g=this,h=g._trigger,i=!1;if(h)for(f in h)if(h.hasOwnProperty(f)&&(b=h[f]))for(d in b)if(b.hasOwnProperty(d))for(c=b[d],e=0;e<c.length;e++)c[e].id===a&&(c[e].enabled=!0,i=!0);return i},number:function(a){var b,c,d,e=this,f=e._trigger[a],g=!1;if(f)for(c in f)if(f.hasOwnProperty(c))for(b=f[c],d=0;d<b.length;d++)b[d].enabled=!0,g=!0;return g},"number, number":function(a,b){var c,d,e=this,f=e._trigger[a],g=!1;if(f&&(c=f[b]))for(d=0;d<c.length;d++)c[d].enabled=!0,g=!0;return g},"string, number, number":function(a,b,c){var d=this,e=d._triggerIndexOf(a,b,c);return e>-1?(d._trigger[b][c][e].enabled=!0,!0):!1}}),disableTrigger:new d({string:function(a){var b,c,d,e,f,g=this,h=g._trigger,i=!1;if(h)for(f in h)if(h.hasOwnProperty(f)&&(b=h[f]))for(d in b)if(b.hasOwnProperty(d))for(c=b[d],e=0;e<c.length;e++)c[e].id===a&&(c[e].enabled=!1,i=!0);return i},number:function(a){var b,c,d,e=this,f=e._trigger[a],g=!1;if(f)for(c in f)if(f.hasOwnProperty(c))for(b=f[c],d=0;d<b.length;d++)b[d].enabled=!1,g=!0;return g},"number, number":function(a,b){var c,d,e=this,f=e._trigger[a],g=!1;if(f&&(c=f[b]))for(d=0;d<c.length;d++)c[d].enabled=!1,g=!0;return g},"string, number, number":function(a,b,c){var d=this,e=d._triggerIndexOf(a,b,c);return e>-1?(d._trigger[b][c][e].enabled=!1,!0):!1}}),willTrigger:function(a,b){if(this._trigger&&this._trigger[a]&&this._trigger[a][b]&&this._trigger[a][b].length){var c,d=this._trigger[a][b];for(c=0;c<d.length;c++)if(d[c].enabled)return!0}return!1},processTrigger:function(a,b,c,d,e){var f,g,h,i,j,k=this;if(k._trigger&&k._trigger[b]&&k._trigger[b][c]){for(f=k._trigger[b][c],h=f.length,g=0;h>g;g++)if(i=f[g],i.enabled){if(this.debug()){var l,m;switch(b){case this.TYPE_INSERT:l="insert";break;case this.TYPE_UPDATE:l="update";break;case this.TYPE_REMOVE:l="remove";break;default:l=""}switch(c){case this.PHASE_BEFORE:m="before";break;case this.PHASE_AFTER:m="after";break;default:m=""}}if(j=i.method.call(k,a,d,e),j===!1)return!1;if(void 0!==j&&j!==!0&&j!==!1)throw"ForerunnerDB.Mixin.Triggers: Trigger error: "+j}return!0}},_triggerIndexOf:function(a,b,c){var d,e,f,g=this;if(g._trigger&&g._trigger[b]&&g._trigger[b][c])for(d=g._trigger[b][c],e=d.length,f=0;e>f;f++)if(d[f].id===a)return f;return-1}};b.exports=e},{"./Overload":27}],25:[function(a,b,c){"use strict";var d={_updateProperty:function(a,b,c){a[b]=c,this.debug()&&console.log(this.logIdentifier()+' Setting non-data-bound document property "'+b+'" to val "'+c+'"')},_updateIncrement:function(a,b,c){a[b]+=c},_updateSpliceMove:function(a,b,c){a.splice(c,0,a.splice(b,1)[0]),this.debug()&&console.log(this.logIdentifier()+' Moving non-data-bound document array index from "'+b+'" to "'+c+'"')},_updateSplicePush:function(a,b,c){a.length>b?a.splice(b,0,c):a.push(c)},_updatePush:function(a,b){a.push(b)},_updatePull:function(a,b){a.splice(b,1)},_updateMultiply:function(a,b,c){a[b]*=c},_updateRename:function(a,b,c){a[c]=a[b],delete a[b]},_updateOverwrite:function(a,b,c){a[b]=c},_updateUnset:function(a,b){delete a[b]},_updateClear:function(a,b){var c,d=a[b];if(d&&"object"==typeof d)for(c in d)d.hasOwnProperty(c)&&this._updateUnset(d,c)},_updatePop:function(a,b){var c,d=!1;if(a.length>0)if(b>0){for(c=0;b>c;c++)a.pop();d=!0}else if(0>b){for(c=0;c>b;c--)a.shift();d=!0}return d}};b.exports=d},{}],26:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=function(a){this.pathSolver=new e,this.counter=0,this.init.apply(this,arguments)};f.prototype.init=function(a){this._data={operation:a,index:{potential:[],used:!1},steps:[],time:{startMs:0,stopMs:0,totalMs:0,process:{}},flag:{},log:[]}},d.addModule("Operation",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.start=function(){this._data.time.startMs=(new Date).getTime()},f.prototype.log=function(a){if(a){var b=this._log.length>0?this._data.log[this._data.log.length-1].time:0,c={event:a,time:(new Date).getTime(),delta:0};return this._data.log.push(c),b&&(c.delta=c.time-b),this}return this._data.log},f.prototype.time=function(a){if(void 0!==a){var b=this._data.time.process,c=b[a]=b[a]||{};return c.startMs?(c.stopMs=(new Date).getTime(),c.totalMs=c.stopMs-c.startMs,c.stepObj.totalMs=c.totalMs,delete c.stepObj):(c.startMs=(new Date).getTime(),c.stepObj={name:a},this._data.steps.push(c.stepObj)),this}return this._data.time},f.prototype.flag=function(a,b){return void 0===a||void 0===b?void 0!==a?this._data.flag[a]:this._data.flag:void(this._data.flag[a]=b)},f.prototype.data=function(a,b,c){return void 0!==b?(this.pathSolver.set(this._data,a,b),this):this.pathSolver.get(this._data,a)},f.prototype.pushData=function(a,b,c){this.pathSolver.push(this._data,a,b)},f.prototype.stop=function(){this._data.time.stopMs=(new Date).getTime(),this._data.time.totalMs=this._data.time.stopMs-this._data.time.startMs},d.finishModule("Operation"),b.exports=f},{"./Path":28,"./Shared":31}],27:[function(a,b,c){"use strict";var d=function(a,b){if(b||(b=a,a=void 0),b){var c,d,e,f,g,h,i=this;if(!(b instanceof Array)){e={};for(c in b)if(b.hasOwnProperty(c))if(f=c.replace(/ /g,""),-1===f.indexOf("*"))e[f]=b[c];else for(h=this.generateSignaturePermutations(f),g=0;g<h.length;g++)e[h[g]]||(e[h[g]]=b[c]);b=e}return function(){var e,f,g,h=[];if(b instanceof Array){for(d=b.length,c=0;d>c;c++)if(b[c].length===arguments.length)return i.callExtend(this,"$main",b,b[c],arguments)}else{for(c=0;c<arguments.length&&(f=typeof arguments[c],"object"===f&&arguments[c]instanceof Array&&(f="array"),1!==arguments.length||"undefined"!==f);c++)h.push(f);if(e=h.join(","),b[e])return i.callExtend(this,"$main",b,b[e],arguments);for(c=h.length;c>=0;c--)if(e=h.slice(0,c).join(","),b[e+",..."])return i.callExtend(this,"$main",b,b[e+",..."],arguments)}throw g=void 0!==a?a:"function"==typeof this.name?this.name():"Unknown",console.log("Overload Definition:",b),'ForerunnerDB.Overload "'+g+'": Overloaded method does not have a matching signature "'+e+'" for the passed arguments: '+this.jStringify(h)}}return function(){}};d.prototype.generateSignaturePermutations=function(a){var b,c,d=[],e=["array","string","object","number","function","undefined"];if(a.indexOf("*")>-1)for(c=0;c<e.length;c++)b=a.replace("*",e[c]),d=d.concat(this.generateSignaturePermutations(b));else d.push(a);return d},d.prototype.callExtend=function(a,b,c,d,e){var f,g;return a&&c[b]?(f=a[b],a[b]=c[b],g=d.apply(a,e),a[b]=f,g):d.apply(a,e)},b.exports=d},{}],28:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a){this.init.apply(this,arguments)};e.prototype.init=function(a){a&&this.path(a)},d.addModule("Path",e),d.mixin(e.prototype,"Mixin.Common"),d.mixin(e.prototype,"Mixin.ChainReactor"),e.prototype.path=function(a){return void 0!==a?(this._path=this.clean(a),this._pathParts=this._path.split("."),this):this._path},e.prototype.hasObjectPaths=function(a,b){var c,d=!0;for(c in a)if(a.hasOwnProperty(c)){if(void 0===b[c])return!1;if("object"==typeof a[c]&&(d=this.hasObjectPaths(a[c],b[c]),!d))return!1}return d},e.prototype.countKeys=function(a){var b,c=0;for(b in a)a.hasOwnProperty(b)&&void 0!==a[b]&&("object"!=typeof a[b]?c++:c+=this.countKeys(a[b]));return c},e.prototype.countObjectPaths=function(a,b){var c,d,e={},f=0,g=0;for(d in b)b.hasOwnProperty(d)&&("object"==typeof b[d]?(c=this.countObjectPaths(a[d],b[d]),e[d]=c.matchedKeys,g+=c.totalKeyCount,f+=c.matchedKeyCount):(g++,a&&a[d]&&"object"!=typeof a[d]?(e[d]=!0,f++):e[d]=!1));return{matchedKeys:e,matchedKeyCount:f,totalKeyCount:g}},e.prototype.parse=function(a,b){var c,d,e,f=[],g="";for(d in a)if(a.hasOwnProperty(d))if(g=d,"object"==typeof a[d])if(b)for(c=this.parse(a[d],b),e=0;e<c.length;e++)f.push({path:g+"."+c[e].path,value:c[e].value});else for(c=this.parse(a[d]),e=0;e<c.length;e++)f.push({path:g+"."+c[e].path});else b?f.push({path:g,value:a[d]}):f.push({path:g});return f},e.prototype.parseArr=function(a,b){return b=b||{},this._parseArr(a,"",[],b)},e.prototype._parseArr=function(a,b,c,d){var e,f="";b=b||"",c=c||[];for(e in a)a.hasOwnProperty(e)&&(!d.ignore||d.ignore&&!d.ignore.test(e))&&(f=b?b+"."+e:e,"object"==typeof a[e]?(d.verbose&&c.push(f),this._parseArr(a[e],f,c,d)):c.push(f));return c},e.prototype.set=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;b=this.clean(b),d=b.split("."),e=d.shift(),d.length?(a[e]=a[e]||{},this.set(a[e],d.join("."),c)):a[e]=c}return a},e.prototype.get=function(a,b){return this.value(a,b)[0]},e.prototype.value=function(a,b,c){var d,e,f,g,h,i,j,k,l;if(b&&-1===b.indexOf("."))return[a[b]];if(void 0!==a&&"object"==typeof a){if((!c||c&&!c.skipArrCheck)&&a instanceof Array){for(j=[],k=0;k<a.length;k++)j.push(this.get(a[k],b));return j}for(i=[],void 0!==b&&(b=this.clean(b),d=b.split(".")),e=d||this._pathParts,f=e.length,g=a,k=0;f>k;k++){if(g=g[e[k]],h instanceof Array){for(l=0;l<h.length;l++)i=i.concat(this.value(h,l+"."+e[k],{skipArrCheck:!0}));return i}if(!g||"object"!=typeof g)break;h=g}return[g]}return[]},e.prototype.push=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;if(b=this.clean(b),d=b.split("."),e=d.shift(),d.length)a[e]=a[e]||{},this.set(a[e],d.join("."),c);else{if(a[e]=a[e]||[],!(a[e]instanceof Array))throw"ForerunnerDB.Path: Cannot push to a path whose endpoint is not an array!";a[e].push(c)}}return a},e.prototype.keyValue=function(a,b){var c,d,e,f,g,h,i;for(void 0!==b&&(b=this.clean(b),c=b.split(".")),d=c||this._pathParts,e=d.length,f=a,i=0;e>i;i++){if(f=f[d[i]],!f||"object"!=typeof f){h=d[i]+":"+f;break}g=f}return h},e.prototype.set=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;b=this.clean(b),d=b.split("."),e=d.shift(),d.length?(a[e]=a[e]||{},this.set(a[e],d.join("."),c)):a[e]=c}return a},e.prototype.clean=function(a){return"."===a.substr(0,1)&&(a=a.substr(1,a.length-1)),a},d.finishModule("Path"),b.exports=e},{"./Shared":31}],29:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a,b,c){if(!(a&&b&&c))throw"ForerunnerDB.ReactorIO: ReactorIO requires in, out and process arguments to instantiate!";if(this._reactorIn=a,this._reactorOut=b,this._chainHandler=c,!a.chain)throw"ForerunnerDB.ReactorIO: ReactorIO requires passed in and out objects to implement the ChainReactor mixin!";a.chain(this),this.chain(b)};d.addModule("ReactorIO",e),e.prototype.drop=function(){return this.isDropped()||(this._state="dropped",this._reactorIn&&this._reactorIn.unChain(this),this._reactorOut&&this.unChain(this._reactorOut),delete this._reactorIn,delete this._reactorOut,delete this._chainHandler,this.emit("drop",this),delete this._listeners),!0},d.synthesize(e.prototype,"state"),d.mixin(e.prototype,"Mixin.Common"),d.mixin(e.prototype,"Mixin.ChainReactor"),d.mixin(e.prototype,"Mixin.Events"),d.finishModule("ReactorIO"),b.exports=e},{"./Shared":31}],30:[function(a,b,c){"use strict";var d=function(){this.init.apply(this,arguments)};d.prototype.init=function(){var a=this;this._encoder=[],this._decoder=[],this.registerHandler("$date",function(a){return a instanceof Date?(a.toJSON=function(){return"$date:"+this.toISOString()},!0):!1},function(b){return"string"==typeof b&&0===b.indexOf("$date:")?a.convert(new Date(b.substr(6))):void 0}),this.registerHandler("$regexp",function(a){return a instanceof RegExp?(a.toJSON=function(){return"$regexp:"+this.source.length+":"+this.source+":"+(this.global?"g":"")+(this.ignoreCase?"i":"")},!0):!1},function(b){if("string"==typeof b&&0===b.indexOf("$regexp:")){var c=b.substr(8),d=c.indexOf(":"),e=Number(c.substr(0,d)),f=c.substr(d+1,e),g=c.substr(d+e+2);return a.convert(new RegExp(f,g))}})},d.prototype.registerHandler=function(a,b,c){void 0!==a&&(this._encoder.push(b),this._decoder.push(c))},d.prototype.convert=function(a){var b,c=this._encoder;for(b=0;b<c.length;b++)if(c[b](a))return a;return a},d.prototype.reviver=function(){var a=this._decoder;return function(b,c){var d,e;for(e=0;e<a.length;e++)if(d=a[e](c),void 0!==d)return d;return c}},b.exports=d},{}],31:[function(a,b,c){"use strict";var d=a("./Overload"),e={version:"1.3.715",modules:{},plugins:{},index:{},_synth:{},addModule:function(a,b){this.modules[a]=b,this.emit("moduleLoad",[a,b])},finishModule:function(a){if(!this.modules[a])throw"ForerunnerDB.Shared: finishModule called on a module that has not been registered with addModule(): "+a;this.modules[a]._fdbFinished=!0,this.modules[a].prototype?this.modules[a].prototype.className=a:this.modules[a].className=a,this.emit("moduleFinished",[a,this.modules[a]])},moduleFinished:function(a,b){this.modules[a]&&this.modules[a]._fdbFinished?b&&b(a,this.modules[a]):this.on("moduleFinished",b)},moduleExists:function(a){return Boolean(this.modules[a])},mixin:new d({"object, string":function(a,b){var c;if("string"==typeof b&&(c=this.mixins[b],!c))throw"ForerunnerDB.Shared: Cannot find mixin named: "+b;return this.$main.call(this,a,c)},"object, *":function(a,b){return this.$main.call(this,a,b)},$main:function(a,b){if(b&&"object"==typeof b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}}),synthesize:function(a,b,c){if(this._synth[b]=this._synth[b]||function(a){return void 0!==a?(this["_"+b]=a,this):this["_"+b]},c){var d=this;a[b]=function(){var a,e=this.$super;return this.$super=d._synth[b],a=c.apply(this,arguments),this.$super=e,a}}else a[b]=this._synth[b]},overload:d,mixins:{"Mixin.Common":a("./Mixin.Common"),"Mixin.Events":a("./Mixin.Events"),"Mixin.ChainReactor":a("./Mixin.ChainReactor"),"Mixin.CRUD":a("./Mixin.CRUD"),"Mixin.Constants":a("./Mixin.Constants"),"Mixin.Triggers":a("./Mixin.Triggers"),"Mixin.Sorting":a("./Mixin.Sorting"),"Mixin.Matching":a("./Mixin.Matching"),"Mixin.Updating":a("./Mixin.Updating"),"Mixin.Tags":a("./Mixin.Tags")}};e.mixin(e,"Mixin.Events"),b.exports=e},{"./Mixin.CRUD":16,"./Mixin.ChainReactor":17,"./Mixin.Common":18,"./Mixin.Constants":19,"./Mixin.Events":20,"./Mixin.Matching":21,"./Mixin.Sorting":22,"./Mixin.Tags":23,"./Mixin.Triggers":24,"./Mixin.Updating":25,"./Overload":27}],32:[function(a,b,c){Array.prototype.filter||(Array.prototype.filter=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),"function"!=typeof Object.create&&(Object.create=function(){var a=function(){};return function(b){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof b)throw TypeError("Argument must be an object");a.prototype=b;var c=new a;return a.prototype=null,c}}()),Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c;if(null===this)throw new TypeError('"this" is null or not defined');var d=Object(this),e=d.length>>>0;if(0===e)return-1;var f=+b||0;if(Math.abs(f)===1/0&&(f=0),f>=e)return-1;for(c=Math.max(f>=0?f:e-Math.abs(f),0);e>c;){if(c in d&&d[c]===a)return c;c++}return-1}),b.exports={}},{}],33:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m,n=a("./Overload");d=a("./Shared");var o=function(a,b,c){this.init.apply(this,arguments)};d.addModule("View",o),d.mixin(o.prototype,"Mixin.Common"),d.mixin(o.prototype,"Mixin.Matching"),d.mixin(o.prototype,"Mixin.ChainReactor"),d.mixin(o.prototype,"Mixin.Constants"),d.mixin(o.prototype,"Mixin.Triggers"),d.mixin(o.prototype,"Mixin.Tags"),f=a("./Collection"),g=a("./CollectionGroup"),k=a("./ActiveBucket"),j=a("./ReactorIO"),h=f.prototype.init,e=d.modules.Db,i=e.prototype.init,
l=d.modules.Path,m=new l,o.prototype.init=function(a,b,c){var d=this;this.sharedPathSolver=m,this._name=a,this._listeners={},this._querySettings={},this._debug={},this.query(b,c,!1),this._collectionDroppedWrap=function(){d._collectionDropped.apply(d,arguments)},this._data=new f(this.name()+"_internal")},o.prototype._handleChainIO=function(a,b){var c,d,e,f,g=a.type;return"setData"!==g&&"insert"!==g&&"update"!==g&&"remove"!==g?!1:(c=Boolean(b._querySettings.options&&b._querySettings.options.$join),d=Boolean(b._querySettings.query),e=void 0!==b._data._transformIn,c||d||e?(f={dataArr:[],removeArr:[]},"insert"===a.type?a.data.dataSet instanceof Array?f.dataArr=a.data.dataSet:f.dataArr=[a.data.dataSet]:"update"===a.type?f.dataArr=a.data.dataSet:"remove"===a.type&&(a.data.dataSet instanceof Array?f.removeArr=a.data.dataSet:f.removeArr=[a.data.dataSet]),f.dataArr instanceof Array||(console.warn("WARNING: dataArr being processed by chain reactor in View class is inconsistent!"),f.dataArr=[]),f.removeArr instanceof Array||(console.warn("WARNING: removeArr being processed by chain reactor in View class is inconsistent!"),f.removeArr=[]),c&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_ActiveJoin"),b._handleChainIO_ActiveJoin(a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_ActiveJoin")),d&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_ActiveQuery"),b._handleChainIO_ActiveQuery(a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_ActiveQuery")),e&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_TransformIn"),b._handleChainIO_TransformIn(a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_TransformIn")),f.dataArr.length||f.removeArr.length?(f.pk=b._data.primaryKey(),f.removeArr.length&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_RemovePackets"),b._handleChainIO_RemovePackets(this,a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_RemovePackets")),f.dataArr.length&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_UpsertPackets"),b._handleChainIO_UpsertPackets(this,a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_UpsertPackets")),!0):!0):!1)},o.prototype._handleChainIO_ActiveJoin=function(a,b){var c,d=b.dataArr;c=this.applyJoin(d,this._querySettings.options.$join,{},{}),this.spliceArrayByIndexList(d,c),b.removeArr=b.removeArr.concat(c)},o.prototype._handleChainIO_ActiveQuery=function(a,b){var c,d=this,e=b.dataArr;for(c=e.length-1;c>=0;c--)d._match(e[c],d._querySettings.query,d._querySettings.options,"and",{})||(b.removeArr.push(e[c]),e.splice(c,1))},o.prototype._handleChainIO_TransformIn=function(a,b){var c,d=this,e=b.dataArr,f=b.removeArr,g=d._data._transformIn;for(c=0;c<e.length;c++)e[c]=g(e[c]);for(c=0;c<f.length;c++)f[c]=g(f[c])},o.prototype._handleChainIO_RemovePackets=function(a,b,c){var d,e,f=[],g=c.pk,h=c.removeArr,i={dataSet:h,query:{$or:f}};for(e=0;e<h.length;e++)d={},d[g]=h[e][g],f.push(d);a.chainSend("remove",i)},o.prototype._handleChainIO_UpsertPackets=function(a,b,c){var d,e,f,g=this._data,h=g._primaryIndex,i=g._primaryCrc,j=c.pk,k=c.dataArr,l=[],m=[];for(f=0;f<k.length;f++)d=k[f],h.get(d[j])?i.get(d[j])!==this.hash(d[j])&&m.push(d):l.push(d);if(l.length&&a.chainSend("insert",{dataSet:l}),m.length)for(f=0;f<m.length;f++)d=m[f],e={},e[j]=d[j],a.chainSend("update",{query:e,update:d,dataSet:[d]})},o.prototype.insert=function(){this._from.insert.apply(this._from,arguments)},o.prototype.update=function(){this._from.update.apply(this._from,arguments)},o.prototype.updateById=function(){this._from.updateById.apply(this._from,arguments)},o.prototype.remove=function(){this._from.remove.apply(this._from,arguments)},o.prototype.find=function(a,b){return this._data.find(a,b)},o.prototype.findOne=function(a,b){return this._data.findOne(a,b)},o.prototype.findById=function(a,b){return this._data.findById(a,b)},o.prototype.findSub=function(a,b,c,d){return this._data.findSub(a,b,c,d)},o.prototype.findSubOne=function(a,b,c,d){return this._data.findSubOne(a,b,c,d)},o.prototype.data=function(){return this._data},o.prototype.from=function(a,b){var c=this;if(void 0!==a){this._from&&(this._from.off("drop",this._collectionDroppedWrap),delete this._from),this._io&&(this._io.drop(),delete this._io),"string"==typeof a&&(a=this._db.collection(a)),"View"===a.className&&(a=a._data,this.debug()&&console.log(this.logIdentifier()+' Using internal data "'+a.instanceIdentifier()+'" for IO graph linking')),this._from=a,this._from.on("drop",this._collectionDroppedWrap),this._io=new j(this._from,this,function(a){return c._handleChainIO.call(this,a,c)}),this._data.primaryKey(a.primaryKey());var d=a.find(this._querySettings.query,this._querySettings.options);return this._data.setData(d,{},b),this._querySettings.options&&this._querySettings.options.$orderBy?this.rebuildActiveBucket(this._querySettings.options.$orderBy):this.rebuildActiveBucket(),this}return this._from},o.prototype._chainHandler=function(a){var b,c,d,e,f,g,h,i;switch(this.debug()&&console.log(this.logIdentifier()+" Received chain reactor data: "+a.type),a.type){case"setData":this.debug()&&console.log(this.logIdentifier()+' Setting data in underlying (internal) view collection "'+this._data.name()+'"');var j=this._from.find(this._querySettings.query,this._querySettings.options);this._data.setData(j),this.rebuildActiveBucket(this._querySettings.options);break;case"insert":if(this.debug()&&console.log(this.logIdentifier()+' Inserting some data into underlying (internal) view collection "'+this._data.name()+'"'),a.data.dataSet=this.decouple(a.data.dataSet),a.data.dataSet instanceof Array||(a.data.dataSet=[a.data.dataSet]),this._querySettings.options&&this._querySettings.options.$orderBy)for(b=a.data.dataSet,c=b.length,d=0;c>d;d++)e=this._activeBucket.insert(b[d]),this._data._insertHandle(b[d],e);else e=this._data._data.length,this._data._insertHandle(a.data.dataSet,e);break;case"update":if(this.debug()&&console.log(this.logIdentifier()+' Updating some data in underlying (internal) view collection "'+this._data.name()+'"'),g=this._data.primaryKey(),f=this._data._handleUpdate(a.data.query,a.data.update,a.data.options),this._querySettings.options&&this._querySettings.options.$orderBy)for(c=f.length,d=0;c>d;d++)h=f[d],this._activeBucket.remove(h),i=this._data._data.indexOf(h),e=this._activeBucket.insert(h),i!==e&&this._data._updateSpliceMove(this._data._data,i,e);break;case"remove":if(this.debug()&&console.log(this.logIdentifier()+' Removing some data from underlying (internal) view collection "'+this._data.name()+'"'),this._data.remove(a.data.query,a.options),this._querySettings.options&&this._querySettings.options.$orderBy)for(b=a.data.dataSet,c=b.length,d=0;c>d;d++)this._activeBucket.remove(b[d])}},o.prototype._collectionDropped=function(a){a&&delete this._from},o.prototype.ensureIndex=function(){return this._data.ensureIndex.apply(this._data,arguments)},o.prototype.on=function(){return this._data.on.apply(this._data,arguments)},o.prototype.off=function(){return this._data.off.apply(this._data,arguments)},o.prototype.emit=function(){return this._data.emit.apply(this._data,arguments)},o.prototype.deferEmit=function(){return this._data.deferEmit.apply(this._data,arguments)},o.prototype.distinct=function(a,b,c){return this._data.distinct(a,b,c)},o.prototype.primaryKey=function(){return this._data.primaryKey()},o.prototype.drop=function(a){return this.isDropped()?!1:(this._from&&(this._from.off("drop",this._collectionDroppedWrap),this._from._removeView(this)),(this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this._io&&this._io.drop(),this._data&&this._data.drop(),this._db&&this._name&&delete this._db._view[this._name],this.emit("drop",this),a&&a(!1,!0),delete this._chain,delete this._from,delete this._data,delete this._io,delete this._listeners,delete this._querySettings,delete this._db,!0)},o.prototype.queryData=function(a,b,c){return void 0!==a&&(this._querySettings.query=a,a.$findSub&&!a.$findSub.$from&&(a.$findSub.$from=this._data.name()),a.$findSubOne&&!a.$findSubOne.$from&&(a.$findSubOne.$from=this._data.name())),void 0!==b&&(this._querySettings.options=b),(void 0!==a||void 0!==b)&&(void 0===c||c===!0)&&this.refresh(),void 0!==a&&this.emit("queryChange",a),void 0!==b&&this.emit("queryOptionsChange",b),void 0!==a||void 0!==b?this:this._querySettings},o.prototype.queryAdd=function(a,b,c){this._querySettings.query=this._querySettings.query||{};var d,e=this._querySettings.query;if(void 0!==a)for(d in a)a.hasOwnProperty(d)&&(void 0===e[d]||void 0!==e[d]&&b!==!1)&&(e[d]=a[d]);(void 0===c||c===!0)&&this.refresh(),void 0!==e&&this.emit("queryChange",e)},o.prototype.queryRemove=function(a,b){var c,d=this._querySettings.query;if(d){if(void 0!==a)for(c in a)a.hasOwnProperty(c)&&delete d[c];(void 0===b||b===!0)&&this.refresh(),void 0!==d&&this.emit("queryChange",d)}},o.prototype.query=new n({"":function(){return this._querySettings.query},object:function(a){return this.$main.call(this,a,void 0,!0)},"*, boolean":function(a,b){return this.$main.call(this,a,void 0,b)},"object, object":function(a,b){return this.$main.call(this,a,b,!0)},"*, *, boolean":function(a,b,c){return this.$main.call(this,a,b,c)},$main:function(a,b,c){return void 0!==a&&(this._querySettings.query=a,a.$findSub&&!a.$findSub.$from&&(a.$findSub.$from=this._data.name()),a.$findSubOne&&!a.$findSubOne.$from&&(a.$findSubOne.$from=this._data.name())),void 0!==b&&(this._querySettings.options=b),(void 0!==a||void 0!==b)&&(void 0===c||c===!0)&&this.refresh(),void 0!==a&&this.emit("queryChange",a),void 0!==b&&this.emit("queryOptionsChange",b),void 0!==a||void 0!==b?this:this._querySettings}}),o.prototype.orderBy=function(a){if(void 0!==a){var b=this.queryOptions()||{};return b.$orderBy=a,this.queryOptions(b),this}return(this.queryOptions()||{}).$orderBy},o.prototype.page=function(a){if(void 0!==a){var b=this.queryOptions()||{};return a!==b.$page&&(b.$page=a,this.queryOptions(b)),this}return(this.queryOptions()||{}).$page},o.prototype.pageFirst=function(){return this.page(0)},o.prototype.pageLast=function(){var a=this.cursor().pages,b=void 0!==a?a:0;return this.page(b-1)},o.prototype.pageScan=function(a){if(void 0!==a){var b=this.cursor().pages,c=this.queryOptions()||{},d=void 0!==c.$page?c.$page:0;return d+=a,0>d&&(d=0),d>=b&&(d=b-1),this.page(d)}},o.prototype.queryOptions=function(a,b){return void 0!==a?(this._querySettings.options=a,void 0===a.$decouple&&(a.$decouple=!0),void 0===b||b===!0?this.refresh():this.rebuildActiveBucket(a.$orderBy),void 0!==a&&this.emit("queryOptionsChange",a),this):this._querySettings.options},o.prototype.rebuildActiveBucket=function(a){if(a){var b=this._data._data,c=b.length;this._activeBucket=new k(a),this._activeBucket.primaryKey(this._data.primaryKey());for(var d=0;c>d;d++)this._activeBucket.insert(b[d])}else delete this._activeBucket},o.prototype.refresh=function(){var a,b,c,d,e=this;if(this._from&&(this._data.remove(),a=this._from.find(this._querySettings.query,this._querySettings.options),this.cursor(a.$cursor),this._data.insert(a),this._data._data.$cursor=a.$cursor,this._data._data.$cursor=a.$cursor),this._querySettings&&this._querySettings.options&&this._querySettings.options.$join&&this._querySettings.options.$join.length){if(e.__joinChange=e.__joinChange||function(){e._joinChange()},this._joinCollections&&this._joinCollections.length)for(c=0;c<this._joinCollections.length;c++)this._db.collection(this._joinCollections[c]).off("immediateChange",e.__joinChange);for(b=this._querySettings.options.$join,this._joinCollections=[],c=0;c<b.length;c++)for(d in b[c])b[c].hasOwnProperty(d)&&this._joinCollections.push(d);if(this._joinCollections.length)for(c=0;c<this._joinCollections.length;c++)this._db.collection(this._joinCollections[c]).on("immediateChange",e.__joinChange)}return this._querySettings.options&&this._querySettings.options.$orderBy?this.rebuildActiveBucket(this._querySettings.options.$orderBy):this.rebuildActiveBucket(),this},o.prototype._joinChange=function(a,b){this.emit("joinChange"),this.refresh()},o.prototype.count=function(){return this._data.count.apply(this._data,arguments)},o.prototype.subset=function(){return this._data.subset.apply(this._data,arguments)},o.prototype.transform=function(a){var b,c;return b=this._data.transform(),this._data.transform(a),c=this._data.transform(),c.enabled&&c.dataIn&&(b.enabled!==c.enabled||b.dataIn!==c.dataIn)&&this.refresh(),c},o.prototype.filter=function(a,b,c){return this._data.filter(a,b,c)},o.prototype.data=function(){return this._data},o.prototype.indexOf=function(){return this._data.indexOf.apply(this._data,arguments)},d.synthesize(o.prototype,"db",function(a){return a&&(this._data.db(a),this.debug(a.debug()),this._data.debug(a.debug())),this.$super.apply(this,arguments)}),d.synthesize(o.prototype,"state"),d.synthesize(o.prototype,"name"),d.synthesize(o.prototype,"cursor",function(a){return void 0===a?this._cursor||{}:void this.$super.apply(this,arguments)}),f.prototype.init=function(){this._view=[],h.apply(this,arguments)},f.prototype.view=function(a,b,c){if(this._db&&this._db._view){if(this._db._view[a])throw this.logIdentifier()+" Cannot create a view using this collection because a view with this name already exists: "+a;var d=new o(a,b,c).db(this._db).from(this);return this._view=this._view||[],this._view.push(d),d}},f.prototype._addView=g.prototype._addView=function(a){return void 0!==a&&this._view.push(a),this},f.prototype._removeView=g.prototype._removeView=function(a){if(void 0!==a){var b=this._view.indexOf(a);b>-1&&this._view.splice(b,1)}return this},e.prototype.init=function(){this._view={},i.apply(this,arguments)},e.prototype.view=function(a){var b=this;return a instanceof o?a:this._view[a]?this._view[a]:((this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Creating view "+a),this._view[a]=new o(a).db(this),b.emit("create",b._view[a],"view",a),this._view[a])},e.prototype.viewExists=function(a){return Boolean(this._view[a])},e.prototype.views=function(){var a,b,c=[];for(b in this._view)this._view.hasOwnProperty(b)&&(a=this._view[b],c.push({name:b,count:a.count(),linked:void 0!==a.isLinked?a.isLinked():!1}));return c},d.finishModule("View"),b.exports=o},{"./ActiveBucket":3,"./Collection":6,"./CollectionGroup":7,"./Overload":27,"./ReactorIO":29,"./Shared":31}]},{},[1]); |
app/javascript/components/collections/CollectionCardBody.js | nulib/avalon | /*
* Copyright 2011-2020, The Trustees of Indiana University and Northwestern
* University. Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* --- END LICENSE_HEADER BLOCK ---
*/
import React from 'react';
const CollectionCardBody = ({ children }) => (
<div className="panel-body">
<div className="collection-card-description">{children}</div>
</div>
);
export default CollectionCardBody;
|
webpack.config.js | tareq-rar/reduxReact | module.exports = {
entry: [
'./src/index.js'
],
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [{
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-1']
}
}]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
historyApiFallback: true,
contentBase: './'
}
};
|
src/svg-icons/editor/border-left.js | ichiohta/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let EditorBorderLeft = (props) => (
<SvgIcon {...props}>
<path d="M11 21h2v-2h-2v2zm0-4h2v-2h-2v2zm0-12h2V3h-2v2zm0 4h2V7h-2v2zm0 4h2v-2h-2v2zm-4 8h2v-2H7v2zM7 5h2V3H7v2zm0 8h2v-2H7v2zm-4 8h2V3H3v18zM19 9h2V7h-2v2zm-4 12h2v-2h-2v2zm4-4h2v-2h-2v2zm0-14v2h2V3h-2zm0 10h2v-2h-2v2zm0 8h2v-2h-2v2zm-4-8h2v-2h-2v2zm0-8h2V3h-2v2z"/>
</SvgIcon>
);
EditorBorderLeft = pure(EditorBorderLeft);
EditorBorderLeft.displayName = 'EditorBorderLeft';
EditorBorderLeft.muiName = 'SvgIcon';
export default EditorBorderLeft;
|
src/components/Pill/Pill.js | propertybase/react-lds | import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { IconButton } from '../Button';
const Pill = (props) => {
const {
bare,
className,
icon,
label,
onClose,
portrait,
preventCloseFocus,
title,
url,
...rest
} = props;
const isLinked = !!url;
const LabelElement = isLinked ? 'a' : 'span';
const sldsClasses = [
'slds-pill',
{ 'slds-pill_bare': bare },
className
];
const closeButton = onClose === null ? null : (
<IconButton
onClick={onClose}
className="slds-pill__remove"
sprite="utility"
icon="close"
tabIndex={preventCloseFocus ? '-1' : null}
title="Remove"
/>
);
return (
<span {...rest} className={cx(sldsClasses)}>
{icon && <span className="slds-pill__icon_container">{icon}</span>}
{portrait && <span className="slds-pill__icon_container">{portrait}</span>}
<LabelElement href={isLinked ? url : null} className="slds-pill__label" title={title}>
{label}
</LabelElement>
{closeButton}
</span>
);
};
Pill.defaultProps = {
className: null,
icon: null,
onClose: null,
portrait: null,
preventCloseFocus: false,
url: null,
bare: false,
};
Pill.propTypes = {
/**
* class name
*/
className: PropTypes.string,
/**
* optional Icon that receives '.pill__icon_container' class
*/
icon: PropTypes.node,
/**
* content of the pill label
*/
label: PropTypes.node.isRequired,
/**
* onClose handler for the pill, if left out, Pill doesn't have close button
*/
onClose: PropTypes.func,
/**
* optional image that receives '.pill__icon' class
*/
portrait: PropTypes.node,
/**
* If set to true, the close icon will not be focusable with the keyboard
*/
preventCloseFocus: PropTypes.bool,
/**
* title of the pill label
*/
title: PropTypes.string.isRequired,
/**
* optional url for the link label
*/
url: PropTypes.string,
/**
* bare flavor
*/
bare: PropTypes.bool,
};
export default Pill;
|
www/js/jquery.js | rlerdorf/WePloy | /*!
* jQuery JavaScript Library v1.4.2
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Sat Feb 13 22:33:48 2010 -0500
*/
(function( window, undefined ) {
// Define a local copy of jQuery
var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context );
},
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// Use the correct document accordingly with window argument (sandbox)
document = window.document,
// A central reference to the root jQuery(document)
rootjQuery,
// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
// Is it a simple selector
isSimple = /^.[^:#\[\.,]*$/,
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,
// Used for trimming whitespace
rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
// Keep a UserAgent string for use with jQuery.browser
userAgent = navigator.userAgent,
// For matching the engine and version of the browser
browserMatch,
// Has the ready events already been bound?
readyBound = false,
// The functions to execute on DOM ready
readyList = [],
// The ready event handler
DOMContentLoaded,
// Save a reference to some core methods
toString = Object.prototype.toString,
hasOwnProperty = Object.prototype.hasOwnProperty,
push = Array.prototype.push,
slice = Array.prototype.slice,
indexOf = Array.prototype.indexOf;
jQuery.fn = jQuery.prototype = {
init: function( selector, context ) {
var match, elem, ret, doc;
// Handle $(""), $(null), or $(undefined)
if ( !selector ) {
return this;
}
// Handle $(DOMElement)
if ( selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;
}
// The body element only exists once, optimize finding it
if ( selector === "body" && !context ) {
this.context = document;
this[0] = document.body;
this.selector = "body";
this.length = 1;
return this;
}
// Handle HTML strings
if ( typeof selector === "string" ) {
// Are we dealing with HTML string or an ID?
match = quickExpr.exec( selector );
// Verify a match, and that no context was specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
doc = (context ? context.ownerDocument || context : document);
// If a single string is passed in and it's a single tag
// just do a createElement and skip the rest
ret = rsingleTag.exec( selector );
if ( ret ) {
if ( jQuery.isPlainObject( context ) ) {
selector = [ document.createElement( ret[1] ) ];
jQuery.fn.attr.call( selector, context, true );
} else {
selector = [ doc.createElement( ret[1] ) ];
}
} else {
ret = buildFragment( [ match[1] ], [ doc ] );
selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
}
return jQuery.merge( this, selector );
// HANDLE: $("#id")
} else {
elem = document.getElementById( match[2] );
if ( elem ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
}
// Otherwise, we inject the element directly into the jQuery object
this.length = 1;
this[0] = elem;
}
this.context = document;
this.selector = selector;
return this;
}
// HANDLE: $("TAG")
} else if ( !context && /^\w+$/.test( selector ) ) {
this.selector = selector;
this.context = document;
selector = document.getElementsByTagName( selector );
return jQuery.merge( this, selector );
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return (context || rootjQuery).find( selector );
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
} else {
return jQuery( context ).find( selector );
}
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
if (selector.selector !== undefined) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The current version of jQuery being used
jquery: "1.4.2",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.length;
},
toArray: function() {
return slice.call( this, 0 );
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
return num == null ?
// Return a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems, name, selector ) {
// Build a new jQuery matched element set
var ret = jQuery();
if ( jQuery.isArray( elems ) ) {
push.apply( ret, elems );
} else {
jQuery.merge( ret, elems );
}
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context = this.context;
if ( name === "find" ) {
ret.selector = this.selector + (this.selector ? " " : "") + selector;
} else if ( name ) {
ret.selector = this.selector + "." + name + "(" + selector + ")";
}
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
return jQuery.each( this, callback, args );
},
ready: function( fn ) {
// Attach the listeners
jQuery.bindReady();
// If the DOM is already ready
if ( jQuery.isReady ) {
// Execute the function immediately
fn.call( document, jQuery );
// Otherwise, remember the function for later
} else if ( readyList ) {
// Add the function to the wait list
readyList.push( fn );
}
return this;
},
eq: function( i ) {
return i === -1 ?
this.slice( i ) :
this.slice( i, +i + 1 );
},
first: function() {
return this.eq( 0 );
},
last: function() {
return this.eq( -1 );
},
slice: function() {
return this.pushStack( slice.apply( this, arguments ),
"slice", slice.call(arguments).join(",") );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
return this.prevObject || jQuery(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
// copy reference to target object
var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
target = {};
}
// extend jQuery itself if only one argument is passed
if ( length === i ) {
target = this;
--i;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging object literal values or arrays
if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
: jQuery.isArray(copy) ? [] : {};
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend({
noConflict: function( deep ) {
window.$ = _$;
if ( deep ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// Handle when the DOM is ready
ready: function() {
// Make sure that the DOM is not already loaded
if ( !jQuery.isReady ) {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready, 13 );
}
// Remember that the DOM is ready
jQuery.isReady = true;
// If there are functions bound, to execute
if ( readyList ) {
// Execute all of them
var fn, i = 0;
while ( (fn = readyList[ i++ ]) ) {
fn.call( document, jQuery );
}
// Reset the list of functions
readyList = null;
}
// Trigger any bound ready events
if ( jQuery.fn.triggerHandler ) {
jQuery( document ).triggerHandler( "ready" );
}
}
},
bindReady: function() {
if ( readyBound ) {
return;
}
readyBound = true;
// Catch cases where $(document).ready() is called after the
// browser event has already occurred.
if ( document.readyState === "complete" ) {
return jQuery.ready();
}
// Mozilla, Opera and webkit nightlies currently support this event
if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", jQuery.ready, false );
// If IE event model is used
} else if ( document.attachEvent ) {
// ensure firing before onload,
// maybe late but safe also for iframes
document.attachEvent("onreadystatechange", DOMContentLoaded);
// A fallback to window.onload, that will always work
window.attachEvent( "onload", jQuery.ready );
// If IE and not a frame
// continually check to see if the document is ready
var toplevel = false;
try {
toplevel = window.frameElement == null;
} catch(e) {}
if ( document.documentElement.doScroll && toplevel ) {
doScrollCheck();
}
}
},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
return toString.call(obj) === "[object Function]";
},
isArray: function( obj ) {
return toString.call(obj) === "[object Array]";
},
isPlainObject: function( obj ) {
// Must be an Object.
// Because of IE, we also have to check the presence of the constructor property.
// Make sure that DOM nodes and window objects don't pass through, as well
if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
return false;
}
// Not own constructor property must be Object
if ( obj.constructor
&& !hasOwnProperty.call(obj, "constructor")
&& !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || hasOwnProperty.call( obj, key );
},
isEmptyObject: function( obj ) {
for ( var name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw msg;
},
parseJSON: function( data ) {
if ( typeof data !== "string" || !data ) {
return null;
}
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
.replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) {
// Try to use the native JSON parser first
return window.JSON && window.JSON.parse ?
window.JSON.parse( data ) :
(new Function("return " + data))();
} else {
jQuery.error( "Invalid JSON: " + data );
}
},
noop: function() {},
// Evalulates a script in a global context
globalEval: function( data ) {
if ( data && rnotwhite.test(data) ) {
// Inspired by code by Andrea Giammarchi
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
var head = document.getElementsByTagName("head")[0] || document.documentElement,
script = document.createElement("script");
script.type = "text/javascript";
if ( jQuery.support.scriptEval ) {
script.appendChild( document.createTextNode( data ) );
} else {
script.text = data;
}
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
// This arises when a base node is used (#2709).
head.insertBefore( script, head.firstChild );
head.removeChild( script );
}
},
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
},
// args is for internal usage only
each: function( object, callback, args ) {
var name, i = 0,
length = object.length,
isObj = length === undefined || jQuery.isFunction(object);
if ( args ) {
if ( isObj ) {
for ( name in object ) {
if ( callback.apply( object[ name ], args ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
if ( callback.apply( object[ i++ ], args ) === false ) {
break;
}
}
}
// A special, fast, case for the most common use of each
} else {
if ( isObj ) {
for ( name in object ) {
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
break;
}
}
} else {
for ( var value = object[0];
i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
}
}
return object;
},
trim: function( text ) {
return (text || "").replace( rtrim, "" );
},
// results is for internal usage only
makeArray: function( array, results ) {
var ret = results || [];
if ( array != null ) {
// The window, strings (and functions) also have 'length'
// The extra typeof function check is to prevent crashes
// in Safari 2 (See: #3039)
if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
push.call( ret, array );
} else {
jQuery.merge( ret, array );
}
}
return ret;
},
inArray: function( elem, array ) {
if ( array.indexOf ) {
return array.indexOf( elem );
}
for ( var i = 0, length = array.length; i < length; i++ ) {
if ( array[ i ] === elem ) {
return i;
}
}
return -1;
},
merge: function( first, second ) {
var i = first.length, j = 0;
if ( typeof second.length === "number" ) {
for ( var l = second.length; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var ret = [];
// Go through the array, only saving the items
// that pass the validator function
for ( var i = 0, length = elems.length; i < length; i++ ) {
if ( !inv !== !callback( elems[ i ], i ) ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
var ret = [], value;
// Go through the array, translating each of the items to their
// new value (or values).
for ( var i = 0, length = elems.length; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
return ret.concat.apply( [], ret );
},
// A global GUID counter for objects
guid: 1,
proxy: function( fn, proxy, thisObject ) {
if ( arguments.length === 2 ) {
if ( typeof proxy === "string" ) {
thisObject = fn;
fn = thisObject[ proxy ];
proxy = undefined;
} else if ( proxy && !jQuery.isFunction( proxy ) ) {
thisObject = proxy;
proxy = undefined;
}
}
if ( !proxy && fn ) {
proxy = function() {
return fn.apply( thisObject || this, arguments );
};
}
// Set the guid of unique handler to the same of original handler, so it can be removed
if ( fn ) {
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
}
// So proxy can be declared as an argument
return proxy;
},
// Use of jQuery.browser is frowned upon.
// More details: http://docs.jquery.com/Utilities/jQuery.browser
uaMatch: function( ua ) {
ua = ua.toLowerCase();
var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
/(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
/(msie) ([\w.]+)/.exec( ua ) ||
!/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
[];
return { browser: match[1] || "", version: match[2] || "0" };
},
browser: {}
});
browserMatch = jQuery.uaMatch( userAgent );
if ( browserMatch.browser ) {
jQuery.browser[ browserMatch.browser ] = true;
jQuery.browser.version = browserMatch.version;
}
// Deprecated, use jQuery.browser.webkit instead
if ( jQuery.browser.webkit ) {
jQuery.browser.safari = true;
}
if ( indexOf ) {
jQuery.inArray = function( elem, array ) {
return indexOf.call( array, elem );
};
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// Cleanup functions for the document ready method
if ( document.addEventListener ) {
DOMContentLoaded = function() {
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
jQuery.ready();
};
} else if ( document.attachEvent ) {
DOMContentLoaded = function() {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( document.readyState === "complete" ) {
document.detachEvent( "onreadystatechange", DOMContentLoaded );
jQuery.ready();
}
};
}
// The DOM ready check for Internet Explorer
function doScrollCheck() {
if ( jQuery.isReady ) {
return;
}
try {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch( error ) {
setTimeout( doScrollCheck, 1 );
return;
}
// and execute any waiting functions
jQuery.ready();
}
function evalScript( i, elem ) {
if ( elem.src ) {
jQuery.ajax({
url: elem.src,
async: false,
dataType: "script"
});
} else {
jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
}
if ( elem.parentNode ) {
elem.parentNode.removeChild( elem );
}
}
// Mutifunctional method to get and set values to a collection
// The value/s can be optionally by executed if its a function
function access( elems, key, value, exec, fn, pass ) {
var length = elems.length;
// Setting many attributes
if ( typeof key === "object" ) {
for ( var k in key ) {
access( elems, k, key[k], exec, fn, value );
}
return elems;
}
// Setting one attribute
if ( value !== undefined ) {
// Optionally, function values get executed if exec is true
exec = !pass && exec && jQuery.isFunction(value);
for ( var i = 0; i < length; i++ ) {
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
}
return elems;
}
// Getting an attribute
return length ? fn( elems[0], key ) : undefined;
}
function now() {
return (new Date).getTime();
}
(function() {
jQuery.support = {};
var root = document.documentElement,
script = document.createElement("script"),
div = document.createElement("div"),
id = "script" + now();
div.style.display = "none";
div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var all = div.getElementsByTagName("*"),
a = div.getElementsByTagName("a")[0];
// Can't get basic test support
if ( !all || !all.length || !a ) {
return;
}
jQuery.support = {
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: div.firstChild.nodeType === 3,
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName("tbody").length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName("link").length,
// Get the style information from getAttribute
// (IE uses .cssText insted)
style: /red/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: a.getAttribute("href") === "/a",
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.55$/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Make sure that if no value is specified for a checkbox
// that it defaults to "on".
// (WebKit defaults to "" instead)
checkOn: div.getElementsByTagName("input")[0].value === "on",
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null,
// Will be defined later
deleteExpando: true,
checkClone: false,
scriptEval: false,
noCloneEvent: true,
boxModel: null
};
script.type = "text/javascript";
try {
script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
} catch(e) {}
root.insertBefore( script, root.firstChild );
// Make sure that the execution of code works by injecting a script
// tag with appendChild/createTextNode
// (IE doesn't support this, fails, and uses .text instead)
if ( window[ id ] ) {
jQuery.support.scriptEval = true;
delete window[ id ];
}
// Test to see if it's possible to delete an expando from an element
// Fails in Internet Explorer
try {
delete script.test;
} catch(e) {
jQuery.support.deleteExpando = false;
}
root.removeChild( script );
if ( div.attachEvent && div.fireEvent ) {
div.attachEvent("onclick", function click() {
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
jQuery.support.noCloneEvent = false;
div.detachEvent("onclick", click);
});
div.cloneNode(true).fireEvent("onclick");
}
div = document.createElement("div");
div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
var fragment = document.createDocumentFragment();
fragment.appendChild( div.firstChild );
// WebKit doesn't clone checked state correctly in fragments
jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
// Figure out if the W3C box model works as expected
// document.body must exist before we can do this
jQuery(function() {
var div = document.createElement("div");
div.style.width = div.style.paddingLeft = "1px";
document.body.appendChild( div );
jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
document.body.removeChild( div ).style.display = 'none';
div = null;
});
// Technique from Juriy Zaytsev
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
var eventSupported = function( eventName ) {
var el = document.createElement("div");
eventName = "on" + eventName;
var isSupported = (eventName in el);
if ( !isSupported ) {
el.setAttribute(eventName, "return;");
isSupported = typeof el[eventName] === "function";
}
el = null;
return isSupported;
};
jQuery.support.submitBubbles = eventSupported("submit");
jQuery.support.changeBubbles = eventSupported("change");
// release memory in IE
root = script = div = all = a = null;
})();
jQuery.props = {
"for": "htmlFor",
"class": "className",
readonly: "readOnly",
maxlength: "maxLength",
cellspacing: "cellSpacing",
rowspan: "rowSpan",
colspan: "colSpan",
tabindex: "tabIndex",
usemap: "useMap",
frameborder: "frameBorder"
};
var expando = "jQuery" + now(), uuid = 0, windowData = {};
jQuery.extend({
cache: {},
expando:expando,
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
"object": true,
"applet": true
},
data: function( elem, name, data ) {
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
return;
}
elem = elem == window ?
windowData :
elem;
var id = elem[ expando ], cache = jQuery.cache, thisCache;
if ( !id && typeof name === "string" && data === undefined ) {
return null;
}
// Compute a unique ID for the element
if ( !id ) {
id = ++uuid;
}
// Avoid generating a new cache unless none exists and we
// want to manipulate it.
if ( typeof name === "object" ) {
elem[ expando ] = id;
thisCache = cache[ id ] = jQuery.extend(true, {}, name);
} else if ( !cache[ id ] ) {
elem[ expando ] = id;
cache[ id ] = {};
}
thisCache = cache[ id ];
// Prevent overriding the named cache with undefined values
if ( data !== undefined ) {
thisCache[ name ] = data;
}
return typeof name === "string" ? thisCache[ name ] : thisCache;
},
removeData: function( elem, name ) {
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
return;
}
elem = elem == window ?
windowData :
elem;
var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
// If we want to remove a specific section of the element's data
if ( name ) {
if ( thisCache ) {
// Remove the section of cache data
delete thisCache[ name ];
// If we've removed all the data, remove the element's cache
if ( jQuery.isEmptyObject(thisCache) ) {
jQuery.removeData( elem );
}
}
// Otherwise, we want to remove all of the element's data
} else {
if ( jQuery.support.deleteExpando ) {
delete elem[ jQuery.expando ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
}
// Completely remove the data cache
delete cache[ id ];
}
}
});
jQuery.fn.extend({
data: function( key, value ) {
if ( typeof key === "undefined" && this.length ) {
return jQuery.data( this[0] );
} else if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
var parts = key.split(".");
parts[1] = parts[1] ? "." + parts[1] : "";
if ( value === undefined ) {
var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
if ( data === undefined && this.length ) {
data = jQuery.data( this[0], key );
}
return data === undefined && parts[1] ?
this.data( parts[0] ) :
data;
} else {
return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
jQuery.data( this, key, value );
});
}
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
jQuery.extend({
queue: function( elem, type, data ) {
if ( !elem ) {
return;
}
type = (type || "fx") + "queue";
var q = jQuery.data( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( !data ) {
return q || [];
}
if ( !q || jQuery.isArray(data) ) {
q = jQuery.data( elem, type, jQuery.makeArray(data) );
} else {
q.push( data );
}
return q;
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ), fn = queue.shift();
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
}
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift("inprogress");
}
fn.call(elem, function() {
jQuery.dequeue(elem, type);
});
}
}
});
jQuery.fn.extend({
queue: function( type, data ) {
if ( typeof type !== "string" ) {
data = type;
type = "fx";
}
if ( data === undefined ) {
return jQuery.queue( this[0], type );
}
return this.each(function( i, elem ) {
var queue = jQuery.queue( this, type, data );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
type = type || "fx";
return this.queue( type, function() {
var elem = this;
setTimeout(function() {
jQuery.dequeue( elem, type );
}, time );
});
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
}
});
var rclass = /[\n\t]/g,
rspace = /\s+/,
rreturn = /\r/g,
rspecialurl = /href|src|style/,
rtype = /(button|input)/i,
rfocusable = /(button|input|object|select|textarea)/i,
rclickable = /^(a|area)$/i,
rradiocheck = /radio|checkbox/;
jQuery.fn.extend({
attr: function( name, value ) {
return access( this, name, value, true, jQuery.attr );
},
removeAttr: function( name, fn ) {
return this.each(function(){
jQuery.attr( this, name, "" );
if ( this.nodeType === 1 ) {
this.removeAttribute( name );
}
});
},
addClass: function( value ) {
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
self.addClass( value.call(this, i, self.attr("class")) );
});
}
if ( value && typeof value === "string" ) {
var classNames = (value || "").split( rspace );
for ( var i = 0, l = this.length; i < l; i++ ) {
var elem = this[i];
if ( elem.nodeType === 1 ) {
if ( !elem.className ) {
elem.className = value;
} else {
var className = " " + elem.className + " ", setClass = elem.className;
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
setClass += " " + classNames[c];
}
}
elem.className = jQuery.trim( setClass );
}
}
}
}
return this;
},
removeClass: function( value ) {
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
self.removeClass( value.call(this, i, self.attr("class")) );
});
}
if ( (value && typeof value === "string") || value === undefined ) {
var classNames = (value || "").split(rspace);
for ( var i = 0, l = this.length; i < l; i++ ) {
var elem = this[i];
if ( elem.nodeType === 1 && elem.className ) {
if ( value ) {
var className = (" " + elem.className + " ").replace(rclass, " ");
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
className = className.replace(" " + classNames[c] + " ", " ");
}
elem.className = jQuery.trim( className );
} else {
elem.className = "";
}
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value, isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function(i) {
var self = jQuery(this);
self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
});
}
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className, i = 0, self = jQuery(this),
state = stateVal,
classNames = value.split( rspace );
while ( (className = classNames[ i++ ]) ) {
// check each className given, space seperated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
} else if ( type === "undefined" || type === "boolean" ) {
if ( this.className ) {
// store className if set
jQuery.data( this, "__className__", this.className );
}
// toggle whole className
this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
}
});
},
hasClass: function( selector ) {
var className = " " + selector + " ";
for ( var i = 0, l = this.length; i < l; i++ ) {
if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
return true;
}
}
return false;
},
val: function( value ) {
if ( value === undefined ) {
var elem = this[0];
if ( elem ) {
if ( jQuery.nodeName( elem, "option" ) ) {
return (elem.attributes.value || {}).specified ? elem.value : elem.text;
}
// We need to handle select boxes special
if ( jQuery.nodeName( elem, "select" ) ) {
var index = elem.selectedIndex,
values = [],
options = elem.options,
one = elem.type === "select-one";
// Nothing was selected
if ( index < 0 ) {
return null;
}
// Loop through all the selected options
for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
var option = options[ i ];
if ( option.selected ) {
// Get the specifc value for the option
value = jQuery(option).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
return values;
}
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
return elem.getAttribute("value") === null ? "on" : elem.value;
}
// Everything else, we just grab the value
return (elem.value || "").replace(rreturn, "");
}
return undefined;
}
var isFunction = jQuery.isFunction(value);
return this.each(function(i) {
var self = jQuery(this), val = value;
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call(this, i, self.val());
}
// Typecast each time if the value is a Function and the appended
// value is therefore different each time.
if ( typeof val === "number" ) {
val += "";
}
if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
this.checked = jQuery.inArray( self.val(), val ) >= 0;
} else if ( jQuery.nodeName( this, "select" ) ) {
var values = jQuery.makeArray(val);
jQuery( "option", this ).each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
this.selectedIndex = -1;
}
} else {
this.value = val;
}
});
}
});
jQuery.extend({
attrFn: {
val: true,
css: true,
html: true,
text: true,
data: true,
width: true,
height: true,
offset: true
},
attr: function( elem, name, value, pass ) {
// don't set attributes on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
return undefined;
}
if ( pass && name in jQuery.attrFn ) {
return jQuery(elem)[name](value);
}
var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
// Whether we are setting (or getting)
set = value !== undefined;
// Try to normalize/fix the name
name = notxml && jQuery.props[ name ] || name;
// Only do all the following if this is a node (faster for style)
if ( elem.nodeType === 1 ) {
// These attributes require special treatment
var special = rspecialurl.test( name );
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( name === "selected" && !jQuery.support.optSelected ) {
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
// Make sure that it also works with optgroups, see #5701
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
}
// If applicable, access the attribute via the DOM 0 way
if ( name in elem && notxml && !special ) {
if ( set ) {
// We can't allow the type property to be changed (since it causes problems in IE)
if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
jQuery.error( "type property can't be changed" );
}
elem[ name ] = value;
}
// browsers index elements by id/name on forms, give priority to attributes.
if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
return elem.getAttributeNode( name ).nodeValue;
}
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
if ( name === "tabIndex" ) {
var attributeNode = elem.getAttributeNode( "tabIndex" );
return attributeNode && attributeNode.specified ?
attributeNode.value :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
return elem[ name ];
}
if ( !jQuery.support.style && notxml && name === "style" ) {
if ( set ) {
elem.style.cssText = "" + value;
}
return elem.style.cssText;
}
if ( set ) {
// convert the value to a string (all browsers do this but IE) see #1070
elem.setAttribute( name, "" + value );
}
var attr = !jQuery.support.hrefNormalized && notxml && special ?
// Some attributes require a special call on IE
elem.getAttribute( name, 2 ) :
elem.getAttribute( name );
// Non-existent attributes return null, we normalize to undefined
return attr === null ? undefined : attr;
}
// elem is actually elem.style ... set the style
// Using attr for specific style information is now deprecated. Use style instead.
return jQuery.style( elem, name, value );
}
});
var rnamespaces = /\.(.*)$/,
fcleanup = function( nm ) {
return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
return "\\" + ch;
});
};
/*
* A number of helper functions used for managing events.
* Many of the ideas behind this code originated from
* Dean Edwards' addEvent library.
*/
jQuery.event = {
// Bind an event to an element
// Original by Dean Edwards
add: function( elem, types, handler, data ) {
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
// For whatever reason, IE has trouble passing the window object
// around, causing it to be cloned in the process
if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
elem = window;
}
var handleObjIn, handleObj;
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
}
// Make sure that the function being executed has a unique ID
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure
var elemData = jQuery.data( elem );
// If no elemData is found then we must be trying to bind to one of the
// banned noData elements
if ( !elemData ) {
return;
}
var events = elemData.events = elemData.events || {},
eventHandle = elemData.handle, eventHandle;
if ( !eventHandle ) {
elemData.handle = eventHandle = function() {
// Handle the second event of a trigger and when
// an event is called after a page has unloaded
return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
jQuery.event.handle.apply( eventHandle.elem, arguments ) :
undefined;
};
}
// Add elem as a property of the handle function
// This is to prevent a memory leak with non-native events in IE.
eventHandle.elem = elem;
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
types = types.split(" ");
var type, i = 0, namespaces;
while ( (type = types[ i++ ]) ) {
handleObj = handleObjIn ?
jQuery.extend({}, handleObjIn) :
{ handler: handler, data: data };
// Namespaced event handlers
if ( type.indexOf(".") > -1 ) {
namespaces = type.split(".");
type = namespaces.shift();
handleObj.namespace = namespaces.slice(0).sort().join(".");
} else {
namespaces = [];
handleObj.namespace = "";
}
handleObj.type = type;
handleObj.guid = handler.guid;
// Get the current list of functions bound to this event
var handlers = events[ type ],
special = jQuery.event.special[ type ] || {};
// Init the event handler queue
if ( !handlers ) {
handlers = events[ type ] = [];
// Check for a special event handler
// Only use addEventListener/attachEvent if the special
// events handler returns false
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
// Bind the global event handler to the element
if ( elem.addEventListener ) {
elem.addEventListener( type, eventHandle, false );
} else if ( elem.attachEvent ) {
elem.attachEvent( "on" + type, eventHandle );
}
}
}
if ( special.add ) {
special.add.call( elem, handleObj );
if ( !handleObj.handler.guid ) {
handleObj.handler.guid = handler.guid;
}
}
// Add the function to the element's handler list
handlers.push( handleObj );
// Keep track of which events have been used, for global triggering
jQuery.event.global[ type ] = true;
}
// Nullify elem to prevent memory leaks in IE
elem = null;
},
global: {},
// Detach an event or set of events from an element
remove: function( elem, types, handler, pos ) {
// don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
elemData = jQuery.data( elem ),
events = elemData && elemData.events;
if ( !elemData || !events ) {
return;
}
// types is actually an event object here
if ( types && types.type ) {
handler = types.handler;
types = types.type;
}
// Unbind all events for the element
if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
types = types || "";
for ( type in events ) {
jQuery.event.remove( elem, type + types );
}
return;
}
// Handle multiple events separated by a space
// jQuery(...).unbind("mouseover mouseout", fn);
types = types.split(" ");
while ( (type = types[ i++ ]) ) {
origType = type;
handleObj = null;
all = type.indexOf(".") < 0;
namespaces = [];
if ( !all ) {
// Namespaced event handlers
namespaces = type.split(".");
type = namespaces.shift();
namespace = new RegExp("(^|\\.)" +
jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
}
eventType = events[ type ];
if ( !eventType ) {
continue;
}
if ( !handler ) {
for ( var j = 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( all || namespace.test( handleObj.namespace ) ) {
jQuery.event.remove( elem, origType, handleObj.handler, j );
eventType.splice( j--, 1 );
}
}
continue;
}
special = jQuery.event.special[ type ] || {};
for ( var j = pos || 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( handler.guid === handleObj.guid ) {
// remove the given handler for the given type
if ( all || namespace.test( handleObj.namespace ) ) {
if ( pos == null ) {
eventType.splice( j--, 1 );
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
if ( pos != null ) {
break;
}
}
}
// remove generic event handler if no more handlers exist
if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
removeEvent( elem, type, elemData.handle );
}
ret = null;
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
var handle = elemData.handle;
if ( handle ) {
handle.elem = null;
}
delete elemData.events;
delete elemData.handle;
if ( jQuery.isEmptyObject( elemData ) ) {
jQuery.removeData( elem );
}
}
},
// bubbling is internal
trigger: function( event, data, elem /*, bubbling */ ) {
// Event object or event type
var type = event.type || event,
bubbling = arguments[3];
if ( !bubbling ) {
event = typeof event === "object" ?
// jQuery.Event object
event[expando] ? event :
// Object literal
jQuery.extend( jQuery.Event(type), event ) :
// Just the event type (string)
jQuery.Event(type);
if ( type.indexOf("!") >= 0 ) {
event.type = type = type.slice(0, -1);
event.exclusive = true;
}
// Handle a global trigger
if ( !elem ) {
// Don't bubble custom events when global (to avoid too much overhead)
event.stopPropagation();
// Only trigger if we've ever bound an event for it
if ( jQuery.event.global[ type ] ) {
jQuery.each( jQuery.cache, function() {
if ( this.events && this.events[type] ) {
jQuery.event.trigger( event, data, this.handle.elem );
}
});
}
}
// Handle triggering a single element
// don't do events on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
return undefined;
}
// Clean up in case it is reused
event.result = undefined;
event.target = elem;
// Clone the incoming data, if any
data = jQuery.makeArray( data );
data.unshift( event );
}
event.currentTarget = elem;
// Trigger the event, it is assumed that "handle" is a function
var handle = jQuery.data( elem, "handle" );
if ( handle ) {
handle.apply( elem, data );
}
var parent = elem.parentNode || elem.ownerDocument;
// Trigger an inline bound script
try {
if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
event.result = false;
}
}
// prevent IE from throwing an error for some elements with some event types, see #3533
} catch (e) {}
if ( !event.isPropagationStopped() && parent ) {
jQuery.event.trigger( event, data, parent, true );
} else if ( !event.isDefaultPrevented() ) {
var target = event.target, old,
isClick = jQuery.nodeName(target, "a") && type === "click",
special = jQuery.event.special[ type ] || {};
if ( (!special._default || special._default.call( elem, event ) === false) &&
!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
try {
if ( target[ type ] ) {
// Make sure that we don't accidentally re-trigger the onFOO events
old = target[ "on" + type ];
if ( old ) {
target[ "on" + type ] = null;
}
jQuery.event.triggered = true;
target[ type ]();
}
// prevent IE from throwing an error for some elements with some event types, see #3533
} catch (e) {}
if ( old ) {
target[ "on" + type ] = old;
}
jQuery.event.triggered = false;
}
}
},
handle: function( event ) {
var all, handlers, namespaces, namespace, events;
event = arguments[0] = jQuery.event.fix( event || window.event );
event.currentTarget = this;
// Namespaced event handlers
all = event.type.indexOf(".") < 0 && !event.exclusive;
if ( !all ) {
namespaces = event.type.split(".");
event.type = namespaces.shift();
namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
}
var events = jQuery.data(this, "events"), handlers = events[ event.type ];
if ( events && handlers ) {
// Clone the handlers to prevent manipulation
handlers = handlers.slice(0);
for ( var j = 0, l = handlers.length; j < l; j++ ) {
var handleObj = handlers[ j ];
// Filter the functions by class
if ( all || namespace.test( handleObj.namespace ) ) {
// Pass in a reference to the handler function itself
// So that we can later remove it
event.handler = handleObj.handler;
event.data = handleObj.data;
event.handleObj = handleObj;
var ret = handleObj.handler.apply( this, arguments );
if ( ret !== undefined ) {
event.result = ret;
if ( ret === false ) {
event.preventDefault();
event.stopPropagation();
}
}
if ( event.isImmediatePropagationStopped() ) {
break;
}
}
}
}
return event.result;
},
props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix: function( event ) {
if ( event[ expando ] ) {
return event;
}
// store a copy of the original event object
// and "clone" to set read-only properties
var originalEvent = event;
event = jQuery.Event( originalEvent );
for ( var i = this.props.length, prop; i; ) {
prop = this.props[ --i ];
event[ prop ] = originalEvent[ prop ];
}
// Fix target property, if necessary
if ( !event.target ) {
event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
}
// check if target is a textnode (safari)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
// Add relatedTarget, if necessary
if ( !event.relatedTarget && event.fromElement ) {
event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
}
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && event.clientX != null ) {
var doc = document.documentElement, body = document.body;
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
}
// Add which for key events
if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
event.which = event.charCode || event.keyCode;
}
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
if ( !event.metaKey && event.ctrlKey ) {
event.metaKey = event.ctrlKey;
}
// Add which for click: 1 === left; 2 === middle; 3 === right
// Note: button is not normalized, so don't use it
if ( !event.which && event.button !== undefined ) {
event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
}
return event;
},
// Deprecated, use jQuery.guid instead
guid: 1E8,
// Deprecated, use jQuery.proxy instead
proxy: jQuery.proxy,
special: {
ready: {
// Make sure the ready event is setup
setup: jQuery.bindReady,
teardown: jQuery.noop
},
live: {
add: function( handleObj ) {
jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) );
},
remove: function( handleObj ) {
var remove = true,
type = handleObj.origType.replace(rnamespaces, "");
jQuery.each( jQuery.data(this, "events").live || [], function() {
if ( type === this.origType.replace(rnamespaces, "") ) {
remove = false;
return false;
}
});
if ( remove ) {
jQuery.event.remove( this, handleObj.origType, liveHandler );
}
}
},
beforeunload: {
setup: function( data, namespaces, eventHandle ) {
// We only want to do this special case on windows
if ( this.setInterval ) {
this.onbeforeunload = eventHandle;
}
return false;
},
teardown: function( namespaces, eventHandle ) {
if ( this.onbeforeunload === eventHandle ) {
this.onbeforeunload = null;
}
}
}
}
};
var removeEvent = document.removeEventListener ?
function( elem, type, handle ) {
elem.removeEventListener( type, handle, false );
} :
function( elem, type, handle ) {
elem.detachEvent( "on" + type, handle );
};
jQuery.Event = function( src ) {
// Allow instantiation without the 'new' keyword
if ( !this.preventDefault ) {
return new jQuery.Event( src );
}
// Event object
if ( src && src.type ) {
this.originalEvent = src;
this.type = src.type;
// Event type
} else {
this.type = src;
}
// timeStamp is buggy for some events on Firefox(#3843)
// So we won't rely on the native value
this.timeStamp = now();
// Mark it as fixed
this[ expando ] = true;
};
function returnFalse() {
return false;
}
function returnTrue() {
return true;
}
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
preventDefault: function() {
this.isDefaultPrevented = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if preventDefault exists run it on the original event
if ( e.preventDefault ) {
e.preventDefault();
}
// otherwise set the returnValue property of the original event to false (IE)
e.returnValue = false;
},
stopPropagation: function() {
this.isPropagationStopped = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if stopPropagation exists run it on the original event
if ( e.stopPropagation ) {
e.stopPropagation();
}
// otherwise set the cancelBubble property of the original event to true (IE)
e.cancelBubble = true;
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
},
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse
};
// Checks if an event happened on an element within another element
// Used in jQuery.event.special.mouseenter and mouseleave handlers
var withinElement = function( event ) {
// Check if mouse(over|out) are still within the same parent element
var parent = event.relatedTarget;
// Firefox sometimes assigns relatedTarget a XUL element
// which we cannot access the parentNode property of
try {
// Traverse up the tree
while ( parent && parent !== this ) {
parent = parent.parentNode;
}
if ( parent !== this ) {
// set the correct event type
event.type = event.data;
// handle event if we actually just moused on to a non sub-element
jQuery.event.handle.apply( this, arguments );
}
// assuming we've left the element since we most likely mousedover a xul element
} catch(e) { }
},
// In case of event delegation, we only need to rename the event.type,
// liveHandler will take care of the rest.
delegate = function( event ) {
event.type = event.data;
jQuery.event.handle.apply( this, arguments );
};
// Create mouseenter and mouseleave events
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
setup: function( data ) {
jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
},
teardown: function( data ) {
jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
}
};
});
// submit delegation
if ( !jQuery.support.submitBubbles ) {
jQuery.event.special.submit = {
setup: function( data, namespaces ) {
if ( this.nodeName.toLowerCase() !== "form" ) {
jQuery.event.add(this, "click.specialSubmit", function( e ) {
var elem = e.target, type = elem.type;
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
return trigger( "submit", this, arguments );
}
});
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
var elem = e.target, type = elem.type;
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
return trigger( "submit", this, arguments );
}
});
} else {
return false;
}
},
teardown: function( namespaces ) {
jQuery.event.remove( this, ".specialSubmit" );
}
};
}
// change delegation, happens here so we have bind.
if ( !jQuery.support.changeBubbles ) {
var formElems = /textarea|input|select/i,
changeFilters,
getVal = function( elem ) {
var type = elem.type, val = elem.value;
if ( type === "radio" || type === "checkbox" ) {
val = elem.checked;
} else if ( type === "select-multiple" ) {
val = elem.selectedIndex > -1 ?
jQuery.map( elem.options, function( elem ) {
return elem.selected;
}).join("-") :
"";
} else if ( elem.nodeName.toLowerCase() === "select" ) {
val = elem.selectedIndex;
}
return val;
},
testChange = function testChange( e ) {
var elem = e.target, data, val;
if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
return;
}
data = jQuery.data( elem, "_change_data" );
val = getVal(elem);
// the current data will be also retrieved by beforeactivate
if ( e.type !== "focusout" || elem.type !== "radio" ) {
jQuery.data( elem, "_change_data", val );
}
if ( data === undefined || val === data ) {
return;
}
if ( data != null || val ) {
e.type = "change";
return jQuery.event.trigger( e, arguments[1], elem );
}
};
jQuery.event.special.change = {
filters: {
focusout: testChange,
click: function( e ) {
var elem = e.target, type = elem.type;
if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
return testChange.call( this, e );
}
},
// Change has to be called before submit
// Keydown will be called before keypress, which is used in submit-event delegation
keydown: function( e ) {
var elem = e.target, type = elem.type;
if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
type === "select-multiple" ) {
return testChange.call( this, e );
}
},
// Beforeactivate happens also before the previous element is blurred
// with this event you can't trigger a change event, but you can store
// information/focus[in] is not needed anymore
beforeactivate: function( e ) {
var elem = e.target;
jQuery.data( elem, "_change_data", getVal(elem) );
}
},
setup: function( data, namespaces ) {
if ( this.type === "file" ) {
return false;
}
for ( var type in changeFilters ) {
jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
}
return formElems.test( this.nodeName );
},
teardown: function( namespaces ) {
jQuery.event.remove( this, ".specialChange" );
return formElems.test( this.nodeName );
}
};
changeFilters = jQuery.event.special.change.filters;
}
function trigger( type, elem, args ) {
args[0].type = type;
return jQuery.event.handle.apply( elem, args );
}
// Create "bubbling" focus and blur events
if ( document.addEventListener ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
jQuery.event.special[ fix ] = {
setup: function() {
this.addEventListener( orig, handler, true );
},
teardown: function() {
this.removeEventListener( orig, handler, true );
}
};
function handler( e ) {
e = jQuery.event.fix( e );
e.type = fix;
return jQuery.event.handle.call( this, e );
}
});
}
jQuery.each(["bind", "one"], function( i, name ) {
jQuery.fn[ name ] = function( type, data, fn ) {
// Handle object literals
if ( typeof type === "object" ) {
for ( var key in type ) {
this[ name ](key, data, type[key], fn);
}
return this;
}
if ( jQuery.isFunction( data ) ) {
fn = data;
data = undefined;
}
var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
jQuery( this ).unbind( event, handler );
return fn.apply( this, arguments );
}) : fn;
if ( type === "unload" && name !== "one" ) {
this.one( type, data, fn );
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
jQuery.event.add( this[i], type, handler, data );
}
}
return this;
};
});
jQuery.fn.extend({
unbind: function( type, fn ) {
// Handle object literals
if ( typeof type === "object" && !type.preventDefault ) {
for ( var key in type ) {
this.unbind(key, type[key]);
}
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
jQuery.event.remove( this[i], type, fn );
}
}
return this;
},
delegate: function( selector, types, data, fn ) {
return this.live( types, data, fn, selector );
},
undelegate: function( selector, types, fn ) {
if ( arguments.length === 0 ) {
return this.unbind( "live" );
} else {
return this.die( types, null, fn, selector );
}
},
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
},
triggerHandler: function( type, data ) {
if ( this[0] ) {
var event = jQuery.Event( type );
event.preventDefault();
event.stopPropagation();
jQuery.event.trigger( event, data, this[0] );
return event.result;
}
},
toggle: function( fn ) {
// Save reference to arguments for access in closure
var args = arguments, i = 1;
// link all the functions, so any of them can unbind this click handler
while ( i < args.length ) {
jQuery.proxy( fn, args[ i++ ] );
}
return this.click( jQuery.proxy( fn, function( event ) {
// Figure out which function to execute
var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
// Make sure that clicks stop
event.preventDefault();
// and execute the function
return args[ lastToggle ].apply( this, arguments ) || false;
}));
},
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
}
});
var liveMap = {
focus: "focusin",
blur: "focusout",
mouseenter: "mouseover",
mouseleave: "mouseout"
};
jQuery.each(["live", "die"], function( i, name ) {
jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
var type, i = 0, match, namespaces, preType,
selector = origSelector || this.selector,
context = origSelector ? this : jQuery( this.context );
if ( jQuery.isFunction( data ) ) {
fn = data;
data = undefined;
}
types = (types || "").split(" ");
while ( (type = types[ i++ ]) != null ) {
match = rnamespaces.exec( type );
namespaces = "";
if ( match ) {
namespaces = match[0];
type = type.replace( rnamespaces, "" );
}
if ( type === "hover" ) {
types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
continue;
}
preType = type;
if ( type === "focus" || type === "blur" ) {
types.push( liveMap[ type ] + namespaces );
type = type + namespaces;
} else {
type = (liveMap[ type ] || type) + namespaces;
}
if ( name === "live" ) {
// bind live handler
context.each(function(){
jQuery.event.add( this, liveConvert( type, selector ),
{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
});
} else {
// unbind live handler
context.unbind( liveConvert( type, selector ), fn );
}
}
return this;
}
});
function liveHandler( event ) {
var stop, elems = [], selectors = [], args = arguments,
related, match, handleObj, elem, j, i, l, data,
events = jQuery.data( this, "events" );
// Make sure we avoid non-left-click bubbling in Firefox (#3861)
if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
return;
}
event.liveFired = this;
var live = events.live.slice(0);
for ( j = 0; j < live.length; j++ ) {
handleObj = live[j];
if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
selectors.push( handleObj.selector );
} else {
live.splice( j--, 1 );
}
}
match = jQuery( event.target ).closest( selectors, event.currentTarget );
for ( i = 0, l = match.length; i < l; i++ ) {
for ( j = 0; j < live.length; j++ ) {
handleObj = live[j];
if ( match[i].selector === handleObj.selector ) {
elem = match[i].elem;
related = null;
// Those two events require additional checking
if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
}
if ( !related || related !== elem ) {
elems.push({ elem: elem, handleObj: handleObj });
}
}
}
}
for ( i = 0, l = elems.length; i < l; i++ ) {
match = elems[i];
event.currentTarget = match.elem;
event.data = match.handleObj.data;
event.handleObj = match.handleObj;
if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) {
stop = false;
break;
}
}
return stop;
}
function liveConvert( type, selector ) {
return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( fn ) {
return fn ? this.bind( name, fn ) : this.trigger( name );
};
if ( jQuery.attrFn ) {
jQuery.attrFn[ name ] = true;
}
});
// Prevent memory leaks in IE
// Window isn't included so as not to unbind existing unload events
// More info:
// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
if ( window.attachEvent && !window.addEventListener ) {
window.attachEvent("onunload", function() {
for ( var id in jQuery.cache ) {
if ( jQuery.cache[ id ].handle ) {
// Try/Catch is to handle iframes being unloaded, see #4280
try {
jQuery.event.remove( jQuery.cache[ id ].handle.elem );
} catch(e) {}
}
}
});
}
/*!
* Sizzle CSS Selector Engine - v1.0
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
(function(){
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
done = 0,
toString = Object.prototype.toString,
hasDuplicate = false,
baseHasDuplicate = true;
// Here we check if the JavaScript engine is using some sort of
// optimization where it does not always call our comparision
// function. If that is the case, discard the hasDuplicate value.
// Thus far that includes Google Chrome.
[0, 0].sort(function(){
baseHasDuplicate = false;
return 0;
});
var Sizzle = function(selector, context, results, seed) {
results = results || [];
var origContext = context = context || document;
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
return [];
}
if ( !selector || typeof selector !== "string" ) {
return results;
}
var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
soFar = selector;
// Reset the position of the chunker regexp (start from head)
while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
soFar = m[3];
parts.push( m[1] );
if ( m[2] ) {
extra = m[3];
break;
}
}
if ( parts.length > 1 && origPOS.exec( selector ) ) {
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
set = posProcess( parts[0] + parts[1], context );
} else {
set = Expr.relative[ parts[0] ] ?
[ context ] :
Sizzle( parts.shift(), context );
while ( parts.length ) {
selector = parts.shift();
if ( Expr.relative[ selector ] ) {
selector += parts.shift();
}
set = posProcess( selector, set );
}
}
} else {
// Take a shortcut and set the context if the root selector is an ID
// (but not if it'll be faster if the inner selector is an ID)
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
var ret = Sizzle.find( parts.shift(), context, contextXML );
context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
}
if ( context ) {
var ret = seed ?
{ expr: parts.pop(), set: makeArray(seed) } :
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
if ( parts.length > 0 ) {
checkSet = makeArray(set);
} else {
prune = false;
}
while ( parts.length ) {
var cur = parts.pop(), pop = cur;
if ( !Expr.relative[ cur ] ) {
cur = "";
} else {
pop = parts.pop();
}
if ( pop == null ) {
pop = context;
}
Expr.relative[ cur ]( checkSet, pop, contextXML );
}
} else {
checkSet = parts = [];
}
}
if ( !checkSet ) {
checkSet = set;
}
if ( !checkSet ) {
Sizzle.error( cur || selector );
}
if ( toString.call(checkSet) === "[object Array]" ) {
if ( !prune ) {
results.push.apply( results, checkSet );
} else if ( context && context.nodeType === 1 ) {
for ( var i = 0; checkSet[i] != null; i++ ) {
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
results.push( set[i] );
}
}
} else {
for ( var i = 0; checkSet[i] != null; i++ ) {
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
results.push( set[i] );
}
}
}
} else {
makeArray( checkSet, results );
}
if ( extra ) {
Sizzle( extra, origContext, results, seed );
Sizzle.uniqueSort( results );
}
return results;
};
Sizzle.uniqueSort = function(results){
if ( sortOrder ) {
hasDuplicate = baseHasDuplicate;
results.sort(sortOrder);
if ( hasDuplicate ) {
for ( var i = 1; i < results.length; i++ ) {
if ( results[i] === results[i-1] ) {
results.splice(i--, 1);
}
}
}
}
return results;
};
Sizzle.matches = function(expr, set){
return Sizzle(expr, null, null, set);
};
Sizzle.find = function(expr, context, isXML){
var set, match;
if ( !expr ) {
return [];
}
for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
var type = Expr.order[i], match;
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
var left = match[1];
match.splice(1,1);
if ( left.substr( left.length - 1 ) !== "\\" ) {
match[1] = (match[1] || "").replace(/\\/g, "");
set = Expr.find[ type ]( match, context, isXML );
if ( set != null ) {
expr = expr.replace( Expr.match[ type ], "" );
break;
}
}
}
}
if ( !set ) {
set = context.getElementsByTagName("*");
}
return {set: set, expr: expr};
};
Sizzle.filter = function(expr, set, inplace, not){
var old = expr, result = [], curLoop = set, match, anyFound,
isXMLFilter = set && set[0] && isXML(set[0]);
while ( expr && set.length ) {
for ( var type in Expr.filter ) {
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
var filter = Expr.filter[ type ], found, item, left = match[1];
anyFound = false;
match.splice(1,1);
if ( left.substr( left.length - 1 ) === "\\" ) {
continue;
}
if ( curLoop === result ) {
result = [];
}
if ( Expr.preFilter[ type ] ) {
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
if ( !match ) {
anyFound = found = true;
} else if ( match === true ) {
continue;
}
}
if ( match ) {
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match, i, curLoop );
var pass = not ^ !!found;
if ( inplace && found != null ) {
if ( pass ) {
anyFound = true;
} else {
curLoop[i] = false;
}
} else if ( pass ) {
result.push( item );
anyFound = true;
}
}
}
}
if ( found !== undefined ) {
if ( !inplace ) {
curLoop = result;
}
expr = expr.replace( Expr.match[ type ], "" );
if ( !anyFound ) {
return [];
}
break;
}
}
}
// Improper expression
if ( expr === old ) {
if ( anyFound == null ) {
Sizzle.error( expr );
} else {
break;
}
}
old = expr;
}
return curLoop;
};
Sizzle.error = function( msg ) {
throw "Syntax error, unrecognized expression: " + msg;
};
var Expr = Sizzle.selectors = {
order: [ "ID", "NAME", "TAG" ],
match: {
ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
},
leftMatch: {},
attrMap: {
"class": "className",
"for": "htmlFor"
},
attrHandle: {
href: function(elem){
return elem.getAttribute("href");
}
},
relative: {
"+": function(checkSet, part){
var isPartStr = typeof part === "string",
isTag = isPartStr && !/\W/.test(part),
isPartStrNotTag = isPartStr && !isTag;
if ( isTag ) {
part = part.toLowerCase();
}
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
if ( (elem = checkSet[i]) ) {
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
elem || false :
elem === part;
}
}
if ( isPartStrNotTag ) {
Sizzle.filter( part, checkSet, true );
}
},
">": function(checkSet, part){
var isPartStr = typeof part === "string";
if ( isPartStr && !/\W/.test(part) ) {
part = part.toLowerCase();
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
var parent = elem.parentNode;
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
}
}
} else {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
checkSet[i] = isPartStr ?
elem.parentNode :
elem.parentNode === part;
}
}
if ( isPartStr ) {
Sizzle.filter( part, checkSet, true );
}
}
},
"": function(checkSet, part, isXML){
var doneName = done++, checkFn = dirCheck;
if ( typeof part === "string" && !/\W/.test(part) ) {
var nodeCheck = part = part.toLowerCase();
checkFn = dirNodeCheck;
}
checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
},
"~": function(checkSet, part, isXML){
var doneName = done++, checkFn = dirCheck;
if ( typeof part === "string" && !/\W/.test(part) ) {
var nodeCheck = part = part.toLowerCase();
checkFn = dirNodeCheck;
}
checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
}
},
find: {
ID: function(match, context, isXML){
if ( typeof context.getElementById !== "undefined" && !isXML ) {
var m = context.getElementById(match[1]);
return m ? [m] : [];
}
},
NAME: function(match, context){
if ( typeof context.getElementsByName !== "undefined" ) {
var ret = [], results = context.getElementsByName(match[1]);
for ( var i = 0, l = results.length; i < l; i++ ) {
if ( results[i].getAttribute("name") === match[1] ) {
ret.push( results[i] );
}
}
return ret.length === 0 ? null : ret;
}
},
TAG: function(match, context){
return context.getElementsByTagName(match[1]);
}
},
preFilter: {
CLASS: function(match, curLoop, inplace, result, not, isXML){
match = " " + match[1].replace(/\\/g, "") + " ";
if ( isXML ) {
return match;
}
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
if ( elem ) {
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
if ( !inplace ) {
result.push( elem );
}
} else if ( inplace ) {
curLoop[i] = false;
}
}
}
return false;
},
ID: function(match){
return match[1].replace(/\\/g, "");
},
TAG: function(match, curLoop){
return match[1].toLowerCase();
},
CHILD: function(match){
if ( match[1] === "nth" ) {
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
// calculate the numbers (first)n+(last) including if they are negative
match[2] = (test[1] + (test[2] || 1)) - 0;
match[3] = test[3] - 0;
}
// TODO: Move to normal caching system
match[0] = done++;
return match;
},
ATTR: function(match, curLoop, inplace, result, not, isXML){
var name = match[1].replace(/\\/g, "");
if ( !isXML && Expr.attrMap[name] ) {
match[1] = Expr.attrMap[name];
}
if ( match[2] === "~=" ) {
match[4] = " " + match[4] + " ";
}
return match;
},
PSEUDO: function(match, curLoop, inplace, result, not){
if ( match[1] === "not" ) {
// If we're dealing with a complex expression, or a simple one
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
match[3] = Sizzle(match[3], null, null, curLoop);
} else {
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
if ( !inplace ) {
result.push.apply( result, ret );
}
return false;
}
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
return true;
}
return match;
},
POS: function(match){
match.unshift( true );
return match;
}
},
filters: {
enabled: function(elem){
return elem.disabled === false && elem.type !== "hidden";
},
disabled: function(elem){
return elem.disabled === true;
},
checked: function(elem){
return elem.checked === true;
},
selected: function(elem){
// Accessing this property makes selected-by-default
// options in Safari work properly
elem.parentNode.selectedIndex;
return elem.selected === true;
},
parent: function(elem){
return !!elem.firstChild;
},
empty: function(elem){
return !elem.firstChild;
},
has: function(elem, i, match){
return !!Sizzle( match[3], elem ).length;
},
header: function(elem){
return /h\d/i.test( elem.nodeName );
},
text: function(elem){
return "text" === elem.type;
},
radio: function(elem){
return "radio" === elem.type;
},
checkbox: function(elem){
return "checkbox" === elem.type;
},
file: function(elem){
return "file" === elem.type;
},
password: function(elem){
return "password" === elem.type;
},
submit: function(elem){
return "submit" === elem.type;
},
image: function(elem){
return "image" === elem.type;
},
reset: function(elem){
return "reset" === elem.type;
},
button: function(elem){
return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
},
input: function(elem){
return /input|select|textarea|button/i.test(elem.nodeName);
}
},
setFilters: {
first: function(elem, i){
return i === 0;
},
last: function(elem, i, match, array){
return i === array.length - 1;
},
even: function(elem, i){
return i % 2 === 0;
},
odd: function(elem, i){
return i % 2 === 1;
},
lt: function(elem, i, match){
return i < match[3] - 0;
},
gt: function(elem, i, match){
return i > match[3] - 0;
},
nth: function(elem, i, match){
return match[3] - 0 === i;
},
eq: function(elem, i, match){
return match[3] - 0 === i;
}
},
filter: {
PSEUDO: function(elem, match, i, array){
var name = match[1], filter = Expr.filters[ name ];
if ( filter ) {
return filter( elem, i, match, array );
} else if ( name === "contains" ) {
return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
} else if ( name === "not" ) {
var not = match[3];
for ( var i = 0, l = not.length; i < l; i++ ) {
if ( not[i] === elem ) {
return false;
}
}
return true;
} else {
Sizzle.error( "Syntax error, unrecognized expression: " + name );
}
},
CHILD: function(elem, match){
var type = match[1], node = elem;
switch (type) {
case 'only':
case 'first':
while ( (node = node.previousSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
if ( type === "first" ) {
return true;
}
node = elem;
case 'last':
while ( (node = node.nextSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
return true;
case 'nth':
var first = match[2], last = match[3];
if ( first === 1 && last === 0 ) {
return true;
}
var doneName = match[0],
parent = elem.parentNode;
if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
var count = 0;
for ( node = parent.firstChild; node; node = node.nextSibling ) {
if ( node.nodeType === 1 ) {
node.nodeIndex = ++count;
}
}
parent.sizcache = doneName;
}
var diff = elem.nodeIndex - last;
if ( first === 0 ) {
return diff === 0;
} else {
return ( diff % first === 0 && diff / first >= 0 );
}
}
},
ID: function(elem, match){
return elem.nodeType === 1 && elem.getAttribute("id") === match;
},
TAG: function(elem, match){
return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
},
CLASS: function(elem, match){
return (" " + (elem.className || elem.getAttribute("class")) + " ")
.indexOf( match ) > -1;
},
ATTR: function(elem, match){
var name = match[1],
result = Expr.attrHandle[ name ] ?
Expr.attrHandle[ name ]( elem ) :
elem[ name ] != null ?
elem[ name ] :
elem.getAttribute( name ),
value = result + "",
type = match[2],
check = match[4];
return result == null ?
type === "!=" :
type === "=" ?
value === check :
type === "*=" ?
value.indexOf(check) >= 0 :
type === "~=" ?
(" " + value + " ").indexOf(check) >= 0 :
!check ?
value && result !== false :
type === "!=" ?
value !== check :
type === "^=" ?
value.indexOf(check) === 0 :
type === "$=" ?
value.substr(value.length - check.length) === check :
type === "|=" ?
value === check || value.substr(0, check.length + 1) === check + "-" :
false;
},
POS: function(elem, match, i, array){
var name = match[2], filter = Expr.setFilters[ name ];
if ( filter ) {
return filter( elem, i, match, array );
}
}
}
};
var origPOS = Expr.match.POS;
for ( var type in Expr.match ) {
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
return "\\" + (num - 0 + 1);
}));
}
var makeArray = function(array, results) {
array = Array.prototype.slice.call( array, 0 );
if ( results ) {
results.push.apply( results, array );
return results;
}
return array;
};
// Perform a simple check to determine if the browser is capable of
// converting a NodeList to an array using builtin methods.
// Also verifies that the returned array holds DOM nodes
// (which is not the case in the Blackberry browser)
try {
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
// Provide a fallback method if it does not work
} catch(e){
makeArray = function(array, results) {
var ret = results || [];
if ( toString.call(array) === "[object Array]" ) {
Array.prototype.push.apply( ret, array );
} else {
if ( typeof array.length === "number" ) {
for ( var i = 0, l = array.length; i < l; i++ ) {
ret.push( array[i] );
}
} else {
for ( var i = 0; array[i]; i++ ) {
ret.push( array[i] );
}
}
}
return ret;
};
}
var sortOrder;
if ( document.documentElement.compareDocumentPosition ) {
sortOrder = function( a, b ) {
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
if ( a == b ) {
hasDuplicate = true;
}
return a.compareDocumentPosition ? -1 : 1;
}
var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
if ( ret === 0 ) {
hasDuplicate = true;
}
return ret;
};
} else if ( "sourceIndex" in document.documentElement ) {
sortOrder = function( a, b ) {
if ( !a.sourceIndex || !b.sourceIndex ) {
if ( a == b ) {
hasDuplicate = true;
}
return a.sourceIndex ? -1 : 1;
}
var ret = a.sourceIndex - b.sourceIndex;
if ( ret === 0 ) {
hasDuplicate = true;
}
return ret;
};
} else if ( document.createRange ) {
sortOrder = function( a, b ) {
if ( !a.ownerDocument || !b.ownerDocument ) {
if ( a == b ) {
hasDuplicate = true;
}
return a.ownerDocument ? -1 : 1;
}
var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
aRange.setStart(a, 0);
aRange.setEnd(a, 0);
bRange.setStart(b, 0);
bRange.setEnd(b, 0);
var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
if ( ret === 0 ) {
hasDuplicate = true;
}
return ret;
};
}
// Utility function for retreiving the text value of an array of DOM nodes
function getText( elems ) {
var ret = "", elem;
for ( var i = 0; elems[i]; i++ ) {
elem = elems[i];
// Get the text from text nodes and CDATA nodes
if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
ret += elem.nodeValue;
// Traverse everything else, except comment nodes
} else if ( elem.nodeType !== 8 ) {
ret += getText( elem.childNodes );
}
}
return ret;
}
// Check to see if the browser returns elements by name when
// querying by getElementById (and provide a workaround)
(function(){
// We're going to inject a fake input element with a specified name
var form = document.createElement("div"),
id = "script" + (new Date).getTime();
form.innerHTML = "<a name='" + id + "'/>";
// Inject it into the root element, check its status, and remove it quickly
var root = document.documentElement;
root.insertBefore( form, root.firstChild );
// The workaround has to do additional checks after a getElementById
// Which slows things down for other browsers (hence the branching)
if ( document.getElementById( id ) ) {
Expr.find.ID = function(match, context, isXML){
if ( typeof context.getElementById !== "undefined" && !isXML ) {
var m = context.getElementById(match[1]);
return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
}
};
Expr.filter.ID = function(elem, match){
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
return elem.nodeType === 1 && node && node.nodeValue === match;
};
}
root.removeChild( form );
root = form = null; // release memory in IE
})();
(function(){
// Check to see if the browser returns only elements
// when doing getElementsByTagName("*")
// Create a fake element
var div = document.createElement("div");
div.appendChild( document.createComment("") );
// Make sure no comments are found
if ( div.getElementsByTagName("*").length > 0 ) {
Expr.find.TAG = function(match, context){
var results = context.getElementsByTagName(match[1]);
// Filter out possible comments
if ( match[1] === "*" ) {
var tmp = [];
for ( var i = 0; results[i]; i++ ) {
if ( results[i].nodeType === 1 ) {
tmp.push( results[i] );
}
}
results = tmp;
}
return results;
};
}
// Check to see if an attribute returns normalized href attributes
div.innerHTML = "<a href='#'></a>";
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
div.firstChild.getAttribute("href") !== "#" ) {
Expr.attrHandle.href = function(elem){
return elem.getAttribute("href", 2);
};
}
div = null; // release memory in IE
})();
if ( document.querySelectorAll ) {
(function(){
var oldSizzle = Sizzle, div = document.createElement("div");
div.innerHTML = "<p class='TEST'></p>";
// Safari can't handle uppercase or unicode characters when
// in quirks mode.
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
return;
}
Sizzle = function(query, context, extra, seed){
context = context || document;
// Only use querySelectorAll on non-XML documents
// (ID selectors don't work in non-HTML documents)
if ( !seed && context.nodeType === 9 && !isXML(context) ) {
try {
return makeArray( context.querySelectorAll(query), extra );
} catch(e){}
}
return oldSizzle(query, context, extra, seed);
};
for ( var prop in oldSizzle ) {
Sizzle[ prop ] = oldSizzle[ prop ];
}
div = null; // release memory in IE
})();
}
(function(){
var div = document.createElement("div");
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
// Opera can't find a second classname (in 9.6)
// Also, make sure that getElementsByClassName actually exists
if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
return;
}
// Safari caches class attributes, doesn't catch changes (in 3.2)
div.lastChild.className = "e";
if ( div.getElementsByClassName("e").length === 1 ) {
return;
}
Expr.order.splice(1, 0, "CLASS");
Expr.find.CLASS = function(match, context, isXML) {
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
return context.getElementsByClassName(match[1]);
}
};
div = null; // release memory in IE
})();
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
elem = elem[dir];
var match = false;
while ( elem ) {
if ( elem.sizcache === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 && !isXML ){
elem.sizcache = doneName;
elem.sizset = i;
}
if ( elem.nodeName.toLowerCase() === cur ) {
match = elem;
break;
}
elem = elem[dir];
}
checkSet[i] = match;
}
}
}
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
elem = elem[dir];
var match = false;
while ( elem ) {
if ( elem.sizcache === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 ) {
if ( !isXML ) {
elem.sizcache = doneName;
elem.sizset = i;
}
if ( typeof cur !== "string" ) {
if ( elem === cur ) {
match = true;
break;
}
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
match = elem;
break;
}
}
elem = elem[dir];
}
checkSet[i] = match;
}
}
}
var contains = document.compareDocumentPosition ? function(a, b){
return !!(a.compareDocumentPosition(b) & 16);
} : function(a, b){
return a !== b && (a.contains ? a.contains(b) : true);
};
var isXML = function(elem){
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false;
};
var posProcess = function(selector, context){
var tmpSet = [], later = "", match,
root = context.nodeType ? [context] : context;
// Position selectors must be done after the filter
// And so must :not(positional) so we move all PSEUDOs to the end
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
later += match[0];
selector = selector.replace( Expr.match.PSEUDO, "" );
}
selector = Expr.relative[selector] ? selector + "*" : selector;
for ( var i = 0, l = root.length; i < l; i++ ) {
Sizzle( selector, root[i], tmpSet );
}
return Sizzle.filter( later, tmpSet );
};
// EXPOSE
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = getText;
jQuery.isXMLDoc = isXML;
jQuery.contains = contains;
return;
window.Sizzle = Sizzle;
})();
var runtil = /Until$/,
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
// Note: This RegExp should be improved, or likely pulled from Sizzle
rmultiselector = /,/,
slice = Array.prototype.slice;
// Implement the identical functionality for filter and not
var winnow = function( elements, qualifier, keep ) {
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
return !!qualifier.call( elem, i, elem ) === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem, i ) {
return (elem === qualifier) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem, i ) {
return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
});
};
jQuery.fn.extend({
find: function( selector ) {
var ret = this.pushStack( "", "find", selector ), length = 0;
for ( var i = 0, l = this.length; i < l; i++ ) {
length = ret.length;
jQuery.find( selector, this[i], ret );
if ( i > 0 ) {
// Make sure that the results are unique
for ( var n = length; n < ret.length; n++ ) {
for ( var r = 0; r < length; r++ ) {
if ( ret[r] === ret[n] ) {
ret.splice(n--, 1);
break;
}
}
}
}
}
return ret;
},
has: function( target ) {
var targets = jQuery( target );
return this.filter(function() {
for ( var i = 0, l = targets.length; i < l; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false), "not", selector);
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true), "filter", selector );
},
is: function( selector ) {
return !!selector && jQuery.filter( selector, this ).length > 0;
},
closest: function( selectors, context ) {
if ( jQuery.isArray( selectors ) ) {
var ret = [], cur = this[0], match, matches = {}, selector;
if ( cur && selectors.length ) {
for ( var i = 0, l = selectors.length; i < l; i++ ) {
selector = selectors[i];
if ( !matches[selector] ) {
matches[selector] = jQuery.expr.match.POS.test( selector ) ?
jQuery( selector, context || this.context ) :
selector;
}
}
while ( cur && cur.ownerDocument && cur !== context ) {
for ( selector in matches ) {
match = matches[selector];
if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
ret.push({ selector: selector, elem: cur });
delete matches[selector];
}
}
cur = cur.parentNode;
}
}
return ret;
}
var pos = jQuery.expr.match.POS.test( selectors ) ?
jQuery( selectors, context || this.context ) : null;
return this.map(function( i, cur ) {
while ( cur && cur.ownerDocument && cur !== context ) {
if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
return cur;
}
cur = cur.parentNode;
}
return null;
});
},
// Determine the position of an element within
// the matched set of elements
index: function( elem ) {
if ( !elem || typeof elem === "string" ) {
return jQuery.inArray( this[0],
// If it receives a string, the selector is used
// If it receives nothing, the siblings are used
elem ? jQuery( elem ) : this.parent().children() );
}
// Locate the position of the desired element
return jQuery.inArray(
// If it receives a jQuery object, the first element is used
elem.jquery ? elem[0] : elem, this );
},
add: function( selector, context ) {
var set = typeof selector === "string" ?
jQuery( selector, context || this.context ) :
jQuery.makeArray( selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
all :
jQuery.unique( all ) );
},
andSelf: function() {
return this.add( this.prevObject );
}
});
// A painfully simple check to see if an element is disconnected
// from a document (should be improved, where feasible).
function isDisconnected( node ) {
return !node || !node.parentNode || node.parentNode.nodeType === 11;
}
jQuery.each({
parent: function( elem ) {
var parent = elem.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
parents: function( elem ) {
return jQuery.dir( elem, "parentNode" );
},
parentsUntil: function( elem, i, until ) {
return jQuery.dir( elem, "parentNode", until );
},
next: function( elem ) {
return jQuery.nth( elem, 2, "nextSibling" );
},
prev: function( elem ) {
return jQuery.nth( elem, 2, "previousSibling" );
},
nextAll: function( elem ) {
return jQuery.dir( elem, "nextSibling" );
},
prevAll: function( elem ) {
return jQuery.dir( elem, "previousSibling" );
},
nextUntil: function( elem, i, until ) {
return jQuery.dir( elem, "nextSibling", until );
},
prevUntil: function( elem, i, until ) {
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return jQuery.sibling( elem.parentNode.firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );
},
contents: function( elem ) {
return jQuery.nodeName( elem, "iframe" ) ?
elem.contentDocument || elem.contentWindow.document :
jQuery.makeArray( elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var ret = jQuery.map( this, fn, until );
if ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 ? jQuery.unique( ret ) : ret;
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret, name, slice.call(arguments).join(",") );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return jQuery.find.matches(expr, elems);
},
dir: function( elem, dir, until ) {
var matched = [], cur = elem[dir];
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
if ( cur.nodeType === 1 ) {
matched.push( cur );
}
cur = cur[dir];
}
return matched;
},
nth: function( cur, result, dir, elem ) {
result = result || 1;
var num = 0;
for ( ; cur; cur = cur[dir] ) {
if ( cur.nodeType === 1 && ++num === result ) {
break;
}
}
return cur;
},
sibling: function( n, elem ) {
var r = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType === 1 && n !== elem ) {
r.push( n );
}
}
return r;
}
});
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rleadingWhitespace = /^\s+/,
rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&#?\w+;/,
rnocache = /<script|<object|<embed|<option|<style/i,
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, // checked="checked" or checked (html5)
fcloseTag = function( all, front, tag ) {
return rselfClosing.test( tag ) ?
all :
front + "></" + tag + ">";
},
wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
thead: [ 1, "<table>", "</table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
area: [ 1, "<map>", "</map>" ],
_default: [ 0, "", "" ]
};
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
// IE can't serialize <link> and <script> tags normally
if ( !jQuery.support.htmlSerialize ) {
wrapMap._default = [ 1, "div<div>", "</div>" ];
}
jQuery.fn.extend({
text: function( text ) {
if ( jQuery.isFunction(text) ) {
return this.each(function(i) {
var self = jQuery(this);
self.text( text.call(this, i, self.text()) );
});
}
if ( typeof text !== "object" && text !== undefined ) {
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
}
return jQuery.text( this );
},
wrapAll: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapAll( html.call(this, i) );
});
}
if ( this[0] ) {
// The elements to wrap the target around
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
if ( this[0].parentNode ) {
wrap.insertBefore( this[0] );
}
wrap.map(function() {
var elem = this;
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
elem = elem.firstChild;
}
return elem;
}).append(this);
}
return this;
},
wrapInner: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapInner( html.call(this, i) );
});
}
return this.each(function() {
var self = jQuery( this ), contents = self.contents();
if ( contents.length ) {
contents.wrapAll( html );
} else {
self.append( html );
}
});
},
wrap: function( html ) {
return this.each(function() {
jQuery( this ).wrapAll( html );
});
},
unwrap: function() {
return this.parent().each(function() {
if ( !jQuery.nodeName( this, "body" ) ) {
jQuery( this ).replaceWith( this.childNodes );
}
}).end();
},
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.appendChild( elem );
}
});
},
prepend: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
if ( this[0] && this[0].parentNode ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this );
});
} else if ( arguments.length ) {
var set = jQuery(arguments[0]);
set.push.apply( set, this.toArray() );
return this.pushStack( set, "before", arguments );
}
},
after: function() {
if ( this[0] && this[0].parentNode ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this.nextSibling );
});
} else if ( arguments.length ) {
var set = this.pushStack( this, "after", arguments );
set.push.apply( set, jQuery(arguments[0]).toArray() );
return set;
}
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
if ( !keepData && elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
jQuery.cleanData( [ elem ] );
}
if ( elem.parentNode ) {
elem.parentNode.removeChild( elem );
}
}
}
return this;
},
empty: function() {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
// Remove element nodes and prevent memory leaks
if ( elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
}
// Remove any remaining nodes
while ( elem.firstChild ) {
elem.removeChild( elem.firstChild );
}
}
return this;
},
clone: function( events ) {
// Do the clone
var ret = this.map(function() {
if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
// IE copies events bound via attachEvent when
// using cloneNode. Calling detachEvent on the
// clone will also remove the events from the orignal
// In order to get around this, we use innerHTML.
// Unfortunately, this means some modifications to
// attributes in IE that are actually only stored
// as properties will not be copied (such as the
// the name attribute on an input).
var html = this.outerHTML, ownerDocument = this.ownerDocument;
if ( !html ) {
var div = ownerDocument.createElement("div");
div.appendChild( this.cloneNode(true) );
html = div.innerHTML;
}
return jQuery.clean([html.replace(rinlinejQuery, "")
// Handle the case in IE 8 where action=/test/> self-closes a tag
.replace(/=([^="'>\s]+\/)>/g, '="$1">')
.replace(rleadingWhitespace, "")], ownerDocument)[0];
} else {
return this.cloneNode(true);
}
});
// Copy the events from the original to the clone
if ( events === true ) {
cloneCopyEvent( this, ret );
cloneCopyEvent( this.find("*"), ret.find("*") );
}
// Return the cloned set
return ret;
},
html: function( value ) {
if ( value === undefined ) {
return this[0] && this[0].nodeType === 1 ?
this[0].innerHTML.replace(rinlinejQuery, "") :
null;
// See if we can take a shortcut and just use innerHTML
} else if ( typeof value === "string" && !rnocache.test( value ) &&
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
value = value.replace(rxhtmlTag, fcloseTag);
try {
for ( var i = 0, l = this.length; i < l; i++ ) {
// Remove element nodes and prevent memory leaks
if ( this[i].nodeType === 1 ) {
jQuery.cleanData( this[i].getElementsByTagName("*") );
this[i].innerHTML = value;
}
}
// If using innerHTML throws an exception, use the fallback method
} catch(e) {
this.empty().append( value );
}
} else if ( jQuery.isFunction( value ) ) {
this.each(function(i){
var self = jQuery(this), old = self.html();
self.empty().append(function(){
return value.call( this, i, old );
});
});
} else {
this.empty().append( value );
}
return this;
},
replaceWith: function( value ) {
if ( this[0] && this[0].parentNode ) {
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( jQuery.isFunction( value ) ) {
return this.each(function(i) {
var self = jQuery(this), old = self.html();
self.replaceWith( value.call( this, i, old ) );
});
}
if ( typeof value !== "string" ) {
value = jQuery(value).detach();
}
return this.each(function() {
var next = this.nextSibling, parent = this.parentNode;
jQuery(this).remove();
if ( next ) {
jQuery(next).before( value );
} else {
jQuery(parent).append( value );
}
});
} else {
return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
}
},
detach: function( selector ) {
return this.remove( selector, true );
},
domManip: function( args, table, callback ) {
var results, first, value = args[0], scripts = [], fragment, parent;
// We can't cloneNode fragments that contain checked, in WebKit
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
return this.each(function() {
jQuery(this).domManip( args, table, callback, true );
});
}
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
args[0] = value.call(this, i, table ? self.html() : undefined);
self.domManip( args, table, callback );
});
}
if ( this[0] ) {
parent = value && value.parentNode;
// If we're in a fragment, just use that instead of building a new one
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
results = { fragment: parent };
} else {
results = buildFragment( args, this, scripts );
}
fragment = results.fragment;
if ( fragment.childNodes.length === 1 ) {
first = fragment = fragment.firstChild;
} else {
first = fragment.firstChild;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
for ( var i = 0, l = this.length; i < l; i++ ) {
callback.call(
table ?
root(this[i], first) :
this[i],
i > 0 || results.cacheable || this.length > 1 ?
fragment.cloneNode(true) :
fragment
);
}
}
if ( scripts.length ) {
jQuery.each( scripts, evalScript );
}
}
return this;
function root( elem, cur ) {
return jQuery.nodeName(elem, "table") ?
(elem.getElementsByTagName("tbody")[0] ||
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
elem;
}
}
});
function cloneCopyEvent(orig, ret) {
var i = 0;
ret.each(function() {
if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
return;
}
var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
if ( events ) {
delete curData.handle;
curData.events = {};
for ( var type in events ) {
for ( var handler in events[ type ] ) {
jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
}
}
}
});
}
function buildFragment( args, nodes, scripts ) {
var fragment, cacheable, cacheresults,
doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
// Only cache "small" (1/2 KB) strings that are associated with the main document
// Cloning options loses the selected state, so don't cache them
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
!rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
cacheable = true;
cacheresults = jQuery.fragments[ args[0] ];
if ( cacheresults ) {
if ( cacheresults !== 1 ) {
fragment = cacheresults;
}
}
}
if ( !fragment ) {
fragment = doc.createDocumentFragment();
jQuery.clean( args, doc, fragment, scripts );
}
if ( cacheable ) {
jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
}
return { fragment: fragment, cacheable: cacheable };
}
jQuery.fragments = {};
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var ret = [], insert = jQuery( selector ),
parent = this.length === 1 && this[0].parentNode;
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
insert[ original ]( this[0] );
return this;
} else {
for ( var i = 0, l = insert.length; i < l; i++ ) {
var elems = (i > 0 ? this.clone(true) : this).get();
jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
ret = ret.concat( elems );
}
return this.pushStack( ret, name, insert.selector );
}
};
});
jQuery.extend({
clean: function( elems, context, fragment, scripts ) {
context = context || document;
// !context.createElement fails in IE with an error but returns typeof 'object'
if ( typeof context.createElement === "undefined" ) {
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
}
var ret = [];
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( typeof elem === "number" ) {
elem += "";
}
if ( !elem ) {
continue;
}
// Convert html string into DOM nodes
if ( typeof elem === "string" && !rhtml.test( elem ) ) {
elem = context.createTextNode( elem );
} else if ( typeof elem === "string" ) {
// Fix "XHTML"-style tags in all browsers
elem = elem.replace(rxhtmlTag, fcloseTag);
// Trim whitespace, otherwise indexOf won't work as expected
var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
wrap = wrapMap[ tag ] || wrapMap._default,
depth = wrap[0],
div = context.createElement("div");
// Go to html and back, then peel off extra wrappers
div.innerHTML = wrap[1] + elem + wrap[2];
// Move to the right depth
while ( depth-- ) {
div = div.lastChild;
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
var hasBody = rtbody.test(elem),
tbody = tag === "table" && !hasBody ?
div.firstChild && div.firstChild.childNodes :
// String was a bare <thead> or <tfoot>
wrap[1] === "<table>" && !hasBody ?
div.childNodes :
[];
for ( var j = tbody.length - 1; j >= 0 ; --j ) {
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
tbody[ j ].parentNode.removeChild( tbody[ j ] );
}
}
}
// IE completely kills leading whitespace when innerHTML is used
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
}
elem = div.childNodes;
}
if ( elem.nodeType ) {
ret.push( elem );
} else {
ret = jQuery.merge( ret, elem );
}
}
if ( fragment ) {
for ( var i = 0; ret[i]; i++ ) {
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
} else {
if ( ret[i].nodeType === 1 ) {
ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
}
fragment.appendChild( ret[i] );
}
}
}
return ret;
},
cleanData: function( elems ) {
var data, id, cache = jQuery.cache,
special = jQuery.event.special,
deleteExpando = jQuery.support.deleteExpando;
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
id = elem[ jQuery.expando ];
if ( id ) {
data = cache[ id ];
if ( data.events ) {
for ( var type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
} else {
removeEvent( elem, type, data.handle );
}
}
}
if ( deleteExpando ) {
delete elem[ jQuery.expando ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
}
delete cache[ id ];
}
}
}
});
// exclude the following css properties to add px
var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
ralpha = /alpha\([^)]*\)/,
ropacity = /opacity=([^)]*)/,
rfloat = /float/i,
rdashAlpha = /-([a-z])/ig,
rupper = /([A-Z])/g,
rnumpx = /^-?\d+(?:px)?$/i,
rnum = /^-?\d/,
cssShow = { position: "absolute", visibility: "hidden", display:"block" },
cssWidth = [ "Left", "Right" ],
cssHeight = [ "Top", "Bottom" ],
// cache check for defaultView.getComputedStyle
getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
// normalize float css property
styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
fcamelCase = function( all, letter ) {
return letter.toUpperCase();
};
jQuery.fn.css = function( name, value ) {
return access( this, name, value, true, function( elem, name, value ) {
if ( value === undefined ) {
return jQuery.curCSS( elem, name );
}
if ( typeof value === "number" && !rexclude.test(name) ) {
value += "px";
}
jQuery.style( elem, name, value );
});
};
jQuery.extend({
style: function( elem, name, value ) {
// don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
return undefined;
}
// ignore negative width and height values #1599
if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
value = undefined;
}
var style = elem.style || elem, set = value !== undefined;
// IE uses filters for opacity
if ( !jQuery.support.opacity && name === "opacity" ) {
if ( set ) {
// IE has trouble with opacity if it does not have layout
// Force it by setting the zoom level
style.zoom = 1;
// Set the alpha filter to set the opacity
var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
}
return style.filter && style.filter.indexOf("opacity=") >= 0 ?
(parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
"";
}
// Make sure we're using the right name for getting the float value
if ( rfloat.test( name ) ) {
name = styleFloat;
}
name = name.replace(rdashAlpha, fcamelCase);
if ( set ) {
style[ name ] = value;
}
return style[ name ];
},
css: function( elem, name, force, extra ) {
if ( name === "width" || name === "height" ) {
var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
function getWH() {
val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
if ( extra === "border" ) {
return;
}
jQuery.each( which, function() {
if ( !extra ) {
val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
}
if ( extra === "margin" ) {
val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
} else {
val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
}
});
}
if ( elem.offsetWidth !== 0 ) {
getWH();
} else {
jQuery.swap( elem, props, getWH );
}
return Math.max(0, Math.round(val));
}
return jQuery.curCSS( elem, name, force );
},
curCSS: function( elem, name, force ) {
var ret, style = elem.style, filter;
// IE uses filters for opacity
if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
ret = ropacity.test(elem.currentStyle.filter || "") ?
(parseFloat(RegExp.$1) / 100) + "" :
"";
return ret === "" ?
"1" :
ret;
}
// Make sure we're using the right name for getting the float value
if ( rfloat.test( name ) ) {
name = styleFloat;
}
if ( !force && style && style[ name ] ) {
ret = style[ name ];
} else if ( getComputedStyle ) {
// Only "float" is needed here
if ( rfloat.test( name ) ) {
name = "float";
}
name = name.replace( rupper, "-$1" ).toLowerCase();
var defaultView = elem.ownerDocument.defaultView;
if ( !defaultView ) {
return null;
}
var computedStyle = defaultView.getComputedStyle( elem, null );
if ( computedStyle ) {
ret = computedStyle.getPropertyValue( name );
}
// We should always get a number back from opacity
if ( name === "opacity" && ret === "" ) {
ret = "1";
}
} else if ( elem.currentStyle ) {
var camelCase = name.replace(rdashAlpha, fcamelCase);
ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
// Remember the original values
var left = style.left, rsLeft = elem.runtimeStyle.left;
// Put in the new values to get a computed value out
elem.runtimeStyle.left = elem.currentStyle.left;
style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
elem.runtimeStyle.left = rsLeft;
}
}
return ret;
},
// A method for quickly swapping in/out CSS properties to get correct calculations
swap: function( elem, options, callback ) {
var old = {};
// Remember the old values, and insert the new ones
for ( var name in options ) {
old[ name ] = elem.style[ name ];
elem.style[ name ] = options[ name ];
}
callback.call( elem );
// Revert the old values
for ( var name in options ) {
elem.style[ name ] = old[ name ];
}
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
var width = elem.offsetWidth, height = elem.offsetHeight,
skip = elem.nodeName.toLowerCase() === "tr";
return width === 0 && height === 0 && !skip ?
true :
width > 0 && height > 0 && !skip ?
false :
jQuery.curCSS(elem, "display") === "none";
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
var jsc = now(),
rscript = /<script(.|\s)*?\/script>/gi,
rselectTextarea = /select|textarea/i,
rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
jsre = /=\?(&|$)/,
rquery = /\?/,
rts = /(\?|&)_=.*?(&|$)/,
rurl = /^(\w+:)?\/\/([^\/?#]+)/,
r20 = /%20/g,
// Keep a copy of the old load method
_load = jQuery.fn.load;
jQuery.fn.extend({
load: function( url, params, callback ) {
if ( typeof url !== "string" ) {
return _load.call( this, url );
// Don't do a request if no elements are being requested
} else if ( !this.length ) {
return this;
}
var off = url.indexOf(" ");
if ( off >= 0 ) {
var selector = url.slice(off, url.length);
url = url.slice(0, off);
}
// Default to a GET request
var type = "GET";
// If the second parameter was provided
if ( params ) {
// If it's a function
if ( jQuery.isFunction( params ) ) {
// We assume that it's the callback
callback = params;
params = null;
// Otherwise, build a param string
} else if ( typeof params === "object" ) {
params = jQuery.param( params, jQuery.ajaxSettings.traditional );
type = "POST";
}
}
var self = this;
// Request the remote document
jQuery.ajax({
url: url,
type: type,
dataType: "html",
data: params,
complete: function( res, status ) {
// If successful, inject the HTML into all the matched elements
if ( status === "success" || status === "notmodified" ) {
// See if a selector was specified
self.html( selector ?
// Create a dummy div to hold the results
jQuery("<div />")
// inject the contents of the document in, removing the scripts
// to avoid any 'Permission Denied' errors in IE
.append(res.responseText.replace(rscript, ""))
// Locate the specified elements
.find(selector) :
// If not, just inject the full result
res.responseText );
}
if ( callback ) {
self.each( callback, [res.responseText, status, res] );
}
}
});
return this;
},
serialize: function() {
return jQuery.param(this.serializeArray());
},
serializeArray: function() {
return this.map(function() {
return this.elements ? jQuery.makeArray(this.elements) : this;
})
.filter(function() {
return this.name && !this.disabled &&
(this.checked || rselectTextarea.test(this.nodeName) ||
rinput.test(this.type));
})
.map(function( i, elem ) {
var val = jQuery(this).val();
return val == null ?
null :
jQuery.isArray(val) ?
jQuery.map( val, function( val, i ) {
return { name: elem.name, value: val };
}) :
{ name: elem.name, value: val };
}).get();
}
});
// Attach a bunch of functions for handling common AJAX events
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
jQuery.fn[o] = function( f ) {
return this.bind(o, f);
};
});
jQuery.extend({
get: function( url, data, callback, type ) {
// shift arguments if data argument was omited
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
data = null;
}
return jQuery.ajax({
type: "GET",
url: url,
data: data,
success: callback,
dataType: type
});
},
getScript: function( url, callback ) {
return jQuery.get(url, null, callback, "script");
},
getJSON: function( url, data, callback ) {
return jQuery.get(url, data, callback, "json");
},
post: function( url, data, callback, type ) {
// shift arguments if data argument was omited
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
data = {};
}
return jQuery.ajax({
type: "POST",
url: url,
data: data,
success: callback,
dataType: type
});
},
ajaxSetup: function( settings ) {
jQuery.extend( jQuery.ajaxSettings, settings );
},
ajaxSettings: {
url: location.href,
global: true,
type: "GET",
contentType: "application/x-www-form-urlencoded",
processData: true,
async: true,
/*
timeout: 0,
data: null,
username: null,
password: null,
traditional: false,
*/
// Create the request object; Microsoft failed to properly
// implement the XMLHttpRequest in IE7 (can't request local files),
// so we use the ActiveXObject when it is available
// This function can be overriden by calling jQuery.ajaxSetup
xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
function() {
return new window.XMLHttpRequest();
} :
function() {
try {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {}
},
accepts: {
xml: "application/xml, text/xml",
html: "text/html",
script: "text/javascript, application/javascript",
json: "application/json, text/javascript",
text: "text/plain",
_default: "*/*"
}
},
// Last-Modified header cache for next request
lastModified: {},
etag: {},
ajax: function( origSettings ) {
var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
var jsonp, status, data,
callbackContext = origSettings && origSettings.context || s,
type = s.type.toUpperCase();
// convert data if not already a string
if ( s.data && s.processData && typeof s.data !== "string" ) {
s.data = jQuery.param( s.data, s.traditional );
}
// Handle JSONP Parameter Callbacks
if ( s.dataType === "jsonp" ) {
if ( type === "GET" ) {
if ( !jsre.test( s.url ) ) {
s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
}
} else if ( !s.data || !jsre.test(s.data) ) {
s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
}
s.dataType = "json";
}
// Build temporary JSONP function
if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
jsonp = s.jsonpCallback || ("jsonp" + jsc++);
// Replace the =? sequence both in the query string and the data
if ( s.data ) {
s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
}
s.url = s.url.replace(jsre, "=" + jsonp + "$1");
// We need to make sure
// that a JSONP style response is executed properly
s.dataType = "script";
// Handle JSONP-style loading
window[ jsonp ] = window[ jsonp ] || function( tmp ) {
data = tmp;
success();
complete();
// Garbage collect
window[ jsonp ] = undefined;
try {
delete window[ jsonp ];
} catch(e) {}
if ( head ) {
head.removeChild( script );
}
};
}
if ( s.dataType === "script" && s.cache === null ) {
s.cache = false;
}
if ( s.cache === false && type === "GET" ) {
var ts = now();
// try replacing _= if it is there
var ret = s.url.replace(rts, "$1_=" + ts + "$2");
// if nothing was replaced, add timestamp to the end
s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
}
// If data is available, append data to url for get requests
if ( s.data && type === "GET" ) {
s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
}
// Watch for a new set of requests
if ( s.global && ! jQuery.active++ ) {
jQuery.event.trigger( "ajaxStart" );
}
// Matches an absolute URL, and saves the domain
var parts = rurl.exec( s.url ),
remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
// If we're requesting a remote document
// and trying to load JSON or Script with a GET
if ( s.dataType === "script" && type === "GET" && remote ) {
var head = document.getElementsByTagName("head")[0] || document.documentElement;
var script = document.createElement("script");
script.src = s.url;
if ( s.scriptCharset ) {
script.charset = s.scriptCharset;
}
// Handle Script loading
if ( !jsonp ) {
var done = false;
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function() {
if ( !done && (!this.readyState ||
this.readyState === "loaded" || this.readyState === "complete") ) {
done = true;
success();
complete();
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
if ( head && script.parentNode ) {
head.removeChild( script );
}
}
};
}
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
// This arises when a base node is used (#2709 and #4378).
head.insertBefore( script, head.firstChild );
// We handle everything using the script element injection
return undefined;
}
var requestDone = false;
// Create the request object
var xhr = s.xhr();
if ( !xhr ) {
return;
}
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
xhr.open(type, s.url, s.async, s.username, s.password);
} else {
xhr.open(type, s.url, s.async);
}
// Need an extra try/catch for cross domain requests in Firefox 3
try {
// Set the correct header, if data is being sent
if ( s.data || origSettings && origSettings.contentType ) {
xhr.setRequestHeader("Content-Type", s.contentType);
}
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
if ( jQuery.lastModified[s.url] ) {
xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
}
if ( jQuery.etag[s.url] ) {
xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
}
}
// Set header so the called script knows that it's an XMLHttpRequest
// Only send the header if it's not a remote XHR
if ( !remote ) {
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
}
// Set the Accepts header for the server, depending on the dataType
xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
s.accepts[ s.dataType ] + ", */*" :
s.accepts._default );
} catch(e) {}
// Allow custom headers/mimetypes and early abort
if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
// Handle the global AJAX counter
if ( s.global && ! --jQuery.active ) {
jQuery.event.trigger( "ajaxStop" );
}
// close opended socket
xhr.abort();
return false;
}
if ( s.global ) {
trigger("ajaxSend", [xhr, s]);
}
// Wait for a response to come back
var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
// The request was aborted
if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
// Opera doesn't call onreadystatechange before this point
// so we simulate the call
if ( !requestDone ) {
complete();
}
requestDone = true;
if ( xhr ) {
xhr.onreadystatechange = jQuery.noop;
}
// The transfer is complete and the data is available, or the request timed out
} else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
requestDone = true;
xhr.onreadystatechange = jQuery.noop;
status = isTimeout === "timeout" ?
"timeout" :
!jQuery.httpSuccess( xhr ) ?
"error" :
s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
"notmodified" :
"success";
var errMsg;
if ( status === "success" ) {
// Watch for, and catch, XML document parse errors
try {
// process the data (runs the xml through httpData regardless of callback)
data = jQuery.httpData( xhr, s.dataType, s );
} catch(err) {
status = "parsererror";
errMsg = err;
}
}
// Make sure that the request was successful or notmodified
if ( status === "success" || status === "notmodified" ) {
// JSONP handles its own success callback
if ( !jsonp ) {
success();
}
} else {
jQuery.handleError(s, xhr, status, errMsg);
}
// Fire the complete handlers
complete();
if ( isTimeout === "timeout" ) {
xhr.abort();
}
// Stop memory leaks
if ( s.async ) {
xhr = null;
}
}
};
// Override the abort handler, if we can (IE doesn't allow it, but that's OK)
// Opera doesn't fire onreadystatechange at all on abort
try {
var oldAbort = xhr.abort;
xhr.abort = function() {
if ( xhr ) {
oldAbort.call( xhr );
}
onreadystatechange( "abort" );
};
} catch(e) { }
// Timeout checker
if ( s.async && s.timeout > 0 ) {
setTimeout(function() {
// Check to see if the request is still happening
if ( xhr && !requestDone ) {
onreadystatechange( "timeout" );
}
}, s.timeout);
}
// Send the data
try {
xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
} catch(e) {
jQuery.handleError(s, xhr, null, e);
// Fire the complete handlers
complete();
}
// firefox 1.5 doesn't fire statechange for sync requests
if ( !s.async ) {
onreadystatechange();
}
function success() {
// If a local callback was specified, fire it and pass it the data
if ( s.success ) {
s.success.call( callbackContext, data, status, xhr );
}
// Fire the global callback
if ( s.global ) {
trigger( "ajaxSuccess", [xhr, s] );
}
}
function complete() {
// Process result
if ( s.complete ) {
s.complete.call( callbackContext, xhr, status);
}
// The request was completed
if ( s.global ) {
trigger( "ajaxComplete", [xhr, s] );
}
// Handle the global AJAX counter
if ( s.global && ! --jQuery.active ) {
jQuery.event.trigger( "ajaxStop" );
}
}
function trigger(type, args) {
(s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
}
// return XMLHttpRequest to allow aborting the request etc.
return xhr;
},
handleError: function( s, xhr, status, e ) {
// If a local callback was specified, fire it
if ( s.error ) {
s.error.call( s.context || s, xhr, status, e );
}
// Fire the global callback
if ( s.global ) {
(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
}
},
// Counter for holding the number of active queries
active: 0,
// Determines if an XMLHttpRequest was successful or not
httpSuccess: function( xhr ) {
try {
// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
return !xhr.status && location.protocol === "file:" ||
// Opera returns 0 when status is 304
( xhr.status >= 200 && xhr.status < 300 ) ||
xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
} catch(e) {}
return false;
},
// Determines if an XMLHttpRequest returns NotModified
httpNotModified: function( xhr, url ) {
var lastModified = xhr.getResponseHeader("Last-Modified"),
etag = xhr.getResponseHeader("Etag");
if ( lastModified ) {
jQuery.lastModified[url] = lastModified;
}
if ( etag ) {
jQuery.etag[url] = etag;
}
// Opera returns 0 when status is 304
return xhr.status === 304 || xhr.status === 0;
},
httpData: function( xhr, type, s ) {
var ct = xhr.getResponseHeader("content-type") || "",
xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
data = xml ? xhr.responseXML : xhr.responseText;
if ( xml && data.documentElement.nodeName === "parsererror" ) {
jQuery.error( "parsererror" );
}
// Allow a pre-filtering function to sanitize the response
// s is checked to keep backwards compatibility
if ( s && s.dataFilter ) {
data = s.dataFilter( data, type );
}
// The filter can actually parse the response
if ( typeof data === "string" ) {
// Get the JavaScript object, if JSON is used.
if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
data = jQuery.parseJSON( data );
// If the type is "script", eval it in global context
} else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
jQuery.globalEval( data );
}
}
return data;
},
// Serialize an array of form elements or a set of
// key/values into a query string
param: function( a, traditional ) {
var s = [];
// Set traditional to true for jQuery <= 1.3.2 behavior.
if ( traditional === undefined ) {
traditional = jQuery.ajaxSettings.traditional;
}
// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray(a) || a.jquery ) {
// Serialize the form elements
jQuery.each( a, function() {
add( this.name, this.value );
});
} else {
// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
for ( var prefix in a ) {
buildParams( prefix, a[prefix] );
}
}
// Return the resulting serialization
return s.join("&").replace(r20, "+");
function buildParams( prefix, obj ) {
if ( jQuery.isArray(obj) ) {
// Serialize array item.
jQuery.each( obj, function( i, v ) {
if ( traditional || /\[\]$/.test( prefix ) ) {
// Treat each array item as a scalar.
add( prefix, v );
} else {
// If array item is non-scalar (array or object), encode its
// numeric index to resolve deserialization ambiguity issues.
// Note that rack (as of 1.0.0) can't currently deserialize
// nested arrays properly, and attempting to do so may cause
// a server error. Possible fixes are to modify rack's
// deserialization algorithm or to provide an option or flag
// to force array serialization to be shallow.
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
}
});
} else if ( !traditional && obj != null && typeof obj === "object" ) {
// Serialize object item.
jQuery.each( obj, function( k, v ) {
buildParams( prefix + "[" + k + "]", v );
});
} else {
// Serialize scalar item.
add( prefix, obj );
}
}
function add( key, value ) {
// If value is a function, invoke it and return its value
value = jQuery.isFunction(value) ? value() : value;
s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
}
}
});
var elemdisplay = {},
rfxtypes = /toggle|show|hide/,
rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
timerId,
fxAttrs = [
// height animations
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
// width animations
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
// opacity animations
[ "opacity" ]
];
jQuery.fn.extend({
show: function( speed, callback ) {
if ( speed || speed === 0) {
return this.animate( genFx("show", 3), speed, callback);
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
var old = jQuery.data(this[i], "olddisplay");
this[i].style.display = old || "";
if ( jQuery.css(this[i], "display") === "none" ) {
var nodeName = this[i].nodeName, display;
if ( elemdisplay[ nodeName ] ) {
display = elemdisplay[ nodeName ];
} else {
var elem = jQuery("<" + nodeName + " />").appendTo("body");
display = elem.css("display");
if ( display === "none" ) {
display = "block";
}
elem.remove();
elemdisplay[ nodeName ] = display;
}
jQuery.data(this[i], "olddisplay", display);
}
}
// Set the display of the elements in a second loop
// to avoid the constant reflow
for ( var j = 0, k = this.length; j < k; j++ ) {
this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
}
return this;
}
},
hide: function( speed, callback ) {
if ( speed || speed === 0 ) {
return this.animate( genFx("hide", 3), speed, callback);
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
var old = jQuery.data(this[i], "olddisplay");
if ( !old && old !== "none" ) {
jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
}
}
// Set the display of the elements in a second loop
// to avoid the constant reflow
for ( var j = 0, k = this.length; j < k; j++ ) {
this[j].style.display = "none";
}
return this;
}
},
// Save the old toggle function
_toggle: jQuery.fn.toggle,
toggle: function( fn, fn2 ) {
var bool = typeof fn === "boolean";
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
this._toggle.apply( this, arguments );
} else if ( fn == null || bool ) {
this.each(function() {
var state = bool ? fn : jQuery(this).is(":hidden");
jQuery(this)[ state ? "show" : "hide" ]();
});
} else {
this.animate(genFx("toggle", 3), fn, fn2);
}
return this;
},
fadeTo: function( speed, to, callback ) {
return this.filter(":hidden").css("opacity", 0).show().end()
.animate({opacity: to}, speed, callback);
},
animate: function( prop, speed, easing, callback ) {
var optall = jQuery.speed(speed, easing, callback);
if ( jQuery.isEmptyObject( prop ) ) {
return this.each( optall.complete );
}
return this[ optall.queue === false ? "each" : "queue" ](function() {
var opt = jQuery.extend({}, optall), p,
hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
self = this;
for ( p in prop ) {
var name = p.replace(rdashAlpha, fcamelCase);
if ( p !== name ) {
prop[ name ] = prop[ p ];
delete prop[ p ];
p = name;
}
if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
return opt.complete.call(this);
}
if ( ( p === "height" || p === "width" ) && this.style ) {
// Store display property
opt.display = jQuery.css(this, "display");
// Make sure that nothing sneaks out
opt.overflow = this.style.overflow;
}
if ( jQuery.isArray( prop[p] ) ) {
// Create (if needed) and add to specialEasing
(opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
prop[p] = prop[p][0];
}
}
if ( opt.overflow != null ) {
this.style.overflow = "hidden";
}
opt.curAnim = jQuery.extend({}, prop);
jQuery.each( prop, function( name, val ) {
var e = new jQuery.fx( self, opt, name );
if ( rfxtypes.test(val) ) {
e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
} else {
var parts = rfxnum.exec(val),
start = e.cur(true) || 0;
if ( parts ) {
var end = parseFloat( parts[2] ),
unit = parts[3] || "px";
// We need to compute starting value
if ( unit !== "px" ) {
self.style[ name ] = (end || 1) + unit;
start = ((end || 1) / e.cur(true)) * start;
self.style[ name ] = start + unit;
}
// If a +=/-= token was provided, we're doing a relative animation
if ( parts[1] ) {
end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
}
e.custom( start, end, unit );
} else {
e.custom( start, val, "" );
}
}
});
// For JS strict compliance
return true;
});
},
stop: function( clearQueue, gotoEnd ) {
var timers = jQuery.timers;
if ( clearQueue ) {
this.queue([]);
}
this.each(function() {
// go in reverse order so anything added to the queue during the loop is ignored
for ( var i = timers.length - 1; i >= 0; i-- ) {
if ( timers[i].elem === this ) {
if (gotoEnd) {
// force the next step to be the last
timers[i](true);
}
timers.splice(i, 1);
}
}
});
// start the next in the queue if the last step wasn't forced
if ( !gotoEnd ) {
this.dequeue();
}
return this;
}
});
// Generate shortcuts for custom animations
jQuery.each({
slideDown: genFx("show", 1),
slideUp: genFx("hide", 1),
slideToggle: genFx("toggle", 1),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" }
}, function( name, props ) {
jQuery.fn[ name ] = function( speed, callback ) {
return this.animate( props, speed, callback );
};
});
jQuery.extend({
speed: function( speed, easing, fn ) {
var opt = speed && typeof speed === "object" ? speed : {
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
};
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
// Queueing
opt.old = opt.complete;
opt.complete = function() {
if ( opt.queue !== false ) {
jQuery(this).dequeue();
}
if ( jQuery.isFunction( opt.old ) ) {
opt.old.call( this );
}
};
return opt;
},
easing: {
linear: function( p, n, firstNum, diff ) {
return firstNum + diff * p;
},
swing: function( p, n, firstNum, diff ) {
return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
}
},
timers: [],
fx: function( elem, options, prop ) {
this.options = options;
this.elem = elem;
this.prop = prop;
if ( !options.orig ) {
options.orig = {};
}
}
});
jQuery.fx.prototype = {
// Simple function for setting a style value
update: function() {
if ( this.options.step ) {
this.options.step.call( this.elem, this.now, this );
}
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
// Set display property to block for height/width animations
if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
this.elem.style.display = "block";
}
},
// Get the current size
cur: function( force ) {
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
return this.elem[ this.prop ];
}
var r = parseFloat(jQuery.css(this.elem, this.prop, force));
return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
},
// Start an animation from one number to another
custom: function( from, to, unit ) {
this.startTime = now();
this.start = from;
this.end = to;
this.unit = unit || this.unit || "px";
this.now = this.start;
this.pos = this.state = 0;
var self = this;
function t( gotoEnd ) {
return self.step(gotoEnd);
}
t.elem = this.elem;
if ( t() && jQuery.timers.push(t) && !timerId ) {
timerId = setInterval(jQuery.fx.tick, 13);
}
},
// Simple 'show' function
show: function() {
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
this.options.show = true;
// Begin the animation
// Make sure that we start at a small width/height to avoid any
// flash of content
this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
// Start by showing the element
jQuery( this.elem ).show();
},
// Simple 'hide' function
hide: function() {
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
this.options.hide = true;
// Begin the animation
this.custom(this.cur(), 0);
},
// Each step of an animation
step: function( gotoEnd ) {
var t = now(), done = true;
if ( gotoEnd || t >= this.options.duration + this.startTime ) {
this.now = this.end;
this.pos = this.state = 1;
this.update();
this.options.curAnim[ this.prop ] = true;
for ( var i in this.options.curAnim ) {
if ( this.options.curAnim[i] !== true ) {
done = false;
}
}
if ( done ) {
if ( this.options.display != null ) {
// Reset the overflow
this.elem.style.overflow = this.options.overflow;
// Reset the display
var old = jQuery.data(this.elem, "olddisplay");
this.elem.style.display = old ? old : this.options.display;
if ( jQuery.css(this.elem, "display") === "none" ) {
this.elem.style.display = "block";
}
}
// Hide the element if the "hide" operation was done
if ( this.options.hide ) {
jQuery(this.elem).hide();
}
// Reset the properties, if the item has been hidden or shown
if ( this.options.hide || this.options.show ) {
for ( var p in this.options.curAnim ) {
jQuery.style(this.elem, p, this.options.orig[p]);
}
}
// Execute the complete function
this.options.complete.call( this.elem );
}
return false;
} else {
var n = t - this.startTime;
this.state = n / this.options.duration;
// Perform the easing function, defaults to swing
var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
this.now = this.start + ((this.end - this.start) * this.pos);
// Perform the next step of the animation
this.update();
}
return true;
}
};
jQuery.extend( jQuery.fx, {
tick: function() {
var timers = jQuery.timers;
for ( var i = 0; i < timers.length; i++ ) {
if ( !timers[i]() ) {
timers.splice(i--, 1);
}
}
if ( !timers.length ) {
jQuery.fx.stop();
}
},
stop: function() {
clearInterval( timerId );
timerId = null;
},
speeds: {
slow: 600,
fast: 200,
// Default speed
_default: 400
},
step: {
opacity: function( fx ) {
jQuery.style(fx.elem, "opacity", fx.now);
},
_default: function( fx ) {
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
} else {
fx.elem[ fx.prop ] = fx.now;
}
}
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
function genFx( type, num ) {
var obj = {};
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
obj[ this ] = type;
});
return obj;
}
if ( "getBoundingClientRect" in document.documentElement ) {
jQuery.fn.offset = function( options ) {
var elem = this[0];
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
if ( !elem || !elem.ownerDocument ) {
return null;
}
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
top = box.top + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
return { top: top, left: left };
};
} else {
jQuery.fn.offset = function( options ) {
var elem = this[0];
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
if ( !elem || !elem.ownerDocument ) {
return null;
}
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
jQuery.offset.initialize();
var offsetParent = elem.offsetParent, prevOffsetParent = elem,
doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
body = doc.body, defaultView = doc.defaultView,
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
top = elem.offsetTop, left = elem.offsetLeft;
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
break;
}
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
top -= elem.scrollTop;
left -= elem.scrollLeft;
if ( elem === offsetParent ) {
top += elem.offsetTop;
left += elem.offsetLeft;
if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
}
if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
prevComputedStyle = computedStyle;
}
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
top += body.offsetTop;
left += body.offsetLeft;
}
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
top += Math.max( docElem.scrollTop, body.scrollTop );
left += Math.max( docElem.scrollLeft, body.scrollLeft );
}
return { top: top, left: left };
};
}
jQuery.offset = {
initialize: function() {
var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
container.innerHTML = html;
body.insertBefore( container, body.firstChild );
innerDiv = container.firstChild;
checkDiv = innerDiv.firstChild;
td = innerDiv.nextSibling.firstChild.firstChild;
this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
// safari subtracts parent border width here which is 5px
this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
checkDiv.style.position = checkDiv.style.top = "";
innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
body.removeChild( container );
body = container = innerDiv = checkDiv = table = td = null;
jQuery.offset.initialize = jQuery.noop;
},
bodyOffset: function( body ) {
var top = body.offsetTop, left = body.offsetLeft;
jQuery.offset.initialize();
if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0;
left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
}
return { top: top, left: left };
},
setOffset: function( elem, options, i ) {
// set position first, in-case top/left are set even on static elem
if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
elem.style.position = "relative";
}
var curElem = jQuery( elem ),
curOffset = curElem.offset(),
curTop = parseInt( jQuery.curCSS( elem, "top", true ), 10 ) || 0,
curLeft = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
if ( jQuery.isFunction( options ) ) {
options = options.call( elem, i, curOffset );
}
var props = {
top: (options.top - curOffset.top) + curTop,
left: (options.left - curOffset.left) + curLeft
};
if ( "using" in options ) {
options.using.call( elem, props );
} else {
curElem.css( props );
}
}
};
jQuery.fn.extend({
position: function() {
if ( !this[0] ) {
return null;
}
var elem = this[0],
// Get *real* offsetParent
offsetParent = this.offsetParent(),
// Get correct offsets
offset = this.offset(),
parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
// Subtract element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// are the same in Safari causing offset.left to incorrectly be 0
offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0;
offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
// Add offsetParent borders
parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0;
parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
// Subtract the two offsets
return {
top: offset.top - parentOffset.top,
left: offset.left - parentOffset.left
};
},
offsetParent: function() {
return this.map(function() {
var offsetParent = this.offsetParent || document.body;
while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent;
});
}
});
// Create scrollLeft and scrollTop methods
jQuery.each( ["Left", "Top"], function( i, name ) {
var method = "scroll" + name;
jQuery.fn[ method ] = function(val) {
var elem = this[0], win;
if ( !elem ) {
return null;
}
if ( val !== undefined ) {
// Set the scroll offset
return this.each(function() {
win = getWindow( this );
if ( win ) {
win.scrollTo(
!i ? val : jQuery(win).scrollLeft(),
i ? val : jQuery(win).scrollTop()
);
} else {
this[ method ] = val;
}
});
} else {
win = getWindow( elem );
// Return the scroll offset
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
jQuery.support.boxModel && win.document.documentElement[ method ] ||
win.document.body[ method ] :
elem[ method ];
}
};
});
function getWindow( elem ) {
return ("scrollTo" in elem && elem.document) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
jQuery.each([ "Height", "Width" ], function( i, name ) {
var type = name.toLowerCase();
// innerHeight and innerWidth
jQuery.fn["inner" + name] = function() {
return this[0] ?
jQuery.css( this[0], type, false, "padding" ) :
null;
};
// outerHeight and outerWidth
jQuery.fn["outer" + name] = function( margin ) {
return this[0] ?
jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
null;
};
jQuery.fn[ type ] = function( size ) {
// Get window width or height
var elem = this[0];
if ( !elem ) {
return size == null ? null : this;
}
if ( jQuery.isFunction( size ) ) {
return this.each(function( i ) {
var self = jQuery( this );
self[ type ]( size.call( this, i, self[ type ]() ) );
});
}
return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
elem.document.body[ "client" + name ] :
// Get document width or height
(elem.nodeType === 9) ? // is it a document
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
Math.max(
elem.documentElement["client" + name],
elem.body["scroll" + name], elem.documentElement["scroll" + name],
elem.body["offset" + name], elem.documentElement["offset" + name]
) :
// Get or set width or height on the element
size === undefined ?
// Get width or height on the element
jQuery.css( elem, type ) :
// Set the width or height on the element (default to pixels if value is unitless)
this.css( type, typeof size === "string" ? size : size + "px" );
};
});
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
})(window);
|
src/containers/Root.dev.js | LopatkinEvgeniy/reduxTestSite | import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { Router, PropTypes as RouterPropTypes } from 'react-router';
import configureStore from '../store/configureStore';
import routes from '../routes';
import createDevToolsWindow from '../utils/createDevToolsWindow';
const store = configureStore();
createDevToolsWindow(store);
export default class Root extends Component {
static propTypes = {
history: RouterPropTypes.history.isRequired
};
render() {
return (
<Provider store={store} key="provider">
<Router history={this.props.history} children={routes} />
</Provider>
);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.